@synthaxai/ui 1.0.0

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.
Files changed (185) hide show
  1. package/README.md +262 -0
  2. package/dist/app.css +2 -0
  3. package/dist/app.html +12 -0
  4. package/dist/data-display/DataTable/DataTable.svelte +773 -0
  5. package/dist/data-display/DataTable/DataTable.svelte.d.ts +120 -0
  6. package/dist/data-display/DataTable/DataTable.svelte.d.ts.map +1 -0
  7. package/dist/data-display/DataTable/index.d.ts +2 -0
  8. package/dist/data-display/DataTable/index.d.ts.map +1 -0
  9. package/dist/data-display/DataTable/index.js +1 -0
  10. package/dist/data-display/StatCard/StatCard.svelte +409 -0
  11. package/dist/data-display/StatCard/StatCard.svelte.d.ts +63 -0
  12. package/dist/data-display/StatCard/StatCard.svelte.d.ts.map +1 -0
  13. package/dist/data-display/StatCard/index.d.ts +2 -0
  14. package/dist/data-display/StatCard/index.d.ts.map +1 -0
  15. package/dist/data-display/StatCard/index.js +1 -0
  16. package/dist/data-display/index.d.ts +8 -0
  17. package/dist/data-display/index.d.ts.map +1 -0
  18. package/dist/data-display/index.js +7 -0
  19. package/dist/dialogs/ConfirmDialog/ConfirmDialog.svelte +693 -0
  20. package/dist/dialogs/ConfirmDialog/ConfirmDialog.svelte.d.ts +66 -0
  21. package/dist/dialogs/ConfirmDialog/ConfirmDialog.svelte.d.ts.map +1 -0
  22. package/dist/dialogs/ConfirmDialog/index.d.ts +2 -0
  23. package/dist/dialogs/ConfirmDialog/index.d.ts.map +1 -0
  24. package/dist/dialogs/ConfirmDialog/index.js +1 -0
  25. package/dist/dialogs/Modal/Modal.svelte +441 -0
  26. package/dist/dialogs/Modal/Modal.svelte.d.ts +69 -0
  27. package/dist/dialogs/Modal/Modal.svelte.d.ts.map +1 -0
  28. package/dist/dialogs/Modal/index.d.ts +2 -0
  29. package/dist/dialogs/Modal/index.d.ts.map +1 -0
  30. package/dist/dialogs/Modal/index.js +1 -0
  31. package/dist/dialogs/index.d.ts +8 -0
  32. package/dist/dialogs/index.d.ts.map +1 -0
  33. package/dist/dialogs/index.js +7 -0
  34. package/dist/feedback/Alert/Alert.svelte +565 -0
  35. package/dist/feedback/Alert/Alert.svelte.d.ts +60 -0
  36. package/dist/feedback/Alert/Alert.svelte.d.ts.map +1 -0
  37. package/dist/feedback/Alert/index.d.ts +2 -0
  38. package/dist/feedback/Alert/index.d.ts.map +1 -0
  39. package/dist/feedback/Alert/index.js +1 -0
  40. package/dist/feedback/EmptyState/EmptyState.svelte +377 -0
  41. package/dist/feedback/EmptyState/EmptyState.svelte.d.ts +63 -0
  42. package/dist/feedback/EmptyState/EmptyState.svelte.d.ts.map +1 -0
  43. package/dist/feedback/EmptyState/index.d.ts +2 -0
  44. package/dist/feedback/EmptyState/index.d.ts.map +1 -0
  45. package/dist/feedback/EmptyState/index.js +1 -0
  46. package/dist/feedback/ProgressBar/ProgressBar.svelte +585 -0
  47. package/dist/feedback/ProgressBar/ProgressBar.svelte.d.ts +68 -0
  48. package/dist/feedback/ProgressBar/ProgressBar.svelte.d.ts.map +1 -0
  49. package/dist/feedback/ProgressBar/index.d.ts +2 -0
  50. package/dist/feedback/ProgressBar/index.d.ts.map +1 -0
  51. package/dist/feedback/ProgressBar/index.js +1 -0
  52. package/dist/feedback/Skeleton/Skeleton.svelte +568 -0
  53. package/dist/feedback/Skeleton/Skeleton.svelte.d.ts +54 -0
  54. package/dist/feedback/Skeleton/Skeleton.svelte.d.ts.map +1 -0
  55. package/dist/feedback/Skeleton/index.d.ts +2 -0
  56. package/dist/feedback/Skeleton/index.d.ts.map +1 -0
  57. package/dist/feedback/Skeleton/index.js +1 -0
  58. package/dist/feedback/Spinner/Spinner.svelte +434 -0
  59. package/dist/feedback/Spinner/Spinner.svelte.d.ts +49 -0
  60. package/dist/feedback/Spinner/Spinner.svelte.d.ts.map +1 -0
  61. package/dist/feedback/Spinner/index.d.ts +2 -0
  62. package/dist/feedback/Spinner/index.d.ts.map +1 -0
  63. package/dist/feedback/Spinner/index.js +1 -0
  64. package/dist/feedback/Toast/Toast.svelte +587 -0
  65. package/dist/feedback/Toast/Toast.svelte.d.ts +55 -0
  66. package/dist/feedback/Toast/Toast.svelte.d.ts.map +1 -0
  67. package/dist/feedback/Toast/ToastContainer.svelte +168 -0
  68. package/dist/feedback/Toast/ToastContainer.svelte.d.ts +28 -0
  69. package/dist/feedback/Toast/ToastContainer.svelte.d.ts.map +1 -0
  70. package/dist/feedback/Toast/index.d.ts +4 -0
  71. package/dist/feedback/Toast/index.d.ts.map +1 -0
  72. package/dist/feedback/Toast/index.js +3 -0
  73. package/dist/feedback/Toast/toast-store.d.ts +72 -0
  74. package/dist/feedback/Toast/toast-store.d.ts.map +1 -0
  75. package/dist/feedback/Toast/toast-store.js +157 -0
  76. package/dist/feedback/index.d.ts +13 -0
  77. package/dist/feedback/index.d.ts.map +1 -0
  78. package/dist/feedback/index.js +12 -0
  79. package/dist/forms/Checkbox/Checkbox.svelte +404 -0
  80. package/dist/forms/Checkbox/Checkbox.svelte.d.ts +62 -0
  81. package/dist/forms/Checkbox/Checkbox.svelte.d.ts.map +1 -0
  82. package/dist/forms/Checkbox/index.d.ts +2 -0
  83. package/dist/forms/Checkbox/index.d.ts.map +1 -0
  84. package/dist/forms/Checkbox/index.js +1 -0
  85. package/dist/forms/FormField/FormField.svelte +299 -0
  86. package/dist/forms/FormField/FormField.svelte.d.ts +43 -0
  87. package/dist/forms/FormField/FormField.svelte.d.ts.map +1 -0
  88. package/dist/forms/FormField/index.d.ts +2 -0
  89. package/dist/forms/FormField/index.d.ts.map +1 -0
  90. package/dist/forms/FormField/index.js +1 -0
  91. package/dist/forms/RadioGroup/RadioGroup.svelte +418 -0
  92. package/dist/forms/RadioGroup/RadioGroup.svelte.d.ts +70 -0
  93. package/dist/forms/RadioGroup/RadioGroup.svelte.d.ts.map +1 -0
  94. package/dist/forms/RadioGroup/index.d.ts +2 -0
  95. package/dist/forms/RadioGroup/index.d.ts.map +1 -0
  96. package/dist/forms/RadioGroup/index.js +1 -0
  97. package/dist/forms/Select/Select.svelte +548 -0
  98. package/dist/forms/Select/Select.svelte.d.ts +74 -0
  99. package/dist/forms/Select/Select.svelte.d.ts.map +1 -0
  100. package/dist/forms/Select/index.d.ts +2 -0
  101. package/dist/forms/Select/index.d.ts.map +1 -0
  102. package/dist/forms/Select/index.js +1 -0
  103. package/dist/forms/TextInput/TextInput.svelte +628 -0
  104. package/dist/forms/TextInput/TextInput.svelte.d.ts +97 -0
  105. package/dist/forms/TextInput/TextInput.svelte.d.ts.map +1 -0
  106. package/dist/forms/TextInput/index.d.ts +2 -0
  107. package/dist/forms/TextInput/index.d.ts.map +1 -0
  108. package/dist/forms/TextInput/index.js +1 -0
  109. package/dist/forms/Textarea/Textarea.svelte +587 -0
  110. package/dist/forms/Textarea/Textarea.svelte.d.ts +71 -0
  111. package/dist/forms/Textarea/Textarea.svelte.d.ts.map +1 -0
  112. package/dist/forms/Textarea/index.d.ts +2 -0
  113. package/dist/forms/Textarea/index.d.ts.map +1 -0
  114. package/dist/forms/Textarea/index.js +1 -0
  115. package/dist/forms/index.d.ts +13 -0
  116. package/dist/forms/index.d.ts.map +1 -0
  117. package/dist/forms/index.js +12 -0
  118. package/dist/index.d.ts +37 -0
  119. package/dist/index.d.ts.map +1 -0
  120. package/dist/index.js +65 -0
  121. package/dist/layout/Card/Card.svelte +316 -0
  122. package/dist/layout/Card/Card.svelte.d.ts +63 -0
  123. package/dist/layout/Card/Card.svelte.d.ts.map +1 -0
  124. package/dist/layout/Card/index.d.ts +2 -0
  125. package/dist/layout/Card/index.d.ts.map +1 -0
  126. package/dist/layout/Card/index.js +1 -0
  127. package/dist/layout/Container/Container.svelte +252 -0
  128. package/dist/layout/Container/Container.svelte.d.ts +50 -0
  129. package/dist/layout/Container/Container.svelte.d.ts.map +1 -0
  130. package/dist/layout/Container/index.d.ts +2 -0
  131. package/dist/layout/Container/index.d.ts.map +1 -0
  132. package/dist/layout/Container/index.js +1 -0
  133. package/dist/layout/index.d.ts +8 -0
  134. package/dist/layout/index.d.ts.map +1 -0
  135. package/dist/layout/index.js +7 -0
  136. package/dist/navigation/StepIndicator/StepIndicator.svelte +601 -0
  137. package/dist/navigation/StepIndicator/StepIndicator.svelte.d.ts +70 -0
  138. package/dist/navigation/StepIndicator/StepIndicator.svelte.d.ts.map +1 -0
  139. package/dist/navigation/StepIndicator/index.d.ts +2 -0
  140. package/dist/navigation/StepIndicator/index.d.ts.map +1 -0
  141. package/dist/navigation/StepIndicator/index.js +1 -0
  142. package/dist/navigation/index.d.ts +7 -0
  143. package/dist/navigation/index.d.ts.map +1 -0
  144. package/dist/navigation/index.js +6 -0
  145. package/dist/primitives/Badge/Badge.svelte +365 -0
  146. package/dist/primitives/Badge/Badge.svelte.d.ts +39 -0
  147. package/dist/primitives/Badge/Badge.svelte.d.ts.map +1 -0
  148. package/dist/primitives/Badge/index.d.ts +2 -0
  149. package/dist/primitives/Badge/index.d.ts.map +1 -0
  150. package/dist/primitives/Badge/index.js +1 -0
  151. package/dist/primitives/Button/Button.svelte +430 -0
  152. package/dist/primitives/Button/Button.svelte.d.ts +50 -0
  153. package/dist/primitives/Button/Button.svelte.d.ts.map +1 -0
  154. package/dist/primitives/Button/index.d.ts +2 -0
  155. package/dist/primitives/Button/index.d.ts.map +1 -0
  156. package/dist/primitives/Button/index.js +1 -0
  157. package/dist/primitives/index.d.ts +9 -0
  158. package/dist/primitives/index.d.ts.map +1 -0
  159. package/dist/primitives/index.js +8 -0
  160. package/dist/routes/+layout.svelte +12 -0
  161. package/dist/routes/+layout.svelte.d.ts +12 -0
  162. package/dist/routes/+layout.svelte.d.ts.map +1 -0
  163. package/dist/routes/+page.svelte +53 -0
  164. package/dist/routes/+page.svelte.d.ts +27 -0
  165. package/dist/routes/+page.svelte.d.ts.map +1 -0
  166. package/dist/styles/tokens.css +399 -0
  167. package/dist/types/index.d.ts +175 -0
  168. package/dist/types/index.d.ts.map +1 -0
  169. package/dist/types/index.js +7 -0
  170. package/dist/utils/accessibility.d.ts +103 -0
  171. package/dist/utils/accessibility.d.ts.map +1 -0
  172. package/dist/utils/accessibility.js +202 -0
  173. package/dist/utils/cn.d.ts +71 -0
  174. package/dist/utils/cn.d.ts.map +1 -0
  175. package/dist/utils/cn.js +61 -0
  176. package/dist/utils/form-styles.d.ts +76 -0
  177. package/dist/utils/form-styles.d.ts.map +1 -0
  178. package/dist/utils/form-styles.js +95 -0
  179. package/dist/utils/index.d.ts +10 -0
  180. package/dist/utils/index.d.ts.map +1 -0
  181. package/dist/utils/index.js +13 -0
  182. package/dist/utils/keyboard.d.ts +94 -0
  183. package/dist/utils/keyboard.d.ts.map +1 -0
  184. package/dist/utils/keyboard.js +179 -0
  185. package/package.json +119 -0
