@r2digisolutions/components 0.23.0 → 0.24.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.
- package/dist/components/atoms/Avatar/Avatar.stories.js +1 -1
- package/dist/components/atoms/BrandMark/BrandMark.svelte +47 -7
- package/dist/components/atoms/BrandMark/BrandMark.svelte.d.ts +4 -0
- package/dist/components/atoms/Input/Input.svelte +5 -4
- package/dist/components/atoms/Slider/Slider.svelte +19 -15
- package/dist/components/atoms/Slider/Slider.svelte.d.ts +2 -0
- package/dist/components/molecules/AuthCard/AuthCard.svelte +19 -4
- package/dist/components/molecules/AuthCard/AuthCard.svelte.d.ts +4 -0
- package/dist/components/molecules/CanvasElementsPanel/CanvasElementsPanel.svelte +90 -26
- package/dist/components/molecules/CanvasInspector/CanvasInspector.svelte +176 -5
- package/dist/components/molecules/ChipBar/ChipBar.svelte +18 -5
- package/dist/components/molecules/ChipBar/ChipBar.svelte.d.ts +1 -1
- package/dist/components/molecules/Combobox/Combobox.svelte +2 -2
- package/dist/components/molecules/DateTimePicker/DateTimePicker.svelte +121 -33
- package/dist/components/molecules/FormSection/FormSection.svelte +25 -28
- package/dist/components/molecules/ImageEditor/ImageEditor.svelte +183 -0
- package/dist/components/molecules/ImageEditor/ImageEditor.svelte.d.ts +19 -0
- package/dist/components/molecules/KnowledgeCard/KnowledgeCard.svelte +5 -5
- package/dist/components/molecules/LocaleSwitcher/LocaleSwitcher.svelte +58 -35
- package/dist/components/molecules/MediaLayerItem/MediaLayerItem.svelte +293 -39
- package/dist/components/molecules/MediaLayerItem/MediaLayerItem.svelte.d.ts +6 -1
- package/dist/components/molecules/MediaStage/MediaStage.svelte +302 -245
- package/dist/components/molecules/MentionInput/MentionInput.svelte +332 -120
- package/dist/components/molecules/MentionInput/MentionInput.svelte.d.ts +13 -2
- package/dist/components/molecules/SearchBar/SearchBar.svelte +7 -1
- package/dist/components/molecules/SearchInput/SearchInput.svelte +77 -18
- package/dist/components/molecules/SearchInput/SearchInput.svelte.d.ts +4 -0
- package/dist/components/molecules/SearchInput/SearchInputStory.svelte +1 -0
- package/dist/components/molecules/Select/Select.svelte +14 -1
- package/dist/components/molecules/Select/Select.svelte.d.ts +3 -0
- package/dist/components/molecules/UserMenu/UserMenu.svelte +30 -27
- package/dist/components/molecules/WidgetFrame/WidgetFrame.svelte +200 -17
- package/dist/components/molecules/WidgetFrame/WidgetFrame.svelte.d.ts +14 -0
- package/dist/components/organisms/AppShell/AppShell.svelte +7 -1
- package/dist/components/organisms/AppShell/AppShell.svelte.d.ts +2 -0
- package/dist/components/organisms/AuthShell/AuthShell.svelte +61 -29
- package/dist/components/organisms/AuthShell/AuthShell.svelte.d.ts +4 -0
- package/dist/components/organisms/CanvasEditor/CanvasEditor.svelte +156 -7
- package/dist/components/organisms/CanvasEditor/CanvasEditor.svelte.d.ts +5 -0
- package/dist/components/organisms/Navbar/Navbar.svelte +2 -2
- package/dist/components/organisms/ProfileHeaderUploader/ProfileHeaderUploader.svelte +314 -141
- package/dist/components/organisms/ProfileHeaderUploader/ProfileHeaderUploader.svelte.d.ts +20 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2 -1
- package/dist/styles.css +17 -0
- package/dist/utils/canvasDocument.d.ts +56 -4
- package/dist/utils/canvasDocument.js +91 -2
- package/dist/utils/canvasExport.d.ts +1 -1
- package/dist/utils/canvasExport.js +15 -25
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import IconButton from '../../atoms/IconButton/IconButton.svelte';
|
|
2
3
|
import Input from '../../atoms/Input/Input.svelte';
|
|
3
4
|
|
|
4
5
|
interface SearchInputProps {
|
|
@@ -8,6 +9,10 @@
|
|
|
8
9
|
disabled?: boolean;
|
|
9
10
|
size?: 'sm' | 'md' | 'lg';
|
|
10
11
|
class?: string;
|
|
12
|
+
/** Accessible label for the submit control. */
|
|
13
|
+
submitLabel?: string;
|
|
14
|
+
/** Show the trailing submit button. Default true. */
|
|
15
|
+
showSubmit?: boolean;
|
|
11
16
|
oninput?: (e: Event) => void;
|
|
12
17
|
onsubmit?: (value: string) => void;
|
|
13
18
|
onchange?: (e: Event) => void;
|
|
@@ -20,32 +25,86 @@
|
|
|
20
25
|
disabled = false,
|
|
21
26
|
size = 'md',
|
|
22
27
|
class: className = '',
|
|
28
|
+
submitLabel = 'Search',
|
|
29
|
+
showSubmit = true,
|
|
23
30
|
oninput,
|
|
24
31
|
onsubmit,
|
|
25
32
|
onchange
|
|
26
33
|
}: SearchInputProps = $props();
|
|
27
34
|
|
|
35
|
+
const submitButtonSize = $derived(size === 'sm' ? 'xs' : 'sm');
|
|
36
|
+
|
|
37
|
+
function submit() {
|
|
38
|
+
onsubmit?.(value);
|
|
39
|
+
}
|
|
40
|
+
|
|
28
41
|
function handleKeydown(e: KeyboardEvent) {
|
|
29
|
-
if (e.key
|
|
42
|
+
if (e.key !== 'Enter') return;
|
|
43
|
+
e.preventDefault();
|
|
44
|
+
submit();
|
|
30
45
|
}
|
|
31
46
|
</script>
|
|
32
47
|
|
|
33
|
-
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
48
|
+
{#snippet leadIcon()}
|
|
49
|
+
<svg
|
|
50
|
+
class="h-4 w-4"
|
|
51
|
+
viewBox="0 0 24 24"
|
|
52
|
+
fill="none"
|
|
53
|
+
stroke="currentColor"
|
|
54
|
+
stroke-width="2"
|
|
55
|
+
aria-hidden="true"
|
|
56
|
+
>
|
|
57
|
+
<path
|
|
58
|
+
stroke-linecap="round"
|
|
59
|
+
stroke-linejoin="round"
|
|
60
|
+
d="M21 21l-4.35-4.35M11 18a7 7 0 100-14 7 7 0 000 14z"
|
|
61
|
+
/>
|
|
62
|
+
</svg>
|
|
63
|
+
{/snippet}
|
|
64
|
+
|
|
65
|
+
{#snippet trailIcon()}
|
|
66
|
+
<IconButton
|
|
67
|
+
type="button"
|
|
68
|
+
variant="ghost"
|
|
69
|
+
size={submitButtonSize}
|
|
70
|
+
label={submitLabel}
|
|
37
71
|
{disabled}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
72
|
+
class="-me-1.5"
|
|
73
|
+
onclick={(e) => {
|
|
74
|
+
e.preventDefault();
|
|
75
|
+
e.stopPropagation();
|
|
76
|
+
submit();
|
|
77
|
+
}}
|
|
44
78
|
>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
79
|
+
<svg
|
|
80
|
+
class="h-full w-full"
|
|
81
|
+
viewBox="0 0 24 24"
|
|
82
|
+
fill="none"
|
|
83
|
+
stroke="currentColor"
|
|
84
|
+
stroke-width="2"
|
|
85
|
+
aria-hidden="true"
|
|
86
|
+
>
|
|
87
|
+
<path
|
|
88
|
+
stroke-linecap="round"
|
|
89
|
+
stroke-linejoin="round"
|
|
90
|
+
d="M21 21l-4.35-4.35M11 18a7 7 0 100-14 7 7 0 000 14z"
|
|
91
|
+
/>
|
|
92
|
+
</svg>
|
|
93
|
+
</IconButton>
|
|
94
|
+
{/snippet}
|
|
95
|
+
|
|
96
|
+
<Input
|
|
97
|
+
{label}
|
|
98
|
+
{placeholder}
|
|
99
|
+
{disabled}
|
|
100
|
+
{size}
|
|
101
|
+
type="search"
|
|
102
|
+
clearable
|
|
103
|
+
class={className}
|
|
104
|
+
bind:value
|
|
105
|
+
{oninput}
|
|
106
|
+
{onchange}
|
|
107
|
+
onkeydown={handleKeydown}
|
|
108
|
+
{leadIcon}
|
|
109
|
+
trailIcon={showSubmit ? trailIcon : undefined}
|
|
110
|
+
/>
|
|
@@ -5,6 +5,10 @@ interface SearchInputProps {
|
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
size?: 'sm' | 'md' | 'lg';
|
|
7
7
|
class?: string;
|
|
8
|
+
/** Accessible label for the submit control. */
|
|
9
|
+
submitLabel?: string;
|
|
10
|
+
/** Show the trailing submit button. Default true. */
|
|
11
|
+
showSubmit?: boolean;
|
|
8
12
|
oninput?: (e: Event) => void;
|
|
9
13
|
onsubmit?: (value: string) => void;
|
|
10
14
|
onchange?: (e: Event) => void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
2
3
|
import { on } from 'svelte/events';
|
|
3
4
|
import { createId } from '../../../utils/id.js';
|
|
4
5
|
import { popoverInvokerToggle } from '../../../utils/popoverInvoker.js';
|
|
@@ -37,6 +38,8 @@
|
|
|
37
38
|
listboxMinWidth?: number;
|
|
38
39
|
class?: string;
|
|
39
40
|
onchange?: (value: string) => void;
|
|
41
|
+
/** Extra row at the bottom of the list (for example, create). */
|
|
42
|
+
footer?: Snippet;
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
let {
|
|
@@ -55,7 +58,8 @@
|
|
|
55
58
|
size = 'md',
|
|
56
59
|
listboxMinWidth,
|
|
57
60
|
class: className = '',
|
|
58
|
-
onchange
|
|
61
|
+
onchange,
|
|
62
|
+
footer
|
|
59
63
|
}: SelectProps = $props();
|
|
60
64
|
|
|
61
65
|
let isOpen = $state(false);
|
|
@@ -739,6 +743,15 @@
|
|
|
739
743
|
{/each}
|
|
740
744
|
{/if}
|
|
741
745
|
</div>
|
|
746
|
+
{#if footer}
|
|
747
|
+
<div
|
|
748
|
+
class="border-border p-1.5 shrink-0 border-t"
|
|
749
|
+
role="presentation"
|
|
750
|
+
onclick={() => closeListbox()}
|
|
751
|
+
>
|
|
752
|
+
{@render footer()}
|
|
753
|
+
</div>
|
|
754
|
+
{/if}
|
|
742
755
|
</div>
|
|
743
756
|
</div>
|
|
744
757
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
1
2
|
export interface SelectOption {
|
|
2
3
|
value: string;
|
|
3
4
|
label: string;
|
|
@@ -31,6 +32,8 @@ interface SelectProps {
|
|
|
31
32
|
listboxMinWidth?: number;
|
|
32
33
|
class?: string;
|
|
33
34
|
onchange?: (value: string) => void;
|
|
35
|
+
/** Extra row at the bottom of the list (for example, create). */
|
|
36
|
+
footer?: Snippet;
|
|
34
37
|
}
|
|
35
38
|
declare const Select: import("svelte").Component<SelectProps, {}, "value">;
|
|
36
39
|
type Select = ReturnType<typeof Select>;
|
|
@@ -101,7 +101,8 @@
|
|
|
101
101
|
};
|
|
102
102
|
});
|
|
103
103
|
|
|
104
|
-
const
|
|
104
|
+
const compact = $derived(size === 'sm' && !showSubtitle);
|
|
105
|
+
const avatarSize = $derived(compact ? 'xs' : size === 'lg' ? 'lg' : size === 'sm' ? 'sm' : 'md');
|
|
105
106
|
const statusLabel = $derived(
|
|
106
107
|
status === 'online'
|
|
107
108
|
? 'Online'
|
|
@@ -221,34 +222,36 @@
|
|
|
221
222
|
});
|
|
222
223
|
</script>
|
|
223
224
|
|
|
224
|
-
<div class={['relative flex w-full
|
|
225
|
+
<div class={['min-w-0 relative flex w-full', className]}>
|
|
225
226
|
<button
|
|
226
227
|
bind:this={triggerEl}
|
|
227
228
|
type="button"
|
|
228
229
|
class={[
|
|
229
|
-
'inline-flex w-full
|
|
230
|
-
'focus-visible:
|
|
230
|
+
'min-w-0 inline-flex w-full max-w-full items-center text-left transition-colors',
|
|
231
|
+
'focus-visible:ring-brand-500/40 focus-visible:ring-2 focus-visible:outline-none',
|
|
231
232
|
variant === 'outline' &&
|
|
232
|
-
'gap-2.5 rounded-xl border
|
|
233
|
-
variant === 'ghost' && 'gap-2 rounded-lg
|
|
234
|
-
|
|
233
|
+
'gap-2.5 rounded-xl border-border bg-surface-elevated hover:bg-surface-overlay border',
|
|
234
|
+
variant === 'ghost' && 'gap-2 rounded-lg hover:bg-surface-overlay border border-transparent',
|
|
235
|
+
compact && 'h-8 gap-2 py-0',
|
|
236
|
+
compact && (variant === 'ghost' ? 'px-1' : 'px-2'),
|
|
237
|
+
!compact && size === 'sm' && (variant === 'ghost' ? 'px-1.5 py-1' : 'px-2.5 py-1'),
|
|
235
238
|
size === 'md' && (variant === 'ghost' ? 'px-2 py-1.5' : 'px-2.5 py-2'),
|
|
236
239
|
size === 'lg' && (variant === 'ghost' ? 'px-2.5 py-2' : 'px-3 py-2.5'),
|
|
237
|
-
open && (variant === 'ghost' ? 'bg-surface-overlay' : 'ring-
|
|
240
|
+
open && (variant === 'ghost' ? 'bg-surface-overlay' : 'ring-brand-500/30 ring-2')
|
|
238
241
|
]}
|
|
239
242
|
aria-haspopup="menu"
|
|
240
243
|
aria-expanded={open}
|
|
241
244
|
aria-controls={menuId || undefined}
|
|
242
245
|
{@attach popoverInvokerToggle(() => menuEl)}
|
|
243
246
|
>
|
|
244
|
-
<span class="shrink-0">
|
|
247
|
+
<span class="flex shrink-0 items-center">
|
|
245
248
|
<Avatar {src} {name} size={avatarSize} {status} />
|
|
246
249
|
</span>
|
|
247
250
|
{#if showMeta}
|
|
248
|
-
<span class="
|
|
249
|
-
<span class="
|
|
251
|
+
<span class="min-w-0 sm:block hidden flex-1 overflow-hidden">
|
|
252
|
+
<span class="text-sm font-medium text-primary block truncate">{name}</span>
|
|
250
253
|
{#if showSubtitle && (email || role)}
|
|
251
|
-
<span class="
|
|
254
|
+
<span class="text-xs text-muted block truncate">
|
|
252
255
|
{role ? `${role}` : ''}{role && email ? ' · ' : ''}{email ?? ''}
|
|
253
256
|
</span>
|
|
254
257
|
{/if}
|
|
@@ -256,7 +259,7 @@
|
|
|
256
259
|
{/if}
|
|
257
260
|
{#if showChevron}
|
|
258
261
|
<svg
|
|
259
|
-
class={['h-4 w-4 shrink-0
|
|
262
|
+
class={['h-4 w-4 text-muted shrink-0 transition-transform', open && 'rotate-180']}
|
|
260
263
|
viewBox="0 0 24 24"
|
|
261
264
|
fill="none"
|
|
262
265
|
stroke="currentColor"
|
|
@@ -278,26 +281,26 @@
|
|
|
278
281
|
style={menuStyle}
|
|
279
282
|
ontoggle={handleToggle}
|
|
280
283
|
onbeforetoggle={handleBeforeToggle}
|
|
281
|
-
class="user-menu m-0
|
|
284
|
+
class="user-menu m-0 rounded-2xl border-border bg-surface-elevated shadow-xl inset-auto overflow-hidden border outline-none"
|
|
282
285
|
>
|
|
283
286
|
{#if header}
|
|
284
287
|
{@render header()}
|
|
285
288
|
{:else}
|
|
286
|
-
<div class="border-
|
|
287
|
-
<div class="flex items-start
|
|
289
|
+
<div class="border-border bg-surface-overlay/50 px-3.5 py-3 border-b">
|
|
290
|
+
<div class="gap-3 flex items-start">
|
|
288
291
|
<Avatar {src} {name} size="lg" {status} />
|
|
289
|
-
<div class="min-w-0
|
|
290
|
-
<p class="
|
|
292
|
+
<div class="min-w-0 pt-0.5 flex-1">
|
|
293
|
+
<p class="text-sm font-semibold text-primary truncate">{name}</p>
|
|
291
294
|
{#if email}
|
|
292
|
-
<p class="
|
|
295
|
+
<p class="text-xs text-muted truncate">{email}</p>
|
|
293
296
|
{/if}
|
|
294
|
-
<div class="mt-2 flex flex-wrap items-center
|
|
297
|
+
<div class="mt-2 gap-2 flex flex-wrap items-center">
|
|
295
298
|
{#if status && statusLabel}
|
|
296
299
|
<StatusDot {status} size="sm" showLabel label={statusLabel} />
|
|
297
300
|
{/if}
|
|
298
301
|
{#if role}
|
|
299
302
|
<span
|
|
300
|
-
class="rounded-md bg-surface-elevated px-1.5 py-0.5
|
|
303
|
+
class="rounded-md bg-surface-elevated px-1.5 py-0.5 font-medium text-secondary ring-border text-[10px] ring-1"
|
|
301
304
|
>
|
|
302
305
|
{role}
|
|
303
306
|
</span>
|
|
@@ -314,7 +317,7 @@
|
|
|
314
317
|
<div class="p-1.5">
|
|
315
318
|
{#each items as item (item.id)}
|
|
316
319
|
{#if item.separator}
|
|
317
|
-
<div class="my-1.5 border-
|
|
320
|
+
<div class="my-1.5 border-border border-t" role="separator"></div>
|
|
318
321
|
{:else}
|
|
319
322
|
<button
|
|
320
323
|
type="button"
|
|
@@ -322,8 +325,8 @@
|
|
|
322
325
|
disabled={item.disabled}
|
|
323
326
|
onclick={() => select(item)}
|
|
324
327
|
class={[
|
|
325
|
-
'
|
|
326
|
-
'focus-visible:
|
|
328
|
+
'gap-2 rounded-xl px-2.5 py-2 flex w-full items-start text-left transition-colors',
|
|
329
|
+
'focus-visible:ring-brand-500/30 focus-visible:ring-2 focus-visible:outline-none',
|
|
327
330
|
item.destructive
|
|
328
331
|
? 'text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-950/40'
|
|
329
332
|
: 'text-primary hover:bg-surface-overlay',
|
|
@@ -331,13 +334,13 @@
|
|
|
331
334
|
]}
|
|
332
335
|
>
|
|
333
336
|
<span class="min-w-0 flex-1">
|
|
334
|
-
<span class="
|
|
337
|
+
<span class="text-sm font-medium block">{item.label}</span>
|
|
335
338
|
{#if item.description}
|
|
336
|
-
<span class="
|
|
339
|
+
<span class="text-xs text-muted block">{item.description}</span>
|
|
337
340
|
{/if}
|
|
338
341
|
</span>
|
|
339
342
|
{#if item.shortcut}
|
|
340
|
-
<span class="mt-0.5
|
|
343
|
+
<span class="mt-0.5 font-mono text-muted shrink-0 text-[10px]">{item.shortcut}</span>
|
|
341
344
|
{/if}
|
|
342
345
|
</button>
|
|
343
346
|
{/if}
|