svelora 3.0.14 → 3.0.16
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/dist/components/ConfirmDialog/ConfirmDialog.svelte +167 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.svelte.d.ts +10 -0
- package/dist/components/ConfirmDialog/confirm.d.ts +9 -0
- package/dist/components/ConfirmDialog/confirm.js +24 -0
- package/dist/components/ConfirmDialog/confirm.types.d.ts +22 -0
- package/dist/components/ConfirmDialog/confirm.types.js +1 -0
- package/dist/components/ConfirmDialog/index.d.ts +4 -0
- package/dist/components/ConfirmDialog/index.js +2 -0
- package/dist/components/Editor/editor.schemas.js +1 -1
- package/dist/components/SortableList/SortableList.svelte +54 -0
- package/dist/components/SortableList/SortableList.svelte.d.ts +26 -0
- package/dist/components/SortableList/index.d.ts +2 -0
- package/dist/components/SortableList/index.js +1 -0
- package/dist/components/SortableList/sortable-list.types.d.ts +17 -0
- package/dist/components/SortableList/sortable-list.types.js +1 -0
- package/dist/components/Table/Table.svelte +57 -1
- package/dist/components/Table/table.types.d.ts +2 -0
- package/dist/components/Table/table.variants.d.ts +34 -0
- package/dist/components/Table/table.variants.js +13 -0
- package/dist/components/Toast/Toaster.svelte +194 -137
- package/dist/components/Toast/index.d.ts +2 -0
- package/dist/components/Toast/index.js +1 -0
- package/dist/components/Toast/internal/AnimatedIcon.svelte +446 -0
- package/dist/components/Toast/internal/AnimatedIcon.svelte.d.ts +15 -0
- package/dist/components/Toast/internal/animated-icon.types.d.ts +1 -0
- package/dist/components/Toast/internal/animated-icon.types.js +1 -0
- package/dist/components/Toast/internal/french-toast/LICENSE.md +21 -0
- package/dist/components/Toast/internal/french-toast/components/CheckmarkIcon.svelte +64 -0
- package/dist/components/Toast/internal/french-toast/components/CheckmarkIcon.svelte.d.ts +8 -0
- package/dist/components/Toast/internal/french-toast/components/ErrorIcon.svelte +74 -0
- package/dist/components/Toast/internal/french-toast/components/ErrorIcon.svelte.d.ts +8 -0
- package/dist/components/Toast/internal/french-toast/components/LoaderIcon.svelte +28 -0
- package/dist/components/Toast/internal/french-toast/components/LoaderIcon.svelte.d.ts +8 -0
- package/dist/components/Toast/internal/french-toast/components/ToastBar.svelte +169 -0
- package/dist/components/Toast/internal/french-toast/components/ToastBar.svelte.d.ts +20 -0
- package/dist/components/Toast/internal/french-toast/components/ToastIcon.svelte +81 -0
- package/dist/components/Toast/internal/french-toast/components/ToastIcon.svelte.d.ts +7 -0
- package/dist/components/Toast/internal/french-toast/components/ToastMessage.svelte +13 -0
- package/dist/components/Toast/internal/french-toast/components/ToastMessage.svelte.d.ts +8 -0
- package/dist/components/Toast/internal/french-toast/components/ToastWrapper.svelte +57 -0
- package/dist/components/Toast/internal/french-toast/components/ToastWrapper.svelte.d.ts +12 -0
- package/dist/components/Toast/internal/french-toast/components/Toaster.svelte +73 -0
- package/dist/components/Toast/internal/french-toast/components/Toaster.svelte.d.ts +23 -0
- package/dist/components/Toast/internal/french-toast/core/store.svelte.d.ts +15 -0
- package/dist/components/Toast/internal/french-toast/core/store.svelte.js +92 -0
- package/dist/components/Toast/internal/french-toast/core/toast.d.ts +21 -0
- package/dist/components/Toast/internal/french-toast/core/toast.js +67 -0
- package/dist/components/Toast/internal/french-toast/core/types.d.ts +58 -0
- package/dist/components/Toast/internal/french-toast/core/types.js +4 -0
- package/dist/components/Toast/internal/french-toast/core/use-toaster.svelte.d.ts +16 -0
- package/dist/components/Toast/internal/french-toast/core/use-toaster.svelte.js +71 -0
- package/dist/components/Toast/internal/french-toast/core/utils.d.ts +6 -0
- package/dist/components/Toast/internal/french-toast/core/utils.js +25 -0
- package/dist/components/Toast/internal/french-toast/toast-context.d.ts +18 -0
- package/dist/components/Toast/internal/french-toast/toast-context.js +10 -0
- package/dist/components/Toast/internal/notify.d.ts +31 -0
- package/dist/components/Toast/internal/notify.js +100 -0
- package/dist/components/Toast/internal/toast-icons/ToastError.svelte +8 -0
- package/dist/components/Toast/internal/toast-icons/ToastError.svelte.d.ts +4 -0
- package/dist/components/Toast/internal/toast-icons/ToastInfo.svelte +8 -0
- package/dist/components/Toast/internal/toast-icons/ToastInfo.svelte.d.ts +4 -0
- package/dist/components/Toast/internal/toast-icons/ToastLoading.svelte +8 -0
- package/dist/components/Toast/internal/toast-icons/ToastLoading.svelte.d.ts +4 -0
- package/dist/components/Toast/internal/toast-icons/ToastProcessing.svelte +8 -0
- package/dist/components/Toast/internal/toast-icons/ToastProcessing.svelte.d.ts +4 -0
- package/dist/components/Toast/internal/toast-icons/ToastSuccess.svelte +8 -0
- package/dist/components/Toast/internal/toast-icons/ToastSuccess.svelte.d.ts +4 -0
- package/dist/components/Toast/internal/toast-icons/ToastWarning.svelte +8 -0
- package/dist/components/Toast/internal/toast-icons/ToastWarning.svelte.d.ts +4 -0
- package/dist/components/Toast/internal/toast-icons/index.d.ts +6 -0
- package/dist/components/Toast/internal/toast-icons/index.js +6 -0
- package/dist/components/Toast/internal/toast-icons/toast-icon.types.d.ts +4 -0
- package/dist/components/Toast/internal/toast-icons/toast-icon.types.js +1 -0
- package/dist/components/Toast/toast.d.ts +31 -16
- package/dist/components/Toast/toast.js +45 -20
- package/dist/components/Toast/toast.types.d.ts +20 -7
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/internal/DragDropProviderScope.svelte +29 -0
- package/dist/hooks/internal/DragDropProviderScope.svelte.d.ts +7 -0
- package/dist/hooks/internal/SortableProvider.svelte +30 -0
- package/dist/hooks/internal/SortableProvider.svelte.d.ts +7 -0
- package/dist/hooks/internal/drag-drop-context.d.ts +12 -0
- package/dist/hooks/internal/drag-drop-context.js +1 -0
- package/dist/hooks/internal/sortable-context.d.ts +12 -0
- package/dist/hooks/internal/sortable-context.js +1 -0
- package/dist/hooks/useDragDrop/index.d.ts +1 -0
- package/dist/hooks/useDragDrop/index.js +1 -0
- package/dist/hooks/useDragDrop/useDragDrop.svelte.d.ts +40 -0
- package/dist/hooks/useDragDrop/useDragDrop.svelte.js +128 -0
- package/dist/hooks/useSortable/index.d.ts +2 -0
- package/dist/hooks/useSortable/index.js +2 -0
- package/dist/hooks/useSortable/sortable-utils.d.ts +1 -0
- package/dist/hooks/useSortable/sortable-utils.js +13 -0
- package/dist/hooks/useSortable/useSortable.svelte.d.ts +52 -0
- package/dist/hooks/useSortable/useSortable.svelte.js +120 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/mcp/svelora-docs.data.json +14 -6
- package/package.json +5 -3
|
@@ -1,65 +1,97 @@
|
|
|
1
1
|
<script lang="ts" module>export {};
|
|
2
2
|
</script>
|
|
3
3
|
|
|
4
|
-
<script lang="ts"
|
|
5
|
-
import { Toaster as SonnerToaster } from "svelte-sonner";
|
|
4
|
+
<script lang="ts">import InternalToaster from "./internal/french-toast/components/Toaster.svelte";
|
|
6
5
|
import { getComponentConfig } from "../../config.js";
|
|
7
6
|
import { toastDefaults } from "./toast.variants.js";
|
|
8
7
|
const config = getComponentConfig("toast", toastDefaults);
|
|
9
|
-
let { variant = config.defaultVariants.variant, position = "bottom-right", visibleToasts = 3, duration = 5e3, closeButton = true, expand = false, gap = 14, class: className,
|
|
8
|
+
let { variant = config.defaultVariants.variant, position = "bottom-right", visibleToasts: _visibleToasts = 3, duration = 5e3, closeButton = true, expand: _expand = false, gap = 14, class: className, theme = "light", reverseOrder = false, toastOptions, successIcon, errorIcon, warningIcon, infoIcon, loadingIcon, closeIcon } = $props();
|
|
10
9
|
const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean).join(" "));
|
|
10
|
+
const mergedToastOptions = $derived({
|
|
11
|
+
duration,
|
|
12
|
+
...toastOptions
|
|
13
|
+
});
|
|
11
14
|
</script>
|
|
12
15
|
|
|
13
|
-
<
|
|
16
|
+
<InternalToaster
|
|
14
17
|
{position}
|
|
15
|
-
{visibleToasts}
|
|
16
|
-
{duration}
|
|
17
18
|
{closeButton}
|
|
18
|
-
{
|
|
19
|
-
{
|
|
20
|
-
|
|
21
|
-
{
|
|
19
|
+
gutter={gap}
|
|
20
|
+
{theme}
|
|
21
|
+
{reverseOrder}
|
|
22
|
+
containerClassName={toasterClass}
|
|
23
|
+
toastOptions={mergedToastOptions}
|
|
24
|
+
iconTone={variant === 'solid' ? 'on-color' : 'standard'}
|
|
25
|
+
{successIcon}
|
|
26
|
+
{errorIcon}
|
|
27
|
+
{warningIcon}
|
|
28
|
+
{infoIcon}
|
|
29
|
+
{loadingIcon}
|
|
30
|
+
{closeIcon}
|
|
22
31
|
/>
|
|
23
32
|
|
|
24
33
|
<style>
|
|
25
34
|
/* ============================================
|
|
26
35
|
* BASE OVERRIDES — applied to all variants
|
|
27
36
|
*
|
|
28
|
-
* Selector: [data-
|
|
29
|
-
*
|
|
37
|
+
* Selector: [data-svelora-toaster] with our variant class.
|
|
38
|
+
* Toaster renders via portal, so we use :global() selectors
|
|
30
39
|
* scoped by our variant class on the toaster <ol> element.
|
|
31
40
|
* ============================================ */
|
|
32
41
|
|
|
33
|
-
:global([data-
|
|
42
|
+
:global([data-svelora-toaster][class*='ps-toast-'] [data-svelora-toast][data-styled='true']) {
|
|
34
43
|
font-family: inherit;
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
gap: 0.75rem;
|
|
47
|
+
width: 100%;
|
|
48
|
+
min-width: min(100%, 18.5rem);
|
|
49
|
+
max-width: 24rem;
|
|
50
|
+
padding: 0.75rem 2.5rem 0.75rem 0.875rem;
|
|
35
51
|
border-radius: 0.75rem;
|
|
36
52
|
box-shadow:
|
|
37
|
-
0
|
|
38
|
-
0
|
|
53
|
+
0 1px 3px oklch(0 0 0 / 0.08),
|
|
54
|
+
0 1px 2px oklch(0 0 0 / 0.05);
|
|
39
55
|
}
|
|
40
56
|
|
|
41
57
|
:global(
|
|
42
|
-
[data-
|
|
43
|
-
[data-
|
|
58
|
+
[data-svelora-toaster][class*='ps-toast-']
|
|
59
|
+
[data-svelora-toast][data-styled='true']
|
|
44
60
|
[data-content]
|
|
45
61
|
) {
|
|
46
|
-
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
gap: 0.125rem;
|
|
65
|
+
flex: 1 1 auto;
|
|
66
|
+
min-width: 0;
|
|
47
67
|
}
|
|
48
68
|
|
|
49
69
|
:global(
|
|
50
|
-
[data-
|
|
51
|
-
[data-
|
|
70
|
+
[data-svelora-toaster][class*='ps-toast-']
|
|
71
|
+
[data-svelora-toast][data-styled='true']
|
|
72
|
+
[data-icon]
|
|
73
|
+
) {
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-shrink: 0;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
width: 1.5rem;
|
|
79
|
+
height: 1.5rem;
|
|
80
|
+
margin: 0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
:global(
|
|
84
|
+
[data-svelora-toaster][class*='ps-toast-']
|
|
85
|
+
[data-svelora-toast][data-styled='true']
|
|
52
86
|
[data-icon]:has([data-avatar-root])
|
|
53
87
|
) {
|
|
54
88
|
width: auto;
|
|
55
89
|
height: auto;
|
|
56
|
-
margin: 0;
|
|
57
|
-
margin-right: 4px;
|
|
58
90
|
}
|
|
59
91
|
|
|
60
92
|
:global(
|
|
61
|
-
[data-
|
|
62
|
-
[data-
|
|
93
|
+
[data-svelora-toaster][class*='ps-toast-']
|
|
94
|
+
[data-svelora-toast][data-styled='true']
|
|
63
95
|
[data-title]
|
|
64
96
|
) {
|
|
65
97
|
font-weight: 600;
|
|
@@ -68,18 +100,18 @@ const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean)
|
|
|
68
100
|
}
|
|
69
101
|
|
|
70
102
|
:global(
|
|
71
|
-
[data-
|
|
72
|
-
[data-
|
|
103
|
+
[data-svelora-toaster][class*='ps-toast-']
|
|
104
|
+
[data-svelora-toast][data-styled='true']
|
|
73
105
|
[data-description]
|
|
74
106
|
) {
|
|
75
107
|
font-size: 0.8125rem;
|
|
76
108
|
line-height: 1.25rem;
|
|
77
|
-
|
|
109
|
+
font-weight: 400;
|
|
78
110
|
}
|
|
79
111
|
|
|
80
112
|
:global(
|
|
81
|
-
[data-
|
|
82
|
-
[data-
|
|
113
|
+
[data-svelora-toaster][class*='ps-toast-']
|
|
114
|
+
[data-svelora-toast][data-styled='true']
|
|
83
115
|
[data-button]
|
|
84
116
|
) {
|
|
85
117
|
font-weight: 600;
|
|
@@ -90,11 +122,24 @@ const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean)
|
|
|
90
122
|
}
|
|
91
123
|
|
|
92
124
|
:global(
|
|
93
|
-
[data-
|
|
94
|
-
[data-
|
|
125
|
+
[data-svelora-toaster][class*='ps-toast-']
|
|
126
|
+
[data-svelora-toast][data-styled='true']
|
|
95
127
|
[data-close-button]
|
|
96
128
|
) {
|
|
129
|
+
position: absolute;
|
|
130
|
+
top: 0.625rem;
|
|
131
|
+
right: 0.625rem;
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
justify-content: center;
|
|
135
|
+
width: 1.375rem;
|
|
136
|
+
height: 1.375rem;
|
|
137
|
+
padding: 0;
|
|
97
138
|
border-radius: 50%;
|
|
139
|
+
border: 1px solid transparent;
|
|
140
|
+
cursor: pointer;
|
|
141
|
+
line-height: 1;
|
|
142
|
+
font-size: 0.875rem;
|
|
98
143
|
transition:
|
|
99
144
|
opacity 150ms,
|
|
100
145
|
background-color 150ms,
|
|
@@ -102,8 +147,8 @@ const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean)
|
|
|
102
147
|
}
|
|
103
148
|
|
|
104
149
|
:global(
|
|
105
|
-
[data-
|
|
106
|
-
[data-
|
|
150
|
+
[data-svelora-toaster][class*='ps-toast-']
|
|
151
|
+
[data-svelora-toast][data-styled='true']
|
|
107
152
|
[data-close-button]:hover
|
|
108
153
|
) {
|
|
109
154
|
opacity: 1;
|
|
@@ -111,45 +156,41 @@ const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean)
|
|
|
111
156
|
|
|
112
157
|
/* ============================================
|
|
113
158
|
* SHARED — CSS custom properties per toast type
|
|
114
|
-
*
|
|
115
|
-
* Each variant sets --toast-bg, --toast-border, --toast-color,
|
|
116
|
-
* --toast-desc, --toast-close-bg, --toast-close-border per type.
|
|
117
|
-
* The shared rules below consume them.
|
|
118
159
|
* ============================================ */
|
|
119
160
|
|
|
120
|
-
:global([data-
|
|
161
|
+
:global([data-svelora-toaster][class*='ps-toast-'] [data-svelora-toast][data-styled='true']) {
|
|
121
162
|
background-color: var(--toast-bg);
|
|
122
163
|
border: 1px solid var(--toast-border);
|
|
123
164
|
color: var(--toast-color);
|
|
124
165
|
}
|
|
125
166
|
|
|
126
167
|
:global(
|
|
127
|
-
[data-
|
|
128
|
-
[data-
|
|
168
|
+
[data-svelora-toaster][class*='ps-toast-']
|
|
169
|
+
[data-svelora-toast][data-styled='true']
|
|
129
170
|
[data-description]
|
|
130
171
|
) {
|
|
131
172
|
color: var(--toast-desc);
|
|
132
173
|
}
|
|
133
174
|
|
|
134
175
|
:global(
|
|
135
|
-
[data-
|
|
136
|
-
[data-
|
|
176
|
+
[data-svelora-toaster][class*='ps-toast-']
|
|
177
|
+
[data-svelora-toast][data-styled='true']
|
|
137
178
|
[data-icon]
|
|
138
179
|
) {
|
|
139
180
|
color: var(--toast-icon, inherit);
|
|
140
181
|
}
|
|
141
182
|
|
|
142
183
|
:global(
|
|
143
|
-
[data-
|
|
144
|
-
[data-
|
|
184
|
+
[data-svelora-toaster][class*='ps-toast-']
|
|
185
|
+
[data-svelora-toast][data-styled='true']
|
|
145
186
|
[data-title]
|
|
146
187
|
) {
|
|
147
188
|
color: var(--toast-title, inherit);
|
|
148
189
|
}
|
|
149
190
|
|
|
150
191
|
:global(
|
|
151
|
-
[data-
|
|
152
|
-
[data-
|
|
192
|
+
[data-svelora-toaster][class*='ps-toast-']
|
|
193
|
+
[data-svelora-toast][data-styled='true']
|
|
153
194
|
[data-button]
|
|
154
195
|
) {
|
|
155
196
|
background-color: var(--toast-action-bg);
|
|
@@ -157,8 +198,8 @@ const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean)
|
|
|
157
198
|
}
|
|
158
199
|
|
|
159
200
|
:global(
|
|
160
|
-
[data-
|
|
161
|
-
[data-
|
|
201
|
+
[data-svelora-toaster][class*='ps-toast-']
|
|
202
|
+
[data-svelora-toast][data-styled='true']
|
|
162
203
|
[data-cancel]
|
|
163
204
|
) {
|
|
164
205
|
background-color: var(--toast-cancel-bg);
|
|
@@ -166,8 +207,8 @@ const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean)
|
|
|
166
207
|
}
|
|
167
208
|
|
|
168
209
|
:global(
|
|
169
|
-
[data-
|
|
170
|
-
[data-
|
|
210
|
+
[data-svelora-toaster][class*='ps-toast-']
|
|
211
|
+
[data-svelora-toast][data-styled='true']
|
|
171
212
|
[data-close-button]
|
|
172
213
|
) {
|
|
173
214
|
background-color: var(--toast-close-bg);
|
|
@@ -176,73 +217,81 @@ const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean)
|
|
|
176
217
|
}
|
|
177
218
|
|
|
178
219
|
:global(
|
|
179
|
-
[data-
|
|
180
|
-
[data-
|
|
220
|
+
[data-svelora-toaster][class*='ps-toast-']
|
|
221
|
+
[data-svelora-toast][data-styled='true']:hover
|
|
181
222
|
[data-close-button]:hover
|
|
182
223
|
) {
|
|
183
224
|
background-color: var(--toast-close-hover-bg);
|
|
184
225
|
}
|
|
185
226
|
|
|
186
227
|
/* ============================================
|
|
187
|
-
* OUTLINE VARIANT
|
|
228
|
+
* OUTLINE VARIANT
|
|
188
229
|
* ============================================ */
|
|
189
|
-
:global([data-
|
|
190
|
-
--toast-bg: var(--color-surface-container);
|
|
230
|
+
:global([data-svelora-toaster].ps-toast-outline [data-svelora-toast][data-styled='true']) {
|
|
231
|
+
--toast-bg: var(--color-surface-container-lowest);
|
|
191
232
|
--toast-border: var(--color-outline-variant);
|
|
192
233
|
--toast-color: var(--color-on-surface);
|
|
193
234
|
--toast-desc: var(--color-on-surface-variant);
|
|
194
|
-
--toast-icon:
|
|
195
|
-
--toast-title:
|
|
235
|
+
--toast-icon: var(--color-on-surface-variant);
|
|
236
|
+
--toast-title: var(--color-on-surface);
|
|
196
237
|
--toast-action-bg: var(--color-primary);
|
|
197
238
|
--toast-action-color: var(--color-on-primary);
|
|
198
239
|
--toast-cancel-bg: var(--color-surface-container-highest);
|
|
199
240
|
--toast-cancel-color: var(--color-on-surface);
|
|
200
|
-
--toast-close-bg: var(--color-surface-container);
|
|
201
|
-
--toast-close-border:
|
|
241
|
+
--toast-close-bg: var(--color-surface-container-highest);
|
|
242
|
+
--toast-close-border: transparent;
|
|
202
243
|
--toast-close-color: var(--color-on-surface-variant);
|
|
203
|
-
--toast-close-hover-bg: var(--color-surface-container-
|
|
244
|
+
--toast-close-hover-bg: var(--color-surface-container-high);
|
|
204
245
|
}
|
|
205
246
|
|
|
206
247
|
:global(
|
|
207
|
-
[data-
|
|
208
|
-
[data-
|
|
248
|
+
[data-svelora-toaster].ps-toast-outline
|
|
249
|
+
[data-svelora-toast][data-type='success'][data-styled='true']
|
|
209
250
|
) {
|
|
210
|
-
--toast-
|
|
251
|
+
--toast-bg: oklch(from var(--color-success) l c h / 0.07);
|
|
252
|
+
--toast-border: oklch(from var(--color-success) l c h / 0.55);
|
|
211
253
|
--toast-icon: var(--color-success);
|
|
212
254
|
--toast-title: var(--color-success);
|
|
255
|
+
--toast-desc: var(--color-on-surface-variant);
|
|
213
256
|
}
|
|
214
257
|
|
|
215
258
|
:global(
|
|
216
|
-
[data-
|
|
217
|
-
[data-
|
|
259
|
+
[data-svelora-toaster].ps-toast-outline
|
|
260
|
+
[data-svelora-toast][data-type='error'][data-styled='true']
|
|
218
261
|
) {
|
|
219
|
-
--toast-
|
|
262
|
+
--toast-bg: oklch(from var(--color-error) l c h / 0.07);
|
|
263
|
+
--toast-border: oklch(from var(--color-error) l c h / 0.55);
|
|
220
264
|
--toast-icon: var(--color-error);
|
|
221
265
|
--toast-title: var(--color-error);
|
|
266
|
+
--toast-desc: var(--color-on-surface-variant);
|
|
222
267
|
}
|
|
223
268
|
|
|
224
269
|
:global(
|
|
225
|
-
[data-
|
|
226
|
-
[data-
|
|
270
|
+
[data-svelora-toaster].ps-toast-outline
|
|
271
|
+
[data-svelora-toast][data-type='warning'][data-styled='true']
|
|
227
272
|
) {
|
|
228
|
-
--toast-
|
|
273
|
+
--toast-bg: oklch(from var(--color-warning) l c h / 0.07);
|
|
274
|
+
--toast-border: oklch(from var(--color-warning) l c h / 0.55);
|
|
229
275
|
--toast-icon: var(--color-warning);
|
|
230
276
|
--toast-title: var(--color-warning);
|
|
277
|
+
--toast-desc: var(--color-on-surface-variant);
|
|
231
278
|
}
|
|
232
279
|
|
|
233
280
|
:global(
|
|
234
|
-
[data-
|
|
235
|
-
[data-
|
|
281
|
+
[data-svelora-toaster].ps-toast-outline
|
|
282
|
+
[data-svelora-toast][data-type='info'][data-styled='true']
|
|
236
283
|
) {
|
|
237
|
-
--toast-
|
|
284
|
+
--toast-bg: oklch(from var(--color-info) l c h / 0.07);
|
|
285
|
+
--toast-border: oklch(from var(--color-info) l c h / 0.55);
|
|
238
286
|
--toast-icon: var(--color-info);
|
|
239
287
|
--toast-title: var(--color-info);
|
|
288
|
+
--toast-desc: var(--color-on-surface-variant);
|
|
240
289
|
}
|
|
241
290
|
|
|
242
291
|
/* ============================================
|
|
243
|
-
* SOFT VARIANT
|
|
292
|
+
* SOFT VARIANT
|
|
244
293
|
* ============================================ */
|
|
245
|
-
:global([data-
|
|
294
|
+
:global([data-svelora-toaster].ps-toast-soft [data-svelora-toast][data-styled='true']) {
|
|
246
295
|
--toast-bg: var(--color-surface-container-high);
|
|
247
296
|
--toast-border: transparent;
|
|
248
297
|
--toast-color: var(--color-on-surface);
|
|
@@ -260,8 +309,8 @@ const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean)
|
|
|
260
309
|
}
|
|
261
310
|
|
|
262
311
|
:global(
|
|
263
|
-
[data-
|
|
264
|
-
[data-
|
|
312
|
+
[data-svelora-toaster].ps-toast-soft
|
|
313
|
+
[data-svelora-toast][data-type='success'][data-styled='true']
|
|
265
314
|
) {
|
|
266
315
|
--toast-bg: oklch(from var(--color-success) l c h / 0.1);
|
|
267
316
|
--toast-color: var(--color-success);
|
|
@@ -271,8 +320,8 @@ const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean)
|
|
|
271
320
|
}
|
|
272
321
|
|
|
273
322
|
:global(
|
|
274
|
-
[data-
|
|
275
|
-
[data-
|
|
323
|
+
[data-svelora-toaster].ps-toast-soft
|
|
324
|
+
[data-svelora-toast][data-type='error'][data-styled='true']
|
|
276
325
|
) {
|
|
277
326
|
--toast-bg: oklch(from var(--color-error) l c h / 0.1);
|
|
278
327
|
--toast-color: var(--color-error);
|
|
@@ -282,8 +331,8 @@ const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean)
|
|
|
282
331
|
}
|
|
283
332
|
|
|
284
333
|
:global(
|
|
285
|
-
[data-
|
|
286
|
-
[data-
|
|
334
|
+
[data-svelora-toaster].ps-toast-soft
|
|
335
|
+
[data-svelora-toast][data-type='warning'][data-styled='true']
|
|
287
336
|
) {
|
|
288
337
|
--toast-bg: oklch(from var(--color-warning) l c h / 0.1);
|
|
289
338
|
--toast-color: var(--color-warning);
|
|
@@ -293,8 +342,8 @@ const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean)
|
|
|
293
342
|
}
|
|
294
343
|
|
|
295
344
|
:global(
|
|
296
|
-
[data-
|
|
297
|
-
[data-
|
|
345
|
+
[data-svelora-toaster].ps-toast-soft
|
|
346
|
+
[data-svelora-toast][data-type='info'][data-styled='true']
|
|
298
347
|
) {
|
|
299
348
|
--toast-bg: oklch(from var(--color-info) l c h / 0.1);
|
|
300
349
|
--toast-color: var(--color-info);
|
|
@@ -304,9 +353,9 @@ const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean)
|
|
|
304
353
|
}
|
|
305
354
|
|
|
306
355
|
/* ============================================
|
|
307
|
-
* SUBTLE VARIANT
|
|
356
|
+
* SUBTLE VARIANT
|
|
308
357
|
* ============================================ */
|
|
309
|
-
:global([data-
|
|
358
|
+
:global([data-svelora-toaster].ps-toast-subtle [data-svelora-toast][data-styled='true']) {
|
|
310
359
|
--toast-bg: var(--color-surface-container-high);
|
|
311
360
|
--toast-border: var(--color-outline-variant);
|
|
312
361
|
--toast-color: var(--color-on-surface);
|
|
@@ -324,8 +373,8 @@ const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean)
|
|
|
324
373
|
}
|
|
325
374
|
|
|
326
375
|
:global(
|
|
327
|
-
[data-
|
|
328
|
-
[data-
|
|
376
|
+
[data-svelora-toaster].ps-toast-subtle
|
|
377
|
+
[data-svelora-toast][data-type='success'][data-styled='true']
|
|
329
378
|
) {
|
|
330
379
|
--toast-bg: oklch(from var(--color-success) l c h / 0.1);
|
|
331
380
|
--toast-border: oklch(from var(--color-success) l c h / 0.3);
|
|
@@ -337,8 +386,8 @@ const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean)
|
|
|
337
386
|
}
|
|
338
387
|
|
|
339
388
|
:global(
|
|
340
|
-
[data-
|
|
341
|
-
[data-
|
|
389
|
+
[data-svelora-toaster].ps-toast-subtle
|
|
390
|
+
[data-svelora-toast][data-type='error'][data-styled='true']
|
|
342
391
|
) {
|
|
343
392
|
--toast-bg: oklch(from var(--color-error) l c h / 0.1);
|
|
344
393
|
--toast-border: oklch(from var(--color-error) l c h / 0.3);
|
|
@@ -350,8 +399,8 @@ const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean)
|
|
|
350
399
|
}
|
|
351
400
|
|
|
352
401
|
:global(
|
|
353
|
-
[data-
|
|
354
|
-
[data-
|
|
402
|
+
[data-svelora-toaster].ps-toast-subtle
|
|
403
|
+
[data-svelora-toast][data-type='warning'][data-styled='true']
|
|
355
404
|
) {
|
|
356
405
|
--toast-bg: oklch(from var(--color-warning) l c h / 0.1);
|
|
357
406
|
--toast-border: oklch(from var(--color-warning) l c h / 0.3);
|
|
@@ -363,8 +412,8 @@ const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean)
|
|
|
363
412
|
}
|
|
364
413
|
|
|
365
414
|
:global(
|
|
366
|
-
[data-
|
|
367
|
-
[data-
|
|
415
|
+
[data-svelora-toaster].ps-toast-subtle
|
|
416
|
+
[data-svelora-toast][data-type='info'][data-styled='true']
|
|
368
417
|
) {
|
|
369
418
|
--toast-bg: oklch(from var(--color-info) l c h / 0.1);
|
|
370
419
|
--toast-border: oklch(from var(--color-info) l c h / 0.3);
|
|
@@ -376,15 +425,15 @@ const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean)
|
|
|
376
425
|
}
|
|
377
426
|
|
|
378
427
|
/* ============================================
|
|
379
|
-
* SOLID VARIANT
|
|
428
|
+
* SOLID VARIANT
|
|
380
429
|
* ============================================ */
|
|
381
|
-
:global([data-
|
|
430
|
+
:global([data-svelora-toaster].ps-toast-solid [data-svelora-toast][data-styled='true']) {
|
|
382
431
|
--toast-bg: var(--color-inverse-surface);
|
|
383
432
|
--toast-border: transparent;
|
|
384
433
|
--toast-color: var(--color-inverse-on-surface);
|
|
385
434
|
--toast-desc: var(--color-inverse-on-surface);
|
|
386
|
-
--toast-icon:
|
|
387
|
-
--toast-title:
|
|
435
|
+
--toast-icon: var(--color-inverse-on-surface);
|
|
436
|
+
--toast-title: var(--color-inverse-on-surface);
|
|
388
437
|
--toast-action-bg: oklch(from var(--color-inverse-on-surface) l c h / 0.2);
|
|
389
438
|
--toast-action-color: var(--color-inverse-on-surface);
|
|
390
439
|
--toast-cancel-bg: oklch(from var(--color-inverse-on-surface) l c h / 0.1);
|
|
@@ -396,53 +445,61 @@ const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean)
|
|
|
396
445
|
}
|
|
397
446
|
|
|
398
447
|
:global(
|
|
399
|
-
[data-
|
|
400
|
-
[data-
|
|
448
|
+
[data-svelora-toaster].ps-toast-solid
|
|
449
|
+
[data-svelora-toast][data-styled='true']
|
|
401
450
|
[data-description]
|
|
402
451
|
) {
|
|
403
452
|
opacity: 0.8;
|
|
404
453
|
}
|
|
405
454
|
|
|
406
455
|
:global(
|
|
407
|
-
[data-
|
|
408
|
-
[data-
|
|
456
|
+
[data-svelora-toaster].ps-toast-solid
|
|
457
|
+
[data-svelora-toast][data-type='success'][data-styled='true']
|
|
409
458
|
) {
|
|
410
459
|
--toast-bg: var(--color-success);
|
|
411
460
|
--toast-color: var(--color-on-success);
|
|
412
461
|
--toast-desc: var(--color-on-success);
|
|
462
|
+
--toast-icon: var(--color-on-success);
|
|
463
|
+
--toast-title: var(--color-on-success);
|
|
413
464
|
--toast-close-bg: var(--color-success);
|
|
414
465
|
--toast-close-color: var(--color-on-success);
|
|
415
466
|
}
|
|
416
467
|
|
|
417
468
|
:global(
|
|
418
|
-
[data-
|
|
419
|
-
[data-
|
|
469
|
+
[data-svelora-toaster].ps-toast-solid
|
|
470
|
+
[data-svelora-toast][data-type='error'][data-styled='true']
|
|
420
471
|
) {
|
|
421
472
|
--toast-bg: var(--color-error);
|
|
422
473
|
--toast-color: var(--color-on-error);
|
|
423
474
|
--toast-desc: var(--color-on-error);
|
|
475
|
+
--toast-icon: var(--color-on-error);
|
|
476
|
+
--toast-title: var(--color-on-error);
|
|
424
477
|
--toast-close-bg: var(--color-error);
|
|
425
478
|
--toast-close-color: var(--color-on-error);
|
|
426
479
|
}
|
|
427
480
|
|
|
428
481
|
:global(
|
|
429
|
-
[data-
|
|
430
|
-
[data-
|
|
482
|
+
[data-svelora-toaster].ps-toast-solid
|
|
483
|
+
[data-svelora-toast][data-type='warning'][data-styled='true']
|
|
431
484
|
) {
|
|
432
485
|
--toast-bg: var(--color-warning);
|
|
433
486
|
--toast-color: var(--color-on-warning);
|
|
434
487
|
--toast-desc: var(--color-on-warning);
|
|
488
|
+
--toast-icon: var(--color-on-warning);
|
|
489
|
+
--toast-title: var(--color-on-warning);
|
|
435
490
|
--toast-close-bg: var(--color-warning);
|
|
436
491
|
--toast-close-color: var(--color-on-warning);
|
|
437
492
|
}
|
|
438
493
|
|
|
439
494
|
:global(
|
|
440
|
-
[data-
|
|
441
|
-
[data-
|
|
495
|
+
[data-svelora-toaster].ps-toast-solid
|
|
496
|
+
[data-svelora-toast][data-type='info'][data-styled='true']
|
|
442
497
|
) {
|
|
443
498
|
--toast-bg: var(--color-info);
|
|
444
499
|
--toast-color: var(--color-on-info);
|
|
445
500
|
--toast-desc: var(--color-on-info);
|
|
501
|
+
--toast-icon: var(--color-on-info);
|
|
502
|
+
--toast-title: var(--color-on-info);
|
|
446
503
|
--toast-close-bg: var(--color-info);
|
|
447
504
|
--toast-close-color: var(--color-on-info);
|
|
448
505
|
}
|
|
@@ -450,7 +507,7 @@ const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean)
|
|
|
450
507
|
/* ============================================
|
|
451
508
|
* ACCENT VARIANT — left border accent strip
|
|
452
509
|
* ============================================ */
|
|
453
|
-
:global([data-
|
|
510
|
+
:global([data-svelora-toaster].ps-toast-accent [data-svelora-toast][data-styled='true']) {
|
|
454
511
|
--toast-bg: var(--color-surface-container);
|
|
455
512
|
--toast-border: var(--color-outline-variant);
|
|
456
513
|
--toast-color: var(--color-on-surface);
|
|
@@ -470,8 +527,8 @@ const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean)
|
|
|
470
527
|
}
|
|
471
528
|
|
|
472
529
|
:global(
|
|
473
|
-
[data-
|
|
474
|
-
[data-
|
|
530
|
+
[data-svelora-toaster].ps-toast-accent
|
|
531
|
+
[data-svelora-toast][data-type='success'][data-styled='true']
|
|
475
532
|
) {
|
|
476
533
|
border-left-color: var(--color-success);
|
|
477
534
|
--toast-icon: var(--color-success);
|
|
@@ -479,8 +536,8 @@ const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean)
|
|
|
479
536
|
}
|
|
480
537
|
|
|
481
538
|
:global(
|
|
482
|
-
[data-
|
|
483
|
-
[data-
|
|
539
|
+
[data-svelora-toaster].ps-toast-accent
|
|
540
|
+
[data-svelora-toast][data-type='error'][data-styled='true']
|
|
484
541
|
) {
|
|
485
542
|
border-left-color: var(--color-error);
|
|
486
543
|
--toast-icon: var(--color-error);
|
|
@@ -488,8 +545,8 @@ const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean)
|
|
|
488
545
|
}
|
|
489
546
|
|
|
490
547
|
:global(
|
|
491
|
-
[data-
|
|
492
|
-
[data-
|
|
548
|
+
[data-svelora-toaster].ps-toast-accent
|
|
549
|
+
[data-svelora-toast][data-type='warning'][data-styled='true']
|
|
493
550
|
) {
|
|
494
551
|
border-left-color: var(--color-warning);
|
|
495
552
|
--toast-icon: var(--color-warning);
|
|
@@ -497,8 +554,8 @@ const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean)
|
|
|
497
554
|
}
|
|
498
555
|
|
|
499
556
|
:global(
|
|
500
|
-
[data-
|
|
501
|
-
[data-
|
|
557
|
+
[data-svelora-toaster].ps-toast-accent
|
|
558
|
+
[data-svelora-toast][data-type='info'][data-styled='true']
|
|
502
559
|
) {
|
|
503
560
|
border-left-color: var(--color-info);
|
|
504
561
|
--toast-icon: var(--color-info);
|
|
@@ -507,55 +564,53 @@ const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean)
|
|
|
507
564
|
|
|
508
565
|
/* ============================================
|
|
509
566
|
* COLOR CLASSES — per-toast color override via class
|
|
510
|
-
*
|
|
511
|
-
* Usage: toast('msg', { class: 'ps-color-primary' })
|
|
512
|
-
* These set --svelora-c (main) and --svelora-c-on (contrast)
|
|
513
|
-
* which are consumed by variant-specific rules below.
|
|
514
567
|
* ============================================ */
|
|
515
568
|
|
|
516
|
-
:global([data-
|
|
569
|
+
:global([data-svelora-toast].ps-color-primary) {
|
|
517
570
|
--svelora-c: var(--color-primary);
|
|
518
571
|
--svelora-c-on: var(--color-on-primary);
|
|
519
572
|
}
|
|
520
|
-
:global([data-
|
|
573
|
+
:global([data-svelora-toast].ps-color-secondary) {
|
|
521
574
|
--svelora-c: var(--color-secondary);
|
|
522
575
|
--svelora-c-on: var(--color-on-secondary);
|
|
523
576
|
}
|
|
524
|
-
:global([data-
|
|
577
|
+
:global([data-svelora-toast].ps-color-tertiary) {
|
|
525
578
|
--svelora-c: var(--color-tertiary);
|
|
526
579
|
--svelora-c-on: var(--color-on-tertiary);
|
|
527
580
|
}
|
|
528
|
-
:global([data-
|
|
581
|
+
:global([data-svelora-toast].ps-color-success) {
|
|
529
582
|
--svelora-c: var(--color-success);
|
|
530
583
|
--svelora-c-on: var(--color-on-success);
|
|
531
584
|
}
|
|
532
|
-
:global([data-
|
|
585
|
+
:global([data-svelora-toast].ps-color-warning) {
|
|
533
586
|
--svelora-c: var(--color-warning);
|
|
534
587
|
--svelora-c-on: var(--color-on-warning);
|
|
535
588
|
}
|
|
536
|
-
:global([data-
|
|
589
|
+
:global([data-svelora-toast].ps-color-error) {
|
|
537
590
|
--svelora-c: var(--color-error);
|
|
538
591
|
--svelora-c-on: var(--color-on-error);
|
|
539
592
|
}
|
|
540
|
-
:global([data-
|
|
593
|
+
:global([data-svelora-toast].ps-color-info) {
|
|
541
594
|
--svelora-c: var(--color-info);
|
|
542
595
|
--svelora-c-on: var(--color-on-info);
|
|
543
596
|
}
|
|
544
597
|
|
|
545
598
|
/* Outline + color class */
|
|
546
599
|
:global(
|
|
547
|
-
[data-
|
|
548
|
-
[data-
|
|
600
|
+
[data-svelora-toaster].ps-toast-outline
|
|
601
|
+
[data-svelora-toast][class*='ps-color-'][data-styled='true']
|
|
549
602
|
) {
|
|
550
|
-
--toast-
|
|
603
|
+
--toast-bg: oklch(from var(--svelora-c) l c h / 0.07);
|
|
604
|
+
--toast-border: oklch(from var(--svelora-c) l c h / 0.55);
|
|
551
605
|
--toast-icon: var(--svelora-c);
|
|
552
606
|
--toast-title: var(--svelora-c);
|
|
607
|
+
--toast-desc: var(--color-on-surface-variant);
|
|
553
608
|
}
|
|
554
609
|
|
|
555
610
|
/* Soft + color class */
|
|
556
611
|
:global(
|
|
557
|
-
[data-
|
|
558
|
-
[data-
|
|
612
|
+
[data-svelora-toaster].ps-toast-soft
|
|
613
|
+
[data-svelora-toast][class*='ps-color-'][data-styled='true']
|
|
559
614
|
) {
|
|
560
615
|
--toast-bg: oklch(from var(--svelora-c) l c h / 0.1);
|
|
561
616
|
--toast-color: var(--svelora-c);
|
|
@@ -566,8 +621,8 @@ const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean)
|
|
|
566
621
|
|
|
567
622
|
/* Subtle + color class */
|
|
568
623
|
:global(
|
|
569
|
-
[data-
|
|
570
|
-
[data-
|
|
624
|
+
[data-svelora-toaster].ps-toast-subtle
|
|
625
|
+
[data-svelora-toast][class*='ps-color-'][data-styled='true']
|
|
571
626
|
) {
|
|
572
627
|
--toast-bg: oklch(from var(--svelora-c) l c h / 0.1);
|
|
573
628
|
--toast-border: oklch(from var(--svelora-c) l c h / 0.3);
|
|
@@ -580,20 +635,22 @@ const toasterClass = $derived([`ps-toast-${variant}`, className].filter(Boolean)
|
|
|
580
635
|
|
|
581
636
|
/* Solid + color class */
|
|
582
637
|
:global(
|
|
583
|
-
[data-
|
|
584
|
-
[data-
|
|
638
|
+
[data-svelora-toaster].ps-toast-solid
|
|
639
|
+
[data-svelora-toast][class*='ps-color-'][data-styled='true']
|
|
585
640
|
) {
|
|
586
641
|
--toast-bg: var(--svelora-c);
|
|
587
642
|
--toast-color: var(--svelora-c-on);
|
|
588
643
|
--toast-desc: var(--svelora-c-on);
|
|
644
|
+
--toast-icon: var(--svelora-c-on);
|
|
645
|
+
--toast-title: var(--svelora-c-on);
|
|
589
646
|
--toast-close-bg: var(--svelora-c);
|
|
590
647
|
--toast-close-color: var(--svelora-c-on);
|
|
591
648
|
}
|
|
592
649
|
|
|
593
650
|
/* Accent + color class */
|
|
594
651
|
:global(
|
|
595
|
-
[data-
|
|
596
|
-
[data-
|
|
652
|
+
[data-svelora-toaster].ps-toast-accent
|
|
653
|
+
[data-svelora-toast][class*='ps-color-'][data-styled='true']
|
|
597
654
|
) {
|
|
598
655
|
border-left-color: var(--svelora-c);
|
|
599
656
|
--toast-icon: var(--svelora-c);
|