@@ -0,0 +1,587 @@
1
+ <!--
2
+ @component Toast
3
+
4
+ A beautiful toast notification component for displaying temporary messages.
5
+ Features glass morphism design, action buttons, progress indicator, and
6
+ comprehensive accessibility support for healthcare applications.
7
+
8
+ @example
9
+ <Toast
10
+ type="success"
11
+ message="Patient record saved successfully"
12
+ />
13
+
14
+ @example
15
+ <Toast
16
+ type="error"
17
+ title="Save Failed"
18
+ message="Unable to save patient record"
19
+ requestId="REQ-12345"
20
+ showProgress
21
+ duration={6000}
22
+ />
23
+ -->
24
+ <script lang="ts">
25
+ import type { Snippet } from 'svelte';
26
+ import { X, CheckCircle2, AlertCircle, AlertTriangle, Info, Bell } from 'lucide-svelte';
27
+ import type { Status } from '../../types/index.js';
28
+
29
+ type ToastPosition = 'top-right' | 'top-left' | 'top-center' | 'bottom-right' | 'bottom-left' | 'bottom-center';
30
+
31
+ interface Props {
32
+ /** Toast message */
33
+ message: string;
34
+ /** Toast type/status */
35
+ type?: Status | 'clinical';
36
+ /** Optional title */
37
+ title?: string;
38
+ /** Whether the toast can be dismissed */
39
+ dismissible?: boolean;
40
+ /** Show progress bar for auto-dismiss countdown */
41
+ showProgress?: boolean;
42
+ /** Duration in ms (0 = no auto-dismiss) */
43
+ duration?: number;
44
+ /** Request ID for error tracking (displayed for errors) */
45
+ requestId?: string;
46
+ /** Action buttons slot */
47
+ actions?: Snippet;
48
+ /** Additional CSS classes */
49
+ class?: string;
50
+ /** Dismiss handler */
51
+ ondismiss?: () => void;
52
+ /** Custom dismiss button aria-label */
53
+ dismissAriaLabel?: string;
54
+ /** Unique ID for the toast */
55
+ id?: string;
56
+ }
57
+
58
+ let {
59
+ message,
60
+ type = 'info',
61
+ title = '',
62
+ dismissible = true,
63
+ showProgress = false,
64
+ duration = 5000,
65
+ requestId = '',
66
+ actions,
67
+ class: className = '',
68
+ ondismiss,
69
+ dismissAriaLabel,
70
+ id
71
+ }: Props = $props();
72
+
73
+ // Generate unique ID (use prop directly, generate fallback once)
74
+ const generatedId = `toast-${Math.random().toString(36).substr(2, 9)}`;
75
+ const toastId = $derived(id || generatedId);
76
+
77
+ // Compute dismiss aria-label
78
+ const closeLabel = $derived(
79
+ dismissAriaLabel || `Dismiss ${title || type} notification`
80
+ );
81
+
82
+ // Determine ARIA attributes based on type
83
+ const ariaRole = $derived(type === 'error' || type === 'warning' || type === 'clinical' ? 'alert' : 'status');
84
+ const ariaLive = $derived(type === 'error' || type === 'clinical' ? 'assertive' : 'polite');
85
+
86
+ function handleDismiss() {
87
+ ondismiss?.();
88
+ }
89
+ </script>
90
+
91
+ <output
92
+ {id}
93
+ class="toast toast-{type} {className}"
94
+ role={ariaRole}
95
+ aria-live={ariaLive}
96
+ aria-atomic="true"
97
+ >
98
+ <!-- Icon with circular background -->
99
+ <span class="toast-icon" aria-hidden="true">
100
+ {#if type === 'success'}
101
+ <CheckCircle2 size={20} strokeWidth={2.5} />
102
+ {:else if type === 'error'}
103
+ <AlertCircle size={20} strokeWidth={2.5} />
104
+ {:else if type === 'warning'}
105
+ <AlertTriangle size={20} strokeWidth={2.5} />
106
+ {:else if type === 'clinical'}
107
+ <Bell size={20} strokeWidth={2.5} />
108
+ {:else}
109
+ <Info size={20} strokeWidth={2.5} />
110
+ {/if}
111
+ </span>
112
+
113
+ <!-- Content -->
114
+ <div class="toast-content">
115
+ {#if title}
116
+ <p class="toast-title">{title}</p>
117
+ {/if}
118
+ <p class="toast-message">{message}</p>
119
+
120
+ {#if requestId}
121
+ <p class="toast-request-id">
122
+ <span class="request-id-label">Request ID:</span>
123
+ <code class="request-id-code">{requestId}</code>
124
+ </p>
125
+ {/if}
126
+
127
+ {#if actions}
128
+ <div class="toast-actions">
129
+ {@render actions()}
130
+ </div>
131
+ {/if}
132
+ </div>
133
+
134
+ <!-- Dismiss button -->
135
+ {#if dismissible}
136
+ <button
137
+ type="button"
138
+ class="toast-dismiss"
139
+ onclick={handleDismiss}
140
+ aria-label={closeLabel}
141
+ >
142
+ <X size={18} strokeWidth={2} />
143
+ </button>
144
+ {/if}
145
+
146
+ <!-- Progress bar for auto-dismiss -->
147
+ {#if showProgress && duration > 0}
148
+ <div
149
+ class="toast-progress"
150
+ style="animation-duration: {duration}ms"
151
+ ></div>
152
+ {/if}
153
+ </output>
154
+
155
+ <style>
156
+ /* ========================================
157
+ BASE TOAST STYLES - Glass Morphism
158
+ ======================================== */
159
+ .toast {
160
+ position: relative;
161
+ display: flex;
162
+ align-items: flex-start;
163
+ gap: 0.875rem;
164
+ padding: 1rem 1.125rem;
165
+ border-radius: 12px;
166
+ border: 1px solid;
167
+ min-width: 320px;
168
+ max-width: 420px;
169
+ font-family: var(--ui-font-sans, 'Inter', system-ui, sans-serif);
170
+
171
+ /* Ensure proper stacking */
172
+ z-index: 1;
173
+
174
+ /* Glass morphism effect */
175
+ backdrop-filter: blur(20px) saturate(180%);
176
+ -webkit-backdrop-filter: blur(20px) saturate(180%);
177
+
178
+ /* Elevated shadow */
179
+ box-shadow:
180
+ 0 8px 32px rgba(0, 0, 0, 0.12),
181
+ 0 2px 8px rgba(0, 0, 0, 0.08),
182
+ inset 0 1px 0 rgba(255, 255, 255, 0.1);
183
+
184
+ transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
185
+ overflow: hidden;
186
+ }
187
+
188
+ .toast:hover {
189
+ transform: translateY(-1px);
190
+ box-shadow:
191
+ 0 12px 40px rgba(0, 0, 0, 0.15),
192
+ 0 4px 12px rgba(0, 0, 0, 0.1),
193
+ inset 0 1px 0 rgba(255, 255, 255, 0.15);
194
+ }
195
+
196
+ /* ========================================
197
+ TYPE STYLES
198
+ ======================================== */
199
+
200
+ /* Success */
201
+ .toast-success {
202
+ background:
203
+ linear-gradient(135deg, rgb(var(--ui-color-success) / 0.15) 0%, rgb(var(--ui-color-success) / 0.08) 100%),
204
+ var(--ui-bg-primary);
205
+ border-color: rgb(var(--ui-color-success) / 0.3);
206
+ }
207
+
208
+ .toast-success .toast-icon {
209
+ color: rgb(var(--ui-color-success));
210
+ background: rgb(var(--ui-color-success) / 0.15);
211
+ }
212
+
213
+ .toast-success .toast-progress {
214
+ background: rgb(var(--ui-color-success));
215
+ }
216
+
217
+ /* Error */
218
+ .toast-error {
219
+ background:
220
+ linear-gradient(135deg, rgb(var(--ui-color-error) / 0.15) 0%, rgb(var(--ui-color-error) / 0.08) 100%),
221
+ var(--ui-bg-primary);
222
+ border-color: rgb(var(--ui-color-error) / 0.3);
223
+ }
224
+
225
+ .toast-error .toast-icon {
226
+ color: rgb(var(--ui-color-error));
227
+ background: rgb(var(--ui-color-error) / 0.15);
228
+ }
229
+
230
+ .toast-error .toast-progress {
231
+ background: rgb(var(--ui-color-error));
232
+ }
233
+
234
+ /* Warning */
235
+ .toast-warning {
236
+ background:
237
+ linear-gradient(135deg, rgb(var(--ui-color-warning) / 0.15) 0%, rgb(var(--ui-color-warning) / 0.08) 100%),
238
+ var(--ui-bg-primary);
239
+ border-color: rgb(var(--ui-color-warning) / 0.3);
240
+ }
241
+
242
+ .toast-warning .toast-icon {
243
+ color: rgb(var(--ui-color-warning));
244
+ background: rgb(var(--ui-color-warning) / 0.15);
245
+ }
246
+
247
+ .toast-warning .toast-progress {
248
+ background: rgb(var(--ui-color-warning));
249
+ }
250
+
251
+ /* Info */
252
+ .toast-info {
253
+ background:
254
+ linear-gradient(135deg, rgb(var(--ui-color-info) / 0.15) 0%, rgb(var(--ui-color-info) / 0.08) 100%),
255
+ var(--ui-bg-primary);
256
+ border-color: rgb(var(--ui-color-info) / 0.3);
257
+ }
258
+
259
+ .toast-info .toast-icon {
260
+ color: rgb(var(--ui-color-info));
261
+ background: rgb(var(--ui-color-info) / 0.15);
262
+ }
263
+
264
+ .toast-info .toast-progress {
265
+ background: rgb(var(--ui-color-info));
266
+ }
267
+
268
+ /* Neutral */
269
+ .toast-neutral {
270
+ background: linear-gradient(135deg, var(--ui-bg-tertiary) 0%, var(--ui-bg-secondary) 100%);
271
+ border-color: var(--ui-border-default);
272
+ }
273
+
274
+ .toast-neutral .toast-icon {
275
+ color: var(--ui-text-tertiary);
276
+ background: var(--ui-bg-tertiary);
277
+ }
278
+
279
+ .toast-neutral .toast-progress {
280
+ background: var(--ui-text-tertiary);
281
+ }
282
+
283
+ /* Clinical */
284
+ .toast-clinical {
285
+ background:
286
+ linear-gradient(135deg, rgb(var(--ui-color-primary) / 0.15) 0%, rgb(var(--ui-color-primary) / 0.08) 100%),
287
+ var(--ui-bg-primary);
288
+ border-color: rgb(var(--ui-color-primary) / 0.3);
289
+ }
290
+
291
+ .toast-clinical .toast-icon {
292
+ color: rgb(var(--ui-color-primary));
293
+ background: rgb(var(--ui-color-primary) / 0.15);
294
+ }
295
+
296
+ .toast-clinical .toast-progress {
297
+ background: rgb(var(--ui-color-primary));
298
+ }
299
+
300
+ /* ========================================
301
+ DARK MODE ADJUSTMENTS
302
+ ======================================== */
303
+ :global([data-theme='dark']) .toast-success {
304
+ background: linear-gradient(135deg, rgb(var(--ui-color-success) / 0.25) 0%, rgb(var(--ui-color-success) / 0.12) 100%);
305
+ border-color: rgb(var(--ui-color-success) / 0.4);
306
+ }
307
+
308
+ :global([data-theme='dark']) .toast-success .toast-icon {
309
+ color: rgb(var(--ui-color-success-light, var(--ui-color-success)));
310
+ background: rgb(var(--ui-color-success) / 0.2);
311
+ }
312
+
313
+ :global([data-theme='dark']) .toast-error {
314
+ background: linear-gradient(135deg, rgb(var(--ui-color-error) / 0.25) 0%, rgb(var(--ui-color-error) / 0.12) 100%);
315
+ border-color: rgb(var(--ui-color-error) / 0.4);
316
+ }
317
+
318
+ :global([data-theme='dark']) .toast-error .toast-icon {
319
+ color: rgb(var(--ui-color-error-light, var(--ui-color-error)));
320
+ background: rgb(var(--ui-color-error) / 0.2);
321
+ }
322
+
323
+ :global([data-theme='dark']) .toast-warning {
324
+ background: linear-gradient(135deg, rgb(var(--ui-color-warning) / 0.25) 0%, rgb(var(--ui-color-warning) / 0.12) 100%);
325
+ border-color: rgb(var(--ui-color-warning) / 0.4);
326
+ }
327
+
328
+ :global([data-theme='dark']) .toast-warning .toast-icon {
329
+ color: rgb(var(--ui-color-warning-light, var(--ui-color-warning)));
330
+ background: rgb(var(--ui-color-warning) / 0.2);
331
+ }
332
+
333
+ :global([data-theme='dark']) .toast-info {
334
+ background: linear-gradient(135deg, rgb(var(--ui-color-info) / 0.25) 0%, rgb(var(--ui-color-info) / 0.12) 100%);
335
+ border-color: rgb(var(--ui-color-info) / 0.4);
336
+ }
337
+
338
+ :global([data-theme='dark']) .toast-info .toast-icon {
339
+ color: rgb(var(--ui-color-info-light, var(--ui-color-info)));
340
+ background: rgb(var(--ui-color-info) / 0.2);
341
+ }
342
+
343
+ :global([data-theme='dark']) .toast-clinical {
344
+ background: linear-gradient(135deg, rgb(var(--ui-color-primary-light) / 0.25) 0%, rgb(var(--ui-color-primary-light) / 0.12) 100%);
345
+ border-color: rgb(var(--ui-color-primary-light) / 0.4);
346
+ }
347
+
348
+ :global([data-theme='dark']) .toast-clinical .toast-icon {
349
+ color: rgb(var(--ui-color-primary-light));
350
+ background: rgb(var(--ui-color-primary-light) / 0.2);
351
+ }
352
+
353
+ @media (prefers-color-scheme: dark) {
354
+ :global(:root:not([data-theme='light'])) .toast-success {
355
+ background: linear-gradient(135deg, rgb(var(--ui-color-success) / 0.25) 0%, rgb(var(--ui-color-success) / 0.12) 100%);
356
+ border-color: rgb(var(--ui-color-success) / 0.4);
357
+ }
358
+
359
+ :global(:root:not([data-theme='light'])) .toast-success .toast-icon {
360
+ color: rgb(var(--ui-color-success-light, var(--ui-color-success)));
361
+ background: rgb(var(--ui-color-success) / 0.2);
362
+ }
363
+
364
+ :global(:root:not([data-theme='light'])) .toast-error {
365
+ background: linear-gradient(135deg, rgb(var(--ui-color-error) / 0.25) 0%, rgb(var(--ui-color-error) / 0.12) 100%);
366
+ border-color: rgb(var(--ui-color-error) / 0.4);
367
+ }
368
+
369
+ :global(:root:not([data-theme='light'])) .toast-error .toast-icon {
370
+ color: rgb(var(--ui-color-error-light, var(--ui-color-error)));
371
+ background: rgb(var(--ui-color-error) / 0.2);
372
+ }
373
+
374
+ :global(:root:not([data-theme='light'])) .toast-warning {
375
+ background: linear-gradient(135deg, rgb(var(--ui-color-warning) / 0.25) 0%, rgb(var(--ui-color-warning) / 0.12) 100%);
376
+ border-color: rgb(var(--ui-color-warning) / 0.4);
377
+ }
378
+
379
+ :global(:root:not([data-theme='light'])) .toast-warning .toast-icon {
380
+ color: rgb(var(--ui-color-warning-light, var(--ui-color-warning)));
381
+ background: rgb(var(--ui-color-warning) / 0.2);
382
+ }
383
+
384
+ :global(:root:not([data-theme='light'])) .toast-info {
385
+ background: linear-gradient(135deg, rgb(var(--ui-color-info) / 0.25) 0%, rgb(var(--ui-color-info) / 0.12) 100%);
386
+ border-color: rgb(var(--ui-color-info) / 0.4);
387
+ }
388
+
389
+ :global(:root:not([data-theme='light'])) .toast-info .toast-icon {
390
+ color: rgb(var(--ui-color-info-light, var(--ui-color-info)));
391
+ background: rgb(var(--ui-color-info) / 0.2);
392
+ }
393
+
394
+ :global(:root:not([data-theme='light'])) .toast-clinical {
395
+ background: linear-gradient(135deg, rgb(var(--ui-color-primary-light) / 0.25) 0%, rgb(var(--ui-color-primary-light) / 0.12) 100%);
396
+ border-color: rgb(var(--ui-color-primary-light) / 0.4);
397
+ }
398
+
399
+ :global(:root:not([data-theme='light'])) .toast-clinical .toast-icon {
400
+ color: rgb(var(--ui-color-primary-light));
401
+ background: rgb(var(--ui-color-primary-light) / 0.2);
402
+ }
403
+ }
404
+
405
+ /* ========================================
406
+ ICON STYLES
407
+ ======================================== */
408
+ .toast-icon {
409
+ display: flex;
410
+ align-items: center;
411
+ justify-content: center;
412
+ flex-shrink: 0;
413
+ width: 36px;
414
+ height: 36px;
415
+ border-radius: 50%;
416
+ transition: transform 0.2s ease;
417
+ }
418
+
419
+ .toast:hover .toast-icon {
420
+ transform: scale(1.05);
421
+ }
422
+
423
+ /* ========================================
424
+ CONTENT STYLES
425
+ ======================================== */
426
+ .toast-content {
427
+ flex: 1;
428
+ min-width: 0;
429
+ padding-top: 0.25rem;
430
+ }
431
+
432
+ .toast-title {
433
+ margin: 0 0 0.25rem 0;
434
+ font-size: 0.9375rem;
435
+ font-weight: 600;
436
+ line-height: 1.4;
437
+ color: var(--ui-text-primary);
438
+ }
439
+
440
+ .toast-message {
441
+ margin: 0;
442
+ font-size: 0.875rem;
443
+ font-weight: 500;
444
+ line-height: 1.5;
445
+ color: var(--ui-text-primary);
446
+ word-wrap: break-word;
447
+ }
448
+
449
+ /* Request ID for error tracking */
450
+ .toast-request-id {
451
+ margin: 0.5rem 0 0 0;
452
+ font-size: 0.75rem;
453
+ line-height: 1.4;
454
+ display: flex;
455
+ flex-wrap: wrap;
456
+ align-items: center;
457
+ gap: 0.375rem;
458
+ opacity: 0.8;
459
+ }
460
+
461
+ .request-id-label {
462
+ color: var(--ui-text-secondary);
463
+ font-weight: 500;
464
+ }
465
+
466
+ .request-id-code {
467
+ font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
468
+ font-size: 0.6875rem;
469
+ padding: 0.125rem 0.375rem;
470
+ border-radius: 4px;
471
+ background: var(--ui-bg-tertiary);
472
+ color: var(--ui-text-primary);
473
+ border: 1px solid var(--ui-border-default);
474
+ font-weight: 600;
475
+ letter-spacing: -0.01em;
476
+ }
477
+
478
+ /* Action buttons */
479
+ .toast-actions {
480
+ display: flex;
481
+ flex-wrap: wrap;
482
+ align-items: center;
483
+ gap: 0.5rem;
484
+ margin-top: 0.75rem;
485
+ }
486
+
487
+ /* ========================================
488
+ DISMISS BUTTON
489
+ ======================================== */
490
+ .toast-dismiss {
491
+ display: flex;
492
+ align-items: center;
493
+ justify-content: center;
494
+ flex-shrink: 0;
495
+ width: 28px;
496
+ height: 28px;
497
+ border-radius: 50%;
498
+ background: transparent;
499
+ border: none;
500
+ color: var(--ui-text-secondary);
501
+ cursor: pointer;
502
+ transition: all 0.2s ease;
503
+ padding: 0;
504
+ margin-top: 0.125rem;
505
+ }
506
+
507
+ .toast-dismiss:hover {
508
+ background: var(--ui-bg-tertiary);
509
+ color: var(--ui-text-primary);
510
+ transform: scale(1.1);
511
+ }
512
+
513
+ .toast-dismiss:active {
514
+ transform: scale(0.95);
515
+ }
516
+
517
+ .toast-dismiss:focus-visible {
518
+ outline: none;
519
+ box-shadow: 0 0 0 3px rgb(var(--ui-color-primary) / 0.4);
520
+ }
521
+
522
+ :global([data-theme='dark']) .toast-dismiss:focus-visible {
523
+ box-shadow: 0 0 0 3px rgb(var(--ui-color-primary-light) / 0.5);
524
+ }
525
+
526
+ @media (prefers-color-scheme: dark) {
527
+ :global(:root:not([data-theme='light'])) .toast-dismiss:focus-visible {
528
+ box-shadow: 0 0 0 3px rgb(var(--ui-color-primary-light) / 0.5);
529
+ }
530
+ }
531
+
532
+ /* ========================================
533
+ PROGRESS BAR
534
+ ======================================== */
535
+ .toast-progress {
536
+ position: absolute;
537
+ bottom: 0;
538
+ left: 0;
539
+ height: 3px;
540
+ width: 100%;
541
+ border-radius: 0 0 12px 12px;
542
+ transform-origin: left;
543
+ animation: shrink linear forwards;
544
+ opacity: 0.8;
545
+ }
546
+
547
+ @keyframes shrink {
548
+ from {
549
+ transform: scaleX(1);
550
+ }
551
+ to {
552
+ transform: scaleX(0);
553
+ }
554
+ }
555
+
556
+ /* ========================================
557
+ REDUCED MOTION
558
+ ======================================== */
559
+ @media (prefers-reduced-motion: reduce) {
560
+ .toast,
561
+ .toast-icon,
562
+ .toast-dismiss {
563
+ transition: none;
564
+ }
565
+
566
+ .toast-progress {
567
+ animation: none;
568
+ transform: scaleX(0);
569
+ }
570
+ }
571
+
572
+ /* ========================================
573
+ RESPONSIVE
574
+ ======================================== */
575
+ @media (max-width: 480px) {
576
+ .toast {
577
+ min-width: 280px;
578
+ max-width: 100%;
579
+ padding: 0.875rem 1rem;
580
+ }
581
+
582
+ .toast-icon {
583
+ width: 32px;
584
+ height: 32px;
585
+ }
586
+ }
587
+ </style>
@@ -0,0 +1,55 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { Status } from '../../types/index.js';
3
+ interface Props {
4
+ /** Toast message */
5
+ message: string;
6
+ /** Toast type/status */
7
+ type?: Status | 'clinical';
8
+ /** Optional title */
9
+ title?: string;
10
+ /** Whether the toast can be dismissed */
11
+ dismissible?: boolean;
12
+ /** Show progress bar for auto-dismiss countdown */
13
+ showProgress?: boolean;
14
+ /** Duration in ms (0 = no auto-dismiss) */
15
+ duration?: number;
16
+ /** Request ID for error tracking (displayed for errors) */
17
+ requestId?: string;
18
+ /** Action buttons slot */
19
+ actions?: Snippet;
20
+ /** Additional CSS classes */
21
+ class?: string;
22
+ /** Dismiss handler */
23
+ ondismiss?: () => void;
24
+ /** Custom dismiss button aria-label */
25
+ dismissAriaLabel?: string;
26
+ /** Unique ID for the toast */
27
+ id?: string;
28
+ }
29
+ /**
30
+ * Toast
31
+ *
32
+ * A beautiful toast notification component for displaying temporary messages.
33
+ * Features glass morphism design, action buttons, progress indicator, and
34
+ * comprehensive accessibility support for healthcare applications.
35
+ *
36
+ * @example
37
+ * <Toast
38
+ * type="success"
39
+ * message="Patient record saved successfully"
40
+ * />
41
+ *
42
+ * @example
43
+ * <Toast
44
+ * type="error"
45
+ * title="Save Failed"
46
+ * message="Unable to save patient record"
47
+ * requestId="REQ-12345"
48
+ * showProgress
49
+ * duration={6000}
50
+ * />
51
+ */
52
+ declare const Toast: import("svelte").Component<Props, {}, "">;
53
+ type Toast = ReturnType<typeof Toast>;
54
+ export default Toast;
55
+ //# sourceMappingURL=Toast.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Toast.svelte.d.ts","sourceRoot":"","sources":["../../../src/feedback/Toast/Toast.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAKlD,UAAU,KAAK;IACd,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,wBAAwB;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAC3B,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mDAAmD;IACnD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0BAA0B;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,uCAAuC;IACvC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,8BAA8B;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;CACZ;AAgGF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,QAAA,MAAM,KAAK,2CAAwC,CAAC;AACpD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}