@r2digisolutions/components 0.25.16 → 0.25.18
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.
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
disabled?: boolean;
|
|
16
16
|
destructive?: boolean;
|
|
17
17
|
separator?: boolean;
|
|
18
|
+
icon?: any;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
type UserStatus = 'online' | 'offline' | 'busy' | 'away' | null;
|
|
@@ -235,8 +236,8 @@
|
|
|
235
236
|
compact && 'h-8 gap-2 py-0',
|
|
236
237
|
compact && (variant === 'ghost' ? 'px-1' : 'px-2'),
|
|
237
238
|
!compact && size === 'sm' && (variant === 'ghost' ? 'px-1.5 py-1' : 'px-2.5 py-1'),
|
|
238
|
-
size === 'md' && (variant === 'ghost' ? 'px-2 py-1.5' : 'px-2.5 py-
|
|
239
|
-
size === 'lg' && (variant === 'ghost' ? 'px-2.5 py-2' : 'px-3 py-2
|
|
239
|
+
size === 'md' && (variant === 'ghost' ? 'px-2 py-1.5' : 'px-2.5 py-1.5'),
|
|
240
|
+
size === 'lg' && (variant === 'ghost' ? 'px-2.5 py-2' : 'px-3 py-2'),
|
|
240
241
|
open && (variant === 'ghost' ? 'bg-surface-overlay' : 'ring-brand-500/30 ring-2')
|
|
241
242
|
]}
|
|
242
243
|
aria-haspopup="menu"
|
|
@@ -286,15 +287,15 @@
|
|
|
286
287
|
{#if header}
|
|
287
288
|
{@render header()}
|
|
288
289
|
{:else}
|
|
289
|
-
<div class="border-border bg-surface-overlay/50 px-3.5 py-
|
|
290
|
-
<div class="gap-
|
|
291
|
-
<Avatar {src} {name} size="
|
|
292
|
-
<div class="min-w-0 pt-0
|
|
293
|
-
<p class="text-sm font-semibold text-primary truncate">{name}</p>
|
|
290
|
+
<div class="border-border bg-surface-overlay/50 px-3.5 py-1.5 border-b">
|
|
291
|
+
<div class="gap-2 flex items-start">
|
|
292
|
+
<Avatar {src} {name} size="md" {status} />
|
|
293
|
+
<div class="min-w-0 pt-0 flex-1">
|
|
294
|
+
<p class="text-sm font-semibold text-primary truncate leading-tight">{name}</p>
|
|
294
295
|
{#if email}
|
|
295
|
-
<p class="text-xs text-muted truncate">{email}</p>
|
|
296
|
+
<p class="text-xs text-muted truncate leading-tight">{email}</p>
|
|
296
297
|
{/if}
|
|
297
|
-
<div class="mt-
|
|
298
|
+
<div class="mt-1 gap-2 flex flex-wrap items-center">
|
|
298
299
|
{#if status && statusLabel}
|
|
299
300
|
<StatusDot {status} size="sm" showLabel label={statusLabel} />
|
|
300
301
|
{/if}
|
|
@@ -317,7 +318,7 @@
|
|
|
317
318
|
<div class="p-1.5">
|
|
318
319
|
{#each items as item (item.id)}
|
|
319
320
|
{#if item.separator}
|
|
320
|
-
<div class="my-1
|
|
321
|
+
<div class="my-1 border-border border-t" role="separator"></div>
|
|
321
322
|
{:else}
|
|
322
323
|
<button
|
|
323
324
|
type="button"
|
|
@@ -325,7 +326,7 @@
|
|
|
325
326
|
disabled={item.disabled}
|
|
326
327
|
onclick={() => select(item)}
|
|
327
328
|
class={[
|
|
328
|
-
'gap-2 rounded-xl px-2.5 py-
|
|
329
|
+
'gap-2.5 rounded-xl px-2.5 py-1.5 flex w-full items-center text-left transition-colors',
|
|
329
330
|
'focus-visible:ring-brand-500/30 focus-visible:ring-2 focus-visible:outline-none',
|
|
330
331
|
item.destructive
|
|
331
332
|
? 'text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-950/40'
|
|
@@ -333,6 +334,9 @@
|
|
|
333
334
|
item.disabled && 'cursor-not-allowed opacity-40'
|
|
334
335
|
]}
|
|
335
336
|
>
|
|
337
|
+
{#if item.icon}
|
|
338
|
+
<svelte:component this={item.icon} size={22} class="shrink-0 text-muted" aria-hidden="true" />
|
|
339
|
+
{/if}
|
|
336
340
|
<span class="min-w-0 flex-1">
|
|
337
341
|
<span class="text-sm font-medium block">{item.label}</span>
|
|
338
342
|
{#if item.description}
|
|
@@ -340,7 +344,7 @@
|
|
|
340
344
|
{/if}
|
|
341
345
|
</span>
|
|
342
346
|
{#if item.shortcut}
|
|
343
|
-
<span class="
|
|
347
|
+
<span class="font-mono text-muted shrink-0 text-[10px]">{item.shortcut}</span>
|
|
344
348
|
{/if}
|
|
345
349
|
</button>
|
|
346
350
|
{/if}
|