plasma-svelte 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -0
- package/dist/accordion/Accordion.svelte +28 -0
- package/dist/accordion/Accordion.svelte.d.ts +8 -0
- package/dist/accordion/AccordionItem.svelte +193 -0
- package/dist/accordion/AccordionItem.svelte.d.ts +14 -0
- package/dist/avatar/Avatar.svelte +178 -0
- package/dist/avatar/Avatar.svelte.d.ts +16 -0
- package/dist/badge/Badge.svelte +162 -0
- package/dist/badge/Badge.svelte.d.ts +16 -0
- package/dist/breadcrumb/Breadcrumb.svelte +59 -0
- package/dist/breadcrumb/Breadcrumb.svelte.d.ts +9 -0
- package/dist/breadcrumb/BreadcrumbItem.svelte +151 -0
- package/dist/breadcrumb/BreadcrumbItem.svelte.d.ts +14 -0
- package/dist/button/Button.svelte +274 -0
- package/dist/button/Button.svelte.d.ts +22 -0
- package/dist/button/ButtonGroup.svelte +98 -0
- package/dist/button/ButtonGroup.svelte.d.ts +12 -0
- package/dist/card/Card.svelte +191 -0
- package/dist/card/Card.svelte.d.ts +18 -0
- package/dist/checkbox/Checkbox.svelte +199 -0
- package/dist/checkbox/Checkbox.svelte.d.ts +12 -0
- package/dist/datepicker/DatePicker.svelte +509 -0
- package/dist/datepicker/DatePicker.svelte.d.ts +14 -0
- package/dist/divider/Divider.svelte +112 -0
- package/dist/divider/Divider.svelte.d.ts +13 -0
- package/dist/drawer/Drawer.svelte +330 -0
- package/dist/drawer/Drawer.svelte.d.ts +21 -0
- package/dist/dropzone/DropZone.svelte +282 -0
- package/dist/dropzone/DropZone.svelte.d.ts +17 -0
- package/dist/emptystate/EmptyState.svelte +169 -0
- package/dist/emptystate/EmptyState.svelte.d.ts +15 -0
- package/dist/headerbar/HeaderBar.svelte +210 -0
- package/dist/headerbar/HeaderBar.svelte.d.ts +17 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +44 -0
- package/dist/input/Input.svelte +227 -0
- package/dist/input/Input.svelte.d.ts +14 -0
- package/dist/layout/Flex.svelte +110 -0
- package/dist/layout/Flex.svelte.d.ts +20 -0
- package/dist/layout/Grid.svelte +78 -0
- package/dist/layout/Grid.svelte.d.ts +19 -0
- package/dist/layout/Space.svelte +64 -0
- package/dist/layout/Space.svelte.d.ts +16 -0
- package/dist/layout/utils.d.ts +2 -0
- package/dist/layout/utils.js +19 -0
- package/dist/menu/Menu.svelte +156 -0
- package/dist/menu/Menu.svelte.d.ts +14 -0
- package/dist/menu/MenuDivider.svelte +19 -0
- package/dist/menu/MenuDivider.svelte.d.ts +6 -0
- package/dist/menu/MenuItem.svelte +126 -0
- package/dist/menu/MenuItem.svelte.d.ts +13 -0
- package/dist/message/InlineMessage.svelte +226 -0
- package/dist/message/InlineMessage.svelte.d.ts +15 -0
- package/dist/modal/ConfirmDialog.svelte +151 -0
- package/dist/modal/ConfirmDialog.svelte.d.ts +19 -0
- package/dist/modal/Modal.svelte +279 -0
- package/dist/modal/Modal.svelte.d.ts +18 -0
- package/dist/pagination/Pagination.svelte +258 -0
- package/dist/pagination/Pagination.svelte.d.ts +16 -0
- package/dist/progress/ProgressBar.svelte +179 -0
- package/dist/progress/ProgressBar.svelte.d.ts +15 -0
- package/dist/radio/Radio.svelte +161 -0
- package/dist/radio/Radio.svelte.d.ts +13 -0
- package/dist/searchfield/SearchField.svelte +246 -0
- package/dist/searchfield/SearchField.svelte.d.ts +15 -0
- package/dist/select/Select.svelte +392 -0
- package/dist/select/Select.svelte.d.ts +20 -0
- package/dist/sidebar/Sidebar.svelte +78 -0
- package/dist/sidebar/Sidebar.svelte.d.ts +11 -0
- package/dist/sidebar/SidebarGroup.svelte +51 -0
- package/dist/sidebar/SidebarGroup.svelte.d.ts +9 -0
- package/dist/sidebar/SidebarItem.svelte +185 -0
- package/dist/sidebar/SidebarItem.svelte.d.ts +16 -0
- package/dist/slider/Slider.svelte +204 -0
- package/dist/slider/Slider.svelte.d.ts +16 -0
- package/dist/spinbox/SpinBox.svelte +299 -0
- package/dist/spinbox/SpinBox.svelte.d.ts +20 -0
- package/dist/spinner/Spinner.svelte +130 -0
- package/dist/spinner/Spinner.svelte.d.ts +11 -0
- package/dist/style/base.css +178 -0
- package/dist/style/index.css +2 -0
- package/dist/style/token.css +230 -0
- package/dist/switch/Switch.svelte +199 -0
- package/dist/switch/Switch.svelte.d.ts +13 -0
- package/dist/table/Table.svelte +305 -0
- package/dist/table/Table.svelte.d.ts +32 -0
- package/dist/tabs/Tabs.svelte +216 -0
- package/dist/tabs/Tabs.svelte.d.ts +21 -0
- package/dist/textarea/TextArea.svelte +114 -0
- package/dist/textarea/TextArea.svelte.d.ts +14 -0
- package/dist/timepicker/TimePicker.svelte +452 -0
- package/dist/timepicker/TimePicker.svelte.d.ts +16 -0
- package/dist/tooltip/Tooltip.svelte +122 -0
- package/dist/tooltip/Tooltip.svelte.d.ts +12 -0
- package/package.json +66 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import Modal from "./Modal.svelte";
|
|
4
|
+
import Button from "../button/Button.svelte";
|
|
5
|
+
|
|
6
|
+
type ConfirmVariant = "primary" | "danger" | "default";
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
open?: boolean;
|
|
10
|
+
title?: string;
|
|
11
|
+
message?: string;
|
|
12
|
+
confirmText?: string;
|
|
13
|
+
cancelText?: string;
|
|
14
|
+
confirmVariant?: ConfirmVariant;
|
|
15
|
+
loading?: boolean;
|
|
16
|
+
icon?: Snippet;
|
|
17
|
+
children?: Snippet;
|
|
18
|
+
onconfirm?: () => void | Promise<void>;
|
|
19
|
+
oncancel?: () => void;
|
|
20
|
+
onclose?: () => void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
let {
|
|
24
|
+
open = $bindable(false),
|
|
25
|
+
title = "Confirm Action",
|
|
26
|
+
message = "",
|
|
27
|
+
confirmText = "Confirm",
|
|
28
|
+
cancelText = "Cancel",
|
|
29
|
+
confirmVariant = "primary",
|
|
30
|
+
loading = false,
|
|
31
|
+
icon,
|
|
32
|
+
children,
|
|
33
|
+
onconfirm,
|
|
34
|
+
oncancel,
|
|
35
|
+
onclose,
|
|
36
|
+
}: Props = $props();
|
|
37
|
+
|
|
38
|
+
async function handleConfirm() {
|
|
39
|
+
if (loading) return;
|
|
40
|
+
await onconfirm?.();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function handleCancel() {
|
|
44
|
+
if (loading) return;
|
|
45
|
+
open = false;
|
|
46
|
+
oncancel?.();
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<Modal
|
|
51
|
+
bind:open
|
|
52
|
+
{title}
|
|
53
|
+
size="sm"
|
|
54
|
+
closeOnEsc={!loading}
|
|
55
|
+
closeOnBackdrop={!loading}
|
|
56
|
+
{onclose}
|
|
57
|
+
>
|
|
58
|
+
<div class="plasma-confirm-body">
|
|
59
|
+
{#if icon}
|
|
60
|
+
<div class="plasma-confirm-icon plasma-confirm-icon--{confirmVariant}">
|
|
61
|
+
{@render icon()}
|
|
62
|
+
</div>
|
|
63
|
+
{:else if confirmVariant === "danger"}
|
|
64
|
+
<div class="plasma-confirm-icon plasma-confirm-icon--danger">
|
|
65
|
+
<svg
|
|
66
|
+
aria-hidden="true"
|
|
67
|
+
viewBox="0 0 24 24"
|
|
68
|
+
width="28"
|
|
69
|
+
height="28"
|
|
70
|
+
fill="none"
|
|
71
|
+
stroke="currentColor"
|
|
72
|
+
stroke-width="2"
|
|
73
|
+
stroke-linecap="round"
|
|
74
|
+
stroke-linejoin="round"
|
|
75
|
+
>
|
|
76
|
+
<path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" />
|
|
77
|
+
<line x1="12" y1="9" x2="12" y2="13" />
|
|
78
|
+
<line x1="12" y1="17" x2="12.01" y2="17" />
|
|
79
|
+
</svg>
|
|
80
|
+
</div>
|
|
81
|
+
{/if}
|
|
82
|
+
|
|
83
|
+
<div class="plasma-confirm-text">
|
|
84
|
+
{#if message}
|
|
85
|
+
<p class="plasma-confirm-message">{message}</p>
|
|
86
|
+
{/if}
|
|
87
|
+
{#if children}
|
|
88
|
+
{@render children()}
|
|
89
|
+
{/if}
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
{#snippet footer()}
|
|
94
|
+
<Button
|
|
95
|
+
variant="flat"
|
|
96
|
+
disabled={loading}
|
|
97
|
+
onclick={handleCancel}
|
|
98
|
+
>
|
|
99
|
+
{cancelText}
|
|
100
|
+
</Button>
|
|
101
|
+
<Button
|
|
102
|
+
variant={confirmVariant === "danger" ? "danger" : "primary"}
|
|
103
|
+
{loading}
|
|
104
|
+
onclick={handleConfirm}
|
|
105
|
+
>
|
|
106
|
+
{confirmText}
|
|
107
|
+
</Button>
|
|
108
|
+
{/snippet}
|
|
109
|
+
</Modal>
|
|
110
|
+
|
|
111
|
+
<style>
|
|
112
|
+
.plasma-confirm-body {
|
|
113
|
+
display: flex;
|
|
114
|
+
align-items: flex-start;
|
|
115
|
+
gap: var(--plasma-space-md);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.plasma-confirm-icon {
|
|
119
|
+
display: inline-flex;
|
|
120
|
+
align-items: center;
|
|
121
|
+
justify-content: center;
|
|
122
|
+
flex-shrink: 0;
|
|
123
|
+
margin-top: 2px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.plasma-confirm-icon--danger {
|
|
127
|
+
color: var(--plasma-color-negative);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.plasma-confirm-icon--primary {
|
|
131
|
+
color: var(--plasma-color-highlight);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.plasma-confirm-icon--default {
|
|
135
|
+
color: var(--plasma-color-text-muted);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.plasma-confirm-text {
|
|
139
|
+
flex: 1;
|
|
140
|
+
display: flex;
|
|
141
|
+
flex-direction: column;
|
|
142
|
+
gap: var(--plasma-space-xs);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.plasma-confirm-message {
|
|
146
|
+
margin: 0;
|
|
147
|
+
font-size: var(--plasma-font-size-base);
|
|
148
|
+
line-height: var(--plasma-line-height-base);
|
|
149
|
+
color: var(--plasma-color-text);
|
|
150
|
+
}
|
|
151
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
type ConfirmVariant = "primary" | "danger" | "default";
|
|
3
|
+
interface Props {
|
|
4
|
+
open?: boolean;
|
|
5
|
+
title?: string;
|
|
6
|
+
message?: string;
|
|
7
|
+
confirmText?: string;
|
|
8
|
+
cancelText?: string;
|
|
9
|
+
confirmVariant?: ConfirmVariant;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
icon?: Snippet;
|
|
12
|
+
children?: Snippet;
|
|
13
|
+
onconfirm?: () => void | Promise<void>;
|
|
14
|
+
oncancel?: () => void;
|
|
15
|
+
onclose?: () => void;
|
|
16
|
+
}
|
|
17
|
+
declare const ConfirmDialog: import("svelte").Component<Props, {}, "open">;
|
|
18
|
+
type ConfirmDialog = ReturnType<typeof ConfirmDialog>;
|
|
19
|
+
export default ConfirmDialog;
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
type ModalSize = "sm" | "md" | "lg" | "fullscreen";
|
|
6
|
+
|
|
7
|
+
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
open?: boolean;
|
|
9
|
+
title?: string;
|
|
10
|
+
size?: ModalSize;
|
|
11
|
+
inline?: boolean;
|
|
12
|
+
closeOnEsc?: boolean;
|
|
13
|
+
closeOnBackdrop?: boolean;
|
|
14
|
+
header?: Snippet;
|
|
15
|
+
footer?: Snippet;
|
|
16
|
+
children?: Snippet;
|
|
17
|
+
onclose?: () => void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let {
|
|
21
|
+
open = $bindable(false),
|
|
22
|
+
title = "",
|
|
23
|
+
size = "md",
|
|
24
|
+
inline = false,
|
|
25
|
+
closeOnEsc = true,
|
|
26
|
+
closeOnBackdrop = true,
|
|
27
|
+
header,
|
|
28
|
+
footer,
|
|
29
|
+
children,
|
|
30
|
+
onclose,
|
|
31
|
+
class: customClass = "",
|
|
32
|
+
...restProps
|
|
33
|
+
}: Props = $props();
|
|
34
|
+
|
|
35
|
+
function close() {
|
|
36
|
+
open = false;
|
|
37
|
+
onclose?.();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function handleBackdropClick(e: MouseEvent) {
|
|
41
|
+
if (!inline && closeOnBackdrop && e.target === e.currentTarget) {
|
|
42
|
+
close();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function handleKeydown(e: KeyboardEvent) {
|
|
47
|
+
if (open && !inline && closeOnEsc && e.key === "Escape") {
|
|
48
|
+
e.stopPropagation();
|
|
49
|
+
close();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<svelte:window onkeydown={handleKeydown} />
|
|
55
|
+
|
|
56
|
+
{#if open}
|
|
57
|
+
<!-- biome-ignore lint/a11y/noStaticElementInteractions: false positive -->
|
|
58
|
+
<div
|
|
59
|
+
class="plasma-modal-backdrop"
|
|
60
|
+
class:plasma-modal-backdrop--inline={inline}
|
|
61
|
+
onclick={handleBackdropClick}
|
|
62
|
+
role="presentation"
|
|
63
|
+
>
|
|
64
|
+
<div
|
|
65
|
+
role="dialog"
|
|
66
|
+
aria-modal="true"
|
|
67
|
+
aria-labelledby={title ? "plasma-modal-title" : undefined}
|
|
68
|
+
class="plasma-modal plasma-modal--{size} {customClass}"
|
|
69
|
+
{...restProps}
|
|
70
|
+
>
|
|
71
|
+
<!-- Title Bar -->
|
|
72
|
+
<div class="plasma-modal-header">
|
|
73
|
+
{#if header}
|
|
74
|
+
{@render header()}
|
|
75
|
+
{:else}
|
|
76
|
+
<h2 id="plasma-modal-title" class="plasma-modal-title">{title}</h2>
|
|
77
|
+
{/if}
|
|
78
|
+
|
|
79
|
+
<button
|
|
80
|
+
type="button"
|
|
81
|
+
class="plasma-modal-close-btn"
|
|
82
|
+
onclick={close}
|
|
83
|
+
aria-label="Close dialog"
|
|
84
|
+
>
|
|
85
|
+
<svg
|
|
86
|
+
aria-hidden="true"
|
|
87
|
+
viewBox="0 0 16 16"
|
|
88
|
+
width="12"
|
|
89
|
+
height="12"
|
|
90
|
+
fill="currentColor"
|
|
91
|
+
>
|
|
92
|
+
<path
|
|
93
|
+
d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"
|
|
94
|
+
/>
|
|
95
|
+
</svg>
|
|
96
|
+
</button>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<!-- Body -->
|
|
100
|
+
{#if children}
|
|
101
|
+
<div class="plasma-modal-body">
|
|
102
|
+
{@render children()}
|
|
103
|
+
</div>
|
|
104
|
+
{/if}
|
|
105
|
+
|
|
106
|
+
<!-- Footer -->
|
|
107
|
+
{#if footer}
|
|
108
|
+
<div class="plasma-modal-footer">
|
|
109
|
+
{@render footer()}
|
|
110
|
+
</div>
|
|
111
|
+
{/if}
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
{/if}
|
|
115
|
+
|
|
116
|
+
<style>
|
|
117
|
+
/* --------------------------------------------------------------------------
|
|
118
|
+
Backdrop
|
|
119
|
+
-------------------------------------------------------------------------- */
|
|
120
|
+
.plasma-modal-backdrop {
|
|
121
|
+
position: fixed;
|
|
122
|
+
top: 0;
|
|
123
|
+
left: 0;
|
|
124
|
+
right: 0;
|
|
125
|
+
bottom: 0;
|
|
126
|
+
z-index: 9999;
|
|
127
|
+
display: flex;
|
|
128
|
+
align-items: center;
|
|
129
|
+
justify-content: center;
|
|
130
|
+
padding: var(--plasma-space-lg);
|
|
131
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
132
|
+
backdrop-filter: blur(4px);
|
|
133
|
+
-webkit-backdrop-filter: blur(4px);
|
|
134
|
+
animation: plasma-fade-in var(--plasma-duration-base)
|
|
135
|
+
var(--plasma-ease-default);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.plasma-modal-backdrop--inline {
|
|
139
|
+
position: relative;
|
|
140
|
+
top: auto;
|
|
141
|
+
left: auto;
|
|
142
|
+
right: auto;
|
|
143
|
+
bottom: auto;
|
|
144
|
+
z-index: auto;
|
|
145
|
+
width: 100%;
|
|
146
|
+
min-height: 100%;
|
|
147
|
+
display: flex;
|
|
148
|
+
align-items: center;
|
|
149
|
+
justify-content: center;
|
|
150
|
+
box-sizing: border-box;
|
|
151
|
+
padding: var(--plasma-space-md);
|
|
152
|
+
background-color: transparent;
|
|
153
|
+
backdrop-filter: none;
|
|
154
|
+
-webkit-backdrop-filter: none;
|
|
155
|
+
animation: none;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* --------------------------------------------------------------------------
|
|
159
|
+
Modal Frame (KDE Breeze Floating Window)
|
|
160
|
+
-------------------------------------------------------------------------- */
|
|
161
|
+
.plasma-modal {
|
|
162
|
+
position: relative;
|
|
163
|
+
display: flex;
|
|
164
|
+
flex-direction: column;
|
|
165
|
+
width: 100%;
|
|
166
|
+
margin: 0 auto;
|
|
167
|
+
max-height: calc(100vh - 4rem);
|
|
168
|
+
background-color: var(--plasma-color-surface);
|
|
169
|
+
color: var(--plasma-color-text);
|
|
170
|
+
font-family: var(--plasma-font-sans);
|
|
171
|
+
border: 1px solid var(--plasma-color-border);
|
|
172
|
+
border-radius: var(--plasma-radius-xl);
|
|
173
|
+
box-shadow: var(--plasma-shadow-lg);
|
|
174
|
+
overflow: hidden;
|
|
175
|
+
animation: plasma-scale-in var(--plasma-duration-base)
|
|
176
|
+
var(--plasma-ease-default);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/* Sizing */
|
|
180
|
+
.plasma-modal--sm {
|
|
181
|
+
max-width: 400px;
|
|
182
|
+
}
|
|
183
|
+
.plasma-modal--md {
|
|
184
|
+
max-width: 540px;
|
|
185
|
+
}
|
|
186
|
+
.plasma-modal--lg {
|
|
187
|
+
max-width: 760px;
|
|
188
|
+
}
|
|
189
|
+
.plasma-modal--fullscreen {
|
|
190
|
+
max-width: calc(100vw - 2rem);
|
|
191
|
+
height: calc(100vh - 2rem);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/* --------------------------------------------------------------------------
|
|
195
|
+
Header / Title Bar
|
|
196
|
+
-------------------------------------------------------------------------- */
|
|
197
|
+
.plasma-modal-header {
|
|
198
|
+
display: flex;
|
|
199
|
+
align-items: center;
|
|
200
|
+
justify-content: space-between;
|
|
201
|
+
padding: var(--plasma-space-md) var(--plasma-space-lg);
|
|
202
|
+
border-bottom: 1px solid var(--plasma-color-border-subtle);
|
|
203
|
+
background-color: var(--plasma-color-surface);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.plasma-modal-title {
|
|
207
|
+
margin: 0;
|
|
208
|
+
font-size: var(--plasma-font-size-md);
|
|
209
|
+
font-weight: var(--plasma-font-weight-bold);
|
|
210
|
+
color: var(--plasma-color-text);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.plasma-modal-close-btn {
|
|
214
|
+
display: inline-flex;
|
|
215
|
+
align-items: center;
|
|
216
|
+
justify-content: center;
|
|
217
|
+
width: 24px;
|
|
218
|
+
height: 24px;
|
|
219
|
+
border-radius: var(--plasma-radius-full);
|
|
220
|
+
border: none;
|
|
221
|
+
background: transparent;
|
|
222
|
+
color: var(--plasma-color-text-muted);
|
|
223
|
+
cursor: pointer;
|
|
224
|
+
transition: var(--plasma-transition-fast);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.plasma-modal-close-btn:hover {
|
|
228
|
+
color: #ffffff;
|
|
229
|
+
background-color: var(--plasma-color-negative);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.plasma-modal-close-btn:focus-visible {
|
|
233
|
+
outline: 2px solid var(--plasma-color-highlight);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/* --------------------------------------------------------------------------
|
|
237
|
+
Body & Footer
|
|
238
|
+
-------------------------------------------------------------------------- */
|
|
239
|
+
.plasma-modal-body {
|
|
240
|
+
flex: 1;
|
|
241
|
+
overflow-y: auto;
|
|
242
|
+
padding: var(--plasma-space-lg);
|
|
243
|
+
font-size: var(--plasma-font-size-base);
|
|
244
|
+
line-height: var(--plasma-line-height-base);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.plasma-modal-footer {
|
|
248
|
+
display: flex;
|
|
249
|
+
align-items: center;
|
|
250
|
+
justify-content: flex-end;
|
|
251
|
+
gap: var(--plasma-space-sm);
|
|
252
|
+
padding: var(--plasma-space-md) var(--plasma-space-lg);
|
|
253
|
+
border-top: 1px solid var(--plasma-color-border-subtle);
|
|
254
|
+
background-color: var(--plasma-color-surface-sunken);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/* --------------------------------------------------------------------------
|
|
258
|
+
Animations
|
|
259
|
+
-------------------------------------------------------------------------- */
|
|
260
|
+
@keyframes plasma-fade-in {
|
|
261
|
+
from {
|
|
262
|
+
opacity: 0;
|
|
263
|
+
}
|
|
264
|
+
to {
|
|
265
|
+
opacity: 1;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
@keyframes plasma-scale-in {
|
|
270
|
+
from {
|
|
271
|
+
opacity: 0;
|
|
272
|
+
transform: scale(0.96) translateY(-8px);
|
|
273
|
+
}
|
|
274
|
+
to {
|
|
275
|
+
opacity: 1;
|
|
276
|
+
transform: scale(1) translateY(0);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
type ModalSize = "sm" | "md" | "lg" | "fullscreen";
|
|
4
|
+
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
open?: boolean;
|
|
6
|
+
title?: string;
|
|
7
|
+
size?: ModalSize;
|
|
8
|
+
inline?: boolean;
|
|
9
|
+
closeOnEsc?: boolean;
|
|
10
|
+
closeOnBackdrop?: boolean;
|
|
11
|
+
header?: Snippet;
|
|
12
|
+
footer?: Snippet;
|
|
13
|
+
children?: Snippet;
|
|
14
|
+
onclose?: () => void;
|
|
15
|
+
}
|
|
16
|
+
declare const Modal: import("svelte").Component<Props, {}, "open">;
|
|
17
|
+
type Modal = ReturnType<typeof Modal>;
|
|
18
|
+
export default Modal;
|