Skip to content
Draft
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
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
engine-strict=true
min-version-age=7d
4 changes: 2 additions & 2 deletions bundle-analyzer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"@sveltejs/vite-plugin-svelte": "catalog:",
"@types/node": "catalog:",
"bits-ui": "workspace:*",
"rollup-plugin-visualizer": "^5.12.0",
"rollup-plugin-visualizer": "^7.0.1",
"svelte": "catalog:",
"tsx": "^4.19.2",
"tsx": "^4.21.0",
"typescript": "catalog:",
"vite": "catalog:"
},
Expand Down
4 changes: 2 additions & 2 deletions docs/mdsx.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { defineConfig } from "mdsx";
import rehypePrettyCode from "rehype-pretty-code";
import rehypeSlug from "rehype-slug";
import remarkGfm from "remark-gfm";
import { getHighlighter } from "shiki";
import { createHighlighter } from "shiki";
import { u } from "unist-builder";
import { visit } from "unist-util-visit";
import { codeBlockPrettierConfig } from "./other/code-block-prettier.js";
Expand Down Expand Up @@ -43,7 +43,7 @@ const prettyCodeOptions = {
),
},
getHighlighter: (options) =>
getHighlighter({
createHighlighter({
...options,
langs: [
"plaintext",
Expand Down
15 changes: 10 additions & 5 deletions docs/other/build-demo-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ async function collectFiles(currentDir: string, baseDir: string): Promise<FileMa
return files;
} catch (error) {
throw new Error(
`Failed to collect files from ${currentDir}: ${error instanceof Error ? error.message : String(error)}`
`Failed to collect files from ${currentDir}: ${error instanceof Error ? error.message : String(error)}`,
{ cause: error }
);
}
}
Expand All @@ -124,7 +125,8 @@ async function writeJsonFile(path: string, data: unknown): Promise<void> {
console.info(`Successfully wrote to ${path}`);
} catch (error) {
throw new Error(
`Failed to write to ${path}: ${error instanceof Error ? error.message : String(error)}`
`Failed to write to ${path}: ${error instanceof Error ? error.message : String(error)}`,
{ cause: error }
);
}
}
Expand Down Expand Up @@ -163,7 +165,8 @@ async function buildDemoRegistry(): Promise<void> {
await writeJsonFile(outputPath, components);
} catch (error) {
throw new Error(
`Failed to build demo registry: ${error instanceof Error ? error.message : String(error)}`
`Failed to build demo registry: ${error instanceof Error ? error.message : String(error)}`,
{ cause: error }
);
}
}
Expand All @@ -180,7 +183,8 @@ async function createSvelteProject(): Promise<string> {
return projectDir;
} catch (error) {
throw new Error(
`Failed to create Svelte project: ${error instanceof Error ? error.message : String(error)}`
`Failed to create Svelte project: ${error instanceof Error ? error.message : String(error)}`,
{ cause: error }
);
}
}
Expand Down Expand Up @@ -220,7 +224,8 @@ async function buildBaseStackBlitzFiles(files: FileMap): Promise<void> {
await writeJsonFile(outputPath, outputFiles);
} catch (error) {
throw new Error(
`Failed to build StackBlitz files: ${error instanceof Error ? error.message : String(error)}`
`Failed to build StackBlitz files: ${error instanceof Error ? error.message : String(error)}`,
{ cause: error }
);
}
}
Expand Down
3 changes: 2 additions & 1 deletion docs/other/build-llms-txt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ async function collectFiles(currentDir: string, baseDir: string): Promise<FileMa
return files;
} catch (error) {
throw new Error(
`Failed to collect files from ${currentDir}: ${error instanceof Error ? error.message : String(error)}`
`Failed to collect files from ${currentDir}: ${error instanceof Error ? error.message : String(error)}`,
{ cause: error }
);
}
}
Expand Down
3 changes: 2 additions & 1 deletion docs/other/update-velite-output.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ async function replaceIndexContents() {
});
if (!data) return;

// velite v0.3+ already generates import attributes; skip if already present
if (data.includes("with { type: 'json' }")) return;
const updatedContent = data.replaceAll(".json'", ".json' with { type: 'json' }");
if (updatedContent === data) return;

