Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

next: fixes and touch ups #111

Open
wants to merge 2 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/chilled-pigs-grab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vaul-svelte": patch
---

fix: android firefox issues
73 changes: 50 additions & 23 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,55 @@
import config, { DEFAULT_IGNORES } from "@huntabyte/eslint-config";
import eslint from "@eslint/js";
import prettier from "eslint-config-prettier";
import svelte from "eslint-plugin-svelte";
import globals from "globals";
import tseslint from "typescript-eslint";

const ignores = ["**/extended-types"];

export default config({ svelte: true, ignores: [...DEFAULT_IGNORES, ...ignores] })
.override("antfu/typescript/rules", {
rules: {
"ts/consistent-type-definitions": "off",
"unused-imports/no-unused-imports": "off",
"unused-imports/no-unused-vars": "off",
"ts/no-unused-expressions": "off",
"no-unused-expressions": "off",
"ts/no-empty-object-type": "off",
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
...svelte.configs["flat/recommended"],
prettier,
...svelte.configs["flat/prettier"],
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
})
.override("antfu/javascript/rules", {
rules: {
"no-unused-expressions": "off",
"unused-imports/no-unused-imports": "off",
},
{
files: ["**/*.svelte"],
languageOptions: {
parserOptions: {
parser: tseslint.parser,
},
},
})
.override("huntabyte/svelte/rules", {
},
{
rules: {
"svelte/no-at-html-tags": "off",
"unused-imports/no-unused-imports": "off",
"unused-imports/no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/no-empty-object-type": "off",
"prefer-const": "off",
},
});
},
{
ignores: [
"build/",
".svelte-kit/",
"dist/",
".svelte-kit/**/*",
"sites/docs/.svelte-kit/**/*",
".svelte-kit",
"packages/vaul-svelte/dist/**/*",
"packages/vaul-svelte/.svelte-kit/**/*",
],
}
);
24 changes: 15 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,29 @@
"license": "MIT",
"devDependencies": {
"@changesets/cli": "^2.27.1",
"@huntabyte/eslint-config": "^0.3.2",
"@huntabyte/eslint-plugin": "^0.1.0",
"@eslint/js": "^9.12.0",
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
"@typescript-eslint/eslint-plugin": "^8.10.0",
"@typescript-eslint/scope-manager": "^8.10.0",
"@typescript-eslint/utils": "^8.10.0",
"eslint": "^9.0.0",
"eslint-plugin-svelte": "^2.44.1",
"prettier": "^3.2.5",
"prettier-plugin-svelte": "^3.2.7",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.46.1",
"globals": "^15.11.0",
"prettier": "^3.3.3",
"prettier-plugin-svelte": "^3.3.2",
"prettier-plugin-tailwindcss": "0.6.8",
"svelte": "^5.0.0",
"svelte-eslint-parser": "^0.41.1",
"svelte": "^5.11.0",
"svelte-eslint-parser": "^0.43.0",
"typescript": "^5.6.3",
"typescript-eslint": "^8.10.0",
"wrangler": "^3.44.0"
},
"type": "module",
"engines": {
"pnpm": ">=8.7.0",
"pnpm": ">=9.0.0",
"node": ">=18"
},
"packageManager": "pnpm@9.6.0",
"packageManager": "pnpm@9.14.4",
"private": true
}
16 changes: 8 additions & 8 deletions packages/vaul-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"devDependencies": {
"@sveltejs/kit": "^2.6.1",
"@sveltejs/package": "^2.3.5",
"@sveltejs/vite-plugin-svelte": "4.0.0",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.4.8",
"@testing-library/svelte": "^5.2.1",
Expand All @@ -38,11 +38,10 @@
"@types/node": "^20.14.10",
"@types/resize-observer-browser": "^0.1.11",
"@types/testing-library__jest-dom": "^5.14.9",
"autoprefixer": "^10.4.16",
"jsdom": "^24.1.0",
"publint": "^0.2.8",
"svelte": "^5.0.0",
"svelte-check": "^4.0.4",
"svelte": "^5.16.0",
"svelte-check": "^4.1.1",
"tslib": "^2.6.3",
"typescript": "^5.5.4",
"vite": "^5.4.8",
Expand All @@ -53,12 +52,13 @@
"types": "./dist/index.d.ts",
"type": "module",
"dependencies": {
"bits-ui": "^1.0.0-next.41",
"svelte-toolbelt": "^0.4.4"
"bits-ui": "^1.0.0-next.74",
"runed": "^0.22.0",
"svelte-toolbelt": "^0.7.0"
},
"engines": {
"pnpm": ">=8.7.0",
"pnpm": ">=9.0.0",
"node": ">=18"
},
"packageManager": "pnpm@9.6.0"
"packageManager": "pnpm@9.14.4"
}
11 changes: 2 additions & 9 deletions packages/vaul-svelte/src/app.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
declare global {
namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface PageState {}
// interface Platform {}
}
var vaulIdCounter: { current: number };
namespace App {}
}

export {};
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import DrawerRoot from "./drawer.svelte";
import type { RootProps } from "./index.js";
import { noop } from "$lib/internal/helpers/noop.js";
import { getDrawerRootContext } from "$lib/vaul.svelte.js";
import { DrawerRootContext } from "$lib/vaul.svelte.js";
import type { ComponentProps } from "svelte";

