@svadmin/ui 0.11.0 → 0.11.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svadmin/ui",
3
- "version": "0.11.0",
3
+ "version": "0.11.2",
4
4
  "description": "Pre-built admin UI components — AdminApp, AutoTable, AutoForm, Sidebar, Layout",
5
5
  "type": "module",
6
6
  "sideEffects": [
package/src/app.css CHANGED
@@ -8,6 +8,14 @@
8
8
  */
9
9
 
10
10
  @layer base {
11
+ /* Global border-color reset — ensures Tailwind border utilities
12
+ * (border-r, border-t, etc.) use the theme color instead of currentColor */
13
+ *,
14
+ ::after,
15
+ ::before {
16
+ border-color: var(--border);
17
+ }
18
+
11
19
  :root {
12
20
  --radius: 0.5rem;
13
21
  --background: oklch(0.98 0.002 264);
@@ -169,3 +177,59 @@ body {
169
177
  --radius-lg: var(--radius);
170
178
  --radius-xl: calc(var(--radius) + 4px);
171
179
  }
180
+
181
+ /* ─── svadmin UI Components CSS ─────────────────────────────── */
182
+ /* These rules were moved from .svelte files to eliminate <style> tags */
183
+
184
+ /* MarkdownRenderer Styles */
185
+ .prose {
186
+ line-height: 1.6;
187
+ }
188
+ .prose p {
189
+ margin-top: 0.5em;
190
+ margin-bottom: 0.5em;
191
+ }
192
+
193
+ /* Streaming cursor effect */
194
+ .streaming > *:last-child::after {
195
+ content: '▋';
196
+ display: inline-block;
197
+ animation: svadmin-blink 1s step-start infinite;
198
+ margin-left: 2px;
199
+ vertical-align: baseline;
200
+ color: currentColor;
201
+ }
202
+
203
+ @keyframes svadmin-blink {
204
+ 50% { opacity: 0; }
205
+ }
206
+
207
+ /* Handle copied state for dynamically injected buttons */
208
+ .copy-btn[data-copied-id] {
209
+ color: #10b981; /* Tailwind emerald-500 */
210
+ }
211
+ .copy-btn[data-copied-id] svg {
212
+ /* Swap to Check icon */
213
+ content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="%2310b981" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>');
214
+ }
215
+
216
+ /* ChatDialog Styles */
217
+ .chat-markdown pre.chat-code-block {
218
+ background: var(--color-muted, hsl(var(--muted)));
219
+ border-radius: 0.5rem;
220
+ padding: 0.75rem;
221
+ margin: 0.5rem 0;
222
+ overflow-x: auto;
223
+ font-size: 0.75rem;
224
+ line-height: 1.5;
225
+ }
226
+ .chat-markdown code.chat-inline-code {
227
+ background: var(--color-muted, hsl(var(--muted)));
228
+ padding: 0.125rem 0.375rem;
229
+ border-radius: 0.25rem;
230
+ font-size: 0.8125em;
231
+ font-family: ui-monospace, monospace;
232
+ }
233
+ .chat-markdown strong {
234
+ font-weight: 600;
235
+ }
@@ -100,6 +100,9 @@
100
100
  let authChecked = $state(false);
101
101
 
102
102
  $effect(() => {
103
+ // Explicitly track route so auth is re-checked on navigation
104
+ const _route = route;
105
+
103
106
  if (!authProvider) {
104
107
  isAuthenticated = true;
105
108
  authChecked = true;
@@ -108,7 +111,7 @@
108
111
  authProvider.check().then(result => {
109
112
  isAuthenticated = result.authenticated;
110
113
  authChecked = true;
111
- if (!result.authenticated && route !== '/login' && route !== '/register' && route !== '/forgot-password' && route !== '/update-password') {
114
+ if (!result.authenticated && _route !== '/login' && _route !== '/register' && _route !== '/forgot-password' && _route !== '/update-password') {
112
115
  navigate(result.redirectTo ?? '/login');
113
116
  }
114
117
  });
@@ -446,24 +446,4 @@
446
446
  {/if}
447
447
  {/if}
448
448
 
449
- <style>
450
- :global(.chat-markdown pre.chat-code-block) {
451
- background: hsl(var(--muted));
452
- border-radius: 0.5rem;
453
- padding: 0.75rem;
454
- margin: 0.5rem 0;
455
- overflow-x: auto;
456
- font-size: 0.75rem;
457
- line-height: 1.5;
458
- }
459
- :global(.chat-markdown code.chat-inline-code) {
460
- background: hsl(var(--muted));
461
- padding: 0.125rem 0.375rem;
462
- border-radius: 0.25rem;
463
- font-size: 0.8125em;
464
- font-family: ui-monospace, monospace;
465
- }
466
- :global(.chat-markdown strong) {
467
- font-weight: 600;
468
- }
469
- </style>
449
+
@@ -109,36 +109,4 @@
109
109
  {@html html}
110
110
  </div>
111
111
 
112
- <style>
113
- /* Base Markdown Styles */
114
- :global(.prose) {
115
- line-height: 1.6;
116
- }
117
- :global(.prose p) {
118
- margin-top: 0.5em;
119
- margin-bottom: 0.5em;
120
- }
121
-
122
- /* Streaming cursor effect */
123
- .streaming > :global(*:last-child)::after {
124
- content: '▋';
125
- display: inline-block;
126
- animation: blink 1s step-start infinite;
127
- margin-left: 2px;
128
- vertical-align: baseline;
129
- color: currentColor;
130
- }
131
112
 
132
- @keyframes blink {
133
- 50% { opacity: 0; }
134
- }
135
-
136
- /* Handle copied state for dynamically injected buttons */
137
- :global(.copy-btn[data-copied-id]) {
138
- color: #10b981; /* Tailwind emerald-500 */
139
- }
140
- :global(.copy-btn[data-copied-id] svg) {
141
- /* Swap to Check icon */
142
- content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="%2310b981" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>');
143
- }
144
- </style>