await writeFile(indexPath, updatedContent, "utf8").catch((err) => {
console.error("Error writing file:", err);
Expand Down
34 changes: 17 additions & 17 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,51 +18,51 @@
"check": "pnpm build:content && pnpm build:demos && svelte-kit sync && svelte-check --tsconfig ./tsconfig.json"
},
"devDependencies": {
"@internationalized/date": "3.8.2",
"@prettier/sync": "0.3.0",
"@internationalized/date": "3.12.1",
"@prettier/sync": "0.6.1",
"@stackblitz/sdk": "^1.11.0",
"@sveltejs/adapter-cloudflare": "^7.0.4",
"@sveltejs/adapter-cloudflare": "^7.2.8",
"@sveltejs/kit": "catalog:",
"@sveltejs/vite-plugin-svelte": "catalog:",
"@tailwindcss/vite": "catalog:",
"@types/hast": "^3.0.4",
"@types/jsdom": "^21.1.7",
"@types/jsdom": "^28.0.3",
"@types/mdast": "^4.0.4",
"@types/node": "catalog:",
"@types/unist": "^3.0.3",
"bits-ui": "workspace:*",
"clsx": "^2.1.1",
"consola": "^3.4.2",
"eruda": "^3.4.3",
"flexsearch": "^0.7.43",
"jsdom": "^24.1.3",
"flexsearch": "^0.8.212",
"jsdom": "^29.1.1",
"mdsx": "^0.0.7",
"mode-watcher": "^1.1.0",
"phosphor-svelte": "^2.0.1",
"phosphor-svelte": "^3.1.0",
"rehype-parse": "^9.0.1",
"rehype-pretty-code": "^0.13.2",
"rehype-pretty-code": "^0.14.3",
"rehype-remark": "^10.0.1",
"rehype-remove-comments": "^6.1.1",
"rehype-slug": "^6.0.0",
"remark-gfm": "^4.0.1",
"remark-stringify": "^11.0.0",
"remove-markdown": "^0.5.5",
"rollup-plugin-visualizer": "^5.14.0",
"remove-markdown": "^0.6.4",
"rollup-plugin-visualizer": "^7.0.1",
"runed": "catalog:",
"shiki": "^1.29.2",
"shiki": "^4.0.2",
"svelte": "catalog:",
"svelte-check": "catalog:",
"svelte-sonner": "^1.0.5",
"tailwind-merge": "^2.6.0",
"tailwind-variants": "^0.1.20",
"svelte-sonner": "^1.1.1",
"tailwind-merge": "^3.6.0",
"tailwind-variants": "^3.2.2",
"tailwindcss": "catalog:",
"tw-animate-css": "^1.3.8",
"tw-animate-css": "^1.4.0",
"typescript": "catalog:",
"unified": "^11.0.5",
"unist-builder": "^4.0.0",
"unist-util-visit": "^5.0.0",
"unist-util-visit": "^5.1.0",
"unist-util-visit-parents": "^6.0.2",
"velite": "^0.2.4",
"velite": "^0.3.1",
"vite": "catalog:",
"vite-plugin-devtools-json": "^1.0.0"
},
Expand Down
2 changes: 2 additions & 0 deletions docs/src/lib/components/demos/switch-demo-custom.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

let {
id = useId(),
// eslint-disable-next-line no-useless-assignment
checked = $bindable(false),
// eslint-disable-next-line no-useless-assignment
ref = $bindable(null),
labelText,
...restProps
Expand Down
12 changes: 6 additions & 6 deletions docs/src/lib/utils/search.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// thanks @joyofcodedev for this :)
import FlexSearch from "flexsearch";
import { Index, type Id } from "flexsearch";

export type SearchContent = {
title: string;
Expand All @@ -14,17 +14,17 @@ export type SearchResult = SearchContent & {
category?: string;
};

let titleIndex: FlexSearch.Index;
let contentIndex: FlexSearch.Index;
let titleIndex: Index;
let contentIndex: Index;
let content: SearchContent[] = [];

export function createContentIndex(data: SearchContent[]) {
titleIndex = new FlexSearch.Index({
titleIndex = new Index({
tokenize: "forward",
resolution: 9,
});

contentIndex = new FlexSearch.Index({
contentIndex = new Index({
tokenize: "forward",
resolution: 5,
});
Expand Down Expand Up @@ -103,7 +103,7 @@ export function searchContentIndex(query: string): SearchResult[] {
const titleResults = titleIndex.search(query, { limit: 20, suggest: true });
const contentResults = contentIndex.search(query, { limit: 20, suggest: true });

const resultMap = new Map<FlexSearch.Id, { score: number; source: string }>();
const resultMap = new Map<Id, { score: number; source: string }>();

for (const id of titleResults) {
resultMap.set(id, { score: 10, source: "title" });
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@
"author": "Hunter Johnston <https://github.com/huntabyte>",
"license": "MIT",
"devDependencies": {
"@changesets/cli": "^2.29.7",
"@eslint/js": "^9.35.0",
"@changesets/cli": "^2.31.0",
"@eslint/js": "^10.0.1",
"@svitejs/changesets-changelog-github-compact": "^1.2.0",
"eslint": "^9.35.0",
"eslint": "^10.3.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-oxlint": "^1.16.0",
"eslint-plugin-svelte": "^3.12.3",
"globals": "^16.4.0",
"oxlint": "^1.16.0",
"eslint-plugin-oxlint": "^1.64.0",
"eslint-plugin-svelte": "^3.17.1",
"globals": "^17.6.0",
"oxlint": "^1.64.0",
"playwright": "catalog:",
"prettier": "^3.6.2",
"prettier-plugin-svelte": "^3.4.0",
"prettier-plugin-tailwindcss": "^0.6.14",
"prettier": "^3.8.3",
"prettier-plugin-svelte": "^3.5.2",
"prettier-plugin-tailwindcss": "^0.8.0",
"svelte": "catalog:",
"typescript": "catalog:",
"typescript-eslint": "^8.44.0",
"wrangler": "^4.37.1"
"typescript-eslint": "^8.59.3",
"wrangler": "^4.90.1"
},
"type": "module",
"engines": {
Expand Down
18 changes: 9 additions & 9 deletions packages/bits-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
"!dist/**/*.spec.*"
],
"devDependencies": {
"@internationalized/date": "^3.8.2",
"@internationalized/date": "^3.12.1",
"@sveltejs/kit": "catalog:",
"@sveltejs/package": "2.5.0",
"@sveltejs/package": "2.5.7",
"@sveltejs/vite-plugin-svelte": "catalog:",
"@types/node": "catalog:",
"@types/resize-observer-browser": "^0.1.11",
"csstype": "^3.1.3",
"jsdom": "^24.1.3",
"publint": "^0.2.12",
"csstype": "^3.2.3",
"jsdom": "^29.1.1",
"publint": "^0.3.21",
"svelte": "catalog:",
"svelte-check": "catalog:",
"typescript": "catalog:",
Expand All @@ -47,12 +47,12 @@
"types": "./dist/index.d.ts",
"type": "module",
"dependencies": {
"@floating-ui/core": "^1.7.1",
"@floating-ui/dom": "^1.7.1",
"esm-env": "^1.1.2",
"@floating-ui/core": "^1.7.5",
"@floating-ui/dom": "^1.7.6",
"esm-env": "^1.2.2",
"runed": "catalog:",
"svelte-toolbelt": "^0.10.6",
"tabbable": "^6.2.0"
"tabbable": "^6.4.0"
},
"peerDependencies": {
"@internationalized/date": "^3.8.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/bits-ui/src/lib/bits/command/command.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ export class CommandRootState {
const column = this.#getColumn(selected, grid);
if (!column) return 0;

let newItem: HTMLElement | null = null;
let newItem: HTMLElement | null;

const skipRows = e.altKey ? 1 : 0;

Expand Down Expand Up @@ -900,7 +900,7 @@ export class CommandRootState {
const column = this.#getColumn(selected, grid);
if (column === null) return 0;

let newItem: HTMLElement | null = null;
let newItem: HTMLElement | null;

const skipRows = e.altKey ? 1 : 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,8 @@ export class DismissibleLayerState {
}

#handleDismiss = (e: MouseEvent) => {
let event = e;
if (event.defaultPrevented) {
event = createWrappedEvent(e);
}
this.#interactOutsideProp.current(e as PointerEvent);
const event = e.defaultPrevented ? createWrappedEvent(e) : e;
this.#interactOutsideProp.current(event as PointerEvent);
};

#handleInteractOutside = debounce((e: PointerEvent) => {
Expand Down
1 change: 1 addition & 0 deletions packages/bits-ui/src/lib/bits/utilities/mounted.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { noop } from "$lib/internal/noop.js";

let {
// eslint-disable-next-line no-useless-assignment
mounted = $bindable(false),
onMountedChange = noop,
}: { mounted?: boolean; onMountedChange?: (mounted: boolean) => void } = $props();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
function getTarget() {
if (!isBrowser || disabled) return null;

let localTarget: Element | null = null;
let localTarget: Element | null;

if (typeof to.current === "string") {
const target = document.querySelector(to.current);
Expand Down
1 change: 1 addition & 0 deletions packages/bits-ui/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const vitestBrowserConditionPlugin: Plugin = {
};

export default defineConfig({
// @ts-expect-error - vite v8 / vitest v3 (vite v7) type mismatch in plugins
plugins: [vitestBrowserConditionPlugin, sveltekit()],
test: {
include: ["src/**/*.{test,spec}.{js,ts}"],
Expand Down
Loading
Loading