bits-ui 0.21.12 → 0.21.13
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/types.d.ts +3 -3
- package/dist/bits/alert-dialog/types.d.ts +3 -3
- package/dist/bits/aspect-ratio/types.d.ts +2 -2
- package/dist/bits/avatar/types.d.ts +2 -2
- package/dist/bits/button/types.d.ts +5 -5
- package/dist/bits/calendar/types.d.ts +6 -6
- package/dist/bits/checkbox/types.d.ts +2 -2
- package/dist/bits/collapsible/types.d.ts +2 -2
- package/dist/bits/combobox/ctx.d.ts +2 -2
- package/dist/bits/combobox/types.d.ts +7 -7
- package/dist/bits/date-field/types.d.ts +6 -6
- package/dist/bits/date-picker/types.d.ts +8 -8
- package/dist/bits/date-range-field/types.d.ts +6 -6
- package/dist/bits/date-range-picker/types.d.ts +8 -8
- package/dist/bits/dialog/types.d.ts +5 -5
- package/dist/bits/floating/_types.d.ts +12 -12
- package/dist/bits/floating/floating-config.d.ts +9 -9
- package/dist/bits/link-preview/types.d.ts +2 -2
- package/dist/bits/menu/types.d.ts +13 -13
- package/dist/bits/pagination/types.d.ts +2 -2
- package/dist/bits/pin-input/types.d.ts +2 -2
- package/dist/bits/popover/types.d.ts +2 -2
- package/dist/bits/progress/types.d.ts +2 -2
- package/dist/bits/radio-group/types.d.ts +2 -2
- package/dist/bits/range-calendar/types.d.ts +6 -6
- package/dist/bits/select/ctx.d.ts +2 -2
- package/dist/bits/select/types.d.ts +6 -6
- package/dist/bits/slider/types.d.ts +2 -2
- package/dist/bits/switch/types.d.ts +4 -4
- package/dist/bits/tabs/types.d.ts +3 -3
- package/dist/bits/toggle/types.d.ts +2 -2
- package/dist/bits/toggle-group/types.d.ts +4 -4
- package/dist/bits/toolbar/types.d.ts +4 -4
- package/dist/bits/tooltip/types.d.ts +2 -2
- package/dist/internal/types.d.ts +9 -9
- package/package.json +1 -1
|
@@ -7,18 +7,18 @@ export type AccordionPropsWithoutHTML<Multiple extends boolean> = Expand<OmitVal
|
|
|
7
7
|
* The value of the accordion.
|
|
8
8
|
* You can bind this to a value to programmatically control the open state.
|
|
9
9
|
*/
|
|
10
|
-
value?: MeltAccordionProps<Multiple>["defaultValue"];
|
|
10
|
+
value?: MeltAccordionProps<Multiple>["defaultValue"] | undefined;
|
|
11
11
|
/**
|
|
12
12
|
* A callback function called when the value changes.
|
|
13
13
|
*/
|
|
14
|
-
onValueChange?: OnChangeFn<MeltAccordionProps<Multiple>["defaultValue"]
|
|
14
|
+
onValueChange?: OnChangeFn<MeltAccordionProps<Multiple>["defaultValue"]> | undefined;
|
|
15
15
|
} & DOMElement>;
|
|
16
16
|
export type AccordionItemPropsWithoutHTML = Expand<ObjectVariation<MeltAccordionItemProps> & DOMElement>;
|
|
17
17
|
export type AccordionHeaderPropsWithoutHTML = Expand<{
|
|
18
18
|
/**
|
|
19
19
|
* The heading level of the accordion header.
|
|
20
20
|
*/
|
|
21
|
-
level?: ObjectVariation<MeltAccordionHeadingProps>["level"];
|
|
21
|
+
level?: ObjectVariation<MeltAccordionHeadingProps>["level"] | undefined;
|
|
22
22
|
} & DOMElement>;
|
|
23
23
|
export type AccordionTriggerPropsWithoutHTML = DOMElement<HTMLButtonElement>;
|
|
24
24
|
export type AccordionContentPropsWithoutHTML<T extends Transition = Transition, In extends Transition = Transition, Out extends Transition = Transition> = Expand<TransitionProps<T, In, Out> & DOMElement>;
|
|
@@ -9,11 +9,11 @@ export type AlertDialogPropsWithoutHTML = Expand<OmitOpen<Omit<MeltDialogProps,
|
|
|
9
9
|
*
|
|
10
10
|
* @defaultValue false
|
|
11
11
|
*/
|
|
12
|
-
open?: boolean;
|
|
12
|
+
open?: boolean | undefined;
|
|
13
13
|
/**
|
|
14
14
|
* A callback function called when the open state changes.
|
|
15
15
|
*/
|
|
16
|
-
onOpenChange?: OnChangeFn<boolean
|
|
16
|
+
onOpenChange?: OnChangeFn<boolean> | undefined;
|
|
17
17
|
}>;
|
|
18
18
|
export type AlertDialogTriggerPropsWithoutHTML = DOMElement<HTMLButtonElement>;
|
|
19
19
|
export type AlertDialogActionPropsWithoutHTML = DOMElement<HTMLButtonElement>;
|
|
@@ -23,7 +23,7 @@ export type AlertDialogOverlayPropsWithoutHTML<T extends Transition = Transition
|
|
|
23
23
|
export type AlertDialogDescriptionPropsWithoutHTML = DOMElement;
|
|
24
24
|
export type AlertDialogPortalPropsWithoutHTML = DOMElement;
|
|
25
25
|
export type AlertDialogTitlePropsWithoutHTML = Expand<{
|
|
26
|
-
level?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
26
|
+
level?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined;
|
|
27
27
|
} & DOMElement<HTMLHeadingElement>>;
|
|
28
28
|
export type AlertDialogProps = AlertDialogPropsWithoutHTML;
|
|
29
29
|
export type AlertDialogTriggerProps = AlertDialogTriggerPropsWithoutHTML & HTMLButtonAttributes;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DOMEl, HTMLDivAttributes } from "../../internal/index.js";
|
|
1
|
+
import type { DOMEl, Expand, HTMLDivAttributes } from "../../internal/index.js";
|
|
2
2
|
export type AspectRatioPropsWithoutHTML = Expand<{
|
|
3
|
-
ratio?: number;
|
|
3
|
+
ratio?: number | undefined;
|
|
4
4
|
} & DOMEl>;
|
|
5
5
|
export type AspectRatioProps = AspectRatioPropsWithoutHTML & HTMLDivAttributes;
|
|
@@ -6,11 +6,11 @@ export type AvatarPropsWithoutHTML = Expand<Omit<MeltAvatarProps, "onLoadingStat
|
|
|
6
6
|
* The loading state of the image.
|
|
7
7
|
* You can bind this to a boolean value to programmatically control the loading state.
|
|
8
8
|
*/
|
|
9
|
-
loadingStatus?: "loading" | "loaded" | "error";
|
|
9
|
+
loadingStatus?: "loading" | "loaded" | "error" | undefined;
|
|
10
10
|
/**
|
|
11
11
|
* A callback function called when the loading state changes.
|
|
12
12
|
*/
|
|
13
|
-
onLoadingStatusChange?: OnChangeFn<"loading" | "loaded" | "error"
|
|
13
|
+
onLoadingStatusChange?: OnChangeFn<"loading" | "loaded" | "error"> | undefined;
|
|
14
14
|
} & DOMElement>;
|
|
15
15
|
export type AvatarImagePropsWithoutHTML = DOMElement<HTMLImageElement>;
|
|
16
16
|
export type AvatarFallbackPropsWithoutHTML = DOMElement<HTMLSpanElement>;
|
|
@@ -5,15 +5,15 @@ export type ButtonPropsWithoutHTML = {
|
|
|
5
5
|
/**
|
|
6
6
|
* Melt UI builders to apply to the button component.
|
|
7
7
|
*/
|
|
8
|
-
builders?: Builder[];
|
|
8
|
+
builders?: Builder[] | undefined;
|
|
9
9
|
};
|
|
10
10
|
type AnchorElement = ButtonPropsWithoutHTML & HTMLAnchorAttributes & {
|
|
11
|
-
href?: HTMLAnchorAttributes["href"];
|
|
12
|
-
type?: never;
|
|
11
|
+
href?: HTMLAnchorAttributes["href"] | undefined;
|
|
12
|
+
type?: never | undefined;
|
|
13
13
|
} & DOMEl<HTMLAnchorElement>;
|
|
14
14
|
type ButtonElement = ButtonPropsWithoutHTML & HTMLButtonAttributes & {
|
|
15
|
-
type?: HTMLButtonAttributes["type"];
|
|
16
|
-
href?: never;
|
|
15
|
+
type?: HTMLButtonAttributes["type"] | undefined;
|
|
16
|
+
href?: never | undefined;
|
|
17
17
|
} & DOMEl<HTMLButtonElement>;
|
|
18
18
|
export type ButtonProps = AnchorElement | ButtonElement;
|
|
19
19
|
export type ButtonEventHandler<T extends Event = Event> = T & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { HTMLAttributes, HTMLButtonAttributes, HTMLTableAttributes, HTMLTdAttributes, HTMLThAttributes } from "svelte/elements";
|
|
2
2
|
import type { DateValue } from "@internationalized/date";
|
|
3
3
|
import type { CreateCalendarProps as MeltCalendarProps } from "@melt-ui/svelte";
|
|
4
|
-
import type { DOMElement, HTMLDivAttributes, OnChangeFn } from "../../internal/index.js";
|
|
4
|
+
import type { DOMElement, Expand, HTMLDivAttributes, OnChangeFn } from "../../internal/index.js";
|
|
5
5
|
import type { CustomEventHandler } from "../../index.js";
|
|
6
6
|
type OmitCalendarProps<T> = Omit<T, "placeholder" | "defaultPlaceholder" | "value" | "defaultValue" | "onPlaceholderChange" | "onValueChange" | "ids">;
|
|
7
7
|
export type CalendarPropsWithoutHTML<Multiple extends boolean = false> = Expand<OmitCalendarProps<MeltCalendarProps<Multiple>> & {
|
|
@@ -12,11 +12,11 @@ export type CalendarPropsWithoutHTML<Multiple extends boolean = false> = Expand<
|
|
|
12
12
|
* You can bind this to a value to programmatically control the
|
|
13
13
|
* value state.
|
|
14
14
|
*/
|
|
15
|
-
value?: MeltCalendarProps<Multiple>["defaultValue"];
|
|
15
|
+
value?: MeltCalendarProps<Multiple>["defaultValue"] | undefined;
|
|
16
16
|
/**
|
|
17
17
|
* A callback function called when the value changes.
|
|
18
18
|
*/
|
|
19
|
-
onValueChange?: OnChangeFn<MeltCalendarProps<Multiple>["defaultValue"]
|
|
19
|
+
onValueChange?: OnChangeFn<MeltCalendarProps<Multiple>["defaultValue"]> | undefined;
|
|
20
20
|
/**
|
|
21
21
|
* The placeholder date, used to display the calendar when no
|
|
22
22
|
* date is selected. This updates as the user navigates
|
|
@@ -25,11 +25,11 @@ export type CalendarPropsWithoutHTML<Multiple extends boolean = false> = Expand<
|
|
|
25
25
|
* You can bind this to a value to programmatically control the
|
|
26
26
|
* placeholder state.
|
|
27
27
|
*/
|
|
28
|
-
placeholder?: DateValue;
|
|
28
|
+
placeholder?: DateValue | undefined;
|
|
29
29
|
/**
|
|
30
30
|
* A callback function called when the placeholder changes.
|
|
31
31
|
*/
|
|
32
|
-
onPlaceholderChange?: OnChangeFn<DateValue
|
|
32
|
+
onPlaceholderChange?: OnChangeFn<DateValue> | undefined;
|
|
33
33
|
/**
|
|
34
34
|
* If `true`, the calendar will focus the selected day,
|
|
35
35
|
* today, or the first day of the month in that order depending
|
|
@@ -37,7 +37,7 @@ export type CalendarPropsWithoutHTML<Multiple extends boolean = false> = Expand<
|
|
|
37
37
|
*
|
|
38
38
|
* @default false
|
|
39
39
|
*/
|
|
40
|
-
initialFocus?: boolean;
|
|
40
|
+
initialFocus?: boolean | undefined;
|
|
41
41
|
} & DOMElement>;
|
|
42
42
|
export type CalendarPrevButtonPropsWithoutHTML = DOMElement<HTMLButtonElement>;
|
|
43
43
|
export type CalendarNextButtonPropsWithoutHTML = DOMElement<HTMLButtonElement>;
|
|
@@ -9,11 +9,11 @@ export type CheckboxPropsWithoutHTML = Expand<OmitChecked<MeltCheckboxProps> & {
|
|
|
9
9
|
*
|
|
10
10
|
* @defaultValue false
|
|
11
11
|
*/
|
|
12
|
-
checked?: boolean | "indeterminate";
|
|
12
|
+
checked?: boolean | "indeterminate" | undefined;
|
|
13
13
|
/**
|
|
14
14
|
* A callback function called when the checked state changes.
|
|
15
15
|
*/
|
|
16
|
-
onCheckedChange?: OnChangeFn<boolean | "indeterminate"
|
|
16
|
+
onCheckedChange?: OnChangeFn<boolean | "indeterminate"> | undefined;
|
|
17
17
|
} & DOMElement<HTMLButtonElement>>;
|
|
18
18
|
export type CheckboxIndicatorPropsWithoutHTML = DOMElement;
|
|
19
19
|
export type CheckboxProps = CheckboxPropsWithoutHTML & HTMLButtonAttributes;
|
|
@@ -9,11 +9,11 @@ export type CollapsiblePropsWithoutHTML = Expand<OmitOpen<OmitForceVisible<MeltC
|
|
|
9
9
|
*
|
|
10
10
|
* @defaultValue false
|
|
11
11
|
*/
|
|
12
|
-
open?: boolean;
|
|
12
|
+
open?: boolean | undefined;
|
|
13
13
|
/**
|
|
14
14
|
* A callback function called when the open state changes.
|
|
15
15
|
*/
|
|
16
|
-
onOpenChange?: OnChangeFn<boolean
|
|
16
|
+
onOpenChange?: OnChangeFn<boolean> | undefined;
|
|
17
17
|
} & DOMElement>;
|
|
18
18
|
export type CollapsibleContentPropsWithoutHTML<T extends Transition = Transition, In extends Transition = Transition, Out extends Transition = Transition> = Expand<TransitionProps<T, In, Out> & DOMElement>;
|
|
19
19
|
export type CollapsibleTriggerPropsWithoutHTML = DOMElement<HTMLButtonElement>;
|
|
@@ -6,10 +6,10 @@ type GetReturn = Omit<ReturnType<typeof setCtx>, "updateOption">;
|
|
|
6
6
|
export declare function getCtx(): GetReturn;
|
|
7
7
|
type Items<T> = {
|
|
8
8
|
value: T;
|
|
9
|
-
label?: string;
|
|
9
|
+
label?: string | undefined;
|
|
10
10
|
};
|
|
11
11
|
type Props<T = unknown, M extends boolean = false> = CreateComboboxProps<T, M> & {
|
|
12
|
-
items?: Items<T>[];
|
|
12
|
+
items?: Items<T>[] | undefined;
|
|
13
13
|
};
|
|
14
14
|
export declare function setCtx<T = unknown, M extends boolean = false>(props: Props<T, M>): {
|
|
15
15
|
updateOption: <K extends string, V extends unknown>(key: K, value: V | undefined) => void;
|
|
@@ -18,41 +18,41 @@ export type ComboboxPropsWithoutHTML<T = unknown, Multiple extends boolean = fal
|
|
|
18
18
|
/**
|
|
19
19
|
* A callback function called when the selected value changes.
|
|
20
20
|
*/
|
|
21
|
-
onSelectedChange?: OnChangeFn<SelectValue<Selected<T>, Multiple
|
|
21
|
+
onSelectedChange?: OnChangeFn<SelectValue<Selected<T>, Multiple>> | undefined;
|
|
22
22
|
/**
|
|
23
23
|
* The open state of the combobox menu.
|
|
24
24
|
* You can bind this to a boolean value to programmatically control the open state.
|
|
25
25
|
*
|
|
26
26
|
* @defaultValue false
|
|
27
27
|
*/
|
|
28
|
-
open?: boolean;
|
|
28
|
+
open?: boolean | undefined;
|
|
29
29
|
/**
|
|
30
30
|
* A callback function called when the open state changes.
|
|
31
31
|
*/
|
|
32
|
-
onOpenChange?: OnChangeFn<boolean
|
|
32
|
+
onOpenChange?: OnChangeFn<boolean> | undefined;
|
|
33
33
|
/**
|
|
34
34
|
* Whether or not multiple values can be selected.
|
|
35
35
|
*/
|
|
36
|
-
multiple?: Multiple;
|
|
36
|
+
multiple?: Multiple | undefined;
|
|
37
37
|
/**
|
|
38
38
|
* The value of the input.
|
|
39
39
|
* You can bind this to a value to programmatically control the input value.
|
|
40
40
|
*
|
|
41
41
|
* @defaultValue ""
|
|
42
42
|
*/
|
|
43
|
-
inputValue?: string;
|
|
43
|
+
inputValue?: string | undefined;
|
|
44
44
|
/**
|
|
45
45
|
* Optionally provide an array of `Selected<T>` objects to
|
|
46
46
|
* type the `selected` and `onSelectedChange` props.
|
|
47
47
|
*/
|
|
48
|
-
items?: Selected<T>[];
|
|
48
|
+
items?: Selected<T>[] | undefined;
|
|
49
49
|
/**
|
|
50
50
|
* Whether the input has been touched or not. You can bind to this to
|
|
51
51
|
* handle filtering the items only when the input has been touched.
|
|
52
52
|
*
|
|
53
53
|
* @defaultValue false
|
|
54
54
|
*/
|
|
55
|
-
touchedInput?: boolean;
|
|
55
|
+
touchedInput?: boolean | undefined;
|
|
56
56
|
}>;
|
|
57
57
|
export type ComboboxInputPropsWithoutHTML = DOMElement<HTMLInputElement>;
|
|
58
58
|
export type ComboboxLabelPropsWithoutHTML = DOMElement<HTMLLabelElement>;
|
|
@@ -8,29 +8,29 @@ export type DateFieldPropsWithoutHTML = Expand<Omit<OmitDates<MeltDateFieldProps
|
|
|
8
8
|
* The value of the date field.
|
|
9
9
|
* You can bind this to a `DateValue` object to programmatically control the value.
|
|
10
10
|
*/
|
|
11
|
-
value?: DateValue;
|
|
11
|
+
value?: DateValue | undefined;
|
|
12
12
|
/**
|
|
13
13
|
* A callback function called when the value changes.
|
|
14
14
|
*/
|
|
15
|
-
onValueChange?: OnChangeFn<DateValue | undefined
|
|
15
|
+
onValueChange?: OnChangeFn<DateValue | undefined> | undefined;
|
|
16
16
|
/**
|
|
17
17
|
* The placeholder date used to start the field.
|
|
18
18
|
*/
|
|
19
|
-
placeholder?: DateValue;
|
|
19
|
+
placeholder?: DateValue | undefined;
|
|
20
20
|
/**
|
|
21
21
|
* A callback function called when the placeholder changes.
|
|
22
22
|
*/
|
|
23
|
-
onPlaceholderChange?: OnChangeFn<DateValue
|
|
23
|
+
onPlaceholderChange?: OnChangeFn<DateValue> | undefined;
|
|
24
24
|
/**
|
|
25
25
|
* The id of the validation message element which is used to apply the
|
|
26
26
|
* appropriate `aria-describedby` attribute to the input.
|
|
27
27
|
*/
|
|
28
|
-
validationId?: string;
|
|
28
|
+
validationId?: string | undefined;
|
|
29
29
|
/**
|
|
30
30
|
* The id of the description element which is used to describe the input.
|
|
31
31
|
* This is used to apply the appropriate `aria-describedby` attribute to the input.
|
|
32
32
|
*/
|
|
33
|
-
descriptionId?: string;
|
|
33
|
+
descriptionId?: string | undefined;
|
|
34
34
|
}>;
|
|
35
35
|
export type DateFieldInputPropsWithoutHTML = DOMElement;
|
|
36
36
|
export type DateFieldDescriptionPropsWithoutHTML = DOMElement;
|
|
@@ -12,38 +12,38 @@ export type DatePickerPropsWithoutHTML = Expand<Omit<OmitFloating<OmitDates<Melt
|
|
|
12
12
|
*
|
|
13
13
|
* @default false
|
|
14
14
|
*/
|
|
15
|
-
open?: boolean;
|
|
15
|
+
open?: boolean | undefined;
|
|
16
16
|
/**
|
|
17
17
|
* A callback function called when the open state changes.
|
|
18
18
|
*/
|
|
19
|
-
onOpenChange?: OnChangeFn<boolean
|
|
19
|
+
onOpenChange?: OnChangeFn<boolean> | undefined;
|
|
20
20
|
/**
|
|
21
21
|
* The value of the date field.
|
|
22
22
|
* You can bind this to a `DateValue` object to programmatically control the value.
|
|
23
23
|
*/
|
|
24
|
-
value?: DateValue;
|
|
24
|
+
value?: DateValue | undefined;
|
|
25
25
|
/**
|
|
26
26
|
* A callback function called when the value changes.
|
|
27
27
|
*/
|
|
28
|
-
onValueChange?: OnChangeFn<DateValue | undefined
|
|
28
|
+
onValueChange?: OnChangeFn<DateValue | undefined> | undefined;
|
|
29
29
|
/**
|
|
30
30
|
* The placeholder date used to start the field.
|
|
31
31
|
*/
|
|
32
|
-
placeholder?: DateValue;
|
|
32
|
+
placeholder?: DateValue | undefined;
|
|
33
33
|
/**
|
|
34
34
|
* A callback function called when the placeholder changes.
|
|
35
35
|
*/
|
|
36
|
-
onPlaceholderChange?: OnChangeFn<DateValue
|
|
36
|
+
onPlaceholderChange?: OnChangeFn<DateValue> | undefined;
|
|
37
37
|
/**
|
|
38
38
|
* The id of the validation message element which is used to apply the
|
|
39
39
|
* appropriate `aria-describedby` attribute to the input.
|
|
40
40
|
*/
|
|
41
|
-
validationId?: string;
|
|
41
|
+
validationId?: string | undefined;
|
|
42
42
|
/**
|
|
43
43
|
* The id of the description element which is used to describe the input.
|
|
44
44
|
* This is used to apply the appropriate `aria-describedby` attribute to the input.
|
|
45
45
|
*/
|
|
46
|
-
descriptionId?: string;
|
|
46
|
+
descriptionId?: string | undefined;
|
|
47
47
|
}>;
|
|
48
48
|
export type DatePickerInputPropsWithoutHTML = DOMElement;
|
|
49
49
|
export type DatePickerDescriptionPropsWithoutHTML = DOMElement;
|
|
@@ -9,29 +9,29 @@ export type DateRangeFieldPropsWithoutHTML = Expand<Omit<OmitDates<CreateDateRan
|
|
|
9
9
|
* The value of the date field.
|
|
10
10
|
* You can bind this to a `DateValue` object to programmatically control the value.
|
|
11
11
|
*/
|
|
12
|
-
value?: DateRange;
|
|
12
|
+
value?: DateRange | undefined;
|
|
13
13
|
/**
|
|
14
14
|
* A callback function called when the value changes.
|
|
15
15
|
*/
|
|
16
|
-
onValueChange?: OnChangeFn<DateRange | undefined
|
|
16
|
+
onValueChange?: OnChangeFn<DateRange | undefined> | undefined;
|
|
17
17
|
/**
|
|
18
18
|
* The placeholder date used to start the field.
|
|
19
19
|
*/
|
|
20
|
-
placeholder?: DateValue;
|
|
20
|
+
placeholder?: DateValue | undefined;
|
|
21
21
|
/**
|
|
22
22
|
* A callback function called when the placeholder changes.
|
|
23
23
|
*/
|
|
24
|
-
onPlaceholderChange?: OnChangeFn<DateValue
|
|
24
|
+
onPlaceholderChange?: OnChangeFn<DateValue> | undefined;
|
|
25
25
|
/**
|
|
26
26
|
* The id of the validation message element which is used to apply the
|
|
27
27
|
* appropriate `aria-describedby` attribute to the input.
|
|
28
28
|
*/
|
|
29
|
-
validationId?: string;
|
|
29
|
+
validationId?: string | undefined;
|
|
30
30
|
/**
|
|
31
31
|
* The id of the description element which is used to describe the input.
|
|
32
32
|
* This is used to apply the appropriate `aria-describedby` attribute to the input.
|
|
33
33
|
*/
|
|
34
|
-
descriptionId?: string;
|
|
34
|
+
descriptionId?: string | undefined;
|
|
35
35
|
}>;
|
|
36
36
|
export type DateRangeFieldInputPropsWithoutHTML = DOMElement;
|
|
37
37
|
export type DateRangeFieldLabelPropsWithoutHTML = DOMElement<HTMLSpanElement>;
|
|
@@ -15,38 +15,38 @@ export type DateRangePickerPropsWithoutHTML = Expand<WithOmission<MeltDateRangeP
|
|
|
15
15
|
*
|
|
16
16
|
* @default false
|
|
17
17
|
*/
|
|
18
|
-
open?: boolean;
|
|
18
|
+
open?: boolean | undefined;
|
|
19
19
|
/**
|
|
20
20
|
* A callback function called when the open state changes.
|
|
21
21
|
*/
|
|
22
|
-
onOpenChange?: OnChangeFn<boolean
|
|
22
|
+
onOpenChange?: OnChangeFn<boolean> | undefined;
|
|
23
23
|
/**
|
|
24
24
|
* The value of the date field.
|
|
25
25
|
* You can bind this to a `DateValue` object to programmatically control the value.
|
|
26
26
|
*/
|
|
27
|
-
value?: DateRange;
|
|
27
|
+
value?: DateRange | undefined;
|
|
28
28
|
/**
|
|
29
29
|
* A callback function called when the value changes.
|
|
30
30
|
*/
|
|
31
|
-
onValueChange?: OnChangeFn<DateRange | undefined
|
|
31
|
+
onValueChange?: OnChangeFn<DateRange | undefined> | undefined;
|
|
32
32
|
/**
|
|
33
33
|
* The placeholder date used to start the field.
|
|
34
34
|
*/
|
|
35
|
-
placeholder?: DateValue;
|
|
35
|
+
placeholder?: DateValue | undefined;
|
|
36
36
|
/**
|
|
37
37
|
* A callback function called when the placeholder changes.
|
|
38
38
|
*/
|
|
39
|
-
onPlaceholderChange?: OnChangeFn<DateValue
|
|
39
|
+
onPlaceholderChange?: OnChangeFn<DateValue> | undefined;
|
|
40
40
|
/**
|
|
41
41
|
* The id of the validation message element which is used to apply the
|
|
42
42
|
* appropriate `aria-describedby` attribute to the input.
|
|
43
43
|
*/
|
|
44
|
-
validationId?: string;
|
|
44
|
+
validationId?: string | undefined;
|
|
45
45
|
/**
|
|
46
46
|
* The id of the description element which is used to describe the input.
|
|
47
47
|
* This is used to apply the appropriate `aria-describedby` attribute to the input.
|
|
48
48
|
*/
|
|
49
|
-
descriptionId?: string;
|
|
49
|
+
descriptionId?: string | undefined;
|
|
50
50
|
/**
|
|
51
51
|
* The `start` value of the date range, which can exist prior
|
|
52
52
|
* to the `value` being set. The `value` is only set once a `start`
|
|
@@ -10,19 +10,19 @@ export type DialogPropsWithoutHTML = Expand<OmitOpen<Omit<MeltDialogProps, "role
|
|
|
10
10
|
*
|
|
11
11
|
* @defaultValue false
|
|
12
12
|
*/
|
|
13
|
-
open?: MeltDialogProps["defaultOpen"] & {};
|
|
13
|
+
open?: (MeltDialogProps["defaultOpen"] & {}) | undefined;
|
|
14
14
|
/**
|
|
15
15
|
* A callback function called when the open state changes.
|
|
16
16
|
*/
|
|
17
|
-
onOpenChange?: OnChangeFn<boolean
|
|
17
|
+
onOpenChange?: OnChangeFn<boolean> | undefined;
|
|
18
18
|
/**
|
|
19
19
|
* Override the default autofocus behavior of the dialog when it opens
|
|
20
20
|
*/
|
|
21
|
-
openFocus?: FocusProp;
|
|
21
|
+
openFocus?: FocusProp | undefined;
|
|
22
22
|
/**
|
|
23
23
|
* Override the default autofocus behavior of the dialog after close
|
|
24
24
|
*/
|
|
25
|
-
closeFocus?: FocusProp;
|
|
25
|
+
closeFocus?: FocusProp | undefined;
|
|
26
26
|
}>;
|
|
27
27
|
export type DialogTriggerPropsWithoutHTML = DOMElement<HTMLButtonElement>;
|
|
28
28
|
export type DialogClosePropsWithoutHTML = DialogTriggerPropsWithoutHTML;
|
|
@@ -31,7 +31,7 @@ export type DialogDescriptionPropsWithoutHTML = DOMElement;
|
|
|
31
31
|
export type DialogOverlayPropsWithoutHTML<T extends Transition = Transition, In extends Transition = Transition, Out extends Transition = Transition> = Expand<TransitionProps<T, In, Out> & DOMElement>;
|
|
32
32
|
export type DialogPortalPropsWithoutHTML = DOMElement;
|
|
33
33
|
export type DialogTitlePropsWithoutHTML = Expand<{
|
|
34
|
-
level?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
34
|
+
level?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined;
|
|
35
35
|
} & DOMElement<HTMLHeadingElement>>;
|
|
36
36
|
export type DialogProps = DialogPropsWithoutHTML;
|
|
37
37
|
export type DialogTriggerProps = DialogTriggerPropsWithoutHTML & HTMLButtonAttributes;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DOMElement, Expand, Transition, TransitionProps } from "../../internal/index.js";
|
|
2
2
|
export type ArrowProps = Expand<{
|
|
3
|
-
size?: number;
|
|
3
|
+
size?: number | undefined;
|
|
4
4
|
} & DOMElement>;
|
|
5
5
|
export type Boundary = "clippingAncestors" | Element | Array<Element> | Rect;
|
|
6
6
|
export type Rect = {
|
|
@@ -16,30 +16,30 @@ export type FloatingProps = {
|
|
|
16
16
|
*
|
|
17
17
|
* @see https://floating-ui.com/docs/computePosition#placement
|
|
18
18
|
*/
|
|
19
|
-
side?: "top" | "right" | "bottom" | "left";
|
|
19
|
+
side?: "top" | "right" | "bottom" | "left" | undefined;
|
|
20
20
|
/**
|
|
21
21
|
* The preferred alignment of the anchor to render against when open.
|
|
22
22
|
* This may change when collisions occur.
|
|
23
23
|
*
|
|
24
24
|
* @see https://floating-ui.com/docs/computePosition#placement
|
|
25
25
|
*/
|
|
26
|
-
align?: "start" | "center" | "end";
|
|
26
|
+
align?: "start" | "center" | "end" | undefined;
|
|
27
27
|
/**
|
|
28
28
|
* An offset in pixels from the "start" or "end" alignment options.
|
|
29
29
|
* @see https://floating-ui.com/docs/offset#options
|
|
30
30
|
*/
|
|
31
|
-
alignOffset?: number;
|
|
31
|
+
alignOffset?: number | undefined;
|
|
32
32
|
/**
|
|
33
33
|
* The distance in pixels from the anchor to the floating element.
|
|
34
34
|
* @see https://floating-ui.com/docs/offset#options
|
|
35
35
|
*/
|
|
36
|
-
sideOffset?: number;
|
|
36
|
+
sideOffset?: number | undefined;
|
|
37
37
|
/**
|
|
38
38
|
* Whether the content should be the same width as the trigger.
|
|
39
39
|
*
|
|
40
40
|
* @see https://floating-ui.com/docs/size
|
|
41
41
|
*/
|
|
42
|
-
sameWidth?: boolean;
|
|
42
|
+
sameWidth?: boolean | undefined;
|
|
43
43
|
/**
|
|
44
44
|
* When `true`, overrides the `side` and `align` options to prevent collisions
|
|
45
45
|
* with the boundary edges.
|
|
@@ -47,7 +47,7 @@ export type FloatingProps = {
|
|
|
47
47
|
* @default true
|
|
48
48
|
* @see https://floating-ui.com/docs/flip
|
|
49
49
|
*/
|
|
50
|
-
avoidCollisions?: boolean;
|
|
50
|
+
avoidCollisions?: boolean | undefined;
|
|
51
51
|
/**
|
|
52
52
|
* The amount in pixels of virtual padding around the viewport edges to check
|
|
53
53
|
* for overflow which will cause a collision.
|
|
@@ -55,31 +55,31 @@ export type FloatingProps = {
|
|
|
55
55
|
* @default 8
|
|
56
56
|
* @see https://floating-ui.com/docs/detectOverflow#padding
|
|
57
57
|
*/
|
|
58
|
-
collisionPadding?: number;
|
|
58
|
+
collisionPadding?: number | undefined;
|
|
59
59
|
/**
|
|
60
60
|
* A boundary element or array of elements to check for collisions against.
|
|
61
61
|
*
|
|
62
62
|
* @see https://floating-ui.com/docs/detectoverflow#boundary
|
|
63
63
|
*/
|
|
64
|
-
collisionBoundary?: Boundary;
|
|
64
|
+
collisionBoundary?: Boundary | undefined;
|
|
65
65
|
/**
|
|
66
66
|
* Whether the floating element should be constrained to the viewport.
|
|
67
67
|
*
|
|
68
68
|
* @default false
|
|
69
69
|
* @see https://floating-ui.com/docs/size
|
|
70
70
|
*/
|
|
71
|
-
fitViewport?: boolean;
|
|
71
|
+
fitViewport?: boolean | undefined;
|
|
72
72
|
/**
|
|
73
73
|
* The positioning strategy to use for the floating element.
|
|
74
74
|
* @see https://floating-ui.com/docs/computeposition#strategy
|
|
75
75
|
*/
|
|
76
|
-
strategy?: "absolute" | "fixed";
|
|
76
|
+
strategy?: "absolute" | "fixed" | undefined;
|
|
77
77
|
/**
|
|
78
78
|
* Whether the floating element can overlap the reference element.
|
|
79
79
|
* @default false
|
|
80
80
|
*
|
|
81
81
|
* @see https://floating-ui.com/docs/shift#options
|
|
82
82
|
*/
|
|
83
|
-
overlap?: boolean;
|
|
83
|
+
overlap?: boolean | undefined;
|
|
84
84
|
};
|
|
85
85
|
export type ContentProps<T extends Transition = Transition, In extends Transition = Transition, Out extends Transition = Transition> = Expand<FloatingProps & TransitionProps<T, In, Out> & DOMElement>;
|
|
@@ -12,7 +12,7 @@ export type FloatingConfig = {
|
|
|
12
12
|
*
|
|
13
13
|
* @see https://floating-ui.com/docs/computePosition#placement
|
|
14
14
|
*/
|
|
15
|
-
strategy?: "absolute" | "fixed";
|
|
15
|
+
strategy?: "absolute" | "fixed" | undefined;
|
|
16
16
|
/**
|
|
17
17
|
* The offset of the floating element.
|
|
18
18
|
*
|
|
@@ -21,55 +21,55 @@ export type FloatingConfig = {
|
|
|
21
21
|
offset?: {
|
|
22
22
|
mainAxis?: number;
|
|
23
23
|
crossAxis?: number;
|
|
24
|
-
};
|
|
24
|
+
} | undefined;
|
|
25
25
|
/**
|
|
26
26
|
* The main axis offset or gap between the reference and floating elements.
|
|
27
27
|
* @default `5`
|
|
28
28
|
*
|
|
29
29
|
* @see https://floating-ui.com/docs/offset#options
|
|
30
30
|
*/
|
|
31
|
-
gutter?: number;
|
|
31
|
+
gutter?: number | undefined;
|
|
32
32
|
/**
|
|
33
33
|
* The virtual padding around the viewport edges to check for overflow.
|
|
34
34
|
* @default `8`
|
|
35
35
|
*
|
|
36
36
|
* @see https://floating-ui.com/docs/detectOverflow#padding
|
|
37
37
|
*/
|
|
38
|
-
overflowPadding?: number;
|
|
38
|
+
overflowPadding?: number | undefined;
|
|
39
39
|
/**
|
|
40
40
|
* Whether to flip the placement.
|
|
41
41
|
* @default `true`
|
|
42
42
|
*
|
|
43
43
|
* @see https://floating-ui.com/docs/flip
|
|
44
44
|
*/
|
|
45
|
-
flip?: boolean;
|
|
45
|
+
flip?: boolean | undefined;
|
|
46
46
|
/**
|
|
47
47
|
* Whether the floating element can overlap the reference element.
|
|
48
48
|
* @default `false`
|
|
49
49
|
*
|
|
50
50
|
* @see https://floating-ui.com/docs/shift#options
|
|
51
51
|
*/
|
|
52
|
-
overlap?: boolean;
|
|
52
|
+
overlap?: boolean | undefined;
|
|
53
53
|
/**
|
|
54
54
|
* Whether to make the floating element same width as the reference element.
|
|
55
55
|
* @default `false`
|
|
56
56
|
*
|
|
57
57
|
* @see https://floating-ui.com/docs/size
|
|
58
58
|
*/
|
|
59
|
-
sameWidth?: boolean;
|
|
59
|
+
sameWidth?: boolean | undefined;
|
|
60
60
|
/**
|
|
61
61
|
* Whether the floating element should fit the viewport.
|
|
62
62
|
* @default `false`
|
|
63
63
|
*
|
|
64
64
|
* @see https://floating-ui.com/docs/size
|
|
65
65
|
*/
|
|
66
|
-
fitViewport?: boolean;
|
|
66
|
+
fitViewport?: boolean | undefined;
|
|
67
67
|
/**
|
|
68
68
|
* The overflow boundary of the reference element.
|
|
69
69
|
*
|
|
70
70
|
* @see https://floating-ui.com/docs/detectoverflow#boundary
|
|
71
71
|
*/
|
|
72
|
-
boundary?: Boundary;
|
|
72
|
+
boundary?: Boundary | undefined;
|
|
73
73
|
};
|
|
74
74
|
type Boundary = "clippingAncestors" | Element | Array<Element> | Rect;
|
|
75
75
|
type Rect = {
|
|
@@ -10,11 +10,11 @@ export type LinkPreviewPropsWithoutHTML = Expand<OmitFloating<CreateLinkPreviewP
|
|
|
10
10
|
*
|
|
11
11
|
* @defaultValue false
|
|
12
12
|
*/
|
|
13
|
-
open?: boolean;
|
|
13
|
+
open?: boolean | undefined;
|
|
14
14
|
/**
|
|
15
15
|
* A callback function called when the open state changes.
|
|
16
16
|
*/
|
|
17
|
-
onOpenChange?: OnChangeFn<boolean
|
|
17
|
+
onOpenChange?: OnChangeFn<boolean> | undefined;
|
|
18
18
|
}>;
|
|
19
19
|
export type LinkPreviewTriggerPropsWithoutHTML = DOMElement<HTMLAnchorElement>;
|
|
20
20
|
export type { LinkPreviewArrowPropsWithoutHTML, LinkPreviewContentPropsWithoutHTML };
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from "svelte/elements";
|
|
6
6
|
import type { CreateContextMenuCheckboxItemProps as MeltContextMenuCheckboxItemProps, CreateContextMenuProps as MeltContextMenuProps, CreateContextMenuRadioGroupProps as MeltContextMenuRadioGroupProps, ContextMenuRadioItemProps as MeltContextMenuRadioItemProps, CreateContextSubmenuProps as MeltContextSubmenuProps } from "@melt-ui/svelte";
|
|
7
|
-
import type { DOMEl, DOMElement, HTMLDivAttributes, OmitChecked, OmitFloating, OnChangeFn } from "../../internal/index.js";
|
|
7
|
+
import type { DOMEl, DOMElement, Expand, HTMLDivAttributes, OmitChecked, OmitFloating, OnChangeFn } from "../../internal/index.js";
|
|
8
8
|
import type { CustomEventHandler } from "../../index.js";
|
|
9
9
|
import type { ContentProps as MenuContentProps } from "../floating/types.js";
|
|
10
10
|
import type { ArrowProps as MenuArrowPropsWithoutHTML, ContentProps as MenuContentPropsWithoutHTML } from "../floating/_types.js";
|
|
@@ -15,11 +15,11 @@ export type MenuPropsWithoutHTML = Expand<OmitFloating<MeltContextMenuProps> & {
|
|
|
15
15
|
*
|
|
16
16
|
* @defaultValue false
|
|
17
17
|
*/
|
|
18
|
-
open?: boolean;
|
|
18
|
+
open?: boolean | undefined;
|
|
19
19
|
/**
|
|
20
20
|
* A callback function called when the open state changes.
|
|
21
21
|
*/
|
|
22
|
-
onOpenChange?: OnChangeFn<boolean
|
|
22
|
+
onOpenChange?: OnChangeFn<boolean> | undefined;
|
|
23
23
|
}>;
|
|
24
24
|
export type MenuSubTriggerPropsWithoutHTML = Expand<{
|
|
25
25
|
/**
|
|
@@ -27,7 +27,7 @@ export type MenuSubTriggerPropsWithoutHTML = Expand<{
|
|
|
27
27
|
*
|
|
28
28
|
* @defaultValue false;
|
|
29
29
|
*/
|
|
30
|
-
disabled?: boolean;
|
|
30
|
+
disabled?: boolean | undefined;
|
|
31
31
|
} & DOMElement>;
|
|
32
32
|
export type MenuCheckboxItemPropsWithoutHTML = Expand<OmitChecked<MeltContextMenuCheckboxItemProps> & {
|
|
33
33
|
/**
|
|
@@ -36,11 +36,11 @@ export type MenuCheckboxItemPropsWithoutHTML = Expand<OmitChecked<MeltContextMen
|
|
|
36
36
|
*
|
|
37
37
|
* @defaultValue false
|
|
38
38
|
*/
|
|
39
|
-
checked?: boolean | "indeterminate";
|
|
39
|
+
checked?: boolean | "indeterminate" | undefined;
|
|
40
40
|
/**
|
|
41
41
|
* A callback function called when the checked state changes.
|
|
42
42
|
*/
|
|
43
|
-
onCheckedChange?: OnChangeFn<boolean | "indeterminate"
|
|
43
|
+
onCheckedChange?: OnChangeFn<boolean | "indeterminate"> | undefined;
|
|
44
44
|
} & DOMElement>;
|
|
45
45
|
export type MenuRadioGroupPropsWithoutHTML = Expand<{
|
|
46
46
|
/**
|
|
@@ -48,11 +48,11 @@ export type MenuRadioGroupPropsWithoutHTML = Expand<{
|
|
|
48
48
|
*
|
|
49
49
|
* @defaultValue undefined
|
|
50
50
|
*/
|
|
51
|
-
value?: MeltContextMenuRadioGroupProps["defaultValue"] & {};
|
|
51
|
+
value?: (MeltContextMenuRadioGroupProps["defaultValue"] & {}) | undefined;
|
|
52
52
|
/**
|
|
53
53
|
* A callback function called when the value changes.
|
|
54
54
|
*/
|
|
55
|
-
onValueChange?: OnChangeFn<MeltContextMenuRadioGroupProps["defaultValue"]
|
|
55
|
+
onValueChange?: OnChangeFn<MeltContextMenuRadioGroupProps["defaultValue"]> | undefined;
|
|
56
56
|
} & DOMElement>;
|
|
57
57
|
export type MenuRadioItemPropsWithoutHTML = Expand<MeltContextMenuRadioItemProps & DOMElement>;
|
|
58
58
|
export type MenuSubPropsWithoutHTML = Expand<OmitFloating<MeltContextSubmenuProps> & {
|
|
@@ -62,11 +62,11 @@ export type MenuSubPropsWithoutHTML = Expand<OmitFloating<MeltContextSubmenuProp
|
|
|
62
62
|
*
|
|
63
63
|
* @defaultValue false
|
|
64
64
|
*/
|
|
65
|
-
open?: boolean;
|
|
65
|
+
open?: boolean | undefined;
|
|
66
66
|
/**
|
|
67
67
|
* A callback function called when the open state changes.
|
|
68
68
|
*/
|
|
69
|
-
onOpenChange?: OnChangeFn<boolean
|
|
69
|
+
onOpenChange?: OnChangeFn<boolean> | undefined;
|
|
70
70
|
}>;
|
|
71
71
|
export type MenuItemPropsWithoutHTML = Expand<{
|
|
72
72
|
/**
|
|
@@ -74,7 +74,7 @@ export type MenuItemPropsWithoutHTML = Expand<{
|
|
|
74
74
|
*
|
|
75
75
|
* @defaultValue false
|
|
76
76
|
*/
|
|
77
|
-
disabled?: boolean;
|
|
77
|
+
disabled?: boolean | undefined;
|
|
78
78
|
} & DOMElement>;
|
|
79
79
|
export type MenuGroupPropsWithoutHTML = DOMElement;
|
|
80
80
|
export type MenuCheckboxIndicatorPropsWithoutHTML = DOMElement;
|
|
@@ -89,10 +89,10 @@ export type MenuRadioGroupProps = MenuRadioGroupPropsWithoutHTML & HTMLDivAttrib
|
|
|
89
89
|
export type MenuRadioItemProps = MenuRadioItemPropsWithoutHTML & HTMLDivAttributes;
|
|
90
90
|
export type MenuGroupProps = MenuGroupPropsWithoutHTML & HTMLDivAttributes;
|
|
91
91
|
type MenuAnchorElement = HTMLAnchorAttributes & {
|
|
92
|
-
href?: HTMLAnchorAttributes["href"];
|
|
92
|
+
href?: HTMLAnchorAttributes["href"] | undefined;
|
|
93
93
|
} & DOMEl<HTMLAnchorElement>;
|
|
94
94
|
type MenuDivElement = HTMLDivAttributes & {
|
|
95
|
-
href?: never;
|
|
95
|
+
href?: never | undefined;
|
|
96
96
|
} & DOMEl;
|
|
97
97
|
export type MenuItemProps = Omit<MenuItemPropsWithoutHTML, "el"> & (MenuAnchorElement | MenuDivElement);
|
|
98
98
|
export type MenuCheckboxIndicatorProps = MenuCheckboxIndicatorPropsWithoutHTML & HTMLDivAttributes;
|
|
@@ -10,11 +10,11 @@ export type PaginationPropsWithoutHTML = Expand<OmitPaginationProps<MeltPaginati
|
|
|
10
10
|
*
|
|
11
11
|
* You can bind this to a value to programmatically control the value state.
|
|
12
12
|
*/
|
|
13
|
-
page?: number;
|
|
13
|
+
page?: number | undefined;
|
|
14
14
|
/**
|
|
15
15
|
* A callback function called when the page changes.
|
|
16
16
|
*/
|
|
17
|
-
onPageChange?: OnChangeFn<number
|
|
17
|
+
onPageChange?: OnChangeFn<number> | undefined;
|
|
18
18
|
} & DOMElement>;
|
|
19
19
|
export type PaginationPagePropsWithoutHTML = {
|
|
20
20
|
page: Page;
|
|
@@ -8,11 +8,11 @@ export type PinInputPropsWithoutHTML = Expand<OmitIds<OmitValue<MeltPinInputProp
|
|
|
8
8
|
*
|
|
9
9
|
* You can bind to this to programmatically control the value.
|
|
10
10
|
*/
|
|
11
|
-
value?: MeltPinInputProps["defaultValue"];
|
|
11
|
+
value?: MeltPinInputProps["defaultValue"] | undefined;
|
|
12
12
|
/**
|
|
13
13
|
* A callback function called when the value changes.
|
|
14
14
|
*/
|
|
15
|
-
onValueChange?: OnChangeFn<MeltPinInputProps["defaultValue"]
|
|
15
|
+
onValueChange?: OnChangeFn<MeltPinInputProps["defaultValue"]> | undefined;
|
|
16
16
|
} & DOMElement>>;
|
|
17
17
|
export type PinInputInputPropsWithoutHTML = DOMElement<HTMLInputElement>;
|
|
18
18
|
export type PinInputHiddenInputPropsWithoutHTML = DOMElement<HTMLInputElement>;
|
|
@@ -12,11 +12,11 @@ export type PopoverPropsWithoutHTML = Expand<OmitFloating<MeltPopoverProps> & {
|
|
|
12
12
|
*
|
|
13
13
|
* @defaultValue false
|
|
14
14
|
*/
|
|
15
|
-
open?: boolean;
|
|
15
|
+
open?: boolean | undefined;
|
|
16
16
|
/**
|
|
17
17
|
* A callback function called when the open state changes.
|
|
18
18
|
*/
|
|
19
|
-
onOpenChange?: OnChangeFn<boolean
|
|
19
|
+
onOpenChange?: OnChangeFn<boolean> | undefined;
|
|
20
20
|
}>;
|
|
21
21
|
export type PopoverTriggerPropsWithoutHTML = DOMElement<HTMLButtonElement>;
|
|
22
22
|
export type PopoverClosePropsWithoutHTML = DOMElement<HTMLButtonElement>;
|
|
@@ -5,10 +5,10 @@ export type ProgressPropsWithoutHTML = Expand<OmitValue<MeltProgressProps> & {
|
|
|
5
5
|
* The value of the progress bar.
|
|
6
6
|
* You can bind this to a number value to programmatically control the value.
|
|
7
7
|
*/
|
|
8
|
-
value?: MeltProgressProps["defaultValue"];
|
|
8
|
+
value?: MeltProgressProps["defaultValue"] | undefined;
|
|
9
9
|
/**
|
|
10
10
|
* A callback function called when the value changes.
|
|
11
11
|
*/
|
|
12
|
-
onValueChange?: OnChangeFn<number | null
|
|
12
|
+
onValueChange?: OnChangeFn<number | null> | undefined;
|
|
13
13
|
} & DOMElement>;
|
|
14
14
|
export type ProgressProps = ProgressPropsWithoutHTML & HTMLDivAttributes;
|
|
@@ -9,11 +9,11 @@ export type RadioGroupPropsWithoutHTML = Expand<OmitValue<MeltRadioGroupProps> &
|
|
|
9
9
|
*
|
|
10
10
|
* @defaultValue undefined
|
|
11
11
|
*/
|
|
12
|
-
value?: MeltRadioGroupProps["defaultValue"] & {};
|
|
12
|
+
value?: (MeltRadioGroupProps["defaultValue"] & {}) | undefined;
|
|
13
13
|
/**
|
|
14
14
|
* A callback function called when the value changes.
|
|
15
15
|
*/
|
|
16
|
-
onValueChange?: OnChangeFn<MeltRadioGroupProps["defaultValue"] & {}
|
|
16
|
+
onValueChange?: OnChangeFn<MeltRadioGroupProps["defaultValue"] & {}> | undefined;
|
|
17
17
|
} & DOMElement>;
|
|
18
18
|
export type RadioGroupInputPropsWithoutHTML = DOMElement<HTMLInputElement>;
|
|
19
19
|
export type RadioGroupItemPropsWithoutHTML = Expand<ObjectVariation<MeltRadioGroupItemProps> & DOMElement<HTMLButtonElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { HTMLAttributes, HTMLButtonAttributes, HTMLTableAttributes, HTMLTdAttributes, HTMLThAttributes } from "svelte/elements";
|
|
2
2
|
import type { DateValue } from "@internationalized/date";
|
|
3
3
|
import type { CreateRangeCalendarProps as MeltRangeCalendarProps } from "@melt-ui/svelte";
|
|
4
|
-
import type { DOMElement, HTMLDivAttributes, OnChangeFn } from "../../internal/index.js";
|
|
4
|
+
import type { DOMElement, Expand, HTMLDivAttributes, OnChangeFn } from "../../internal/index.js";
|
|
5
5
|
import type { CustomEventHandler } from "../../index.js";
|
|
6
6
|
import type { DateRange } from "../../shared/index.js";
|
|
7
7
|
export type RangeCalendarPropsWithoutHTML = Expand<Omit<MeltRangeCalendarProps, "placeholder" | "defaultPlaceholder" | "value" | "defaultValue" | "onPlaceholderChange" | "onValueChange" | "ids"> & {
|
|
@@ -12,11 +12,11 @@ export type RangeCalendarPropsWithoutHTML = Expand<Omit<MeltRangeCalendarProps,
|
|
|
12
12
|
* You can bind this to a value to programmatically control the
|
|
13
13
|
* value state.
|
|
14
14
|
*/
|
|
15
|
-
value?: DateRange;
|
|
15
|
+
value?: DateRange | undefined;
|
|
16
16
|
/**
|
|
17
17
|
* A callback function called when the value changes.
|
|
18
18
|
*/
|
|
19
|
-
onValueChange?: OnChangeFn<DateRange
|
|
19
|
+
onValueChange?: OnChangeFn<DateRange> | undefined;
|
|
20
20
|
/**
|
|
21
21
|
* The placeholder date, used to display the calendar when no
|
|
22
22
|
* date is selected. This updates as the user navigates
|
|
@@ -25,11 +25,11 @@ export type RangeCalendarPropsWithoutHTML = Expand<Omit<MeltRangeCalendarProps,
|
|
|
25
25
|
* You can bind this to a value to programmatically control the
|
|
26
26
|
* placeholder state.
|
|
27
27
|
*/
|
|
28
|
-
placeholder?: DateValue;
|
|
28
|
+
placeholder?: DateValue | undefined;
|
|
29
29
|
/**
|
|
30
30
|
* A callback function called when the placeholder changes.
|
|
31
31
|
*/
|
|
32
|
-
onPlaceholderChange?: OnChangeFn<DateValue
|
|
32
|
+
onPlaceholderChange?: OnChangeFn<DateValue> | undefined;
|
|
33
33
|
/**
|
|
34
34
|
* If `true`, the calendar will focus the selected day,
|
|
35
35
|
* today, or the first day of the month in that order depending
|
|
@@ -37,7 +37,7 @@ export type RangeCalendarPropsWithoutHTML = Expand<Omit<MeltRangeCalendarProps,
|
|
|
37
37
|
*
|
|
38
38
|
* @default false
|
|
39
39
|
*/
|
|
40
|
-
initialFocus?: boolean;
|
|
40
|
+
initialFocus?: boolean | undefined;
|
|
41
41
|
/**
|
|
42
42
|
* The `start` value of the date range, which can exist prior
|
|
43
43
|
* to the `value` being set. The `value` is only set once a `start`
|
|
@@ -6,10 +6,10 @@ type GetReturn = Omit<ReturnType<typeof setCtx>, "updateOption">;
|
|
|
6
6
|
export declare function getCtx(): GetReturn;
|
|
7
7
|
type Items<T> = {
|
|
8
8
|
value: T;
|
|
9
|
-
label?: string;
|
|
9
|
+
label?: string | undefined;
|
|
10
10
|
};
|
|
11
11
|
type Props<T = unknown, M extends boolean = false> = CreateSelectProps<T, M> & {
|
|
12
|
-
items?: Items<T>[];
|
|
12
|
+
items?: Items<T>[] | undefined;
|
|
13
13
|
};
|
|
14
14
|
export declare function setCtx<T = unknown, M extends boolean = false>(props: Props<T, M>): {
|
|
15
15
|
updateOption: <K extends string, V extends unknown>(key: K, value: V | undefined) => void;
|
|
@@ -19,27 +19,27 @@ export type SelectPropsWithoutHTML<T = unknown, Multiple extends boolean = false
|
|
|
19
19
|
/**
|
|
20
20
|
* A callback function called when the selected value changes.
|
|
21
21
|
*/
|
|
22
|
-
onSelectedChange?: OnChangeFn<SelectValue<Selected<T>, Multiple
|
|
22
|
+
onSelectedChange?: OnChangeFn<SelectValue<Selected<T>, Multiple>> | undefined;
|
|
23
23
|
/**
|
|
24
24
|
* The open state of the select menu.
|
|
25
25
|
* You can bind this to a boolean value to programmatically control the open state.
|
|
26
26
|
*
|
|
27
27
|
* @defaultValue false
|
|
28
28
|
*/
|
|
29
|
-
open?: boolean;
|
|
29
|
+
open?: boolean | undefined;
|
|
30
30
|
/**
|
|
31
31
|
* A callback function called when the open state changes.
|
|
32
32
|
*/
|
|
33
|
-
onOpenChange?: OnChangeFn<boolean
|
|
33
|
+
onOpenChange?: OnChangeFn<boolean> | undefined;
|
|
34
34
|
/**
|
|
35
35
|
* Whether or not multiple values can be selected.
|
|
36
36
|
*/
|
|
37
|
-
multiple?: Multiple;
|
|
37
|
+
multiple?: Multiple | undefined;
|
|
38
38
|
/**
|
|
39
39
|
* Optionally provide an array of `Selected<T>` objects to
|
|
40
40
|
* type the `selected` and `onSelectedChange` props.
|
|
41
41
|
*/
|
|
42
|
-
items?: Selected<T>[];
|
|
42
|
+
items?: Selected<T>[] | undefined;
|
|
43
43
|
}>;
|
|
44
44
|
export type SelectGroupPropsWithoutHTML = DOMElement;
|
|
45
45
|
export type SelectInputPropsWithoutHTML = DOMElement<HTMLInputElement>;
|
|
@@ -54,7 +54,7 @@ export type SelectValuePropsWithoutHTML = Expand<{
|
|
|
54
54
|
*
|
|
55
55
|
* @defaultValue ""
|
|
56
56
|
*/
|
|
57
|
-
placeholder?: string;
|
|
57
|
+
placeholder?: string | undefined;
|
|
58
58
|
} & DOMElement<HTMLSpanElement>>;
|
|
59
59
|
export type SelectProps<T, Multiple extends boolean = false> = SelectPropsWithoutHTML<T, Multiple>;
|
|
60
60
|
export type SelectContentProps<T extends Transition = Transition, In extends Transition = Transition, Out extends Transition = Transition> = SelectContentPropsWithoutHTML<T, In, Out> & HTMLDivAttributes;
|
|
@@ -9,11 +9,11 @@ export type SliderPropsWithoutHTML = Expand<OmitValue<MeltSliderProps> & {
|
|
|
9
9
|
* The value of the slider.
|
|
10
10
|
* You can bind this to a number value to programmatically control the value.
|
|
11
11
|
*/
|
|
12
|
-
value?: number[];
|
|
12
|
+
value?: number[] | undefined;
|
|
13
13
|
/**
|
|
14
14
|
* A callback function called when the value changes.
|
|
15
15
|
*/
|
|
16
|
-
onValueChange?: OnChangeFn<number[]
|
|
16
|
+
onValueChange?: OnChangeFn<number[]> | undefined;
|
|
17
17
|
} & DOMElement<HTMLSpanElement>>;
|
|
18
18
|
export type SliderRangePropsWithoutHTML = DOMElement<HTMLSpanElement>;
|
|
19
19
|
export type SliderThumbPropsWithoutHTML = DOMElement<HTMLSpanElement> & {
|
|
@@ -9,21 +9,21 @@ export type SwitchPropsWithoutHTML = Expand<OmitChecked<MeltSwitchProps> & {
|
|
|
9
9
|
*
|
|
10
10
|
* @defaultValue false
|
|
11
11
|
*/
|
|
12
|
-
checked?: boolean;
|
|
12
|
+
checked?: boolean | undefined;
|
|
13
13
|
/**
|
|
14
14
|
* A callback function called when the checked state changes.
|
|
15
15
|
*/
|
|
16
|
-
onCheckedChange?: OnChangeFn<boolean
|
|
16
|
+
onCheckedChange?: OnChangeFn<boolean> | undefined;
|
|
17
17
|
/**
|
|
18
18
|
* Whether to include the hidden input element in the DOM.
|
|
19
19
|
*/
|
|
20
|
-
includeInput?: boolean;
|
|
20
|
+
includeInput?: boolean | undefined;
|
|
21
21
|
/**
|
|
22
22
|
* Additional input attributes to pass to the hidden input element.
|
|
23
23
|
* Note, the value, name, type, and checked attributes are derived from the
|
|
24
24
|
* Switch props and cannot be overridden.
|
|
25
25
|
*/
|
|
26
|
-
inputAttrs?: Partial<Omit<HTMLInputAttributes, "value" | "name" | "type" | "checked"
|
|
26
|
+
inputAttrs?: Partial<Omit<HTMLInputAttributes, "value" | "name" | "type" | "checked">> | undefined;
|
|
27
27
|
} & DOMElement<HTMLButtonElement>>;
|
|
28
28
|
export type SwitchThumbPropsWithoutHTML = DOMElement<HTMLSpanElement>;
|
|
29
29
|
export type SwitchProps = SwitchPropsWithoutHTML & HTMLButtonAttributes;
|
|
@@ -7,17 +7,17 @@ export type TabsPropsWithoutHTML = Expand<OmitValue<MeltTabsProps> & {
|
|
|
7
7
|
* The value of the currently active tab.
|
|
8
8
|
* You can bind this to a string value to programmatically control the active tab.
|
|
9
9
|
*/
|
|
10
|
-
value?: MeltTabsProps["defaultValue"] & {};
|
|
10
|
+
value?: (MeltTabsProps["defaultValue"] & {}) | undefined;
|
|
11
11
|
/**
|
|
12
12
|
* A callback function called when the value changes.
|
|
13
13
|
*/
|
|
14
|
-
onValueChange?: OnChangeFn<MeltTabsProps["defaultValue"]
|
|
14
|
+
onValueChange?: OnChangeFn<MeltTabsProps["defaultValue"]> | undefined;
|
|
15
15
|
/**
|
|
16
16
|
* The orientation of the tabs, which determines how keyboard navigation works.
|
|
17
17
|
*
|
|
18
18
|
* @defaultValue "horizontal"
|
|
19
19
|
*/
|
|
20
|
-
orientation?: MeltTabsProps["orientation"] & {};
|
|
20
|
+
orientation?: (MeltTabsProps["orientation"] & {}) | undefined;
|
|
21
21
|
} & DOMElement>;
|
|
22
22
|
export type TabsContentPropsWithoutHTML = Expand<{
|
|
23
23
|
value: string;
|
|
@@ -9,11 +9,11 @@ export type TogglePropsWithoutHTML = Expand<OmitPressed<MeltToggleProps> & {
|
|
|
9
9
|
*
|
|
10
10
|
* @defaultValue false
|
|
11
11
|
*/
|
|
12
|
-
pressed?: boolean;
|
|
12
|
+
pressed?: boolean | undefined;
|
|
13
13
|
/**
|
|
14
14
|
* A callback function called when the pressed state changes.
|
|
15
15
|
*/
|
|
16
|
-
onPressedChange?: OnChangeFn<boolean
|
|
16
|
+
onPressedChange?: OnChangeFn<boolean> | undefined;
|
|
17
17
|
} & DOMElement<HTMLButtonElement>>;
|
|
18
18
|
export type ToggleProps = TogglePropsWithoutHTML & HTMLButtonAttributes;
|
|
19
19
|
export type ToggleEvents<T extends Element = HTMLButtonElement> = {
|
|
@@ -9,11 +9,11 @@ export type ToggleGroupPropsWithoutHTML<T extends "single" | "multiple"> = Expan
|
|
|
9
9
|
*
|
|
10
10
|
* You can bind to this to programmatically control the value.
|
|
11
11
|
*/
|
|
12
|
-
value?: MeltToggleGroupProps<T>["defaultValue"];
|
|
12
|
+
value?: MeltToggleGroupProps<T>["defaultValue"] | undefined;
|
|
13
13
|
/**
|
|
14
14
|
* A callback function called when the value changes.
|
|
15
15
|
*/
|
|
16
|
-
onValueChange?: OnChangeFn<MeltToggleGroupProps<T>["defaultValue"]
|
|
16
|
+
onValueChange?: OnChangeFn<MeltToggleGroupProps<T>["defaultValue"]> | undefined;
|
|
17
17
|
/**
|
|
18
18
|
* The type of the toggle group.
|
|
19
19
|
*
|
|
@@ -21,7 +21,7 @@ export type ToggleGroupPropsWithoutHTML<T extends "single" | "multiple"> = Expan
|
|
|
21
21
|
* at a time. If the type is `"multiple"`, the toggle group allows multiple items
|
|
22
22
|
* to be selected at a time.
|
|
23
23
|
*/
|
|
24
|
-
type?: T;
|
|
24
|
+
type?: T | undefined;
|
|
25
25
|
} & DOMElement>;
|
|
26
26
|
export type ToggleGroupItemPropsWithoutHTML = Expand<{
|
|
27
27
|
/**
|
|
@@ -37,7 +37,7 @@ export type ToggleGroupItemPropsWithoutHTML = Expand<{
|
|
|
37
37
|
*
|
|
38
38
|
* @defaultValue false
|
|
39
39
|
*/
|
|
40
|
-
disabled?: boolean;
|
|
40
|
+
disabled?: boolean | undefined;
|
|
41
41
|
} & DOMElement<HTMLButtonElement>>;
|
|
42
42
|
export type ToggleGroupProps<T extends "single" | "multiple"> = ToggleGroupPropsWithoutHTML<T> & HTMLDivAttributes;
|
|
43
43
|
export type ToggleGroupItemProps = ToggleGroupItemPropsWithoutHTML & HTMLButtonAttributes;
|
|
@@ -12,11 +12,11 @@ export type ToolbarGroupPropsWithoutHTML<T extends "single" | "multiple"> = Expa
|
|
|
12
12
|
*
|
|
13
13
|
* You can bind to this to programmatically control the value.
|
|
14
14
|
*/
|
|
15
|
-
value?: MeltToolbarGroupProps<T>["defaultValue"];
|
|
15
|
+
value?: MeltToolbarGroupProps<T>["defaultValue"] | undefined;
|
|
16
16
|
/**
|
|
17
17
|
* A callback function called when the value changes.
|
|
18
18
|
*/
|
|
19
|
-
onValueChange?: OnChangeFn<MeltToolbarGroupProps<T>["defaultValue"]
|
|
19
|
+
onValueChange?: OnChangeFn<MeltToolbarGroupProps<T>["defaultValue"]> | undefined;
|
|
20
20
|
/**
|
|
21
21
|
* The type of the toolbar toggle group.
|
|
22
22
|
*
|
|
@@ -24,7 +24,7 @@ export type ToolbarGroupPropsWithoutHTML<T extends "single" | "multiple"> = Expa
|
|
|
24
24
|
* at a time. If the type is `"multiple"`, the toolbar toggle group allows multiple items
|
|
25
25
|
* to be selected at a time.
|
|
26
26
|
*/
|
|
27
|
-
type?: T;
|
|
27
|
+
type?: T | undefined;
|
|
28
28
|
} & DOMElement>;
|
|
29
29
|
export type ToolbarGroupItemPropsWithoutHTML = Expand<{
|
|
30
30
|
/**
|
|
@@ -40,7 +40,7 @@ export type ToolbarGroupItemPropsWithoutHTML = Expand<{
|
|
|
40
40
|
*
|
|
41
41
|
* @defaultValue false
|
|
42
42
|
*/
|
|
43
|
-
disabled?: boolean;
|
|
43
|
+
disabled?: boolean | undefined;
|
|
44
44
|
} & DOMElement<HTMLButtonElement>>;
|
|
45
45
|
export type ToolbarProps = ToolbarPropsWithoutHTML & HTMLDivAttributes;
|
|
46
46
|
export type ToolbarButtonProps = ToolbarButtonPropsWithoutHTML & HTMLButtonAttributes;
|
|
@@ -25,11 +25,11 @@ export type TooltipPropsWithoutHTML = Expand<OmitFloating<MeltTooltipProps>> & {
|
|
|
25
25
|
* </Tooltip.Root>
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
|
-
open?: boolean & {};
|
|
28
|
+
open?: (boolean & {}) | undefined;
|
|
29
29
|
/**
|
|
30
30
|
* A callback function called when the open state changes.
|
|
31
31
|
*/
|
|
32
|
-
onOpenChange?: OnChangeFn<boolean
|
|
32
|
+
onOpenChange?: OnChangeFn<boolean> | undefined;
|
|
33
33
|
};
|
|
34
34
|
export type TooltipTriggerPropsWithoutHTML = DOMElement<HTMLButtonElement>;
|
|
35
35
|
export type TooltipProps = TooltipPropsWithoutHTML;
|
package/dist/internal/types.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export type DOMEl<T extends Element = HTMLDivElement> = Expand<{
|
|
|
31
31
|
/**
|
|
32
32
|
* Wheter to expose the underlying DOM element.
|
|
33
33
|
*/
|
|
34
|
-
el?: T;
|
|
34
|
+
el?: T | undefined;
|
|
35
35
|
}>;
|
|
36
36
|
export type DOMElement<T extends Element = HTMLDivElement> = Expand<{
|
|
37
37
|
/**
|
|
@@ -40,39 +40,39 @@ export type DOMElement<T extends Element = HTMLDivElement> = Expand<{
|
|
|
40
40
|
*
|
|
41
41
|
* @see https://www.bits-ui.com/docs/delegation
|
|
42
42
|
*/
|
|
43
|
-
asChild?: boolean;
|
|
43
|
+
asChild?: boolean | undefined;
|
|
44
44
|
/**
|
|
45
45
|
* Bind to the underlying DOM element of the component.
|
|
46
46
|
*/
|
|
47
|
-
el?: T;
|
|
47
|
+
el?: T | undefined;
|
|
48
48
|
}>;
|
|
49
49
|
export type TransitionProps<T extends Transition = Transition, In extends Transition = Transition, Out extends Transition = Transition> = Expand<{
|
|
50
50
|
/**
|
|
51
51
|
* A transition function to use during both the in and out transitions.
|
|
52
52
|
*/
|
|
53
|
-
transition?: T;
|
|
53
|
+
transition?: T | undefined;
|
|
54
54
|
/**
|
|
55
55
|
* The configuration to pass to the `transition` function.
|
|
56
56
|
*/
|
|
57
|
-
transitionConfig?: TransitionParams<T
|
|
57
|
+
transitionConfig?: TransitionParams<T> | undefined;
|
|
58
58
|
/**
|
|
59
59
|
* A transition function to use during the in transition.
|
|
60
60
|
*
|
|
61
61
|
* If provided, this will override the `transition` function.
|
|
62
62
|
*/
|
|
63
|
-
inTransition?: In;
|
|
63
|
+
inTransition?: In | undefined;
|
|
64
64
|
/**
|
|
65
65
|
* The configuration to pass to the `inTransition` function.
|
|
66
66
|
*/
|
|
67
|
-
inTransitionConfig?: TransitionParams<In
|
|
67
|
+
inTransitionConfig?: TransitionParams<In> | undefined;
|
|
68
68
|
/**
|
|
69
69
|
* A transition function to use during the out transition.
|
|
70
70
|
*
|
|
71
71
|
* If provided, this will override the `transition` function.
|
|
72
72
|
*/
|
|
73
|
-
outTransition?: Out;
|
|
73
|
+
outTransition?: Out | undefined;
|
|
74
74
|
/**
|
|
75
75
|
* The configuration to pass to the `outTransition` function.
|
|
76
76
|
*/
|
|
77
|
-
outTransitionConfig?: TransitionParams<Out
|
|
77
|
+
outTransitionConfig?: TransitionParams<Out> | undefined;
|
|
78
78
|
}>;
|