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

Fix self-closing tags #84

Merged
merged 5 commits into from
Jul 15, 2024
Merged
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/serious-spies-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'cmdk-sv': patch
---

fix: Removes self-closing non-void elements to fix Svelte 5 warnings
1 change: 0 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"pluginSearchDirs": ["."],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"prepublishOnly": "npm run package",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --plugin-search-dir . --check . && eslint .",
"format": "prettier --plugin-search-dir . --write .",
"lint": "prettier --check . && eslint .",
"format": "prettier --write .",
"test": "vitest",
"release": "changeset publish",
"changeset": "changeset"
Expand Down Expand Up @@ -48,8 +48,8 @@
"postcss": "^8.4.31",
"postcss-load-config": "^4.0.1",
"postcss-preset-env": "^9.2.0",
"prettier": "^2.8.0",
"prettier-plugin-svelte": "^2.10.1",
"prettier": "^3.3.3",
"prettier-plugin-svelte": "^3.2.5",
"prism-svelte": "^0.5.0",
"prismjs": "^1.29.0",
"publint": "^0.1.9",
Expand Down
32 changes: 19 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/app.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en" style="color-scheme: dark">
<head>
<meta charset="utf-8" />
Expand Down
4 changes: 2 additions & 2 deletions src/docs/components/cmdk/framer/framer-cmdk.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@
<img src="/rauno.jpeg" alt="Avatar of Rauno" />
{:else if value === 'Slider'}
<div data-cmdk-framer-slider="">
<div />
<div></div>
</div>
{:else if value === 'Container'}
<div data-cmdk-framer-container="" />
<div data-cmdk-framer-container=""></div>
{/if}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/docs/components/cmdk/raycast/raycast-cmdk.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<div class="raycast">
<Command.Root bind:value>
<div data-cmdk-raycast-top-shine="" />
<div data-cmdk-raycast-top-shine=""></div>
<Command.Input autofocus placeholder="Search for apps and commands..." bind:el={inputEl} />
<hr data-cmdk-raycast-loader="" />
<Command.List bind:el={listEl}>
Expand Down
6 changes: 3 additions & 3 deletions src/docs/components/code-block.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
</script>

<div class="codeBlock">
<div class="line2" aria-hidden />
<div class="line3" aria-hidden />
<div class="line2" aria-hidden></div>
<div class="line3" aria-hidden></div>
<pre
use:setCodeString
class="root prism-code language-svelte"
Expand All @@ -46,7 +46,7 @@
<button aria-label="Copy Code" on:click={copyCode}>
<CopyIcon />
</button>
<div class="shine" />
<div class="shine"></div>
{@html rawCodeString}
</pre>
</div>
2 changes: 1 addition & 1 deletion src/docs/components/theme-switcher.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
<svelte:component this={icon} />
{key}
{#if isActive}
<div class="activeTheme" in:send={{ key: 'active' }} out:receive={{ key: 'active' }} />
<div class="activeTheme" in:send={{ key: 'active' }} out:receive={{ key: 'active' }}></div>
{/if}
</button>
{/each}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/cmdk/components/CommandSeparator.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
{#if asChild}
<slot {attrs} />
{:else}
<div {...attrs} {...$$restProps} />
<div {...attrs} {...$$restProps}></div>
{/if}
{/if}
2 changes: 1 addition & 1 deletion src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
</div>
<ThemeSwitcher bind:theme />

<div aria-hidden class="line" />
<div aria-hidden class="line"></div>
<CodeBlock />
</div>
<Footer />
Expand Down
8 changes: 6 additions & 2 deletions src/styles/app.postcss
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,9 @@
&[aria-selected] {
background: #ffffff;
color: var(--gray12);
box-shadow: 0px 2px 5px -2px rgb(0 0 0 / 15%), 0 1px 3px -1px rgb(0 0 0 / 20%);
box-shadow:
0px 2px 5px -2px rgb(0 0 0 / 15%),
0 1px 3px -1px rgb(0 0 0 / 20%);
}
}
}
Expand Down Expand Up @@ -400,7 +402,9 @@
border-radius: inherit;
padding: var(--size);
background: linear-gradient(to top, var(--gray1), var(--gray7));
mask: linear-gradient(black, black) content-box, linear-gradient(black, black);
mask:
linear-gradient(black, black) content-box,
linear-gradient(black, black);
mask-composite: exclude;
transform: translateZ(0);
}
Expand Down
5 changes: 4 additions & 1 deletion src/styles/code.postcss
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
right: 12px;
color: var(--gray11);
cursor: copy;
transition: color 150ms ease, background 150ms ease, transform 150ms ease;
transition:
color 150ms ease,
background 150ms ease,
transform 150ms ease;

&:hover {
color: var(--gray12);
Expand Down
Loading