@aphexcms/ui 0.8.2 → 0.8.4
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/ui/attachment/attachment-action.svelte +7 -0
- package/dist/components/ui/attachment/attachment-action.svelte.d.ts +4 -0
- package/dist/components/ui/attachment/attachment-actions.svelte +19 -0
- package/dist/components/ui/attachment/attachment-actions.svelte.d.ts +5 -0
- package/dist/components/ui/attachment/attachment-content.svelte +19 -0
- package/dist/components/ui/attachment/attachment-content.svelte.d.ts +5 -0
- package/dist/components/ui/attachment/attachment-context.svelte.d.ts +10 -0
- package/dist/components/ui/attachment/attachment-context.svelte.js +13 -0
- package/dist/components/ui/attachment/attachment-description.svelte +19 -0
- package/dist/components/ui/attachment/attachment-description.svelte.d.ts +5 -0
- package/dist/components/ui/attachment/attachment-group.svelte +22 -0
- package/dist/components/ui/attachment/attachment-group.svelte.d.ts +5 -0
- package/dist/components/ui/attachment/attachment-media.svelte +26 -0
- package/dist/components/ui/attachment/attachment-media.svelte.d.ts +8 -0
- package/dist/components/ui/attachment/attachment-title.svelte +25 -0
- package/dist/components/ui/attachment/attachment-title.svelte.d.ts +5 -0
- package/dist/components/ui/attachment/attachment-trigger.svelte +34 -0
- package/dist/components/ui/attachment/attachment-trigger.svelte.d.ts +6 -0
- package/dist/components/ui/attachment/attachment.svelte +56 -0
- package/dist/components/ui/attachment/attachment.svelte.d.ts +11 -0
- package/dist/components/ui/attachment/index.d.ts +10 -0
- package/dist/components/ui/attachment/index.js +9 -0
- package/dist/components/ui/avatar/avatar-fallback.svelte +4 -1
- package/dist/components/ui/avatar/avatar-image.svelte +1 -1
- package/dist/components/ui/avatar/avatar.svelte +9 -2
- package/dist/components/ui/avatar/avatar.svelte.d.ts +4 -1
- package/dist/components/ui/bubble/bubble-content.svelte +22 -0
- package/dist/components/ui/bubble/bubble-content.svelte.d.ts +5 -0
- package/dist/components/ui/bubble/bubble-group.svelte +19 -0
- package/dist/components/ui/bubble/bubble-group.svelte.d.ts +5 -0
- package/dist/components/ui/bubble/bubble-reactions.svelte +32 -0
- package/dist/components/ui/bubble/bubble-reactions.svelte.d.ts +9 -0
- package/dist/components/ui/bubble/bubble.svelte +48 -0
- package/dist/components/ui/bubble/bubble.svelte.d.ts +43 -0
- package/dist/components/ui/bubble/index.d.ts +5 -0
- package/dist/components/ui/bubble/index.js +5 -0
- package/dist/components/ui/button-group/button-group-separator.svelte +23 -0
- package/dist/components/ui/button-group/button-group-separator.svelte.d.ts +13 -0
- package/dist/components/ui/button-group/button-group-text.svelte +31 -0
- package/dist/components/ui/button-group/button-group-text.svelte.d.ts +11 -0
- package/dist/components/ui/button-group/button-group.svelte +46 -0
- package/dist/components/ui/button-group/button-group.svelte.d.ts +26 -0
- package/dist/components/ui/button-group/index.d.ts +4 -0
- package/dist/components/ui/button-group/index.js +6 -0
- package/dist/components/ui/marker/index.d.ts +4 -0
- package/dist/components/ui/marker/index.js +4 -0
- package/dist/components/ui/marker/marker-content.svelte +17 -0
- package/dist/components/ui/marker/marker-content.svelte.d.ts +5 -0
- package/dist/components/ui/marker/marker-icon.svelte +18 -0
- package/dist/components/ui/marker/marker-icon.svelte.d.ts +5 -0
- package/dist/components/ui/marker/marker.svelte +38 -0
- package/dist/components/ui/marker/marker.svelte.d.ts +29 -0
- package/dist/components/ui/message/index.d.ts +7 -0
- package/dist/components/ui/message/index.js +6 -0
- package/dist/components/ui/message/message-avatar.svelte +22 -0
- package/dist/components/ui/message/message-avatar.svelte.d.ts +5 -0
- package/dist/components/ui/message/message-content.svelte +19 -0
- package/dist/components/ui/message/message-content.svelte.d.ts +5 -0
- package/dist/components/ui/message/message-context.d.ts +3 -0
- package/dist/components/ui/message/message-context.js +8 -0
- package/dist/components/ui/message/message-footer.svelte +22 -0
- package/dist/components/ui/message/message-footer.svelte.d.ts +5 -0
- package/dist/components/ui/message/message-group.svelte +19 -0
- package/dist/components/ui/message/message-group.svelte.d.ts +5 -0
- package/dist/components/ui/message/message-header.svelte +19 -0
- package/dist/components/ui/message/message-header.svelte.d.ts +5 -0
- package/dist/components/ui/message/message.svelte +27 -0
- package/dist/components/ui/message/message.svelte.d.ts +9 -0
- package/dist/components/ui/message-scroller/index.d.ts +7 -0
- package/dist/components/ui/message-scroller/index.js +7 -0
- package/dist/components/ui/message-scroller/message-scroller-button.svelte +51 -0
- package/dist/components/ui/message-scroller/message-scroller-button.svelte.d.ts +11 -0
- package/dist/components/ui/message-scroller/message-scroller-content.svelte +35 -0
- package/dist/components/ui/message-scroller/message-scroller-content.svelte.d.ts +5 -0
- package/dist/components/ui/message-scroller/message-scroller-context.svelte.d.ts +39 -0
- package/dist/components/ui/message-scroller/message-scroller-context.svelte.js +161 -0
- package/dist/components/ui/message-scroller/message-scroller-item.svelte +51 -0
- package/dist/components/ui/message-scroller/message-scroller-item.svelte.d.ts +9 -0
- package/dist/components/ui/message-scroller/message-scroller-provider.svelte +40 -0
- package/dist/components/ui/message-scroller/message-scroller-provider.svelte.d.ts +12 -0
- package/dist/components/ui/message-scroller/message-scroller-viewport.svelte +46 -0
- package/dist/components/ui/message-scroller/message-scroller-viewport.svelte.d.ts +5 -0
- package/dist/components/ui/message-scroller/message-scroller.svelte +27 -0
- package/dist/components/ui/message-scroller/message-scroller.svelte.d.ts +5 -0
- package/dist/components/ui/sidebar/context.svelte.js +9 -0
- package/dist/components/ui/sidebar/sidebar-input.svelte.d.ts +1 -1
- package/package.json +35 -5
- package/src/app.css +451 -174
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Button, type ButtonProps } from '../button/index.js';
|
|
3
|
+
let { variant = 'ghost', size = 'icon-sm', children, ...restProps }: ButtonProps = $props();
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<Button data-slot="attachment-action" {variant} {size} {...restProps}>{@render children?.()}</Button
|
|
7
|
+
>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn, type WithElementRef } from '../../../utils.js';
|
|
4
|
+
let {
|
|
5
|
+
ref = $bindable(null),
|
|
6
|
+
class: className,
|
|
7
|
+
children,
|
|
8
|
+
...restProps
|
|
9
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<div
|
|
13
|
+
bind:this={ref}
|
|
14
|
+
data-slot="attachment-actions"
|
|
15
|
+
class={cn('cn-attachment-actions ml-auto flex shrink-0 items-center', className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
>
|
|
18
|
+
{@render children?.()}
|
|
19
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
3
|
+
declare const AttachmentActions: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
|
|
4
|
+
type AttachmentActions = ReturnType<typeof AttachmentActions>;
|
|
5
|
+
export default AttachmentActions;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn, type WithElementRef } from '../../../utils.js';
|
|
4
|
+
let {
|
|
5
|
+
ref = $bindable(null),
|
|
6
|
+
class: className,
|
|
7
|
+
children,
|
|
8
|
+
...restProps
|
|
9
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<div
|
|
13
|
+
bind:this={ref}
|
|
14
|
+
data-slot="attachment-content"
|
|
15
|
+
class={cn('cn-attachment-content min-w-0 flex-1', className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
>
|
|
18
|
+
{@render children?.()}
|
|
19
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
3
|
+
declare const AttachmentContent: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
|
|
4
|
+
type AttachmentContent = ReturnType<typeof AttachmentContent>;
|
|
5
|
+
export default AttachmentContent;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type AttachmentState = 'idle' | 'uploading' | 'processing' | 'error' | 'done';
|
|
2
|
+
export type AttachmentSize = 'default' | 'sm' | 'xs';
|
|
3
|
+
export type AttachmentOrientation = 'horizontal' | 'vertical';
|
|
4
|
+
export declare class AttachmentContext {
|
|
5
|
+
state: AttachmentState;
|
|
6
|
+
size: AttachmentSize;
|
|
7
|
+
orientation: AttachmentOrientation;
|
|
8
|
+
}
|
|
9
|
+
export declare function setAttachmentContext(): AttachmentContext;
|
|
10
|
+
export declare function getAttachmentContext(): AttachmentContext;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getContext, setContext } from 'svelte';
|
|
2
|
+
const ATTACHMENT = Symbol.for('aphexcms.ui.attachment');
|
|
3
|
+
export class AttachmentContext {
|
|
4
|
+
state = $state('done');
|
|
5
|
+
size = $state('default');
|
|
6
|
+
orientation = $state('horizontal');
|
|
7
|
+
}
|
|
8
|
+
export function setAttachmentContext() {
|
|
9
|
+
return setContext(ATTACHMENT, new AttachmentContext());
|
|
10
|
+
}
|
|
11
|
+
export function getAttachmentContext() {
|
|
12
|
+
return getContext(ATTACHMENT) ?? new AttachmentContext();
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn, type WithElementRef } from '../../../utils.js';
|
|
4
|
+
let {
|
|
5
|
+
ref = $bindable(null),
|
|
6
|
+
class: className,
|
|
7
|
+
children,
|
|
8
|
+
...restProps
|
|
9
|
+
}: WithElementRef<HTMLAttributes<HTMLParagraphElement>> = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<p
|
|
13
|
+
bind:this={ref}
|
|
14
|
+
data-slot="attachment-description"
|
|
15
|
+
class={cn('cn-attachment-description text-muted-foreground truncate', className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
>
|
|
18
|
+
{@render children?.()}
|
|
19
|
+
</p>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
3
|
+
declare const AttachmentDescription: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLParagraphElement>>, {}, "ref">;
|
|
4
|
+
type AttachmentDescription = ReturnType<typeof AttachmentDescription>;
|
|
5
|
+
export default AttachmentDescription;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn, type WithElementRef } from '../../../utils.js';
|
|
4
|
+
let {
|
|
5
|
+
ref = $bindable(null),
|
|
6
|
+
class: className,
|
|
7
|
+
children,
|
|
8
|
+
...restProps
|
|
9
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<div
|
|
13
|
+
bind:this={ref}
|
|
14
|
+
data-slot="attachment-group"
|
|
15
|
+
class={cn(
|
|
16
|
+
'cn-attachment-group scroll-fade flex snap-x overflow-x-auto [&>[data-slot=attachment]]:snap-start',
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
{...restProps}
|
|
20
|
+
>
|
|
21
|
+
{@render children?.()}
|
|
22
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
3
|
+
declare const AttachmentGroup: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
|
|
4
|
+
type AttachmentGroup = ReturnType<typeof AttachmentGroup>;
|
|
5
|
+
export default AttachmentGroup;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn, type WithElementRef } from '../../../utils.js';
|
|
4
|
+
type Props = WithElementRef<HTMLAttributes<HTMLDivElement>> & { variant?: 'icon' | 'image' };
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
variant = 'icon',
|
|
9
|
+
children,
|
|
10
|
+
...restProps
|
|
11
|
+
}: Props = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<div
|
|
15
|
+
bind:this={ref}
|
|
16
|
+
data-slot="attachment-media"
|
|
17
|
+
data-variant={variant}
|
|
18
|
+
class={cn(
|
|
19
|
+
'cn-attachment-media flex aspect-square shrink-0 items-center justify-center overflow-hidden [&_img]:size-full [&_img]:object-cover',
|
|
20
|
+
variant === 'image' && 'cn-attachment-media-variant-image',
|
|
21
|
+
className
|
|
22
|
+
)}
|
|
23
|
+
{...restProps}
|
|
24
|
+
>
|
|
25
|
+
{@render children?.()}
|
|
26
|
+
</div>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
3
|
+
type Props = WithElementRef<HTMLAttributes<HTMLDivElement>> & {
|
|
4
|
+
variant?: 'icon' | 'image';
|
|
5
|
+
};
|
|
6
|
+
declare const AttachmentMedia: import("svelte").Component<Props, {}, "ref">;
|
|
7
|
+
type AttachmentMedia = ReturnType<typeof AttachmentMedia>;
|
|
8
|
+
export default AttachmentMedia;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn, type WithElementRef } from '../../../utils.js';
|
|
4
|
+
import { getAttachmentContext } from './attachment-context.svelte.js';
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLParagraphElement>> = $props();
|
|
11
|
+
const context = getAttachmentContext();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<p
|
|
15
|
+
bind:this={ref}
|
|
16
|
+
data-slot="attachment-title"
|
|
17
|
+
class={cn(
|
|
18
|
+
'cn-attachment-title truncate',
|
|
19
|
+
(context.state === 'uploading' || context.state === 'processing') && 'shimmer',
|
|
20
|
+
className
|
|
21
|
+
)}
|
|
22
|
+
{...restProps}
|
|
23
|
+
>
|
|
24
|
+
{@render children?.()}
|
|
25
|
+
</p>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
3
|
+
declare const AttachmentTitle: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLParagraphElement>>, {}, "ref">;
|
|
4
|
+
type AttachmentTitle = ReturnType<typeof AttachmentTitle>;
|
|
5
|
+
export default AttachmentTitle;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn, type WithElementRef } from '../../../utils.js';
|
|
4
|
+
type Props = WithElementRef<HTMLButtonAttributes> & WithElementRef<HTMLAnchorAttributes>;
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
href,
|
|
9
|
+
children,
|
|
10
|
+
type = 'button',
|
|
11
|
+
...restProps
|
|
12
|
+
}: Props = $props();
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
{#if href}
|
|
16
|
+
<a
|
|
17
|
+
bind:this={ref}
|
|
18
|
+
data-slot="attachment-trigger"
|
|
19
|
+
{href}
|
|
20
|
+
class={cn('cn-attachment-trigger focus-visible:ring-ring focus-visible:ring-2', className)}
|
|
21
|
+
{...restProps}>{@render children?.()}</a
|
|
22
|
+
>
|
|
23
|
+
{:else}
|
|
24
|
+
<button
|
|
25
|
+
bind:this={ref}
|
|
26
|
+
data-slot="attachment-trigger"
|
|
27
|
+
{type}
|
|
28
|
+
class={cn(
|
|
29
|
+
'cn-attachment-trigger focus-visible:ring-ring cursor-pointer focus-visible:ring-2',
|
|
30
|
+
className
|
|
31
|
+
)}
|
|
32
|
+
{...restProps}>{@render children?.()}</button
|
|
33
|
+
>
|
|
34
|
+
{/if}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
3
|
+
type Props = WithElementRef<HTMLButtonAttributes> & WithElementRef<HTMLAnchorAttributes>;
|
|
4
|
+
declare const AttachmentTrigger: import("svelte").Component<Props, {}, "ref">;
|
|
5
|
+
type AttachmentTrigger = ReturnType<typeof AttachmentTrigger>;
|
|
6
|
+
export default AttachmentTrigger;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn, type WithElementRef } from '../../../utils.js';
|
|
4
|
+
import {
|
|
5
|
+
setAttachmentContext,
|
|
6
|
+
type AttachmentOrientation,
|
|
7
|
+
type AttachmentSize,
|
|
8
|
+
type AttachmentState
|
|
9
|
+
} from './attachment-context.svelte.js';
|
|
10
|
+
|
|
11
|
+
type Props = WithElementRef<HTMLAttributes<HTMLDivElement>> & {
|
|
12
|
+
state?: AttachmentState;
|
|
13
|
+
size?: AttachmentSize;
|
|
14
|
+
orientation?: AttachmentOrientation;
|
|
15
|
+
};
|
|
16
|
+
let {
|
|
17
|
+
ref = $bindable(null),
|
|
18
|
+
class: className,
|
|
19
|
+
state = 'done',
|
|
20
|
+
size = 'default',
|
|
21
|
+
orientation = 'horizontal',
|
|
22
|
+
children,
|
|
23
|
+
...restProps
|
|
24
|
+
}: Props = $props();
|
|
25
|
+
const context = setAttachmentContext();
|
|
26
|
+
$effect(() => {
|
|
27
|
+
context.state = state;
|
|
28
|
+
context.size = size;
|
|
29
|
+
context.orientation = orientation;
|
|
30
|
+
});
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<div
|
|
34
|
+
bind:this={ref}
|
|
35
|
+
data-slot="attachment"
|
|
36
|
+
data-state={state}
|
|
37
|
+
data-size={size}
|
|
38
|
+
data-orientation={orientation}
|
|
39
|
+
class={cn(
|
|
40
|
+
'cn-attachment group/attachment bg-card text-card-foreground relative flex min-w-0 overflow-hidden border',
|
|
41
|
+
orientation === 'horizontal'
|
|
42
|
+
? 'cn-attachment-orientation-horizontal'
|
|
43
|
+
: 'cn-attachment-orientation-vertical',
|
|
44
|
+
size === 'default'
|
|
45
|
+
? 'cn-attachment-size-default'
|
|
46
|
+
: size === 'sm'
|
|
47
|
+
? 'cn-attachment-size-sm'
|
|
48
|
+
: 'cn-attachment-size-xs',
|
|
49
|
+
orientation === 'horizontal' ? 'items-center' : 'flex-col items-stretch',
|
|
50
|
+
state === 'error' && 'border-destructive/50 text-destructive',
|
|
51
|
+
className
|
|
52
|
+
)}
|
|
53
|
+
{...restProps}
|
|
54
|
+
>
|
|
55
|
+
{@render children?.()}
|
|
56
|
+
</div>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
3
|
+
import { type AttachmentOrientation, type AttachmentSize, type AttachmentState } from './attachment-context.svelte.js';
|
|
4
|
+
type Props = WithElementRef<HTMLAttributes<HTMLDivElement>> & {
|
|
5
|
+
state?: AttachmentState;
|
|
6
|
+
size?: AttachmentSize;
|
|
7
|
+
orientation?: AttachmentOrientation;
|
|
8
|
+
};
|
|
9
|
+
declare const Attachment: import("svelte").Component<Props, {}, "ref">;
|
|
10
|
+
type Attachment = ReturnType<typeof Attachment>;
|
|
11
|
+
export default Attachment;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default as Attachment } from './attachment.svelte';
|
|
2
|
+
export { default as AttachmentMedia } from './attachment-media.svelte';
|
|
3
|
+
export { default as AttachmentContent } from './attachment-content.svelte';
|
|
4
|
+
export { default as AttachmentTitle } from './attachment-title.svelte';
|
|
5
|
+
export { default as AttachmentDescription } from './attachment-description.svelte';
|
|
6
|
+
export { default as AttachmentActions } from './attachment-actions.svelte';
|
|
7
|
+
export { default as AttachmentAction } from './attachment-action.svelte';
|
|
8
|
+
export { default as AttachmentTrigger } from './attachment-trigger.svelte';
|
|
9
|
+
export { default as AttachmentGroup } from './attachment-group.svelte';
|
|
10
|
+
export type { AttachmentState, AttachmentSize, AttachmentOrientation } from './attachment-context.svelte.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as Attachment } from './attachment.svelte';
|
|
2
|
+
export { default as AttachmentMedia } from './attachment-media.svelte';
|
|
3
|
+
export { default as AttachmentContent } from './attachment-content.svelte';
|
|
4
|
+
export { default as AttachmentTitle } from './attachment-title.svelte';
|
|
5
|
+
export { default as AttachmentDescription } from './attachment-description.svelte';
|
|
6
|
+
export { default as AttachmentActions } from './attachment-actions.svelte';
|
|
7
|
+
export { default as AttachmentAction } from './attachment-action.svelte';
|
|
8
|
+
export { default as AttachmentTrigger } from './attachment-trigger.svelte';
|
|
9
|
+
export { default as AttachmentGroup } from './attachment-group.svelte';
|
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
<AvatarPrimitive.Fallback
|
|
13
13
|
bind:ref
|
|
14
14
|
data-slot="avatar-fallback"
|
|
15
|
-
class={cn(
|
|
15
|
+
class={cn(
|
|
16
|
+
'cn-avatar-fallback bg-muted flex size-full items-center justify-center rounded-full',
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
16
19
|
{...restProps}
|
|
17
20
|
/>
|
|
@@ -2,18 +2,25 @@
|
|
|
2
2
|
import { Avatar as AvatarPrimitive } from 'bits-ui';
|
|
3
3
|
import { cn } from '../../../utils.js';
|
|
4
4
|
|
|
5
|
+
type Props = AvatarPrimitive.RootProps & { size?: 'sm' | 'default' | 'lg' };
|
|
6
|
+
|
|
5
7
|
let {
|
|
6
8
|
ref = $bindable(null),
|
|
7
9
|
loadingStatus = $bindable('loading'),
|
|
8
10
|
class: className,
|
|
11
|
+
size = 'default',
|
|
9
12
|
...restProps
|
|
10
|
-
}:
|
|
13
|
+
}: Props = $props();
|
|
11
14
|
</script>
|
|
12
15
|
|
|
13
16
|
<AvatarPrimitive.Root
|
|
14
17
|
bind:ref
|
|
15
18
|
bind:loadingStatus
|
|
16
19
|
data-slot="avatar"
|
|
17
|
-
|
|
20
|
+
data-size={size}
|
|
21
|
+
class={cn(
|
|
22
|
+
'cn-avatar group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full',
|
|
23
|
+
className
|
|
24
|
+
)}
|
|
18
25
|
{...restProps}
|
|
19
26
|
/>
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { Avatar as AvatarPrimitive } from 'bits-ui';
|
|
2
|
-
|
|
2
|
+
type Props = AvatarPrimitive.RootProps & {
|
|
3
|
+
size?: 'sm' | 'default' | 'lg';
|
|
4
|
+
};
|
|
5
|
+
declare const Avatar: import("svelte").Component<Props, {}, "ref" | "loadingStatus">;
|
|
3
6
|
type Avatar = ReturnType<typeof Avatar>;
|
|
4
7
|
export default Avatar;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn, type WithElementRef } from '../../../utils.js';
|
|
4
|
+
let {
|
|
5
|
+
ref = $bindable(null),
|
|
6
|
+
class: className,
|
|
7
|
+
children,
|
|
8
|
+
...restProps
|
|
9
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<div
|
|
13
|
+
bind:this={ref}
|
|
14
|
+
data-slot="bubble-content"
|
|
15
|
+
class={cn(
|
|
16
|
+
'cn-bubble-content w-fit max-w-full min-w-0 overflow-hidden wrap-break-word [button]:text-left [button,a]:transition-colors',
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
{...restProps}
|
|
20
|
+
>
|
|
21
|
+
{@render children?.()}
|
|
22
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
3
|
+
declare const BubbleContent: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
|
|
4
|
+
type BubbleContent = ReturnType<typeof BubbleContent>;
|
|
5
|
+
export default BubbleContent;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn, type WithElementRef } from '../../../utils.js';
|
|
4
|
+
let {
|
|
5
|
+
ref = $bindable(null),
|
|
6
|
+
class: className,
|
|
7
|
+
children,
|
|
8
|
+
...restProps
|
|
9
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<div
|
|
13
|
+
bind:this={ref}
|
|
14
|
+
data-slot="bubble-group"
|
|
15
|
+
class={cn('cn-bubble-group flex min-w-0 flex-col', className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
>
|
|
18
|
+
{@render children?.()}
|
|
19
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
3
|
+
declare const BubbleGroup: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
|
|
4
|
+
type BubbleGroup = ReturnType<typeof BubbleGroup>;
|
|
5
|
+
export default BubbleGroup;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { cn, type WithElementRef } from '../../../utils.js';
|
|
4
|
+
type Props = WithElementRef<HTMLAttributes<HTMLDivElement>> & {
|
|
5
|
+
side?: 'top' | 'bottom';
|
|
6
|
+
align?: 'start' | 'end';
|
|
7
|
+
};
|
|
8
|
+
let {
|
|
9
|
+
ref = $bindable(null),
|
|
10
|
+
class: className,
|
|
11
|
+
side = 'bottom',
|
|
12
|
+
align = 'end',
|
|
13
|
+
children,
|
|
14
|
+
...restProps
|
|
15
|
+
}: Props = $props();
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<div
|
|
19
|
+
bind:this={ref}
|
|
20
|
+
data-slot="bubble-reactions"
|
|
21
|
+
data-align={align}
|
|
22
|
+
data-side={side}
|
|
23
|
+
class={cn(
|
|
24
|
+
'cn-bubble-reactions absolute z-10 flex w-fit items-center justify-center',
|
|
25
|
+
side === 'top' ? 'cn-bubble-reactions-side-top' : 'cn-bubble-reactions-side-bottom',
|
|
26
|
+
align === 'start' ? 'cn-bubble-reactions-align-start' : 'cn-bubble-reactions-align-end',
|
|
27
|
+
className
|
|
28
|
+
)}
|
|
29
|
+
{...restProps}
|
|
30
|
+
>
|
|
31
|
+
{@render children?.()}
|
|
32
|
+
</div>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
3
|
+
type Props = WithElementRef<HTMLAttributes<HTMLDivElement>> & {
|
|
4
|
+
side?: 'top' | 'bottom';
|
|
5
|
+
align?: 'start' | 'end';
|
|
6
|
+
};
|
|
7
|
+
declare const BubbleReactions: import("svelte").Component<Props, {}, "ref">;
|
|
8
|
+
type BubbleReactions = ReturnType<typeof BubbleReactions>;
|
|
9
|
+
export default BubbleReactions;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import { tv, type VariantProps } from 'tailwind-variants';
|
|
3
|
+
export const bubbleVariants = tv({
|
|
4
|
+
base: 'cn-bubble group/bubble relative flex w-fit min-w-0 flex-col',
|
|
5
|
+
variants: {
|
|
6
|
+
variant: {
|
|
7
|
+
default: 'cn-bubble-variant-default',
|
|
8
|
+
secondary: 'cn-bubble-variant-secondary',
|
|
9
|
+
muted: 'cn-bubble-variant-muted',
|
|
10
|
+
tinted: 'cn-bubble-variant-tinted',
|
|
11
|
+
outline: 'cn-bubble-variant-outline',
|
|
12
|
+
ghost: 'cn-bubble-variant-ghost',
|
|
13
|
+
destructive: 'cn-bubble-variant-destructive'
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: { variant: 'default' }
|
|
17
|
+
});
|
|
18
|
+
export type BubbleVariant = VariantProps<typeof bubbleVariants>['variant'];
|
|
19
|
+
export type BubbleAlign = 'start' | 'end';
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<script lang="ts">
|
|
23
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
24
|
+
import { cn, type WithElementRef } from '../../../utils.js';
|
|
25
|
+
type Props = WithElementRef<HTMLAttributes<HTMLDivElement>> & {
|
|
26
|
+
variant?: BubbleVariant;
|
|
27
|
+
align?: BubbleAlign;
|
|
28
|
+
};
|
|
29
|
+
let {
|
|
30
|
+
ref = $bindable(null),
|
|
31
|
+
class: className,
|
|
32
|
+
variant = 'default',
|
|
33
|
+
align = 'start',
|
|
34
|
+
children,
|
|
35
|
+
...restProps
|
|
36
|
+
}: Props = $props();
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<div
|
|
40
|
+
bind:this={ref}
|
|
41
|
+
data-slot="bubble"
|
|
42
|
+
data-variant={variant}
|
|
43
|
+
data-align={align}
|
|
44
|
+
class={cn(bubbleVariants({ variant }), className)}
|
|
45
|
+
{...restProps}
|
|
46
|
+
>
|
|
47
|
+
{@render children?.()}
|
|
48
|
+
</div>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type VariantProps } from 'tailwind-variants';
|
|
2
|
+
export declare const bubbleVariants: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
variant: {
|
|
4
|
+
default: string;
|
|
5
|
+
secondary: string;
|
|
6
|
+
muted: string;
|
|
7
|
+
tinted: string;
|
|
8
|
+
outline: string;
|
|
9
|
+
ghost: string;
|
|
10
|
+
destructive: string;
|
|
11
|
+
};
|
|
12
|
+
}, undefined, "cn-bubble group/bubble relative flex w-fit min-w-0 flex-col", {
|
|
13
|
+
variant: {
|
|
14
|
+
default: string;
|
|
15
|
+
secondary: string;
|
|
16
|
+
muted: string;
|
|
17
|
+
tinted: string;
|
|
18
|
+
outline: string;
|
|
19
|
+
ghost: string;
|
|
20
|
+
destructive: string;
|
|
21
|
+
};
|
|
22
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
23
|
+
variant: {
|
|
24
|
+
default: string;
|
|
25
|
+
secondary: string;
|
|
26
|
+
muted: string;
|
|
27
|
+
tinted: string;
|
|
28
|
+
outline: string;
|
|
29
|
+
ghost: string;
|
|
30
|
+
destructive: string;
|
|
31
|
+
};
|
|
32
|
+
}, undefined, "cn-bubble group/bubble relative flex w-fit min-w-0 flex-col", unknown, unknown, undefined>>;
|
|
33
|
+
export type BubbleVariant = VariantProps<typeof bubbleVariants>['variant'];
|
|
34
|
+
export type BubbleAlign = 'start' | 'end';
|
|
35
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
36
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
37
|
+
type Props = WithElementRef<HTMLAttributes<HTMLDivElement>> & {
|
|
38
|
+
variant?: BubbleVariant;
|
|
39
|
+
align?: BubbleAlign;
|
|
40
|
+
};
|
|
41
|
+
declare const Bubble: import("svelte").Component<Props, {}, "ref">;
|
|
42
|
+
type Bubble = ReturnType<typeof Bubble>;
|
|
43
|
+
export default Bubble;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as Bubble } from './bubble.svelte';
|
|
2
|
+
export { bubbleVariants, type BubbleVariant, type BubbleAlign } from './bubble.svelte';
|
|
3
|
+
export { default as BubbleContent } from './bubble-content.svelte';
|
|
4
|
+
export { default as BubbleReactions } from './bubble-reactions.svelte';
|
|
5
|
+
export { default as BubbleGroup } from './bubble-group.svelte';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as Bubble } from './bubble.svelte';
|
|
2
|
+
export { bubbleVariants } from './bubble.svelte';
|
|
3
|
+
export { default as BubbleContent } from './bubble-content.svelte';
|
|
4
|
+
export { default as BubbleReactions } from './bubble-reactions.svelte';
|
|
5
|
+
export { default as BubbleGroup } from './bubble-group.svelte';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from '../../../utils.js';
|
|
3
|
+
import type { ComponentProps } from 'svelte';
|
|
4
|
+
import { Separator } from '../separator/index.js';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
orientation = 'vertical',
|
|
10
|
+
...restProps
|
|
11
|
+
}: ComponentProps<typeof Separator> = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Separator
|
|
15
|
+
bind:ref
|
|
16
|
+
data-slot="button-group-separator"
|
|
17
|
+
{orientation}
|
|
18
|
+
class={cn(
|
|
19
|
+
'bg-input relative self-stretch data-[orientation=horizontal]:mx-px data-[orientation=horizontal]:w-auto data-[orientation=vertical]:my-px data-[orientation=vertical]:h-auto',
|
|
20
|
+
className
|
|
21
|
+
)}
|
|
22
|
+
{...restProps}
|
|
23
|
+
/>
|