bits-ui 0.11.5 → 0.11.7
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/README.md +3 -5
- package/dist/bits/accordion/ctx.d.ts +8 -5
- package/dist/bits/alert-dialog/ctx.d.ts +23 -18
- package/dist/bits/avatar/ctx.d.ts +6 -4
- package/dist/bits/calendar/ctx.d.ts +50 -50
- package/dist/bits/checkbox/ctx.d.ts +9 -7
- package/dist/bits/collapsible/ctx.d.ts +7 -4
- package/dist/bits/context-menu/components/context-menu.svelte.d.ts +1 -0
- package/dist/bits/context-menu/ctx.d.ts +52 -42
- package/dist/bits/date-field/ctx.d.ts +94 -62
- package/dist/bits/date-picker/ctx.d.ts +44 -44
- package/dist/bits/date-range-field/ctx.d.ts +68 -68
- package/dist/bits/date-range-picker/ctx.d.ts +84 -84
- package/dist/bits/dialog/ctx.d.ts +23 -18
- package/dist/bits/index.d.ts +2 -0
- package/dist/bits/index.js +2 -0
- package/dist/bits/link-preview/ctx.d.ts +22 -18
- 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 +77 -62
- 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 +135 -115
- package/dist/bits/pagination/_export.types.d.ts +1 -0
- package/dist/bits/pagination/_export.types.js +1 -0
- package/dist/bits/pagination/_types.d.ts +26 -0
- package/dist/bits/pagination/_types.js +6 -0
- package/dist/bits/pagination/components/pagination-next-button.svelte +27 -0
- package/dist/bits/pagination/components/pagination-next-button.svelte.d.ts +26 -0
- package/dist/bits/pagination/components/pagination-page.svelte +30 -0
- package/dist/bits/pagination/components/pagination-page.svelte.d.ts +27 -0
- package/dist/bits/pagination/components/pagination-prev-button.svelte +27 -0
- package/dist/bits/pagination/components/pagination-prev-button.svelte.d.ts +26 -0
- package/dist/bits/pagination/components/pagination.svelte +38 -0
- package/dist/bits/pagination/components/pagination.svelte.d.ts +30 -0
- package/dist/bits/pagination/ctx.d.ts +58 -0
- package/dist/bits/pagination/ctx.js +17 -0
- package/dist/bits/pagination/index.d.ts +5 -0
- package/dist/bits/pagination/index.js +5 -0
- package/dist/bits/pagination/types.d.ts +21 -0
- package/dist/bits/pagination/types.js +1 -0
- package/dist/bits/popover/ctx.d.ts +24 -19
- package/dist/bits/progress/ctx.d.ts +6 -5
- package/dist/bits/radio-group/ctx.d.ts +9 -8
- package/dist/bits/range-calendar/ctx.d.ts +52 -52
- package/dist/bits/select/ctx.d.ts +27 -27
- package/dist/bits/separator/ctx.d.ts +4 -4
- package/dist/bits/slider/ctx.d.ts +10 -7
- package/dist/bits/switch/ctx.d.ts +9 -8
- package/dist/bits/tabs/ctx.d.ts +9 -5
- package/dist/bits/toggle/ctx.d.ts +6 -5
- package/dist/bits/toggle-group/ctx.d.ts +10 -9
- package/dist/bits/toolbar/_export.types.d.ts +1 -0
- package/dist/bits/toolbar/_export.types.js +1 -0
- package/dist/bits/toolbar/_types.d.ts +48 -0
- package/dist/bits/toolbar/_types.js +1 -0
- package/dist/bits/toolbar/components/toolbar-button.svelte +27 -0
- package/dist/bits/toolbar/components/toolbar-button.svelte.d.ts +25 -0
- package/dist/bits/toolbar/components/toolbar-group-item.svelte +30 -0
- package/dist/bits/toolbar/components/toolbar-group-item.svelte.d.ts +33 -0
- package/dist/bits/toolbar/components/toolbar-group.svelte +48 -0
- package/dist/bits/toolbar/components/toolbar-group.svelte.d.ts +26 -0
- package/dist/bits/toolbar/components/toolbar-link.svelte +27 -0
- package/dist/bits/toolbar/components/toolbar-link.svelte.d.ts +25 -0
- package/dist/bits/toolbar/components/toolbar.svelte +30 -0
- package/dist/bits/toolbar/components/toolbar.svelte.d.ts +26 -0
- package/dist/bits/toolbar/ctx.d.ts +120 -0
- package/dist/bits/toolbar/ctx.js +30 -0
- package/dist/bits/toolbar/index.d.ts +6 -0
- package/dist/bits/toolbar/index.js +6 -0
- package/dist/bits/toolbar/types.d.ts +23 -0
- package/dist/bits/toolbar/types.js +1 -0
- package/dist/bits/tooltip/ctx.d.ts +24 -19
- package/dist/shared/index.d.ts +2 -2
- package/dist/types.d.ts +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createBitAttrs, getOptionUpdater, removeUndefined } from "../../internal/index.js";
|
|
2
|
+
import { createToolbar } from "@melt-ui/svelte";
|
|
3
|
+
import { getContext, setContext } from "svelte";
|
|
4
|
+
const NAME = "toolbar";
|
|
5
|
+
const GROUP_NAME = "toolbar-group";
|
|
6
|
+
const PARTS = ["root", "button", "link", "group", "group-item"];
|
|
7
|
+
export const getAttrs = createBitAttrs(NAME, PARTS);
|
|
8
|
+
export function setCtx(props) {
|
|
9
|
+
const toolbar = createToolbar(removeUndefined(props));
|
|
10
|
+
setContext(NAME, toolbar);
|
|
11
|
+
return {
|
|
12
|
+
...toolbar,
|
|
13
|
+
updateOption: getOptionUpdater(toolbar.options)
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export function setGroupCtx(props) {
|
|
17
|
+
const { builders: { createToolbarGroup } } = getCtx();
|
|
18
|
+
const group = createToolbarGroup(removeUndefined(props));
|
|
19
|
+
setContext(GROUP_NAME, group);
|
|
20
|
+
return {
|
|
21
|
+
...group,
|
|
22
|
+
updateOption: getOptionUpdater(group.options)
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export function getCtx() {
|
|
26
|
+
return getContext(NAME);
|
|
27
|
+
}
|
|
28
|
+
export function getGroupCtx() {
|
|
29
|
+
return getContext(GROUP_NAME);
|
|
30
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as Root } from "./components/toolbar.svelte";
|
|
2
|
+
export { default as Button } from "./components/toolbar-button.svelte";
|
|
3
|
+
export { default as Link } from "./components/toolbar-link.svelte";
|
|
4
|
+
export { default as Group } from "./components/toolbar-group.svelte";
|
|
5
|
+
export { default as GroupItem } from "./components/toolbar-group-item.svelte";
|
|
6
|
+
export * from "./types.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as Root } from "./components/toolbar.svelte";
|
|
2
|
+
export { default as Button } from "./components/toolbar-button.svelte";
|
|
3
|
+
export { default as Link } from "./components/toolbar-link.svelte";
|
|
4
|
+
export { default as Group } from "./components/toolbar-group.svelte";
|
|
5
|
+
export { default as GroupItem } from "./components/toolbar-group-item.svelte";
|
|
6
|
+
export * from "./types.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { HTMLDivAttributes } from "../../internal/index.js";
|
|
2
|
+
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from "svelte/elements";
|
|
3
|
+
import type * as I from "./_types.js";
|
|
4
|
+
import type { CustomEventHandler } from "../../index.js";
|
|
5
|
+
type Props = I.Props & HTMLDivAttributes;
|
|
6
|
+
type ButtonProps = I.ButtonProps & HTMLButtonAttributes;
|
|
7
|
+
type LinkProps = I.LinkProps & HTMLAnchorAttributes;
|
|
8
|
+
type GroupProps<T extends "single" | "multiple"> = I.GroupProps<T> & HTMLDivAttributes;
|
|
9
|
+
type GroupItemProps = I.GroupItemProps & HTMLButtonAttributes;
|
|
10
|
+
/**
|
|
11
|
+
* Events
|
|
12
|
+
*/
|
|
13
|
+
type ButtonEvents = {
|
|
14
|
+
keydown: CustomEventHandler<KeyboardEvent, HTMLButtonElement>;
|
|
15
|
+
};
|
|
16
|
+
type LinkEvents = {
|
|
17
|
+
keydown: CustomEventHandler<KeyboardEvent, HTMLAnchorElement>;
|
|
18
|
+
};
|
|
19
|
+
type GroupItemEvents<T extends Element = HTMLButtonElement> = {
|
|
20
|
+
click: CustomEventHandler<MouseEvent, T>;
|
|
21
|
+
keydown: CustomEventHandler<KeyboardEvent, T>;
|
|
22
|
+
};
|
|
23
|
+
export type { Props, ButtonProps, LinkProps, GroupProps, GroupItemProps, ButtonEvents, LinkEvents, GroupItemEvents };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,10 +5,10 @@ import type { FloatingProps } from "../floating/_types.js";
|
|
|
5
5
|
export declare const getAttrs: (part: "content" | "arrow" | "trigger") => Record<string, string>;
|
|
6
6
|
export declare function setCtx(props: CreateTooltipProps): {
|
|
7
7
|
updateOption: <K extends string, V extends unknown>(key: K, value: V | undefined) => void;
|
|
8
|
-
ids: {
|
|
9
|
-
content:
|
|
10
|
-
trigger:
|
|
11
|
-
}
|
|
8
|
+
ids: import("@melt-ui/svelte/internal/helpers").ToWritableStores<{
|
|
9
|
+
content: string;
|
|
10
|
+
trigger: string;
|
|
11
|
+
}>;
|
|
12
12
|
elements: {
|
|
13
13
|
trigger: import("@melt-ui/svelte/internal/helpers").ExplicitBuilderReturn<[Writable<string>, Writable<string>], (node: HTMLElement) => import("@melt-ui/svelte/internal/types").MeltActionReturn<"keydown" | "blur" | "focus" | "pointerdown" | "pointerenter" | "pointerleave">, ([$contentId, $triggerId]: [string, string]) => {
|
|
14
14
|
'aria-describedby': string;
|
|
@@ -34,22 +34,27 @@ export declare function setCtx(props: CreateTooltipProps): {
|
|
|
34
34
|
subscribe(this: void, run: import("svelte/store").Subscriber<boolean>, invalidate?: import("svelte/store").Invalidator<boolean> | undefined): import("svelte/store").Unsubscriber;
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
|
-
options: {
|
|
38
|
-
|
|
39
|
-
defaultOpen: Writable<boolean>;
|
|
40
|
-
onOpenChange?: Writable<import("@melt-ui/svelte/internal/helpers").ChangeFn<boolean> | undefined> | undefined;
|
|
41
|
-
portal: Writable<string | HTMLElement | null>;
|
|
42
|
-
positioning: Writable<import("@melt-ui/svelte/internal/actions").FloatingConfig | {
|
|
37
|
+
options: import("@melt-ui/svelte/internal/helpers").ToWritableStores<Omit<{
|
|
38
|
+
positioning: import("@melt-ui/svelte/internal/actions").FloatingConfig | {
|
|
43
39
|
placement: "bottom";
|
|
44
|
-
}
|
|
45
|
-
arrowSize:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
40
|
+
};
|
|
41
|
+
arrowSize: number;
|
|
42
|
+
defaultOpen: boolean;
|
|
43
|
+
open?: Writable<boolean> | undefined;
|
|
44
|
+
onOpenChange?: import("@melt-ui/svelte/internal/helpers").ChangeFn<boolean> | undefined;
|
|
45
|
+
closeOnPointerDown: boolean;
|
|
46
|
+
openDelay: number;
|
|
47
|
+
closeDelay: number;
|
|
48
|
+
forceVisible: boolean;
|
|
49
|
+
closeOnEscape: boolean;
|
|
50
|
+
disableHoverableContent: boolean;
|
|
51
|
+
group: string | boolean | undefined;
|
|
52
|
+
portal: string | HTMLElement | null;
|
|
53
|
+
ids?: Partial<{
|
|
54
|
+
content: string;
|
|
55
|
+
trigger: string;
|
|
56
|
+
}> | undefined;
|
|
57
|
+
}, "open" | "ids">>;
|
|
53
58
|
};
|
|
54
59
|
export declare function getCtx(sideOffset?: number): TooltipReturn;
|
|
55
60
|
export declare function setArrow(size?: number): TooltipReturn;
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DateValue } from "@internationalized/date";
|
|
2
|
-
import type { Month } from "@melt-ui/svelte";
|
|
2
|
+
import type { Month, Page, PageItem, Ellipsis } from "@melt-ui/svelte";
|
|
3
3
|
export type Selected<Value> = {
|
|
4
4
|
value: Value;
|
|
5
5
|
label?: string;
|
|
@@ -9,4 +9,4 @@ export type DateRange = {
|
|
|
9
9
|
end: DateValue | undefined;
|
|
10
10
|
};
|
|
11
11
|
export type SegmentPart = "month" | "day" | "year" | "hour" | "minute" | "second" | "dayPeriod" | "timeZoneName" | "literal";
|
|
12
|
-
export type { Month };
|
|
12
|
+
export type { Month, Page, PageItem, Ellipsis };
|
package/dist/types.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export type * from "./bits/dropdown-menu/_export.types.js";
|
|
|
16
16
|
export type * from "./bits/label/_export.types.js";
|
|
17
17
|
export type * from "./bits/link-preview/_export.types.js";
|
|
18
18
|
export type * from "./bits/menubar/_export.types.js";
|
|
19
|
+
export type * from "./bits/pagination/_export.types.js";
|
|
19
20
|
export type * from "./bits/popover/_export.types.js";
|
|
20
21
|
export type * from "./bits/progress/_export.types.js";
|
|
21
22
|
export type * from "./bits/radio-group/_export.types.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bits-ui",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "github:huntabyte/bits-ui",
|
|
6
6
|
"exports": {
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"type": "module",
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"@internationalized/date": "^3.5.0",
|
|
77
|
-
"@melt-ui/svelte": "0.
|
|
77
|
+
"@melt-ui/svelte": "0.65.1",
|
|
78
78
|
"nanoid": "^5.0.4"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|