Skip to content

Commit 9186c5e

Browse files
authored
Merge pull request #36 from mattjennings/svelte-5
Svelte 5
2 parents f3d2535 + 20b21f6 commit 9186c5e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+14307
-5512
lines changed

.eslintrc.cjs

Lines changed: 0 additions & 23 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
.DS_Store
22
node_modules
33
/.svelte-kit
4+
/dist
5+
/dist-docs
46
/package
5-
7+
.astro/
68
.vercel
79
.vercel_build_output

.prettierrc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
2-
"useTabs": false,
3-
"singleQuote": true,
4-
"trailingComma": "none",
5-
"printWidth": 100,
6-
"semi": false
2+
"useTabs": false,
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"printWidth": 100,
6+
"semi": false,
7+
"plugins": ["prettier-plugin-svelte"],
8+
"pluginSearchDirs": ["."],
9+
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
710
}

README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@ Add `Modals` somewhere in your app. This is where the modals will render.
1818
</script>
1919
2020
<Modals>
21-
<div
22-
slot="backdrop"
23-
class="backdrop"
24-
on:click={closeModal}
25-
/>
21+
<div slot="backdrop" class="backdrop" on:click={closeModal} />
2622
</Modals>
2723
2824
<style>
@@ -32,7 +28,7 @@ Add `Modals` somewhere in your app. This is where the modals will render.
3228
bottom: 0;
3329
right: 0;
3430
left: 0;
35-
background: rgba(0,0,0,0.50)
31+
background: rgba(0, 0, 0, 0.5);
3632
}
3733
</style>
3834
```
@@ -110,7 +106,7 @@ Open it
110106

111107
```html
112108
<script>
113-
import { openModal } from 'svelte-modals'
109+
import { openModal } from 'svelte-modals/legacy'
114110
import Modal from './Modal.svelte'
115111
116112
function handleClick() {

astro.config.mjs

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
// @ts-check
2+
import { defineConfig } from 'astro/config'
3+
import starlight from '@astrojs/starlight'
4+
import liveCode from 'astro-live-code'
5+
6+
import svelte from '@astrojs/svelte'
7+
8+
// https://astro.build/config
9+
export default defineConfig({
10+
srcDir: 'docs',
11+
outDir: 'dist-docs',
12+
vite: {
13+
resolve: {
14+
alias: {
15+
'svelte-modals/legacy': '/src/lib/legacy.svelte.ts',
16+
'svelte-modals': '/src/lib/index.ts',
17+
$lib: '/docs/lib'
18+
},
19+
dedupe: ['svelte-modals']
20+
}
21+
},
22+
integrations: [
23+
starlight({
24+
title: 'Svelte Modals',
25+
social: {
26+
github: 'https://github.com/mattjennings/svelte-modals'
27+
},
28+
sidebar: [
29+
{
30+
label: 'Overview',
31+
items: [
32+
{ label: 'Getting Started', slug: 'overview/getting-started' },
33+
{ label: 'How it works', slug: 'overview/how-it-works' }
34+
]
35+
},
36+
{
37+
label: 'Modal Components',
38+
items: [
39+
{ label: 'Props', slug: 'modal-components/props' },
40+
{ label: 'Transitions', slug: 'modal-components/transitions' },
41+
{ label: 'Snippets', slug: 'modal-components/snippets' },
42+
{ label: 'Lazy loading', slug: 'modal-components/lazy-loading' },
43+
{ label: 'Preventing close', slug: 'modal-components/preventing-close' }
44+
]
45+
},
46+
{
47+
label: 'API',
48+
items: [
49+
{ label: 'modals', slug: 'api/modals' },
50+
{ label: '<Modals />', slug: 'api/modals-component' }
51+
]
52+
},
53+
{
54+
label: 'Migrations',
55+
items: [{ label: 'v2', slug: 'migrations/v2' }]
56+
}
57+
],
58+
customCss: ['./docs/styles.css']
59+
}),
60+
svelte({
61+
preprocess: []
62+
}),
63+
liveCode({
64+
layout: '/docs/lib/layouts/code/Code.astro',
65+
defaultProps: {
66+
'client:load': true
67+
}
68+
})
69+
]
70+
})

dist/Modals.svelte

Lines changed: 0 additions & 51 deletions
This file was deleted.

dist/Modals.svelte.d.ts

Lines changed: 0 additions & 31 deletions
This file was deleted.

dist/index.d.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

dist/index.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

dist/store.d.ts

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)