bits-ui 0.17.0 → 0.18.1
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/_export.types.d.ts +1 -1
- package/dist/bits/accordion/components/accordion-content.svelte +3 -18
- package/dist/bits/accordion/ctx.js +3 -3
- package/dist/bits/accordion/types.d.ts +1 -1
- package/dist/bits/alert-dialog/_export.types.d.ts +1 -1
- package/dist/bits/alert-dialog/_types.d.ts +1 -1
- package/dist/bits/alert-dialog/components/alert-dialog-overlay.svelte +2 -12
- package/dist/bits/alert-dialog/components/alert-dialog-title.svelte +1 -6
- package/dist/bits/alert-dialog/ctx.js +4 -4
- package/dist/bits/alert-dialog/types.d.ts +1 -1
- package/dist/bits/aspect-ratio/components/aspect-ratio.svelte +1 -5
- package/dist/bits/avatar/_export.types.d.ts +1 -1
- package/dist/bits/avatar/ctx.js +2 -2
- package/dist/bits/button/_export.types.d.ts +1 -1
- package/dist/bits/button/types.d.ts +1 -1
- package/dist/bits/calendar/_export.types.d.ts +1 -1
- package/dist/bits/calendar/_types.d.ts +1 -1
- package/dist/bits/calendar/components/calendar-next-button.svelte +1 -7
- package/dist/bits/calendar/components/calendar-prev-button.svelte +1 -7
- package/dist/bits/calendar/components/calendar.svelte +2 -12
- package/dist/bits/calendar/ctx.js +2 -2
- package/dist/bits/calendar/types.d.ts +1 -1
- package/dist/bits/checkbox/_export.types.d.ts +1 -1
- package/dist/bits/checkbox/_types.d.ts +1 -1
- package/dist/bits/checkbox/components/checkbox-input.svelte +1 -6
- package/dist/bits/checkbox/ctx.js +2 -2
- package/dist/bits/checkbox/types.d.ts +1 -1
- package/dist/bits/collapsible/_export.types.d.ts +1 -1
- package/dist/bits/collapsible/components/collapsible-content.svelte +3 -18
- package/dist/bits/collapsible/components/collapsible-trigger.svelte +1 -7
- package/dist/bits/collapsible/ctx.js +2 -2
- package/dist/bits/collapsible/types.d.ts +1 -1
- package/dist/bits/combobox/_export.types.d.ts +1 -0
- package/dist/bits/combobox/_export.types.js +1 -0
- package/dist/bits/combobox/_types.d.ts +62 -0
- package/dist/bits/combobox/_types.js +1 -0
- package/dist/bits/combobox/components/combobox-arrow.svelte +21 -0
- package/dist/bits/combobox/components/combobox-arrow.svelte.d.ts +26 -0
- package/dist/bits/combobox/components/combobox-content.svelte +104 -0
- package/dist/bits/combobox/components/combobox-content.svelte.d.ts +27 -0
- package/dist/bits/combobox/components/combobox-group-label.svelte +25 -0
- package/dist/bits/combobox/components/combobox-group-label.svelte.d.ts +23 -0
- package/dist/bits/combobox/components/combobox-group.svelte +19 -0
- package/dist/bits/combobox/components/combobox-group.svelte.d.ts +26 -0
- package/dist/bits/combobox/components/combobox-hidden-input.svelte +25 -0
- package/dist/bits/combobox/components/combobox-hidden-input.svelte.d.ts +32 -0
- package/dist/bits/combobox/components/combobox-input.svelte +31 -0
- package/dist/bits/combobox/components/combobox-input.svelte.d.ts +33 -0
- package/dist/bits/combobox/components/combobox-item-indicator.svelte +16 -0
- package/dist/bits/combobox/components/combobox-item-indicator.svelte.d.ts +20 -0
- package/dist/bits/combobox/components/combobox-item.svelte +47 -0
- package/dist/bits/combobox/components/combobox-item.svelte.d.ts +31 -0
- package/dist/bits/combobox/components/combobox-label.svelte +22 -0
- package/dist/bits/combobox/components/combobox-label.svelte.d.ts +17 -0
- package/dist/bits/combobox/components/combobox.svelte +113 -0
- package/dist/bits/combobox/components/combobox.svelte.d.ts +41 -0
- package/dist/bits/combobox/ctx.d.ts +187 -0
- package/dist/bits/combobox/ctx.js +91 -0
- package/dist/bits/combobox/index.d.ts +12 -0
- package/dist/bits/combobox/index.js +12 -0
- package/dist/bits/combobox/types.d.ts +36 -0
- package/dist/bits/combobox/types.js +1 -0
- package/dist/bits/context-menu/_export.types.d.ts +1 -1
- package/dist/bits/context-menu/components/context-menu-content.svelte +1 -6
- package/dist/bits/context-menu/components/context-menu.svelte +4 -7
- package/dist/bits/context-menu/components/context-menu.svelte.d.ts +2 -2
- package/dist/bits/context-menu/ctx.d.ts +1 -1
- package/dist/bits/context-menu/ctx.js +5 -5
- package/dist/bits/context-menu/types.d.ts +1 -1
- package/dist/bits/date-field/_export.types.d.ts +1 -1
- package/dist/bits/date-field/components/date-field.svelte +1 -5
- package/dist/bits/date-field/ctx.d.ts +1 -1
- package/dist/bits/date-field/ctx.js +2 -2
- package/dist/bits/date-field/types.d.ts +1 -1
- package/dist/bits/date-picker/_export.types.d.ts +1 -1
- package/dist/bits/date-picker/components/date-picker-calendar.svelte +1 -6
- package/dist/bits/date-picker/components/date-picker-content.svelte +3 -18
- package/dist/bits/date-picker/components/date-picker-field.svelte +1 -5
- package/dist/bits/date-picker/components/date-picker-next-button.svelte +1 -7
- package/dist/bits/date-picker/components/date-picker-prev-button.svelte +1 -7
- package/dist/bits/date-picker/components/date-picker.svelte +1 -5
- package/dist/bits/date-picker/ctx.d.ts +2 -2
- package/dist/bits/date-picker/ctx.js +5 -5
- package/dist/bits/date-picker/types.d.ts +1 -1
- package/dist/bits/date-range-field/_export.types.d.ts +1 -1
- package/dist/bits/date-range-field/components/date-range-field.svelte +2 -11
- package/dist/bits/date-range-field/ctx.d.ts +1 -1
- package/dist/bits/date-range-field/ctx.js +1 -1
- package/dist/bits/date-range-picker/_export.types.d.ts +1 -1
- package/dist/bits/date-range-picker/components/date-range-picker-content.svelte +3 -18
- package/dist/bits/date-range-picker/components/date-range-picker-field.svelte +1 -5
- package/dist/bits/date-range-picker/ctx.d.ts +2 -2
- package/dist/bits/date-range-picker/ctx.js +5 -5
- package/dist/bits/date-range-picker/types.d.ts +1 -1
- package/dist/bits/dialog/_export.types.d.ts +1 -1
- package/dist/bits/dialog/_types.d.ts +1 -1
- package/dist/bits/dialog/components/dialog-title.svelte +1 -6
- package/dist/bits/dialog/ctx.js +4 -4
- package/dist/bits/dialog/types.d.ts +1 -1
- package/dist/bits/dropdown-menu/_export.types.d.ts +1 -1
- package/dist/bits/dropdown-menu/types.d.ts +1 -1
- package/dist/bits/floating/helpers.js +3 -3
- package/dist/bits/index.d.ts +1 -0
- package/dist/bits/index.js +1 -0
- package/dist/bits/label/_export.types.d.ts +1 -1
- package/dist/bits/label/components/label.svelte +1 -6
- package/dist/bits/label/ctx.js +1 -1
- package/dist/bits/label/types.d.ts +1 -1
- package/dist/bits/link-preview/_export.types.d.ts +1 -1
- package/dist/bits/link-preview/components/link-preview.svelte +4 -7
- package/dist/bits/link-preview/ctx.js +6 -6
- package/dist/bits/link-preview/types.d.ts +1 -1
- package/dist/bits/menu/components/menu-content.svelte +1 -6
- package/dist/bits/menu/components/menu-sub.svelte +4 -7
- package/dist/bits/menu/components/menu.svelte +4 -7
- package/dist/bits/menu/components/menu.svelte.d.ts +2 -2
- package/dist/bits/menu/ctx.d.ts +8 -8
- package/dist/bits/menu/ctx.js +20 -20
- package/dist/bits/menu/types.d.ts +1 -1
- package/dist/bits/menubar/_export.types.d.ts +1 -1
- package/dist/bits/menubar/components/menubar-menu.svelte +4 -7
- package/dist/bits/menubar/components/menubar-menu.svelte.d.ts +2 -2
- package/dist/bits/menubar/components/menubar-sub.svelte +4 -7
- package/dist/bits/menubar/ctx.d.ts +3 -3
- package/dist/bits/menubar/ctx.js +12 -12
- package/dist/bits/menubar/types.d.ts +1 -1
- package/dist/bits/pagination/_export.types.d.ts +1 -1
- package/dist/bits/pagination/components/pagination-next-button.svelte +1 -7
- package/dist/bits/pagination/components/pagination-page.svelte +1 -7
- package/dist/bits/pagination/components/pagination-prev-button.svelte +1 -7
- package/dist/bits/pagination/ctx.js +2 -2
- package/dist/bits/pagination/types.d.ts +1 -1
- package/dist/bits/pin-input/_export.types.d.ts +1 -1
- package/dist/bits/pin-input/ctx.js +2 -2
- package/dist/bits/pin-input/types.d.ts +1 -1
- package/dist/bits/popover/_export.types.d.ts +1 -1
- package/dist/bits/popover/components/popover-content.svelte +3 -18
- package/dist/bits/popover/components/popover.svelte +4 -7
- package/dist/bits/popover/ctx.js +7 -7
- package/dist/bits/popover/types.d.ts +1 -1
- package/dist/bits/progress/ctx.js +2 -2
- package/dist/bits/radio-group/_export.types.d.ts +1 -1
- package/dist/bits/radio-group/ctx.js +2 -2
- package/dist/bits/radio-group/types.d.ts +1 -1
- package/dist/bits/range-calendar/_export.types.d.ts +1 -1
- package/dist/bits/range-calendar/_types.d.ts +1 -1
- package/dist/bits/range-calendar/components/range-calendar-next-button.svelte +1 -7
- package/dist/bits/range-calendar/components/range-calendar-prev-button.svelte +1 -7
- package/dist/bits/range-calendar/components/range-calendar.svelte +1 -6
- package/dist/bits/range-calendar/ctx.js +2 -2
- package/dist/bits/range-calendar/types.d.ts +1 -1
- package/dist/bits/select/_export.types.d.ts +1 -1
- package/dist/bits/select/_types.d.ts +1 -1
- package/dist/bits/select/components/select-content.svelte +1 -7
- package/dist/bits/select/components/select-value.svelte +1 -6
- package/dist/bits/select/components/select.svelte.d.ts +1 -1
- package/dist/bits/select/ctx.d.ts +4 -4
- package/dist/bits/select/ctx.js +11 -11
- package/dist/bits/select/types.d.ts +1 -1
- package/dist/bits/separator/ctx.js +2 -2
- package/dist/bits/slider/_export.types.d.ts +1 -1
- package/dist/bits/slider/components/slider-thumb.svelte +1 -6
- package/dist/bits/slider/ctx.js +2 -2
- package/dist/bits/slider/types.d.ts +1 -1
- package/dist/bits/switch/_export.types.d.ts +1 -1
- package/dist/bits/switch/ctx.js +2 -2
- package/dist/bits/switch/types.d.ts +1 -1
- package/dist/bits/tabs/_export.types.d.ts +1 -1
- package/dist/bits/tabs/ctx.js +2 -2
- package/dist/bits/tabs/types.d.ts +1 -1
- package/dist/bits/toggle/_export.types.d.ts +1 -1
- package/dist/bits/toggle/_types.d.ts +1 -1
- package/dist/bits/toggle/ctx.js +2 -2
- package/dist/bits/toggle/types.d.ts +1 -1
- package/dist/bits/toggle-group/_export.types.d.ts +1 -1
- package/dist/bits/toggle-group/ctx.js +2 -2
- package/dist/bits/toggle-group/types.d.ts +1 -1
- package/dist/bits/toolbar/_export.types.d.ts +1 -1
- package/dist/bits/toolbar/components/toolbar-button.svelte +1 -7
- package/dist/bits/toolbar/ctx.js +5 -5
- package/dist/bits/toolbar/types.d.ts +1 -1
- package/dist/bits/tooltip/_export.types.d.ts +1 -1
- package/dist/bits/tooltip/components/tooltip.svelte +4 -7
- package/dist/bits/tooltip/ctx.js +7 -7
- package/dist/bits/tooltip/types.d.ts +1 -1
- package/dist/helpers/builders.js +1 -1
- package/dist/internal/attrs.js +1 -1
- package/dist/internal/focus.js +1 -1
- package/dist/internal/kbd.js +1 -1
- package/dist/internal/style.js +1 -1
- package/dist/types.d.ts +1 -0
- package/package.json +27 -24
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { Props as AccordionProps, ItemProps as AccordionItemProps, HeaderProps as AccordionHeaderProps, TriggerProps as AccordionTriggerProps, ContentProps as AccordionContentProps, TriggerEvents as AccordionTriggerEvents } from "./types.js";
|
|
1
|
+
export type { Props as AccordionProps, ItemProps as AccordionItemProps, HeaderProps as AccordionHeaderProps, TriggerProps as AccordionTriggerProps, ContentProps as AccordionContentProps, TriggerEvents as AccordionTriggerEvents, } from "./types.js";
|
|
@@ -24,12 +24,7 @@ $:
|
|
|
24
24
|
{#if asChild && $isSelected(props)}
|
|
25
25
|
<slot {builder} />
|
|
26
26
|
{:else if transition && $isSelected(props)}
|
|
27
|
-
<div
|
|
28
|
-
bind:this={el}
|
|
29
|
-
transition:transition={transitionConfig}
|
|
30
|
-
{...builder} use:builder.action
|
|
31
|
-
{...$$restProps}
|
|
32
|
-
>
|
|
27
|
+
<div bind:this={el} transition:transition={transitionConfig} {...builder} use:builder.action {...$$restProps}>
|
|
33
28
|
<slot {builder} />
|
|
34
29
|
</div>
|
|
35
30
|
{:else if inTransition && outTransition && $isSelected(props)}
|
|
@@ -43,21 +38,11 @@ $:
|
|
|
43
38
|
<slot {builder} />
|
|
44
39
|
</div>
|
|
45
40
|
{:else if inTransition && $isSelected(props)}
|
|
46
|
-
<div
|
|
47
|
-
bind:this={el}
|
|
48
|
-
in:inTransition={inTransitionConfig}
|
|
49
|
-
{...builder} use:builder.action
|
|
50
|
-
{...$$restProps}
|
|
51
|
-
>
|
|
41
|
+
<div bind:this={el} in:inTransition={inTransitionConfig} {...builder} use:builder.action {...$$restProps}>
|
|
52
42
|
<slot {builder} />
|
|
53
43
|
</div>
|
|
54
44
|
{:else if outTransition && $isSelected(props)}
|
|
55
|
-
<div
|
|
56
|
-
bind:this={el}
|
|
57
|
-
out:outTransition={outTransitionConfig}
|
|
58
|
-
{...builder} use:builder.action
|
|
59
|
-
{...$$restProps}
|
|
60
|
-
>
|
|
45
|
+
<div bind:this={el} out:outTransition={outTransitionConfig} {...builder} use:builder.action {...$$restProps}>
|
|
61
46
|
<slot {builder} />
|
|
62
47
|
</div>
|
|
63
48
|
{:else if $isSelected(props)}
|
|
@@ -14,7 +14,7 @@ export function setCtx(props) {
|
|
|
14
14
|
const accordion = {
|
|
15
15
|
...initAccordion,
|
|
16
16
|
getAttrs,
|
|
17
|
-
updateOption: getOptionUpdater(initAccordion.options)
|
|
17
|
+
updateOption: getOptionUpdater(initAccordion.options),
|
|
18
18
|
};
|
|
19
19
|
setContext(NAME, accordion);
|
|
20
20
|
return accordion;
|
|
@@ -38,7 +38,7 @@ export function getContent() {
|
|
|
38
38
|
const { value: props } = getItemProps();
|
|
39
39
|
return {
|
|
40
40
|
...ctx,
|
|
41
|
-
props
|
|
41
|
+
props,
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
export function getTrigger() {
|
|
@@ -46,6 +46,6 @@ export function getTrigger() {
|
|
|
46
46
|
const { value, disabled } = getItemProps();
|
|
47
47
|
return {
|
|
48
48
|
...ctx,
|
|
49
|
-
props: { value, disabled }
|
|
49
|
+
props: { value, disabled },
|
|
50
50
|
};
|
|
51
51
|
}
|
|
@@ -11,4 +11,4 @@ type TriggerEvents = {
|
|
|
11
11
|
click: CustomEventHandler<MouseEvent, HTMLButtonElement>;
|
|
12
12
|
keydown: CustomEventHandler<KeyboardEvent, HTMLButtonElement>;
|
|
13
13
|
};
|
|
14
|
-
export type { Props, ItemProps, HeaderProps, TriggerProps, ContentProps, TriggerEvents };
|
|
14
|
+
export type { Props, ItemProps, HeaderProps, TriggerProps, ContentProps, TriggerEvents, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { Props as AlertDialogProps, TriggerProps as AlertDialogTriggerProps, ActionProps as AlertDialogActionProps, CancelProps as AlertDialogCancelProps, ContentProps as AlertDialogContentProps, DescriptionProps as AlertDialogDescriptionProps, PortalProps as AlertDialogPortalProps, OverlayProps as AlertDialogOverlayProps, TitleProps as AlertDialogTitleProps, TriggerEvents as AlertDialogTriggerEvents, CancelEvents as AlertDialogCancelEvents, ActionEvents as AlertDialogActionEvents, ContentEvents as AlertDialogContentEvents } from "./types.js";
|
|
1
|
+
export type { Props as AlertDialogProps, TriggerProps as AlertDialogTriggerProps, ActionProps as AlertDialogActionProps, CancelProps as AlertDialogCancelProps, ContentProps as AlertDialogContentProps, DescriptionProps as AlertDialogDescriptionProps, PortalProps as AlertDialogPortalProps, OverlayProps as AlertDialogOverlayProps, TitleProps as AlertDialogTitleProps, TriggerEvents as AlertDialogTriggerEvents, CancelEvents as AlertDialogCancelEvents, ActionEvents as AlertDialogActionEvents, ContentEvents as AlertDialogContentEvents, } from "./types.js";
|
|
@@ -27,4 +27,4 @@ type PortalProps = DOMElement;
|
|
|
27
27
|
type TitleProps = Expand<{
|
|
28
28
|
level?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
29
29
|
} & DOMElement<HTMLHeadingElement>>;
|
|
30
|
-
export type { Props, TriggerProps, ActionProps, CancelProps, ContentProps, DescriptionProps, ContentProps as OverlayProps, PortalProps, TitleProps };
|
|
30
|
+
export type { Props, TriggerProps, ActionProps, CancelProps, ContentProps, DescriptionProps, ContentProps as OverlayProps, PortalProps, TitleProps, };
|
|
@@ -38,19 +38,9 @@ $:
|
|
|
38
38
|
{...$$restProps}
|
|
39
39
|
/>
|
|
40
40
|
{:else if inTransition && $open}
|
|
41
|
-
<div
|
|
42
|
-
bind:this={el}
|
|
43
|
-
in:inTransition={inTransitionConfig}
|
|
44
|
-
{...builder} use:builder.action
|
|
45
|
-
{...$$restProps}
|
|
46
|
-
/>
|
|
41
|
+
<div bind:this={el} in:inTransition={inTransitionConfig} {...builder} use:builder.action {...$$restProps} />
|
|
47
42
|
{:else if outTransition && $open}
|
|
48
|
-
<div
|
|
49
|
-
bind:this={el}
|
|
50
|
-
out:outTransition={outTransitionConfig}
|
|
51
|
-
{...builder} use:builder.action
|
|
52
|
-
{...$$restProps}
|
|
53
|
-
/>
|
|
43
|
+
<div bind:this={el} out:outTransition={outTransitionConfig} {...builder} use:builder.action {...$$restProps} />
|
|
54
44
|
{:else if $open}
|
|
55
45
|
<div bind:this={el} {...builder} use:builder.action {...$$restProps} />
|
|
56
46
|
{/if}
|
|
@@ -23,12 +23,7 @@ $:
|
|
|
23
23
|
{#if asChild}
|
|
24
24
|
<slot {builder} />
|
|
25
25
|
{:else}
|
|
26
|
-
<svelte:element
|
|
27
|
-
this={level}
|
|
28
|
-
bind:this={el}
|
|
29
|
-
{...builder} use:builder.action
|
|
30
|
-
{...$$restProps}
|
|
31
|
-
>
|
|
26
|
+
<svelte:element this={level} bind:this={el} {...builder} use:builder.action {...$$restProps}>
|
|
32
27
|
<slot {builder} />
|
|
33
28
|
</svelte:element>
|
|
34
29
|
{/if}
|
|
@@ -11,7 +11,7 @@ function getAlertDialogData() {
|
|
|
11
11
|
"overlay",
|
|
12
12
|
"portal",
|
|
13
13
|
"title",
|
|
14
|
-
"trigger"
|
|
14
|
+
"trigger",
|
|
15
15
|
];
|
|
16
16
|
return { NAME, PARTS };
|
|
17
17
|
}
|
|
@@ -21,18 +21,18 @@ export function setCtx(props) {
|
|
|
21
21
|
const initAlertDialog = createDialog({
|
|
22
22
|
...removeUndefined(props),
|
|
23
23
|
role: "alertdialog",
|
|
24
|
-
forceVisible: true
|
|
24
|
+
forceVisible: true,
|
|
25
25
|
});
|
|
26
26
|
const alertDialog = {
|
|
27
27
|
...initAlertDialog,
|
|
28
28
|
getAttrs,
|
|
29
|
-
updateOption: getOptionUpdater(initAlertDialog.options)
|
|
29
|
+
updateOption: getOptionUpdater(initAlertDialog.options),
|
|
30
30
|
};
|
|
31
31
|
setContext(NAME, alertDialog);
|
|
32
32
|
return {
|
|
33
33
|
...alertDialog,
|
|
34
34
|
updateOption: getOptionUpdater(alertDialog.options),
|
|
35
|
-
getAttrs
|
|
35
|
+
getAttrs,
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
export function getCtx() {
|
|
@@ -25,4 +25,4 @@ type ContentEvents<T extends Element = HTMLElement> = {
|
|
|
25
25
|
};
|
|
26
26
|
type ActionEvents = TriggerEvents;
|
|
27
27
|
type CancelEvents = TriggerEvents;
|
|
28
|
-
export type { Props, TriggerProps, ActionProps, CancelProps, ContentProps, DescriptionProps, ContentProps as OverlayProps, PortalProps, TitleProps, TriggerEvents, CancelEvents, ActionEvents, ContentEvents };
|
|
28
|
+
export type { Props, TriggerProps, ActionProps, CancelProps, ContentProps, DescriptionProps, ContentProps as OverlayProps, PortalProps, TitleProps, TriggerEvents, CancelEvents, ActionEvents, ContentEvents, };
|
|
@@ -5,11 +5,7 @@ const attrs = {
|
|
|
5
5
|
};
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
|
-
<div
|
|
9
|
-
style:position="relative"
|
|
10
|
-
style:width="100%"
|
|
11
|
-
style:padding-bottom="{ratio ? 100 / ratio : 0}%"
|
|
12
|
-
>
|
|
8
|
+
<div style:position="relative" style:width="100%" style:padding-bottom="{ratio ? 100 / ratio : 0}%">
|
|
13
9
|
<div
|
|
14
10
|
bind:this={el}
|
|
15
11
|
style:position="absolute"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { Props as AvatarProps, ImageProps as AvatarImageProps, FallbackProps as AvatarFallbackProps } from "./types.js";
|
|
1
|
+
export type { Props as AvatarProps, ImageProps as AvatarImageProps, FallbackProps as AvatarFallbackProps, } from "./types.js";
|
package/dist/bits/avatar/ctx.js
CHANGED
|
@@ -6,7 +6,7 @@ export function getAvatarData() {
|
|
|
6
6
|
const PARTS = ["root", "image", "fallback"];
|
|
7
7
|
return {
|
|
8
8
|
NAME,
|
|
9
|
-
PARTS
|
|
9
|
+
PARTS,
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
export function setCtx(props) {
|
|
@@ -16,7 +16,7 @@ export function setCtx(props) {
|
|
|
16
16
|
setContext(NAME, avatar);
|
|
17
17
|
return {
|
|
18
18
|
...avatar,
|
|
19
|
-
updateOption: getOptionUpdater(avatar.options)
|
|
19
|
+
updateOption: getOptionUpdater(avatar.options),
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
export function getImage(src = "") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { Props as ButtonProps, Events as ButtonEvents } from "./types.js";
|
|
1
|
+
export type { Props as ButtonProps, Events as ButtonEvents, } from "./types.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { Props as CalendarProps, PrevButtonProps as CalendarPrevButtonProps, NextButtonProps as CalendarNextButtonProps, HeadingProps as CalendarHeadingProps, GridProps as CalendarGridProps, CellProps as CalendarCellProps, GridRowProps as CalendarGridRowProps, GridBodyProps as CalendarGridBodyProps, HeadCellProps as CalendarHeadCellProps, GridHeadProps as CalendarGridHeadProps, HeaderProps as CalendarHeaderProps, DayProps as CalendarDayProps, Events as CalendarEvents, PrevButtonEvents as CalendarPrevButtonEvents, NextButtonEvents as CalendarNextButtonEvents, DayEvents as CalendarDayEvents } from "./types.js";
|
|
1
|
+
export type { Props as CalendarProps, PrevButtonProps as CalendarPrevButtonProps, NextButtonProps as CalendarNextButtonProps, HeadingProps as CalendarHeadingProps, GridProps as CalendarGridProps, CellProps as CalendarCellProps, GridRowProps as CalendarGridRowProps, GridBodyProps as CalendarGridBodyProps, HeadCellProps as CalendarHeadCellProps, GridHeadProps as CalendarGridHeadProps, HeaderProps as CalendarHeaderProps, DayProps as CalendarDayProps, Events as CalendarEvents, PrevButtonEvents as CalendarPrevButtonEvents, NextButtonEvents as CalendarNextButtonEvents, DayEvents as CalendarDayEvents, } from "./types.js";
|
|
@@ -63,4 +63,4 @@ type BaseDayProps = Expand<{
|
|
|
63
63
|
}>;
|
|
64
64
|
type CellProps = Expand<Omit<BaseDayProps, "month">> & DOMElement<HTMLTableCellElement>;
|
|
65
65
|
type DayProps = Expand<BaseDayProps & DOMElement>;
|
|
66
|
-
export type { Props, PrevButtonProps, NextButtonProps, HeadingProps, HeaderProps, GridProps, GridHeadProps, HeadCellProps, GridBodyProps, GridRowProps, CellProps, DayProps };
|
|
66
|
+
export type { Props, PrevButtonProps, NextButtonProps, HeadingProps, HeaderProps, GridProps, GridHeadProps, HeadCellProps, GridBodyProps, GridRowProps, CellProps, DayProps, };
|
|
@@ -18,13 +18,7 @@ const dispatch = createDispatcher();
|
|
|
18
18
|
{#if asChild}
|
|
19
19
|
<slot {builder} />
|
|
20
20
|
{:else}
|
|
21
|
-
<button
|
|
22
|
-
bind:this={el}
|
|
23
|
-
{...builder} use:builder.action
|
|
24
|
-
type="button"
|
|
25
|
-
{...$$restProps}
|
|
26
|
-
on:m-click={dispatch}
|
|
27
|
-
>
|
|
21
|
+
<button bind:this={el} {...builder} use:builder.action type="button" {...$$restProps} on:m-click={dispatch}>
|
|
28
22
|
<slot {builder} />
|
|
29
23
|
</button>
|
|
30
24
|
{/if}
|
|
@@ -18,13 +18,7 @@ const dispatch = createDispatcher();
|
|
|
18
18
|
{#if asChild}
|
|
19
19
|
<slot {builder} />
|
|
20
20
|
{:else}
|
|
21
|
-
<button
|
|
22
|
-
bind:this={el}
|
|
23
|
-
{...builder} use:builder.action
|
|
24
|
-
type="button"
|
|
25
|
-
{...$$restProps}
|
|
26
|
-
on:m-click={dispatch}
|
|
27
|
-
>
|
|
21
|
+
<button bind:this={el} {...builder} use:builder.action type="button" {...$$restProps} on:m-click={dispatch}>
|
|
28
22
|
<slot {builder} />
|
|
29
23
|
</button>
|
|
30
24
|
{/if}
|
|
@@ -34,12 +34,7 @@ onMount(() => {
|
|
|
34
34
|
});
|
|
35
35
|
const {
|
|
36
36
|
elements: { calendar },
|
|
37
|
-
states: {
|
|
38
|
-
value: localValue,
|
|
39
|
-
placeholder: localPlaceholder,
|
|
40
|
-
months: localMonths,
|
|
41
|
-
weekdays
|
|
42
|
-
},
|
|
37
|
+
states: { value: localValue, placeholder: localPlaceholder, months: localMonths, weekdays },
|
|
43
38
|
updateOption,
|
|
44
39
|
ids,
|
|
45
40
|
getCalendarAttrs
|
|
@@ -137,12 +132,7 @@ $:
|
|
|
137
132
|
{#if asChild}
|
|
138
133
|
<slot {months} weekdays={$weekdays} {builder} />
|
|
139
134
|
{:else}
|
|
140
|
-
<div
|
|
141
|
-
{...builder} use:builder.action
|
|
142
|
-
{...$$restProps}
|
|
143
|
-
on:m-keydown={dispatch}
|
|
144
|
-
bind:this={el}
|
|
145
|
-
>
|
|
135
|
+
<div {...builder} use:builder.action {...$$restProps} on:m-keydown={dispatch} bind:this={el}>
|
|
146
136
|
<slot {months} weekdays={$weekdays} {builder} />
|
|
147
137
|
</div>
|
|
148
138
|
{/if}
|
|
@@ -15,7 +15,7 @@ export function getCalendarData() {
|
|
|
15
15
|
"head-cell",
|
|
16
16
|
"grid-body",
|
|
17
17
|
"cell",
|
|
18
|
-
"grid-row"
|
|
18
|
+
"grid-row",
|
|
19
19
|
];
|
|
20
20
|
return { NAME, PARTS };
|
|
21
21
|
}
|
|
@@ -26,7 +26,7 @@ export function setCtx(props) {
|
|
|
26
26
|
setContext(NAME, calendar);
|
|
27
27
|
return {
|
|
28
28
|
...calendar,
|
|
29
|
-
updateOption: getOptionUpdater(calendar.options)
|
|
29
|
+
updateOption: getOptionUpdater(calendar.options),
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
export function getCtx() {
|
|
@@ -28,4 +28,4 @@ type DayEvents = {
|
|
|
28
28
|
type Events = {
|
|
29
29
|
keydown: CustomEventHandler<KeyboardEvent, HTMLDivElement>;
|
|
30
30
|
};
|
|
31
|
-
export type { Props, PrevButtonProps, NextButtonProps, HeadingProps, GridProps, CellProps, GridRowProps, GridBodyProps, HeadCellProps, GridHeadProps, HeaderProps, DayProps, Events, PrevButtonEvents, NextButtonEvents, DayEvents };
|
|
31
|
+
export type { Props, PrevButtonProps, NextButtonProps, HeadingProps, GridProps, CellProps, GridRowProps, GridBodyProps, HeadCellProps, GridHeadProps, HeaderProps, DayProps, Events, PrevButtonEvents, NextButtonEvents, DayEvents, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { Props as CheckboxProps, IndicatorProps as CheckboxIndicatorProps, InputProps as CheckboxInputProps, Events as CheckboxEvents } from "./types.js";
|
|
1
|
+
export type { Props as CheckboxProps, IndicatorProps as CheckboxIndicatorProps, InputProps as CheckboxInputProps, Events as CheckboxEvents, } from "./types.js";
|
|
@@ -19,4 +19,4 @@ type Props = Expand<OmitChecked<CreateCheckboxProps> & {
|
|
|
19
19
|
onCheckedChange?: OnChangeFn<boolean | "indeterminate">;
|
|
20
20
|
} & DOMElement<HTMLButtonElement>>;
|
|
21
21
|
type IndicatorProps = DOMElement;
|
|
22
|
-
export type { Props, IndicatorProps, Props as CheckboxProps, IndicatorProps as CheckboxIndicatorProps };
|
|
22
|
+
export type { Props, IndicatorProps, Props as CheckboxProps, IndicatorProps as CheckboxIndicatorProps, };
|
|
@@ -6,7 +6,7 @@ export function getCheckboxData() {
|
|
|
6
6
|
const PARTS = ["root", "input", "indicator"];
|
|
7
7
|
return {
|
|
8
8
|
NAME,
|
|
9
|
-
PARTS
|
|
9
|
+
PARTS,
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
export function setCtx(props) {
|
|
@@ -16,7 +16,7 @@ export function setCtx(props) {
|
|
|
16
16
|
setContext(NAME, checkbox);
|
|
17
17
|
return {
|
|
18
18
|
...checkbox,
|
|
19
|
-
updateOption: getOptionUpdater(checkbox.options)
|
|
19
|
+
updateOption: getOptionUpdater(checkbox.options),
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
export function getCtx() {
|
|
@@ -9,4 +9,4 @@ type Events = {
|
|
|
9
9
|
click: CustomEventHandler<MouseEvent, HTMLButtonElement>;
|
|
10
10
|
keydown: CustomEventHandler<KeyboardEvent, HTMLButtonElement>;
|
|
11
11
|
};
|
|
12
|
-
export type { Props, IndicatorProps, InputProps, Events };
|
|
12
|
+
export type { Props, IndicatorProps, InputProps, Events, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { Props as CollapsibleProps, ContentProps as CollapsibleContentProps, TriggerProps as CollapsibleTriggerProps, TriggerEvents as CollapsibleTriggerEvents } from "./types.js";
|
|
1
|
+
export type { Props as CollapsibleProps, ContentProps as CollapsibleContentProps, TriggerProps as CollapsibleTriggerProps, TriggerEvents as CollapsibleTriggerEvents, } from "./types.js";
|
|
@@ -23,12 +23,7 @@ $:
|
|
|
23
23
|
{#if asChild && $open}
|
|
24
24
|
<slot {builder} />
|
|
25
25
|
{:else if transition && $open}
|
|
26
|
-
<div
|
|
27
|
-
bind:this={el}
|
|
28
|
-
transition:transition={transitionConfig}
|
|
29
|
-
{...builder} use:builder.action
|
|
30
|
-
{...$$restProps}
|
|
31
|
-
>
|
|
26
|
+
<div bind:this={el} transition:transition={transitionConfig} {...builder} use:builder.action {...$$restProps}>
|
|
32
27
|
<slot {builder} />
|
|
33
28
|
</div>
|
|
34
29
|
{:else if inTransition && outTransition && $open}
|
|
@@ -42,21 +37,11 @@ $:
|
|
|
42
37
|
<slot {builder} />
|
|
43
38
|
</div>
|
|
44
39
|
{:else if inTransition && $open}
|
|
45
|
-
<div
|
|
46
|
-
bind:this={el}
|
|
47
|
-
in:inTransition={inTransitionConfig}
|
|
48
|
-
{...builder} use:builder.action
|
|
49
|
-
{...$$restProps}
|
|
50
|
-
>
|
|
40
|
+
<div bind:this={el} in:inTransition={inTransitionConfig} {...builder} use:builder.action {...$$restProps}>
|
|
51
41
|
<slot {builder} />
|
|
52
42
|
</div>
|
|
53
43
|
{:else if outTransition && $open}
|
|
54
|
-
<div
|
|
55
|
-
bind:this={el}
|
|
56
|
-
out:outTransition={outTransitionConfig}
|
|
57
|
-
{...builder} use:builder.action
|
|
58
|
-
{...$$restProps}
|
|
59
|
-
>
|
|
44
|
+
<div bind:this={el} out:outTransition={outTransitionConfig} {...builder} use:builder.action {...$$restProps}>
|
|
60
45
|
<slot {builder} />
|
|
61
46
|
</div>
|
|
62
47
|
{:else if $open}
|
|
@@ -18,13 +18,7 @@ $:
|
|
|
18
18
|
{#if asChild}
|
|
19
19
|
<slot {builder} />
|
|
20
20
|
{:else}
|
|
21
|
-
<button
|
|
22
|
-
bind:this={el}
|
|
23
|
-
{...builder} use:builder.action
|
|
24
|
-
type="button"
|
|
25
|
-
{...$$restProps}
|
|
26
|
-
on:m-click={dispatch}
|
|
27
|
-
>
|
|
21
|
+
<button bind:this={el} {...builder} use:builder.action type="button" {...$$restProps} on:m-click={dispatch}>
|
|
28
22
|
<slot {builder} />
|
|
29
23
|
</button>
|
|
30
24
|
{/if}
|
|
@@ -6,7 +6,7 @@ export function getCollapsibleData() {
|
|
|
6
6
|
const PARTS = ["root", "content", "trigger"];
|
|
7
7
|
return {
|
|
8
8
|
NAME,
|
|
9
|
-
PARTS
|
|
9
|
+
PARTS,
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
export function setCtx(props) {
|
|
@@ -16,7 +16,7 @@ export function setCtx(props) {
|
|
|
16
16
|
setContext(NAME, collapsible);
|
|
17
17
|
return {
|
|
18
18
|
...collapsible,
|
|
19
|
-
updateOption: getOptionUpdater(collapsible.options)
|
|
19
|
+
updateOption: getOptionUpdater(collapsible.options),
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
export function getCtx() {
|
|
@@ -8,4 +8,4 @@ type TriggerProps = I.TriggerProps & HTMLButtonAttributes;
|
|
|
8
8
|
type TriggerEvents = {
|
|
9
9
|
click: CustomEventHandler<MouseEvent, HTMLButtonElement>;
|
|
10
10
|
};
|
|
11
|
-
export type { Props, ContentProps, TriggerProps, TriggerEvents };
|
|
11
|
+
export type { Props, ContentProps, TriggerProps, TriggerEvents, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { Props as ComboboxProps, ContentProps as ComboboxContentProps, InputProps as ComboboxInputProps, ItemProps as ComboboxItemProps, LabelProps as ComboboxLabelProps, GroupProps as ComboboxGroupProps, GroupLabelProps as ComboboxGroupLabelProps, ArrowProps as ComboboxArrowProps, HiddenInputProps as ComboboxHiddenInputProps, SeparatorProps as ComboboxSeparatorProps, IndicatorProps as ComboboxIndicatorProps, ItemEvents as ComboboxItemEvents, InputEvents as ComboboxInputEvents, GroupLabelEvents as ComboboxGroupLabelEvents, ContentEvents as ComboboxContentEvents, } from "./types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* We define prop types without the HTMLAttributes here so that we can use them
|
|
3
|
+
* to type-check our API documentation, which requires we document each prop,
|
|
4
|
+
* but we don't want to document the HTML attributes.
|
|
5
|
+
*/
|
|
6
|
+
import type { CreateComboboxProps, ComboboxOptionProps } from "@melt-ui/svelte";
|
|
7
|
+
import type { DOMElement, Expand, OmitFloating, OnChangeFn } from "../../internal/index.js";
|
|
8
|
+
import type { ContentProps, ArrowProps } from "../floating/_types.js";
|
|
9
|
+
import type { Selected } from "../..";
|
|
10
|
+
export type WhenTrue<TrueOrFalse, IfTrue, IfFalse, IfNeither = IfTrue | IfFalse> = [
|
|
11
|
+
TrueOrFalse
|
|
12
|
+
] extends [true] ? IfTrue : [TrueOrFalse] extends [false] ? IfFalse : IfNeither;
|
|
13
|
+
type SelectValue<T, Multiple extends boolean> = WhenTrue<Multiple, T[] | undefined, T | undefined>;
|
|
14
|
+
type Props<T = unknown, Multiple extends boolean = false> = Expand<OmitFloating<Omit<CreateComboboxProps, "selected" | "defaultSelected" | "onSelectedChange" | "multiple">> & {
|
|
15
|
+
/**
|
|
16
|
+
* The selected value of the combobox.
|
|
17
|
+
* You can bind this to a value to programmatically control the selected value.
|
|
18
|
+
*
|
|
19
|
+
* @defaultValue undefined
|
|
20
|
+
*/
|
|
21
|
+
selected?: SelectValue<Selected<T>, Multiple> | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* A callback function called when the selected value changes.
|
|
24
|
+
*/
|
|
25
|
+
onSelectedChange?: OnChangeFn<SelectValue<Selected<T>, Multiple>>;
|
|
26
|
+
/**
|
|
27
|
+
* The open state of the combobox menu.
|
|
28
|
+
* You can bind this to a boolean value to programmatically control the open state.
|
|
29
|
+
*
|
|
30
|
+
* @defaultValue false
|
|
31
|
+
*/
|
|
32
|
+
open?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* A callback function called when the open state changes.
|
|
35
|
+
*/
|
|
36
|
+
onOpenChange?: OnChangeFn<boolean>;
|
|
37
|
+
/**
|
|
38
|
+
* Whether or not multiple values can be selected.
|
|
39
|
+
*/
|
|
40
|
+
multiple?: Multiple;
|
|
41
|
+
/**
|
|
42
|
+
* The value of the input.
|
|
43
|
+
* You can bind this to a value to programmatically control the input value.
|
|
44
|
+
*
|
|
45
|
+
* @defaultValue ""
|
|
46
|
+
*/
|
|
47
|
+
inputValue?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Optionally provide an array of `Selected<T>` objects to
|
|
50
|
+
* type the `selected` and `onSelectedChange` props.
|
|
51
|
+
*/
|
|
52
|
+
items?: Selected<T>[];
|
|
53
|
+
}>;
|
|
54
|
+
type InputProps = DOMElement<HTMLInputElement>;
|
|
55
|
+
type LabelProps = DOMElement<HTMLLabelElement>;
|
|
56
|
+
type GroupProps = DOMElement;
|
|
57
|
+
type GroupLabelProps = DOMElement;
|
|
58
|
+
type ItemProps = Expand<ComboboxOptionProps & DOMElement>;
|
|
59
|
+
type HiddenInputProps = DOMElement;
|
|
60
|
+
type SeparatorProps = DOMElement;
|
|
61
|
+
type IndicatorProps = DOMElement;
|
|
62
|
+
export type { Props, ContentProps, InputProps, ItemProps, LabelProps, GroupProps, GroupLabelProps, ArrowProps, HiddenInputProps, SeparatorProps, IndicatorProps, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script>import { melt } from "@melt-ui/svelte";
|
|
2
|
+
import { setArrow } from "../ctx.js";
|
|
3
|
+
export let asChild = false;
|
|
4
|
+
export let el = void 0;
|
|
5
|
+
export let size = 8;
|
|
6
|
+
const {
|
|
7
|
+
elements: { arrow },
|
|
8
|
+
getAttrs
|
|
9
|
+
} = setArrow(size);
|
|
10
|
+
const attrs = getAttrs("arrow");
|
|
11
|
+
$:
|
|
12
|
+
builder = $arrow;
|
|
13
|
+
$:
|
|
14
|
+
Object.assign(builder, attrs);
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
{#if asChild}
|
|
18
|
+
<slot {builder} />
|
|
19
|
+
{:else}
|
|
20
|
+
<div bind:this={el} {...builder} use:builder.action {...$$restProps} />
|
|
21
|
+
{/if}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { ArrowProps } from "../types.js";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: ArrowProps;
|
|
5
|
+
events: {
|
|
6
|
+
[evt: string]: CustomEvent<any>;
|
|
7
|
+
};
|
|
8
|
+
slots: {
|
|
9
|
+
default: {
|
|
10
|
+
builder: {
|
|
11
|
+
'data-arrow': boolean;
|
|
12
|
+
style: string;
|
|
13
|
+
} & {
|
|
14
|
+
[x: `data-melt-${string}`]: "";
|
|
15
|
+
} & {
|
|
16
|
+
action: import("svelte/action").Action<any, any, Record<never, any>>;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export type ComboboxArrowProps = typeof __propDef.props;
|
|
22
|
+
export type ComboboxArrowEvents = typeof __propDef.events;
|
|
23
|
+
export type ComboboxArrowSlots = typeof __propDef.slots;
|
|
24
|
+
export default class ComboboxArrow extends SvelteComponent<ComboboxArrowProps, ComboboxArrowEvents, ComboboxArrowSlots> {
|
|
25
|
+
}
|
|
26
|
+
export {};
|