Skip to content

Commit 7a8140b

Browse files
committed
Refactor Dialog component and update related documentation
- Improved code formatting and consistency in Dialog component. - Enhanced user experience by ensuring proper focus handling on dialog open. - Updated dialog styles for better responsiveness and accessibility. - Removed unused Dropdown and File components to streamline the codebase. - Added TypeScript definitions for svelte-highlight and codesandbox. - Updated tsconfig.json to improve type checking and module resolution. - Modified package.json to include type definitions and exports. - Removed obsolete publish-doc.ps1 script. - Enhanced utility functions with JSDoc comments for better documentation.
1 parent 38a3619 commit 7a8140b

23 files changed

+694
-401
lines changed

.npmignore

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Build outputs
5+
dist/
6+
dist-ssr/
7+
*.local
8+
9+
# Development files
10+
*.log
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
pnpm-debug.log*
15+
lerna-debug.log*
16+
17+
# Editor directories and files
18+
.vscode/*
19+
!.vscode/extensions.json
20+
.idea
21+
.DS_Store
22+
*.suo
23+
*.ntvs*
24+
*.njsproj
25+
*.sln
26+
*.sw?
27+
28+
# Documentation
29+
docs/
30+
*.md
31+
!README.md
32+
33+
# Config files
34+
.gitignore
35+
.npmignore
36+
.gitattributes
37+
.eslintrc*
38+
.prettierrc*
39+
40+
# Test files
41+
test/
42+
*.test.*
43+
*.spec.*
44+
45+
# Example files
46+
examples/
47+
example/
48+
49+
# CI/CD
50+
.github/
51+
.gitlab-ci.yml
52+
.travis.yml
53+
circle.yml
54+
appveyor.yml
55+
56+
# Misc
57+
.editorconfig
58+
.cache/
59+
coverage/
60+
.nyc_output/

.vscode/extensions.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
{
2-
"recommendations": ["svelte.svelte-vscode"]
2+
"recommendations": [
3+
"svelte.svelte-vscode",
4+
"dbaeumer.vscode-eslint",
5+
"esbenp.prettier-vscode",
6+
"bradlc.vscode-tailwindcss"
7+
]
38
}

docs/package-lock.json

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

docs/src/components/Code.svelte

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@
1111
</style>
1212
{#if showCopy}
1313
<div class="copy">
14-
<button class="button is-small is-white" on:click={() => {
15-
navigator.clipboard.write(
16-
[new ClipboardItem({ ["text/plain"]: new Blob([code], { type: "text/plain" }) })]
17-
)
18-
}}>
14+
<button class="button is-small is-white" on:click={() => {
15+
navigator.clipboard.writeText(code)
16+
}}>
1917
<span class="icon">
2018
<i class="fa fa-clipboard"></i>
2119
</span>

docs/src/components/Example.svelte

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,11 @@
11
<script>
2-
import { onMount } from 'svelte'
32
import { Button } from 'svelma'
43
import Code from './Code.svelte'
54
import CodepenButton from './CodepenButton.svelte'
65
76
export let lang = 'xml'
87
export let code
98
export let horizontal = false
10-
11-
let showCode = false
12-
13-
function show() {
14-
showCode = true
15-
}
16-
17-
function hide(e) {
18-
e.stopPropagation()
19-
showCode = false
20-
}
219
</script>
2210

2311
<style lang="scss">
@@ -57,51 +45,6 @@
5745
border-left: 1px solid #f5f5f5;
5846
overflow: hidden;
5947
position: relative;
60-
/* cursor: pointer;
61-
pointer-events: auto; */
62-
63-
/*
64-
&::before {
65-
position: absolute;
66-
top: 0;
67-
left: 0;
68-
right: 0;
69-
bottom: 0;
70-
opacity: 0.8;
71-
background-color: white;
72-
content: '<> Show Code';
73-
display: flex;
74-
justify-content: center;
75-
align-items: center;
76-
z-index: 1;
77-
font-size: 0.75rem;
78-
}*/
79-
80-
/*
81-
&:hover::before {
82-
background-color: #ffdd57;
83-
}
84-
85-
& :global(pre),
86-
& :global(pre code) {
87-
overflow: hidden;
88-
}
89-
90-
&.show-code {
91-
cursor: auto;
92-
93-
&::before {
94-
content: inherit;
95-
}
96-
97-
& :global(figure) {
98-
margin-bottom: 3em;
99-
}
100-
101-
& :global(pre) {
102-
overflow: auto;
103-
}
104-
}*/
10548
}
10649
10750
.snippet::before {
@@ -144,31 +87,9 @@
14487
line-height: 17px;
14588
}
14689
147-
/*.code {
148-
:global(.codeview) {
149-
height: 100%;
150-
151-
:global(figure) {
152-
height: 100%;
153-
154-
:global(pre:not(.hidden)) {
155-
height: 100%;
156-
}
157-
}
158-
}
159-
}*/
160-
16190
:global(.codeview) {
16291
margin-bottom: 0 !important;
16392
}
164-
165-
:global(.btn-show-code) {
166-
align-self: center;
167-
margin: 2em 0 0.5em;
168-
position: absolute;
169-
bottom: 0;
170-
background: none;
171-
}
17293
</style>
17394

17495
<div class="snippet" class:horizontal>
@@ -182,13 +103,6 @@
182103
<slot name="preview" />
183104
</div>
184105
<div class="code">
185-
<!-- class:show-code={showCode} on:click={show} -->
186106
<Code {lang} {code} />
187-
188-
<!-- {#if showCode}
189-
<Button class="btn-show-code is-rounded is-outline has-text-grey-light" on:click|stopPropagation={hide}>
190-
Hide Code
191-
</Button>
192-
{/if} -->
193107
</div>
194108
</div>

0 commit comments

Comments
 (0)