let {
open = $bindable(false),
Expand All @@ -12,7 +13,7 @@
...restProps
}: Omit<RootProps, "nested" | "onRelease" | "onClose"> = $props();

const rootState = getDrawerRootContext();
const rootState = DrawerRootContext.get();
</script>

<DrawerRoot
Expand All @@ -31,5 +32,5 @@
onOpenChange(o);
}}
onRelease={(e, o) => rootState.onNestedRelease(e, o)}
{...restProps as any}
{...restProps as ComponentProps<typeof DrawerRoot>}
/>
57 changes: 29 additions & 28 deletions packages/vaul-svelte/src/lib/components/drawer/drawer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
container: box.with(() => container),
});

// eslint-disable-next-line @typescript-eslint/no-explicit-any
let bodyStyles: any;

function handleOpenChange(o: boolean) {
Expand Down Expand Up @@ -149,46 +150,46 @@
}

:global(
[data-vaul-drawer][data-vaul-snap-points="false"][data-vaul-drawer-direction="bottom"][data-state="open"]
) {
[data-vaul-drawer][data-vaul-snap-points="false"][data-vaul-drawer-direction="bottom"][data-state="open"]
) {
animation-name: slideFromBottom;
}
:global(
[data-vaul-drawer][data-vaul-snap-points="false"][data-vaul-drawer-direction="bottom"][data-state="closed"]
) {
[data-vaul-drawer][data-vaul-snap-points="false"][data-vaul-drawer-direction="bottom"][data-state="closed"]
) {
animation-name: slideToBottom;
}

:global(
[data-vaul-drawer][data-vaul-snap-points="false"][data-vaul-drawer-direction="top"][data-state="open"]
) {
[data-vaul-drawer][data-vaul-snap-points="false"][data-vaul-drawer-direction="top"][data-state="open"]
) {
animation-name: slideFromTop;
}
:global(
[data-vaul-drawer][data-vaul-snap-points="false"][data-vaul-drawer-direction="top"][data-state="closed"]
) {
[data-vaul-drawer][data-vaul-snap-points="false"][data-vaul-drawer-direction="top"][data-state="closed"]
) {
animation-name: slideToTop;
}

:global(
[data-vaul-drawer][data-vaul-snap-points="false"][data-vaul-drawer-direction="left"][data-state="open"]
) {
[data-vaul-drawer][data-vaul-snap-points="false"][data-vaul-drawer-direction="left"][data-state="open"]
) {
animation-name: slideFromLeft;
}
:global(
[data-vaul-drawer][data-vaul-snap-points="false"][data-vaul-drawer-direction="left"][data-state="closed"]
) {
[data-vaul-drawer][data-vaul-snap-points="false"][data-vaul-drawer-direction="left"][data-state="closed"]
) {
animation-name: slideToLeft;
}

:global(
[data-vaul-drawer][data-vaul-snap-points="false"][data-vaul-drawer-direction="right"][data-state="open"]
) {
[data-vaul-drawer][data-vaul-snap-points="false"][data-vaul-drawer-direction="right"][data-state="open"]
) {
animation-name: slideFromRight;
}
:global(
[data-vaul-drawer][data-vaul-snap-points="false"][data-vaul-drawer-direction="right"][data-state="closed"]
) {
[data-vaul-drawer][data-vaul-snap-points="false"][data-vaul-drawer-direction="right"][data-state="closed"]
) {
animation-name: slideToRight;
}

Expand All @@ -209,26 +210,26 @@
}

:global(
[data-vaul-drawer][data-vaul-delayed-snap-points="true"][data-vaul-snap-points="true"][data-vaul-drawer-direction="top"]
) {
[data-vaul-drawer][data-vaul-delayed-snap-points="true"][data-vaul-snap-points="true"][data-vaul-drawer-direction="top"]
) {
transform: translate3d(0, var(--snap-point-height, 0), 0);
}

:global(
[data-vaul-drawer][data-vaul-delayed-snap-points="true"][data-vaul-snap-points="true"][data-vaul-drawer-direction="bottom"]
) {
[data-vaul-drawer][data-vaul-delayed-snap-points="true"][data-vaul-snap-points="true"][data-vaul-drawer-direction="bottom"]
) {
transform: translate3d(0, var(--snap-point-height, 0), 0);
}

:global(
[data-vaul-drawer][data-vaul-delayed-snap-points="true"][data-vaul-drawer-direction="left"]
) {
[data-vaul-drawer][data-vaul-delayed-snap-points="true"][data-vaul-drawer-direction="left"]
) {
transform: translate3d(var(--snap-point-height, 0), 0, 0);
}

:global(
[data-vaul-drawer][data-vaul-delayed-snap-points="true"][data-vaul-drawer-direction="right"]
) {
[data-vaul-drawer][data-vaul-delayed-snap-points="true"][data-vaul-drawer-direction="right"]
) {
transform: translate3d(var(--snap-point-height, 0), 0, 0);
}

Expand Down Expand Up @@ -292,10 +293,10 @@
}

:global(
[data-vaul-overlay][data-vaul-snap-points="true"]:not(
[data-vaul-snap-points-overlay="true"]
):not([data-state="closed"])
) {
[data-vaul-overlay][data-vaul-snap-points="true"]:not(
[data-vaul-snap-points-overlay="true"]
):not([data-state="closed"])
) {
opacity: 0;
}

Expand Down
Loading
Loading