bits-ui 0.13.4 → 0.13.5
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 +7 -2
- package/dist/bits/calendar/ctx.js +0 -2
- package/dist/bits/floating/helpers.js +2 -1
- package/dist/bits/menu/_types.js +1 -1
- package/dist/bits/tooltip/components/tooltip-content.svelte +16 -14
- package/dist/bits/tooltip/components/tooltip.svelte +6 -0
- package/dist/bits/tooltip/ctx.d.ts +1 -1
- package/dist/bits/tooltip/ctx.js +9 -9
- package/package.json +20 -20
package/README.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
The headless components for Svelte.
|
|
4
4
|
|
|
5
|
-
[Read the docs](https://bits-ui.com)
|
|
5
|
+
[Read the docs](https://bits-ui.com)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Credits
|
|
8
|
+
|
|
9
|
+
- [Bitworks](https://bitworks.cz) - The design team behind the Bits UI documentation and example components.
|
|
10
|
+
- [Melt UI](https://melt-ui.com) - The underlying builder API that powers Bits.
|
|
11
|
+
- [Radix UI](https://radix-ui.com) - The incredible headless component APIs that we've taken heavy inspiration from.
|
|
12
|
+
- [React Spectrum](https://react-spectrum.adobe.com) - An incredible collection of headless components we've taken inspiration from.
|
|
@@ -22,7 +22,6 @@ export function getCalendarData() {
|
|
|
22
22
|
export function setCtx(props) {
|
|
23
23
|
const { NAME, PARTS } = getCalendarData();
|
|
24
24
|
const getCalendarAttrs = createBitAttrs(NAME, PARTS);
|
|
25
|
-
console.log(getCalendarAttrs);
|
|
26
25
|
const calendar = { ...createCalendar(removeUndefined(props)), getCalendarAttrs };
|
|
27
26
|
setContext(NAME, calendar);
|
|
28
27
|
return {
|
|
@@ -33,6 +32,5 @@ export function setCtx(props) {
|
|
|
33
32
|
export function getCtx() {
|
|
34
33
|
const { NAME } = getCalendarData();
|
|
35
34
|
const ctx = getContext(NAME);
|
|
36
|
-
console.log(ctx);
|
|
37
35
|
return ctx;
|
|
38
36
|
}
|
|
@@ -20,10 +20,11 @@ export function updatePositioning(store, props) {
|
|
|
20
20
|
...prev,
|
|
21
21
|
placement: joinPlacement(withDefaults.side, withDefaults.align),
|
|
22
22
|
offset: {
|
|
23
|
+
...prev.offset,
|
|
23
24
|
mainAxis: withDefaults.sideOffset,
|
|
24
25
|
crossAxis: withDefaults.alignOffset
|
|
25
26
|
},
|
|
26
|
-
gutter:
|
|
27
|
+
gutter: 0,
|
|
27
28
|
sameWidth: withDefaults.sameWidth,
|
|
28
29
|
flip: withDefaults.avoidCollisions,
|
|
29
30
|
overflowPadding: withDefaults.collisionPadding,
|
package/dist/bits/menu/_types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
|
@@ -26,7 +26,7 @@ const {
|
|
|
26
26
|
states: { open },
|
|
27
27
|
ids,
|
|
28
28
|
getAttrs
|
|
29
|
-
} = getCtx(
|
|
29
|
+
} = getCtx();
|
|
30
30
|
const dispatch = createDispatcher();
|
|
31
31
|
const attrs = getAttrs("content");
|
|
32
32
|
$:
|
|
@@ -38,19 +38,21 @@ $:
|
|
|
38
38
|
$:
|
|
39
39
|
Object.assign(builder, attrs);
|
|
40
40
|
$:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
41
|
+
if ($open) {
|
|
42
|
+
updatePositioning({
|
|
43
|
+
side,
|
|
44
|
+
align,
|
|
45
|
+
sideOffset,
|
|
46
|
+
alignOffset,
|
|
47
|
+
collisionPadding,
|
|
48
|
+
avoidCollisions,
|
|
49
|
+
collisionBoundary,
|
|
50
|
+
sameWidth,
|
|
51
|
+
fitViewport,
|
|
52
|
+
strategy,
|
|
53
|
+
overlap
|
|
54
|
+
});
|
|
55
|
+
}
|
|
54
56
|
</script>
|
|
55
57
|
|
|
56
58
|
{#if asChild && $open}
|
|
@@ -57,7 +57,7 @@ export declare function setCtx(props: CreateTooltipProps): {
|
|
|
57
57
|
}> | undefined;
|
|
58
58
|
}, "open" | "ids">>;
|
|
59
59
|
};
|
|
60
|
-
export declare function getCtx(
|
|
60
|
+
export declare function getCtx(): GetReturn;
|
|
61
61
|
export declare function setArrow(size?: number): GetReturn;
|
|
62
62
|
export declare function updatePositioning(props: FloatingProps): void;
|
|
63
63
|
export {};
|
package/dist/bits/tooltip/ctx.js
CHANGED
|
@@ -16,10 +16,12 @@ export function setCtx(props) {
|
|
|
16
16
|
const tooltip = {
|
|
17
17
|
...createTooltip({
|
|
18
18
|
positioning: {
|
|
19
|
-
placement: "top"
|
|
19
|
+
placement: "top",
|
|
20
|
+
gutter: 0
|
|
20
21
|
},
|
|
21
22
|
openDelay: 700,
|
|
22
|
-
...removeUndefined(props)
|
|
23
|
+
...removeUndefined(props),
|
|
24
|
+
forceVisible: true
|
|
23
25
|
}),
|
|
24
26
|
getAttrs
|
|
25
27
|
};
|
|
@@ -29,12 +31,9 @@ export function setCtx(props) {
|
|
|
29
31
|
updateOption: getOptionUpdater(tooltip.options)
|
|
30
32
|
};
|
|
31
33
|
}
|
|
32
|
-
export function getCtx(
|
|
34
|
+
export function getCtx() {
|
|
33
35
|
const { NAME } = getTooltipData();
|
|
34
|
-
|
|
35
|
-
const { options: { positioning } } = tooltip;
|
|
36
|
-
positioning.update((prev) => ({ ...prev, gutter: sideOffset }));
|
|
37
|
-
return tooltip;
|
|
36
|
+
return getContext(NAME);
|
|
38
37
|
}
|
|
39
38
|
export function setArrow(size = 8) {
|
|
40
39
|
const tooltip = getCtx();
|
|
@@ -44,10 +43,11 @@ export function setArrow(size = 8) {
|
|
|
44
43
|
export function updatePositioning(props) {
|
|
45
44
|
const defaultPlacement = {
|
|
46
45
|
side: "top",
|
|
47
|
-
align: "center"
|
|
46
|
+
align: "center",
|
|
47
|
+
sideOffset: 1
|
|
48
48
|
};
|
|
49
49
|
const withDefaults = { ...defaultPlacement, ...props };
|
|
50
50
|
const { options: { positioning } } = getCtx();
|
|
51
51
|
const updater = getPositioningUpdater(positioning);
|
|
52
|
-
updater(withDefaults);
|
|
52
|
+
updater({ ...withDefaults });
|
|
53
53
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bits-ui",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "github:huntabyte/bits-ui",
|
|
6
6
|
"exports": {
|
|
@@ -17,53 +17,53 @@
|
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@changesets/cli": "^2.27.1",
|
|
19
19
|
"@huntabyte/mdsvex": "0.16.5",
|
|
20
|
-
"@melt-ui/pp": "^0.
|
|
20
|
+
"@melt-ui/pp": "^0.3.0",
|
|
21
21
|
"@playwright/test": "^1.28.1",
|
|
22
22
|
"@sveltejs/adapter-vercel": "^3.1.0",
|
|
23
23
|
"@sveltejs/kit": "^1.27.6",
|
|
24
|
-
"@sveltejs/package": "^2.2.
|
|
24
|
+
"@sveltejs/package": "^2.2.5",
|
|
25
25
|
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
|
|
26
26
|
"@tailwindcss/typography": "^0.5.10",
|
|
27
|
-
"@testing-library/dom": "^9.3.
|
|
27
|
+
"@testing-library/dom": "^9.3.3",
|
|
28
28
|
"@testing-library/jest-dom": "^5.17.0",
|
|
29
29
|
"@testing-library/svelte": "^4.0.5",
|
|
30
30
|
"@testing-library/user-event": "^14.4.3",
|
|
31
|
-
"@types/jest-axe": "^3.5.
|
|
31
|
+
"@types/jest-axe": "^3.5.9",
|
|
32
32
|
"@types/testing-library__jest-dom": "^5.14.9",
|
|
33
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
34
|
-
"@typescript-eslint/parser": "^6.
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "^6.18.0",
|
|
34
|
+
"@typescript-eslint/parser": "^6.18.0",
|
|
35
35
|
"autoprefixer": "^10.4.16",
|
|
36
|
-
"clsx": "^2.
|
|
36
|
+
"clsx": "^2.1.0",
|
|
37
37
|
"concurrently": "^8.2.2",
|
|
38
38
|
"contentlayer": "^0.3.4",
|
|
39
|
-
"eslint": "^8.
|
|
39
|
+
"eslint": "^8.56.0",
|
|
40
40
|
"eslint-config-prettier": "^8.5.0",
|
|
41
|
-
"eslint-plugin-svelte": "^2.35.
|
|
41
|
+
"eslint-plugin-svelte": "^2.35.1",
|
|
42
42
|
"esm-env": "^1.0.0",
|
|
43
43
|
"hast-util-to-html": "^9.0.0",
|
|
44
44
|
"jest-axe": "^8.0.0",
|
|
45
45
|
"jsdom": "^22.1.0",
|
|
46
|
-
"mode-watcher": "^0.1.
|
|
47
|
-
"phosphor-svelte": "^1.
|
|
48
|
-
"postcss": "^8.4.
|
|
46
|
+
"mode-watcher": "^0.1.2",
|
|
47
|
+
"phosphor-svelte": "^1.4.2",
|
|
48
|
+
"postcss": "^8.4.33",
|
|
49
49
|
"postcss-load-config": "^4.0.1",
|
|
50
50
|
"prettier": "^2.8.8",
|
|
51
51
|
"prettier-plugin-svelte": "^2.10.1",
|
|
52
52
|
"prettier-plugin-tailwindcss": "0.2.7",
|
|
53
|
-
"publint": "^0.2.
|
|
53
|
+
"publint": "^0.2.7",
|
|
54
54
|
"rehype-pretty-code": "^0.10.0",
|
|
55
55
|
"remark-gfm": "^4.0.0",
|
|
56
56
|
"resize-observer-polyfill": "^1.5.1",
|
|
57
57
|
"shiki": "^0.14.5",
|
|
58
|
-
"svelte": "^4.2.
|
|
59
|
-
"svelte-check": "^3.6.
|
|
58
|
+
"svelte": "^4.2.8",
|
|
59
|
+
"svelte-check": "^3.6.2",
|
|
60
60
|
"svelte-sequential-preprocessor": "^2.0.1",
|
|
61
61
|
"svelte-wrap-balancer": "^0.0.4",
|
|
62
|
-
"tailwind-merge": "^
|
|
63
|
-
"tailwind-variants": "^0.1.
|
|
64
|
-
"tailwindcss": "^3.
|
|
62
|
+
"tailwind-merge": "^2.2.0",
|
|
63
|
+
"tailwind-variants": "^0.1.20",
|
|
64
|
+
"tailwindcss": "^3.4.1",
|
|
65
65
|
"tslib": "^2.6.2",
|
|
66
|
-
"typescript": "^5.
|
|
66
|
+
"typescript": "^5.3.3",
|
|
67
67
|
"unist-builder": "^4.0.0",
|
|
68
68
|
"unist-util-visit": "^5.0.0",
|
|
69
69
|
"vite": "^4.5.0",
|