@cognite/aura 0.2.0 → 0.3.1
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/DESIGN.md +869 -870
- package/README.md +143 -9
- package/dist/colors.css +30 -0
- package/dist/components/index.d.ts +7 -36
- package/dist/components/index.js +319 -350
- package/dist/components/ui/core/accordion/accordion.d.ts +7 -7
- package/dist/components/ui/core/accordion/accordion.js +49 -47
- package/dist/components/ui/core/action-toolbar/action-toolbar.d.ts +41 -0
- package/dist/components/ui/core/action-toolbar/action-toolbar.js +176 -0
- package/dist/components/ui/core/alert/alert.d.ts +23 -12
- package/dist/components/ui/core/alert/alert.js +123 -120
- package/dist/components/ui/core/avatar/avatar.d.ts +12 -8
- package/dist/components/ui/core/badge/badge.d.ts +11 -8
- package/dist/components/ui/core/banner/banner.d.ts +18 -28
- package/dist/components/ui/core/breadcrumb/breadcrumb.d.ts +10 -9
- package/dist/components/ui/core/breadcrumb/breadcrumb.js +98 -88
- package/dist/components/ui/core/button/button.d.ts +8 -5
- package/dist/components/ui/core/button/button.js +22 -19
- package/dist/components/ui/core/button-group/button-group.d.ts +7 -6
- package/dist/components/ui/core/card/card.d.ts +17 -16
- package/dist/components/ui/core/chart/chart.d.ts +69 -0
- package/dist/components/ui/core/chart/chart.js +215 -0
- package/dist/components/ui/core/chart/index.d.ts +2 -0
- package/dist/components/ui/core/chart/index.js +8 -0
- package/dist/components/ui/core/checkbox/checkbox.d.ts +13 -9
- package/dist/components/ui/core/checkbox/checkbox.js +32 -28
- package/dist/components/ui/core/code-block/code-block.d.ts +6 -9
- package/dist/components/ui/core/code-block/code-block.js +48 -44
- package/dist/components/ui/core/collapsible/collapsible.d.ts +5 -3
- package/dist/components/ui/core/combobox/combobox.d.ts +2 -2
- package/dist/components/ui/core/command/command.d.ts +11 -78
- package/dist/components/ui/core/command/command.js +53 -52
- package/dist/components/ui/core/count/count.d.ts +7 -6
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.d.ts +15 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js +84 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/index.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/types.d.ts +18 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js +63 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.d.ts +15 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +99 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/index.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/types.d.ts +25 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.d.ts +4 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js +82 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.d.ts +17 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +190 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/index.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.d.ts +42 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js +161 -0
- package/dist/components/ui/core/date-time-pickers/index.d.ts +8 -0
- package/dist/components/ui/core/date-time-pickers/index.js +8 -0
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.d.ts +7 -0
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js +57 -0
- package/dist/components/ui/core/date-time-pickers/shared/calendar/calendar.d.ts +13 -0
- package/dist/components/ui/core/date-time-pickers/shared/calendar/calendar.js +119 -0
- package/dist/components/ui/core/date-time-pickers/shared/calendar-header/calendar-header.d.ts +10 -0
- package/dist/components/ui/core/date-time-pickers/shared/calendar-header/calendar-header.js +93 -0
- package/dist/components/ui/core/date-time-pickers/shared/constants.d.ts +20 -0
- package/dist/components/ui/core/date-time-pickers/shared/constants.js +14 -0
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.d.ts +19 -0
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js +99 -0
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.d.ts +12 -0
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js +68 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.d.ts +12 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js +40 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.d.ts +29 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.js +63 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.d.ts +8 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.js +19 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.d.ts +23 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.js +32 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.d.ts +17 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js +34 -0
- package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.d.ts +8 -0
- package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.js +7 -0
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.d.ts +13 -0
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js +31 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.d.ts +10 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js +52 -0
- package/dist/components/ui/core/date-time-pickers/utils/calendar-utils.d.ts +48 -0
- package/dist/components/ui/core/date-time-pickers/utils/calendar-utils.js +52 -0
- package/dist/components/ui/core/date-time-pickers/utils/date-range-utils.d.ts +26 -0
- package/dist/components/ui/core/date-time-pickers/utils/format-utils.d.ts +37 -0
- package/dist/components/ui/core/date-time-pickers/utils/segment-utils.d.ts +34 -0
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.d.ts +43 -0
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.js +15 -0
- package/dist/components/ui/core/date-time-pickers/utils/time-validation.d.ts +23 -0
- package/dist/components/ui/core/dialog/dialog.d.ts +10 -10
- package/dist/components/ui/core/dialog/dialog.js +12 -3
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +24 -47
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +125 -123
- package/dist/components/ui/core/empty-state/empty-state.context.d.ts +10 -0
- package/dist/components/ui/core/empty-state/empty-state.context.js +8 -0
- package/dist/components/ui/core/empty-state/empty-state.d.ts +18 -0
- package/dist/components/ui/core/empty-state/empty-state.js +139 -0
- package/dist/components/ui/core/helper-text/helper-text.d.ts +7 -5
- package/dist/components/ui/core/hover-card/hover-card.d.ts +5 -7
- package/dist/components/ui/core/hover-card/hover-card.js +23 -22
- package/dist/components/ui/core/inline-citation/inline-citation.d.ts +10 -10
- package/dist/components/ui/core/inline-citation/inline-citation.js +57 -49
- package/dist/components/ui/core/input/input.d.ts +2 -1
- package/dist/components/ui/core/input/input.js +1 -1
- package/dist/components/ui/core/input-group/input-group.d.ts +17 -13
- package/dist/components/ui/core/input-group/input-group.js +35 -36
- package/dist/components/ui/core/kbd/kbd.d.ts +3 -2
- package/dist/components/ui/core/label/label.d.ts +3 -2
- package/dist/components/ui/core/loader/loader.d.ts +2 -2
- package/dist/components/ui/core/message/message.d.ts +18 -17
- package/dist/components/ui/core/message/message.js +387 -99
- package/dist/components/ui/core/pagination/pagination-size-context.d.ts +5 -0
- package/dist/components/ui/core/pagination/pagination-size-context.js +6 -0
- package/dist/components/ui/core/pagination/pagination-teleport.d.ts +11 -0
- package/dist/components/ui/core/pagination/pagination-teleport.js +108 -0
- package/dist/components/ui/core/pagination/pagination-teleport.utils.d.ts +1 -0
- package/dist/components/ui/core/pagination/pagination-teleport.utils.js +7 -0
- package/dist/components/ui/core/pagination/pagination.d.ts +41 -0
- package/dist/components/ui/core/pagination/pagination.js +337 -0
- package/dist/components/ui/core/popover/popover.d.ts +12 -16
- package/dist/components/ui/core/popover/popover.js +52 -51
- package/dist/components/ui/core/progress/progress.d.ts +7 -4
- package/dist/components/ui/core/prompt-input/prompt-input.d.ts +36 -103
- package/dist/components/ui/core/prompt-input/prompt-input.js +180 -167
- package/dist/components/ui/core/radio-group/radio-group.d.ts +12 -8
- package/dist/components/ui/core/radio-group/radio-group.js +56 -53
- package/dist/components/ui/core/reasoning/reasoning.d.ts +5 -5
- package/dist/components/ui/core/scroll-area/scroll-area.d.ts +4 -2
- package/dist/components/ui/core/search/search.d.ts +10 -0
- package/dist/components/ui/core/search/search.js +99 -0
- package/dist/components/ui/core/segmented-control/segmented-control.d.ts +15 -11
- package/dist/components/ui/core/segmented-control/segmented-control.js +4 -1
- package/dist/components/ui/core/select/select.d.ts +15 -14
- package/dist/components/ui/core/select/select.js +135 -108
- package/dist/components/ui/core/separator/separator.d.ts +2 -4
- package/dist/components/ui/core/separator/separator.js +4 -5
- package/dist/components/ui/core/shimmer/shimmer.d.ts +5 -5
- package/dist/components/ui/core/shimmer/shimmer.js +91 -52
- package/dist/components/ui/core/skeleton/skeleton.d.ts +2 -1
- package/dist/components/ui/core/sonner-toast/sonner-toast.d.ts +2 -1
- package/dist/components/ui/core/sources/sources.d.ts +3 -3
- package/dist/components/ui/core/sources/sources.js +6 -1
- package/dist/components/ui/core/switch/switch.d.ts +11 -0
- package/dist/components/ui/core/{button/button.metadata.d.ts → switch/switch.metadata.d.ts} +1 -1
- package/dist/components/ui/core/tabs/tabs.d.ts +21 -17
- package/dist/components/ui/core/tabs/tabs.js +11 -9
- package/dist/components/ui/core/textarea/textarea.d.ts +2 -1
- package/dist/components/ui/core/textarea/textarea.js +20 -18
- package/dist/components/ui/core/toggle/toggle.d.ts +15 -0
- package/dist/components/ui/core/toggle/toggle.js +74 -0
- package/dist/components/ui/core/tool/tool.d.ts +7 -6
- package/dist/components/ui/core/tool/tool.js +47 -43
- package/dist/components/ui/core/tooltip/tooltip.d.ts +6 -5
- package/dist/components/ui/core/tooltip/tooltip.js +10 -8
- package/dist/components/ui/core/topbar/topbar.d.ts +11 -13
- package/dist/eslint/index.d.ts +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/lib/portal-container-context.d.ts +2 -1
- package/dist/lib/portal-container-context.js +3 -5
- package/dist/lib/utils.d.ts +1 -1
- package/dist/lib/utils.js +7 -7
- package/dist/styles.css +1 -1
- package/dist/styles.source.css +12 -1
- package/package.json +217 -14
- package/dist/components/ui/core/accordion/accordion.metadata.d.ts +0 -2
- package/dist/components/ui/core/accordion/accordion.metadata.js +0 -9
- package/dist/components/ui/core/alert/alert.metadata.d.ts +0 -2
- package/dist/components/ui/core/alert/alert.metadata.js +0 -9
- package/dist/components/ui/core/avatar/avatar.metadata.d.ts +0 -8
- package/dist/components/ui/core/avatar/avatar.metadata.js +0 -9
- package/dist/components/ui/core/badge/badge.metadata.d.ts +0 -2
- package/dist/components/ui/core/badge/badge.metadata.js +0 -8
- package/dist/components/ui/core/banner/banner.metadata.d.ts +0 -2
- package/dist/components/ui/core/banner/banner.metadata.js +0 -9
- package/dist/components/ui/core/breadcrumb/breadcrumb.metadata.d.ts +0 -2
- package/dist/components/ui/core/breadcrumb/breadcrumb.metadata.js +0 -9
- package/dist/components/ui/core/button/button.metadata.js +0 -9
- package/dist/components/ui/core/button-group/button-group.metadata.d.ts +0 -2
- package/dist/components/ui/core/button-group/button-group.metadata.js +0 -8
- package/dist/components/ui/core/card/card.metadata.d.ts +0 -8
- package/dist/components/ui/core/card/card.metadata.js +0 -9
- package/dist/components/ui/core/code-block/code-block.metadata.d.ts +0 -2
- package/dist/components/ui/core/code-block/code-block.metadata.js +0 -8
- package/dist/components/ui/core/collapsible/collapsible.metadata.d.ts +0 -2
- package/dist/components/ui/core/collapsible/collapsible.metadata.js +0 -9
- package/dist/components/ui/core/combobox/combobox.metadata.d.ts +0 -2
- package/dist/components/ui/core/command/command.metadata.d.ts +0 -2
- package/dist/components/ui/core/command/command.metadata.js +0 -9
- package/dist/components/ui/core/dialog/dialog.metadata.d.ts +0 -2
- package/dist/components/ui/core/dialog/dialog.metadata.js +0 -9
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.metadata.d.ts +0 -2
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.metadata.js +0 -9
- package/dist/components/ui/core/helper-text/helper-text.metadata.d.ts +0 -2
- package/dist/components/ui/core/helper-text/helper-text.metadata.js +0 -9
- package/dist/components/ui/core/hover-card/hover-card.metadata.d.ts +0 -2
- package/dist/components/ui/core/hover-card/hover-card.metadata.js +0 -8
- package/dist/components/ui/core/inline-citation/inline-citation.metadata.d.ts +0 -2
- package/dist/components/ui/core/inline-citation/inline-citation.metadata.js +0 -8
- package/dist/components/ui/core/input/input.metadata.d.ts +0 -2
- package/dist/components/ui/core/input/input.metadata.js +0 -9
- package/dist/components/ui/core/input-group/input-group.metadata.d.ts +0 -2
- package/dist/components/ui/core/input-group/input-group.metadata.js +0 -9
- package/dist/components/ui/core/kbd/kbd.metadata.d.ts +0 -2
- package/dist/components/ui/core/kbd/kbd.metadata.js +0 -9
- package/dist/components/ui/core/label/label.metadata.d.ts +0 -2
- package/dist/components/ui/core/label/label.metadata.js +0 -9
- package/dist/components/ui/core/loader/loader.metadata.d.ts +0 -2
- package/dist/components/ui/core/loader/loader.metadata.js +0 -9
- package/dist/components/ui/core/message/message.metadata.d.ts +0 -2
- package/dist/components/ui/core/popover/popover.metadata.d.ts +0 -2
- package/dist/components/ui/core/popover/popover.metadata.js +0 -9
- package/dist/components/ui/core/progress/progress.metadata.d.ts +0 -2
- package/dist/components/ui/core/progress/progress.metadata.js +0 -9
- package/dist/components/ui/core/prompt-input/prompt-input.metadata.d.ts +0 -2
- package/dist/components/ui/core/prompt-input/prompt-input.metadata.js +0 -9
- package/dist/components/ui/core/radio-group/radio-group.metadata.d.ts +0 -2
- package/dist/components/ui/core/radio-group/radio-group.metadata.js +0 -9
- package/dist/components/ui/core/reasoning/reasoning.metadata.d.ts +0 -2
- package/dist/components/ui/core/reasoning/reasoning.metadata.js +0 -8
- package/dist/components/ui/core/scroll-area/scroll-area.metadata.d.ts +0 -2
- package/dist/components/ui/core/scroll-area/scroll-area.metadata.js +0 -9
- package/dist/components/ui/core/select/select.metadata.d.ts +0 -2
- package/dist/components/ui/core/select/select.metadata.js +0 -9
- package/dist/components/ui/core/separator/separator.metadata.d.ts +0 -2
- package/dist/components/ui/core/separator/separator.metadata.js +0 -8
- package/dist/components/ui/core/shimmer/shimmer.metadata.d.ts +0 -2
- package/dist/components/ui/core/shimmer/shimmer.metadata.js +0 -9
- package/dist/components/ui/core/skeleton/skeleton.metadata.d.ts +0 -2
- package/dist/components/ui/core/skeleton/skeleton.metadata.js +0 -9
- package/dist/components/ui/core/sonner-toast/sonner-toast.metadata.d.ts +0 -2
- package/dist/components/ui/core/sonner-toast/sonner-toast.metadata.js +0 -9
- package/dist/components/ui/core/sources/sources.metadata.d.ts +0 -2
- package/dist/components/ui/core/textarea/textarea.metadata.d.ts +0 -2
- package/dist/components/ui/core/textarea/textarea.metadata.js +0 -9
- package/dist/components/ui/core/tool/tool.metadata.d.ts +0 -2
- package/dist/components/ui/core/tool/tool.metadata.js +0 -8
- package/dist/components/ui/core/tooltip/tooltip.metadata.d.ts +0 -8
- package/dist/components/ui/core/tooltip/tooltip.metadata.js +0 -9
- package/dist/index.js +0 -342
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ComponentProps, HTMLAttributes } from 'react';
|
|
1
|
+
import { ComponentProps, HTMLAttributes, MemoExoticComponent, ReactNode } from 'react';
|
|
2
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
3
|
import { Streamdown } from 'streamdown';
|
|
3
4
|
import { FileUIPart, UIMessage } from '../../../../lib/ai/types';
|
|
4
5
|
import { Avatar, AvatarIcon } from '../avatar/avatar';
|
|
@@ -6,50 +7,50 @@ import { Button } from '../button/button';
|
|
|
6
7
|
type MessageProps = HTMLAttributes<HTMLDivElement> & {
|
|
7
8
|
isResponse?: boolean;
|
|
8
9
|
};
|
|
9
|
-
declare const Message: ({ className, isResponse, ...props }: MessageProps) =>
|
|
10
|
+
declare const Message: ({ className, isResponse, ...props }: MessageProps) => ReactNode;
|
|
10
11
|
type MessageContentProps = HTMLAttributes<HTMLDivElement>;
|
|
11
|
-
declare const MessageContent: ({ children, className, ...props }: MessageContentProps) =>
|
|
12
|
+
declare const MessageContent: ({ children, className, ...props }: MessageContentProps) => ReactNode;
|
|
12
13
|
type MessageAvatarProps = ComponentProps<typeof Avatar> & {
|
|
13
14
|
avatarUrl?: string;
|
|
14
15
|
name?: string;
|
|
15
16
|
};
|
|
16
|
-
declare const MessageAvatar: ({ avatarUrl, name, className, children, variant, sizes, ...props }: MessageAvatarProps) =>
|
|
17
|
+
declare const MessageAvatar: ({ avatarUrl, name, className, children, variant, sizes, ...props }: MessageAvatarProps) => ReactNode;
|
|
17
18
|
type MessageAvatarIconProps = ComponentProps<typeof AvatarIcon>;
|
|
18
|
-
declare const MessageAvatarIcon: (props: MessageAvatarIconProps) =>
|
|
19
|
+
declare const MessageAvatarIcon: (props: MessageAvatarIconProps) => ReactNode;
|
|
19
20
|
type MessageActionsProps = ComponentProps<'div'>;
|
|
20
|
-
declare const MessageActions: ({ className, children, ...props }: MessageActionsProps) =>
|
|
21
|
+
declare const MessageActions: ({ className, children, ...props }: MessageActionsProps) => ReactNode;
|
|
21
22
|
type MessageActionProps = ComponentProps<typeof Button> & {
|
|
22
23
|
tooltip?: string;
|
|
23
24
|
label?: string;
|
|
24
25
|
};
|
|
25
|
-
declare const MessageAction: ({ tooltip, children, label, className, variant, size, ...props }: MessageActionProps) =>
|
|
26
|
+
declare const MessageAction: ({ tooltip, children, label, className, variant, size, ...props }: MessageActionProps) => ReactNode;
|
|
26
27
|
type MessageBranchProps = HTMLAttributes<HTMLDivElement> & {
|
|
27
28
|
defaultBranch?: number;
|
|
28
29
|
onBranchChange?: (branchIndex: number) => void;
|
|
29
30
|
};
|
|
30
|
-
declare const MessageBranch: ({ defaultBranch, onBranchChange, className, ...props }: MessageBranchProps) =>
|
|
31
|
+
declare const MessageBranch: ({ defaultBranch, onBranchChange, className, ...props }: MessageBranchProps) => ReactNode;
|
|
31
32
|
type MessageBranchContentProps = HTMLAttributes<HTMLDivElement>;
|
|
32
|
-
declare const MessageBranchContent: ({ children, ...props }: MessageBranchContentProps) =>
|
|
33
|
+
declare const MessageBranchContent: ({ children, ...props }: MessageBranchContentProps) => ReactNode[];
|
|
33
34
|
type MessageBranchSelectorProps = HTMLAttributes<HTMLDivElement> & {
|
|
34
35
|
from: UIMessage['role'];
|
|
35
36
|
};
|
|
36
|
-
declare const MessageBranchSelector: ({ ...props }: MessageBranchSelectorProps) =>
|
|
37
|
+
declare const MessageBranchSelector: ({ ...props }: MessageBranchSelectorProps) => ReactNode;
|
|
37
38
|
type MessageBranchPreviousProps = ComponentProps<typeof Button>;
|
|
38
|
-
declare const MessageBranchPrevious: ({ children, ...props }: MessageBranchPreviousProps) =>
|
|
39
|
+
declare const MessageBranchPrevious: ({ children, ...props }: MessageBranchPreviousProps) => ReactNode;
|
|
39
40
|
type MessageBranchNextProps = ComponentProps<typeof Button>;
|
|
40
|
-
declare const MessageBranchNext: ({ children, ...props }: MessageBranchNextProps) =>
|
|
41
|
+
declare const MessageBranchNext: ({ children, ...props }: MessageBranchNextProps) => ReactNode;
|
|
41
42
|
type MessageBranchPageProps = HTMLAttributes<HTMLSpanElement>;
|
|
42
|
-
declare const MessageBranchPage: ({ className, ...props }: MessageBranchPageProps) =>
|
|
43
|
+
declare const MessageBranchPage: ({ className, ...props }: MessageBranchPageProps) => ReactNode;
|
|
43
44
|
type MessageResponseProps = ComponentProps<typeof Streamdown>;
|
|
44
|
-
declare const MessageResponse:
|
|
45
|
+
declare const MessageResponse: MemoExoticComponent<({ className, components, plugins, controls, ...props }: MessageResponseProps) => JSX.Element>;
|
|
45
46
|
type MessageAttachmentProps = HTMLAttributes<HTMLDivElement> & {
|
|
46
47
|
data: FileUIPart;
|
|
47
48
|
className?: string;
|
|
48
49
|
onRemove?: () => void;
|
|
49
50
|
};
|
|
50
|
-
declare function MessageAttachment({ data, className, onRemove, ...props }: MessageAttachmentProps):
|
|
51
|
+
declare function MessageAttachment({ data, className, onRemove, ...props }: MessageAttachmentProps): ReactNode;
|
|
51
52
|
type MessageAttachmentsProps = ComponentProps<'div'>;
|
|
52
|
-
declare function MessageAttachments({ children, className, ...props }: MessageAttachmentsProps):
|
|
53
|
+
declare function MessageAttachments({ children, className, ...props }: MessageAttachmentsProps): ReactNode;
|
|
53
54
|
type MessageToolbarProps = ComponentProps<'div'>;
|
|
54
|
-
declare const MessageToolbar: ({ className, children, ...props }: MessageToolbarProps) =>
|
|
55
|
+
declare const MessageToolbar: ({ className, children, ...props }: MessageToolbarProps) => ReactNode;
|
|
55
56
|
export { Message, MessageAction, MessageActions, MessageAttachment, MessageAttachments, MessageAvatar, MessageAvatarIcon, MessageBranch, MessageBranchContent, MessageBranchNext, MessageBranchPage, MessageBranchPrevious, MessageBranchSelector, MessageContent, MessageResponse, MessageToolbar, };
|
|
@@ -1,143 +1,313 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { mermaid as
|
|
4
|
-
import "@tabler/icons-react";
|
|
5
|
-
import { Streamdown as
|
|
6
|
-
import { cn as
|
|
7
|
-
import "../avatar/avatar.js";
|
|
8
|
-
import { Button as
|
|
9
|
-
import "../button-group/button-group.js";
|
|
10
|
-
import { Tooltip as
|
|
11
|
-
import { MESSAGE_RESPONSE_DEFAULT_STREAMDOWN_CONTROLS as
|
|
12
|
-
const
|
|
1
|
+
import { jsx as t, jsxs as l, Fragment as h } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as A, memo as T, useState as w, useCallback as v, useMemo as k, useEffect as z, useContext as C } from "react";
|
|
3
|
+
import { mermaid as I } from "@streamdown/mermaid";
|
|
4
|
+
import { IconX as f, IconPaperclip as P, IconChevronRight as E, IconChevronLeft as S } from "@tabler/icons-react";
|
|
5
|
+
import { Streamdown as R } from "streamdown";
|
|
6
|
+
import { cn as c, getInitials as j } from "../../../../lib/utils.js";
|
|
7
|
+
import { Avatar as q, AvatarImage as L, AvatarFallback as O, AvatarIcon as F } from "../avatar/avatar.js";
|
|
8
|
+
import { Button as g } from "../button/button.js";
|
|
9
|
+
import { ButtonGroupText as G, ButtonGroup as D } from "../button-group/button-group.js";
|
|
10
|
+
import { Tooltip as x, TooltipTrigger as N, TooltipContent as y } from "../tooltip/tooltip.js";
|
|
11
|
+
import { MESSAGE_RESPONSE_DEFAULT_STREAMDOWN_CONTROLS as W } from "./message-response-default-streamdown-controls.js";
|
|
12
|
+
const oe = ({
|
|
13
|
+
className: e,
|
|
14
|
+
isResponse: a = !1,
|
|
15
|
+
...o
|
|
16
|
+
}) => /* @__PURE__ */ t(
|
|
13
17
|
"div",
|
|
14
18
|
{
|
|
15
19
|
"data-slot": "message",
|
|
16
|
-
className:
|
|
20
|
+
className: c(
|
|
17
21
|
"group flex w-full items-start justify-start gap-3 mb-0 py-3",
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
a ? "is-assistant items-start" : "is-user flex-row-reverse",
|
|
23
|
+
e
|
|
20
24
|
),
|
|
21
|
-
...
|
|
25
|
+
...o
|
|
22
26
|
}
|
|
23
|
-
),
|
|
24
|
-
children:
|
|
25
|
-
className:
|
|
26
|
-
...
|
|
27
|
-
}) => /* @__PURE__ */
|
|
27
|
+
), re = ({
|
|
28
|
+
children: e,
|
|
29
|
+
className: a,
|
|
30
|
+
...o
|
|
31
|
+
}) => /* @__PURE__ */ t(
|
|
28
32
|
"div",
|
|
29
33
|
{
|
|
30
34
|
"data-slot": "message-content",
|
|
31
|
-
className:
|
|
35
|
+
className: c(
|
|
32
36
|
"is-user:dark flex flex-col gap-4 rounded-md text-base leading-tight tracking-tightest",
|
|
33
37
|
"max-w-4/5",
|
|
34
38
|
"group-[.is-user]:overflow-hidden group-[.is-user]:bg-accent-background group-[.is-user]:p-2 group-[.is-user]:text-foreground",
|
|
35
39
|
"group-[.is-assistant]:text-foreground group-[.is-assistant]:pt-1",
|
|
36
|
-
|
|
40
|
+
a
|
|
37
41
|
),
|
|
38
|
-
...
|
|
39
|
-
children:
|
|
42
|
+
...o,
|
|
43
|
+
children: e
|
|
40
44
|
}
|
|
41
|
-
),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
), de = ({
|
|
46
|
+
avatarUrl: e,
|
|
47
|
+
name: a,
|
|
48
|
+
className: o,
|
|
49
|
+
children: r,
|
|
50
|
+
variant: s,
|
|
51
|
+
sizes: n,
|
|
52
|
+
...d
|
|
53
|
+
}) => {
|
|
54
|
+
const m = a ? j(a) : "ME";
|
|
55
|
+
return /* @__PURE__ */ t(
|
|
56
|
+
q,
|
|
57
|
+
{
|
|
58
|
+
"data-slot": "message-avatar",
|
|
59
|
+
className: c("size-7 group-[.is-user]:mt-1", o),
|
|
60
|
+
variant: s,
|
|
61
|
+
sizes: n,
|
|
62
|
+
...d,
|
|
63
|
+
children: r || /* @__PURE__ */ l(h, { children: [
|
|
64
|
+
e && /* @__PURE__ */ t(
|
|
65
|
+
L,
|
|
66
|
+
{
|
|
67
|
+
alt: a || "",
|
|
68
|
+
className: "mt-0 mb-0",
|
|
69
|
+
src: e
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ t(O, { children: m })
|
|
73
|
+
] })
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}, se = (e) => /* @__PURE__ */ t(F, { "data-slot": "message-avatar-icon", ...e }), ne = ({
|
|
77
|
+
className: e,
|
|
78
|
+
children: a,
|
|
79
|
+
...o
|
|
80
|
+
}) => /* @__PURE__ */ t(
|
|
46
81
|
"div",
|
|
47
82
|
{
|
|
48
83
|
"data-slot": "message-actions",
|
|
49
|
-
className:
|
|
50
|
-
...
|
|
51
|
-
children:
|
|
84
|
+
className: c("flex items-center gap-2 pt-2", e),
|
|
85
|
+
...o,
|
|
86
|
+
children: a
|
|
52
87
|
}
|
|
53
|
-
),
|
|
54
|
-
tooltip:
|
|
55
|
-
children:
|
|
56
|
-
label:
|
|
88
|
+
), ce = ({
|
|
89
|
+
tooltip: e,
|
|
90
|
+
children: a,
|
|
91
|
+
label: o,
|
|
57
92
|
className: r,
|
|
58
93
|
variant: s = "ghost",
|
|
59
|
-
size:
|
|
60
|
-
...
|
|
94
|
+
size: n = "sm",
|
|
95
|
+
...d
|
|
61
96
|
}) => {
|
|
62
|
-
const
|
|
63
|
-
|
|
97
|
+
const m = /* @__PURE__ */ l(
|
|
98
|
+
g,
|
|
64
99
|
{
|
|
65
100
|
"data-slot": "message-action",
|
|
66
|
-
className:
|
|
101
|
+
className: c(
|
|
67
102
|
"relative icon-sm text-muted-foreground hover:text-foreground",
|
|
68
103
|
r
|
|
69
104
|
),
|
|
70
|
-
size:
|
|
105
|
+
size: n,
|
|
71
106
|
type: "button",
|
|
72
107
|
variant: s,
|
|
73
|
-
...
|
|
108
|
+
...d,
|
|
74
109
|
children: [
|
|
75
|
-
|
|
76
|
-
/* @__PURE__ */
|
|
110
|
+
a,
|
|
111
|
+
/* @__PURE__ */ t("span", { className: "sr-only", children: o || e })
|
|
77
112
|
]
|
|
78
113
|
}
|
|
79
114
|
);
|
|
80
|
-
return
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
] }) :
|
|
84
|
-
}
|
|
85
|
-
i(
|
|
115
|
+
return e ? /* @__PURE__ */ l(x, { children: [
|
|
116
|
+
/* @__PURE__ */ t(N, { render: m }),
|
|
117
|
+
/* @__PURE__ */ t(y, { children: /* @__PURE__ */ t("p", { children: e }) })
|
|
118
|
+
] }) : m;
|
|
119
|
+
}, M = A(
|
|
86
120
|
null
|
|
87
|
-
)
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
121
|
+
), p = () => {
|
|
122
|
+
const e = C(M);
|
|
123
|
+
if (!e)
|
|
124
|
+
throw new Error(
|
|
125
|
+
"MessageBranch components must be used within MessageBranch"
|
|
126
|
+
);
|
|
127
|
+
return e;
|
|
128
|
+
}, me = ({
|
|
129
|
+
defaultBranch: e = 0,
|
|
130
|
+
onBranchChange: a,
|
|
131
|
+
className: o,
|
|
132
|
+
...r
|
|
133
|
+
}) => {
|
|
134
|
+
const [s, n] = w(e), [d, m] = w([]), i = v(() => {
|
|
135
|
+
n((b) => {
|
|
136
|
+
const u = b > 0 ? b - 1 : d.length - 1;
|
|
137
|
+
return a?.(u), u;
|
|
138
|
+
});
|
|
139
|
+
}, [d.length, a]), _ = v(() => {
|
|
140
|
+
n((b) => {
|
|
141
|
+
const u = b < d.length - 1 ? b + 1 : 0;
|
|
142
|
+
return a?.(u), u;
|
|
143
|
+
});
|
|
144
|
+
}, [d.length, a]), B = k(
|
|
145
|
+
() => ({
|
|
146
|
+
currentBranch: s,
|
|
147
|
+
totalBranches: d.length,
|
|
148
|
+
goToPrevious: i,
|
|
149
|
+
goToNext: _,
|
|
150
|
+
branches: d,
|
|
151
|
+
setBranches: m
|
|
152
|
+
}),
|
|
153
|
+
[s, d, i, _, m]
|
|
154
|
+
);
|
|
155
|
+
return /* @__PURE__ */ t(M.Provider, { value: B, children: /* @__PURE__ */ t(
|
|
156
|
+
"div",
|
|
157
|
+
{
|
|
158
|
+
"data-slot": "message-branch",
|
|
159
|
+
className: c("grid w-full gap-2 [&>div]:pb-0", o),
|
|
160
|
+
...r
|
|
161
|
+
}
|
|
162
|
+
) });
|
|
163
|
+
}, le = ({
|
|
164
|
+
children: e,
|
|
165
|
+
...a
|
|
166
|
+
}) => {
|
|
167
|
+
const { currentBranch: o, setBranches: r, branches: s } = p(), n = k(
|
|
168
|
+
() => Array.isArray(e) ? e : [e],
|
|
169
|
+
[e]
|
|
170
|
+
);
|
|
171
|
+
return z(() => {
|
|
172
|
+
s.length !== n.length && r(n);
|
|
173
|
+
}, [n, s, r]), n.map((d, m) => /* @__PURE__ */ t(
|
|
174
|
+
"div",
|
|
175
|
+
{
|
|
176
|
+
"data-slot": "message-branch-content",
|
|
177
|
+
className: c(
|
|
178
|
+
"grid gap-2 overflow-hidden [&>div]:pb-0",
|
|
179
|
+
m === o ? "block" : "hidden"
|
|
180
|
+
),
|
|
181
|
+
...a,
|
|
182
|
+
children: d
|
|
183
|
+
},
|
|
184
|
+
d.key
|
|
185
|
+
));
|
|
186
|
+
}, ie = ({
|
|
187
|
+
...e
|
|
188
|
+
}) => {
|
|
189
|
+
const { totalBranches: a } = p();
|
|
190
|
+
return a <= 1 ? null : /* @__PURE__ */ t(
|
|
191
|
+
D,
|
|
192
|
+
{
|
|
193
|
+
"data-slot": "message-branch-selector",
|
|
194
|
+
className: "[&>*:not(:first-child)]:rounded-l-md [&>*:not(:last-child)]:rounded-r-md",
|
|
195
|
+
orientation: "horizontal",
|
|
196
|
+
...e
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
}, be = ({
|
|
200
|
+
children: e,
|
|
201
|
+
...a
|
|
202
|
+
}) => {
|
|
203
|
+
const { goToPrevious: o, totalBranches: r } = p();
|
|
204
|
+
return /* @__PURE__ */ t(
|
|
205
|
+
g,
|
|
206
|
+
{
|
|
207
|
+
"data-slot": "message-branch-previous",
|
|
208
|
+
"aria-label": "Previous branch",
|
|
209
|
+
disabled: r <= 1,
|
|
210
|
+
onClick: o,
|
|
211
|
+
size: "icon-sm",
|
|
212
|
+
type: "button",
|
|
213
|
+
variant: "ghost",
|
|
214
|
+
...a,
|
|
215
|
+
children: e ?? /* @__PURE__ */ t(S, { size: 14 })
|
|
216
|
+
}
|
|
217
|
+
);
|
|
218
|
+
}, ue = ({
|
|
219
|
+
children: e,
|
|
220
|
+
...a
|
|
221
|
+
}) => {
|
|
222
|
+
const { goToNext: o, totalBranches: r } = p();
|
|
223
|
+
return /* @__PURE__ */ t(
|
|
224
|
+
g,
|
|
225
|
+
{
|
|
226
|
+
"data-slot": "message-branch-next",
|
|
227
|
+
"aria-label": "Next branch",
|
|
228
|
+
disabled: r <= 1,
|
|
229
|
+
onClick: o,
|
|
230
|
+
size: "icon-sm",
|
|
231
|
+
type: "button",
|
|
232
|
+
variant: "ghost",
|
|
233
|
+
...a,
|
|
234
|
+
children: e ?? /* @__PURE__ */ t(E, { size: 14 })
|
|
235
|
+
}
|
|
236
|
+
);
|
|
237
|
+
}, ge = ({
|
|
238
|
+
className: e,
|
|
239
|
+
...a
|
|
240
|
+
}) => {
|
|
241
|
+
const { currentBranch: o, totalBranches: r } = p();
|
|
242
|
+
return /* @__PURE__ */ l(
|
|
243
|
+
G,
|
|
244
|
+
{
|
|
245
|
+
"data-slot": "message-branch-page",
|
|
246
|
+
className: c(
|
|
247
|
+
"border-none bg-transparent text-muted-foreground shadow-none px-2",
|
|
248
|
+
e
|
|
249
|
+
),
|
|
250
|
+
...a,
|
|
251
|
+
children: [
|
|
252
|
+
o + 1,
|
|
253
|
+
"/",
|
|
254
|
+
r
|
|
255
|
+
]
|
|
256
|
+
}
|
|
257
|
+
);
|
|
258
|
+
}, V = {
|
|
259
|
+
h1: ({ children: e }) => /* @__PURE__ */ t("h1", { className: "mt-0 mb-2 scroll-m-20 text-xl font-medium tracking-tightest", children: e }),
|
|
260
|
+
h2: ({ children: e }) => /* @__PURE__ */ t("h2", { className: "mt-4 mb-1 scroll-m-20 text-lg font-medium tracking-tightest", children: e }),
|
|
261
|
+
h3: ({ children: e }) => /* @__PURE__ */ t("h3", { className: "mt-4 mb-1 scroll-m-20 text-base font-medium tracking-tighter", children: e }),
|
|
262
|
+
h4: ({ children: e }) => /* @__PURE__ */ t("h4", { className: "mt-2 mb-0 scroll-m-20 text-sm font-medium tracking-normal", children: e }),
|
|
263
|
+
h5: ({ children: e }) => /* @__PURE__ */ t("h5", { className: "mt-0 mb-0 scroll-m-20 text-xs font-medium tracking-tighter", children: e }),
|
|
264
|
+
h6: ({ children: e }) => /* @__PURE__ */ t("h6", { className: "mt-0 mb-0 scroll-m-20 text-2xs font-medium tracking-tighter", children: e }),
|
|
265
|
+
p: ({ children: e }) => /* @__PURE__ */ t("p", { className: "mt-2 mb-3 text-base font-normal leading-5 tracking-tightest", children: e }),
|
|
266
|
+
strong: ({ children: e }) => /* @__PURE__ */ t("strong", { className: "font-medium", children: e }),
|
|
267
|
+
em: ({ children: e }) => /* @__PURE__ */ t("em", { className: "italic", children: e }),
|
|
268
|
+
b: ({ children: e }) => /* @__PURE__ */ t("b", { className: "font-medium", children: e }),
|
|
269
|
+
i: ({ children: e }) => /* @__PURE__ */ t("i", { className: "italic", children: e }),
|
|
270
|
+
ul: ({ children: e }) => /* @__PURE__ */ t("ul", { className: "ml-8.25 mb-3 pt-2 pl-0 pb-0 list-disc text-base font-normal tracking-tightest", children: e }),
|
|
271
|
+
ol: ({ children: e }) => /* @__PURE__ */ t("ol", { className: "ml-8.25 mb-3 pt-2 pl-0 pb-0 list-decimal text-base font-normal tracking-tightest", children: e }),
|
|
272
|
+
li: ({ children: e }) => /* @__PURE__ */ t("li", { className: "py-0", children: e }),
|
|
273
|
+
blockquote: ({ children: e }) => /* @__PURE__ */ t("blockquote", { className: "my-3 pr-2 pl-2 border-l border-l-border text-sm text-muted-foreground font-normal tracking-tight not-italic", children: e }),
|
|
274
|
+
hr: () => /* @__PURE__ */ t("hr", { className: "my-4 border-border" }),
|
|
275
|
+
a: ({ children: e, href: a, ...o }) => /* @__PURE__ */ t(
|
|
106
276
|
"a",
|
|
107
277
|
{
|
|
108
278
|
className: "text-link-foreground no-underline hover:underline underline-offset-4",
|
|
109
|
-
href:
|
|
110
|
-
...
|
|
111
|
-
children:
|
|
279
|
+
href: a,
|
|
280
|
+
...o,
|
|
281
|
+
children: e
|
|
112
282
|
}
|
|
113
283
|
),
|
|
114
|
-
table: ({ children:
|
|
284
|
+
table: ({ children: e }) => /* @__PURE__ */ t(
|
|
115
285
|
"div",
|
|
116
286
|
{
|
|
117
287
|
className: "my-6 overflow-x-auto",
|
|
118
288
|
tabIndex: 0,
|
|
119
289
|
role: "group",
|
|
120
290
|
"aria-label": "Atlas AI Chat Table",
|
|
121
|
-
children: /* @__PURE__ */
|
|
291
|
+
children: /* @__PURE__ */ t("table", { className: "w-full", children: e })
|
|
122
292
|
}
|
|
123
293
|
),
|
|
124
|
-
thead: ({ children:
|
|
125
|
-
tbody: ({ children:
|
|
126
|
-
tr: ({ children:
|
|
127
|
-
th: ({ children:
|
|
128
|
-
td: ({ children:
|
|
129
|
-
},
|
|
294
|
+
thead: ({ children: e }) => /* @__PURE__ */ t("thead", { children: e }),
|
|
295
|
+
tbody: ({ children: e }) => /* @__PURE__ */ t("tbody", { children: e }),
|
|
296
|
+
tr: ({ children: e }) => /* @__PURE__ */ t("tr", { className: "m-0 border-t p-0 even:bg-muted-background", children: e }),
|
|
297
|
+
th: ({ children: e }) => /* @__PURE__ */ t("th", { className: "border px-4 py-2 text-left font-bold", children: e }),
|
|
298
|
+
td: ({ children: e }) => /* @__PURE__ */ t("td", { className: "border px-4 py-2 text-left", children: e })
|
|
299
|
+
}, X = T(
|
|
130
300
|
({
|
|
131
|
-
className:
|
|
132
|
-
components:
|
|
133
|
-
plugins:
|
|
301
|
+
className: e,
|
|
302
|
+
components: a,
|
|
303
|
+
plugins: o,
|
|
134
304
|
controls: r,
|
|
135
305
|
...s
|
|
136
|
-
}) => /* @__PURE__ */
|
|
137
|
-
|
|
306
|
+
}) => /* @__PURE__ */ t(
|
|
307
|
+
R,
|
|
138
308
|
{
|
|
139
309
|
"data-slot": "message-response",
|
|
140
|
-
className:
|
|
310
|
+
className: c(
|
|
141
311
|
"size-full",
|
|
142
312
|
// Blockquote paragraph overrides
|
|
143
313
|
"[&_blockquote_p]:text-sm",
|
|
@@ -236,21 +406,139 @@ const f = {
|
|
|
236
406
|
// First and last child margin resets
|
|
237
407
|
"[&>*:first-child]:mt-0",
|
|
238
408
|
"[&>*:last-child]:mb-0",
|
|
239
|
-
|
|
409
|
+
e
|
|
240
410
|
),
|
|
241
|
-
components: { ...
|
|
242
|
-
controls: r ??
|
|
243
|
-
plugins: { ...
|
|
411
|
+
components: { ...V, ...a },
|
|
412
|
+
controls: r ?? W,
|
|
413
|
+
plugins: { ...o, mermaid: I },
|
|
244
414
|
...s
|
|
245
415
|
}
|
|
246
416
|
),
|
|
247
|
-
(
|
|
417
|
+
(e, a) => e.children === a.children
|
|
418
|
+
);
|
|
419
|
+
X.displayName = "MessageResponse";
|
|
420
|
+
function pe({
|
|
421
|
+
data: e,
|
|
422
|
+
className: a,
|
|
423
|
+
onRemove: o,
|
|
424
|
+
...r
|
|
425
|
+
}) {
|
|
426
|
+
const s = e.filename || "", d = (e.mediaType?.startsWith("image/") && e.url ? "image" : "file") === "image", m = s || (d ? "Image" : "Attachment");
|
|
427
|
+
return /* @__PURE__ */ t(
|
|
428
|
+
"div",
|
|
429
|
+
{
|
|
430
|
+
"data-slot": "message-attachment",
|
|
431
|
+
className: c(
|
|
432
|
+
"group relative size-24 overflow-hidden rounded-lg",
|
|
433
|
+
a
|
|
434
|
+
),
|
|
435
|
+
...r,
|
|
436
|
+
children: d ? /* @__PURE__ */ l(h, { children: [
|
|
437
|
+
/* @__PURE__ */ t(
|
|
438
|
+
"img",
|
|
439
|
+
{
|
|
440
|
+
alt: s || "attachment",
|
|
441
|
+
className: "size-full object-cover",
|
|
442
|
+
height: 100,
|
|
443
|
+
src: e.url,
|
|
444
|
+
width: 100
|
|
445
|
+
}
|
|
446
|
+
),
|
|
447
|
+
o && /* @__PURE__ */ l(
|
|
448
|
+
g,
|
|
449
|
+
{
|
|
450
|
+
"aria-label": "Remove attachment",
|
|
451
|
+
className: "absolute top-2 right-2 size-6 rounded-full bg-background/80 p-0 opacity-0 backdrop-blur-sm transition-opacity hover:bg-background group-hover:opacity-100 [&>svg]:size-3",
|
|
452
|
+
onClick: (i) => {
|
|
453
|
+
i.stopPropagation(), o();
|
|
454
|
+
},
|
|
455
|
+
type: "button",
|
|
456
|
+
variant: "ghost",
|
|
457
|
+
children: [
|
|
458
|
+
/* @__PURE__ */ t(f, {}),
|
|
459
|
+
/* @__PURE__ */ t("span", { className: "sr-only", children: "Remove" })
|
|
460
|
+
]
|
|
461
|
+
}
|
|
462
|
+
)
|
|
463
|
+
] }) : /* @__PURE__ */ l(h, { children: [
|
|
464
|
+
/* @__PURE__ */ l(x, { children: [
|
|
465
|
+
/* @__PURE__ */ t(
|
|
466
|
+
N,
|
|
467
|
+
{
|
|
468
|
+
render: /* @__PURE__ */ t("div", { className: "flex size-full shrink-0 items-center justify-center rounded-lg bg-muted-background text-muted-foreground", children: /* @__PURE__ */ t(P, { className: "size-4" }) })
|
|
469
|
+
}
|
|
470
|
+
),
|
|
471
|
+
/* @__PURE__ */ t(y, { children: /* @__PURE__ */ t("p", { children: m }) })
|
|
472
|
+
] }),
|
|
473
|
+
o && /* @__PURE__ */ l(
|
|
474
|
+
g,
|
|
475
|
+
{
|
|
476
|
+
"aria-label": "Remove attachment",
|
|
477
|
+
className: "size-6 shrink-0 rounded-full p-0 opacity-0 transition-opacity hover:bg-accent-background group-hover:opacity-100 [&>svg]:size-3",
|
|
478
|
+
onClick: (i) => {
|
|
479
|
+
i.stopPropagation(), o();
|
|
480
|
+
},
|
|
481
|
+
type: "button",
|
|
482
|
+
variant: "ghost",
|
|
483
|
+
children: [
|
|
484
|
+
/* @__PURE__ */ t(f, {}),
|
|
485
|
+
/* @__PURE__ */ t("span", { className: "sr-only", children: "Remove" })
|
|
486
|
+
]
|
|
487
|
+
}
|
|
488
|
+
)
|
|
489
|
+
] })
|
|
490
|
+
}
|
|
491
|
+
);
|
|
492
|
+
}
|
|
493
|
+
function he({
|
|
494
|
+
children: e,
|
|
495
|
+
className: a,
|
|
496
|
+
...o
|
|
497
|
+
}) {
|
|
498
|
+
return e ? /* @__PURE__ */ t(
|
|
499
|
+
"div",
|
|
500
|
+
{
|
|
501
|
+
"data-slot": "message-attachments",
|
|
502
|
+
className: c(
|
|
503
|
+
"ml-auto flex w-fit flex-wrap items-start gap-2",
|
|
504
|
+
a
|
|
505
|
+
),
|
|
506
|
+
...o,
|
|
507
|
+
children: e
|
|
508
|
+
}
|
|
509
|
+
) : null;
|
|
510
|
+
}
|
|
511
|
+
const _e = ({
|
|
512
|
+
className: e,
|
|
513
|
+
children: a,
|
|
514
|
+
...o
|
|
515
|
+
}) => /* @__PURE__ */ t(
|
|
516
|
+
"div",
|
|
517
|
+
{
|
|
518
|
+
"data-slot": "message-toolbar",
|
|
519
|
+
className: c(
|
|
520
|
+
"mt-4 flex w-full items-center justify-between gap-4",
|
|
521
|
+
e
|
|
522
|
+
),
|
|
523
|
+
...o,
|
|
524
|
+
children: a
|
|
525
|
+
}
|
|
248
526
|
);
|
|
249
|
-
h.displayName = "MessageResponse";
|
|
250
527
|
export {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
528
|
+
oe as Message,
|
|
529
|
+
ce as MessageAction,
|
|
530
|
+
ne as MessageActions,
|
|
531
|
+
pe as MessageAttachment,
|
|
532
|
+
he as MessageAttachments,
|
|
533
|
+
de as MessageAvatar,
|
|
534
|
+
se as MessageAvatarIcon,
|
|
535
|
+
me as MessageBranch,
|
|
536
|
+
le as MessageBranchContent,
|
|
537
|
+
ue as MessageBranchNext,
|
|
538
|
+
ge as MessageBranchPage,
|
|
539
|
+
be as MessageBranchPrevious,
|
|
540
|
+
ie as MessageBranchSelector,
|
|
541
|
+
re as MessageContent,
|
|
542
|
+
X as MessageResponse,
|
|
543
|
+
_e as MessageToolbar
|
|
256
544
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Context } from 'react';
|
|
2
|
+
type PaginationSize = 'default' | 'small';
|
|
3
|
+
declare const PaginationSizeContext: Context<PaginationSize>;
|
|
4
|
+
declare const usePaginationSize: () => PaginationSize;
|
|
5
|
+
export { type PaginationSize, PaginationSizeContext, usePaginationSize };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ForwardRefExoticComponent, RefAttributes, ComponentProps } from 'react';
|
|
2
|
+
import { Input } from '../input/input';
|
|
3
|
+
import { PaginationSize } from './pagination-size-context';
|
|
4
|
+
type PaginationTeleportProps = {
|
|
5
|
+
currentPage: number;
|
|
6
|
+
totalPages: number;
|
|
7
|
+
onPageChange: (page: number) => void;
|
|
8
|
+
size?: PaginationSize;
|
|
9
|
+
} & Omit<ComponentProps<typeof Input>, 'size' | 'value' | 'onChange' | 'children' | 'type'>;
|
|
10
|
+
declare const PaginationTeleport: ForwardRefExoticComponent<Omit<PaginationTeleportProps, 'ref'> & RefAttributes<HTMLInputElement>>;
|
|
11
|
+
export { PaginationTeleport };
|