Skip to content

Commit f32dd0d

Browse files
authored
Add missing FloatingArrowProps export. (#147)
1 parent 56a804b commit f32dd0d

File tree

10 files changed

+76
-16
lines changed

10 files changed

+76
-16
lines changed

.changeset/silly-donkeys-suffer.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@skeletonlabs/floating-ui-svelte": patch
3+
---
4+
5+
Add missing `FloatingArrowProps` export.

packages/floating-ui-svelte/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"@testing-library/jest-dom": "^6.6.3",
3434
"@testing-library/svelte": "^5.2.6",
3535
"@testing-library/user-event": "^14.5.2",
36+
"csstype": "^3.1.3",
3637
"svelte": "^5.16.0",
3738
"typescript": "^5.7.2",
3839
"vite": "^6.0.6",

packages/floating-ui-svelte/src/components/floating-arrow.svelte

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,61 @@
1+
<script lang="ts" module>
2+
import type { SVGAttributes } from "svelte/elements";
3+
import type { FloatingContext } from "../../src/index.js";
4+
5+
export interface FloatingArrowProps extends SVGAttributes<SVGElement> {
6+
/** The bound HTML element reference. */
7+
ref: Element | null;
8+
/** The floating context. */
9+
context: FloatingContext;
10+
/**
11+
* Width of the arrow.
12+
* @default 14
13+
*/
14+
width?: number;
15+
/**
16+
* Height of the arrow.
17+
* @default 7
18+
*/
19+
height?: number;
20+
/**
21+
* The corner radius (rounding) of the arrow tip.
22+
* @default 0 (sharp)
23+
*/
24+
tipRadius?: number;
25+
/**
26+
* Forces a static offset over dynamic positioning under a certain condition.
27+
* @default undefined (use dynamic position)
28+
*/
29+
staticOffset?: string | number | null;
30+
/**
31+
* Custom path string.
32+
* @default undefined (use dynamic path)
33+
*/
34+
d?: string;
35+
/**
36+
* Stroke (border) color of the arrow.
37+
* @default "none"
38+
*/
39+
stroke?: string;
40+
/**
41+
* Stroke (border) width of the arrow.
42+
* @default 0
43+
*/
44+
strokeWidth?: number;
45+
46+
// Styling ---
47+
/** Set transform styles. */
48+
transform?: string;
49+
/** Set fill styles. */
50+
fill?: string;
51+
}
52+
</script>
53+
154
<script lang="ts">
255
import type { Alignment, Side } from "@floating-ui/dom";
356
import { platform } from "@floating-ui/dom";
457
import { useId } from "../hooks/use-id.js";
558
import { styleObjectToString } from "../internal/style-object-to-string.js";
6-
import type { FloatingArrowProps } from "../internal/types.js";
759
860
let {
961
ref = $bindable(null),

packages/floating-ui-svelte/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export * from "@floating-ui/dom";
2+
export * from "./components/floating-arrow.svelte";
23
export { default as FloatingArrow } from "./components/floating-arrow.svelte";
34
export * from "./hooks/use-click.svelte.js";
45
export * from "./hooks/use-dismiss.svelte.js";

packages/floating-ui-svelte/test/hooks/use-floating.svelte.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@ import {
66
offset,
77
} from "@floating-ui/dom";
88
import { describe, expect, expectTypeOf, it, vi } from "vitest";
9-
import {
10-
type FloatingContext,
11-
useFloating,
12-
} from "../../src/hooks/use-floating.svelte.js";
13-
import { useId } from "../../src/hooks/use-id.js";
9+
import { type FloatingContext, useFloating } from "../../src/index.js";
10+
import { useId } from "../../src/index.js";
1411
import { withRunes } from "../internal/with-runes.svelte.js";
1512

1613
function createElements(): { reference: HTMLElement; floating: HTMLElement } {

packages/floating-ui-svelte/test/hooks/use-id.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, expect, expectTypeOf, test } from "vitest";
2-
import { useId } from "../../src/hooks/use-id.js";
2+
import { useId } from "../../src/index.js";
33

44
describe("useId", () => {
55
test("returns an id", () => {

packages/floating-ui-svelte/test/hooks/use-interactions.svelte.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import { describe, expect, it, vi } from "vitest";
2-
import {
3-
type ElementProps,
4-
useInteractions,
5-
} from "../../src/hooks/use-interactions.svelte.js";
2+
import { type ElementProps, useInteractions } from "../../src/index.js";
63
import { withRunes } from "../internal/with-runes.svelte";
74

85
describe("useInteractions", () => {

packages/floating-ui-svelte/tsconfig.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
"sourceMap": true,
1111
"strict": true,
1212
"module": "NodeNext",
13-
"moduleResolution": "NodeNext"
14-
}
13+
"moduleResolution": "NodeNext",
14+
"types": ["svelte"]
15+
},
16+
"include": ["src", "test"]
1517
}

packages/floating-ui-svelte/vite.config.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,5 @@ export default defineConfig({
88
include: ["./test/{hooks, components}/*.ts"],
99
setupFiles: ["./test/internal/setup.ts"],
1010
environment: "jsdom",
11-
coverage: {
12-
reporter: ["text"],
13-
},
1411
},
1512
});

pnpm-lock.yaml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)