diff --git a/client/src/components/Chat/Input/TokenUsage/index.spec.tsx b/client/src/components/Chat/Input/TokenUsage/index.spec.tsx index a776599ad4..061a83a59a 100644 --- a/client/src/components/Chat/Input/TokenUsage/index.spec.tsx +++ b/client/src/components/Chat/Input/TokenUsage/index.spec.tsx @@ -36,9 +36,22 @@ jest.mock('~/hooks/Chat/useCompactConversation', () => ({ supportsCompaction: () => false, })); -jest.mock('./Breakdown', () => ({ - __esModule: true, - default: () =>
, +jest.mock('@librechat/chat/components', () => ({ + ...jest.requireActual('@librechat/chat/components'), + ContextBreakdown: ({ + expanded, + onExpandedChange, + }: { + expanded: boolean; + onExpandedChange: (expanded: boolean) => void; + }) => ( + + + Details + , + ); + + expect(screen.getByText('Details')).toHaveClass( + 'motion-reduce:data-[state=open]:animate-none', + 'motion-reduce:data-[state=closed]:animate-none', + ); + }); }); diff --git a/packages/client/src/components/HoverCard.tsx b/packages/client/src/components/HoverCard.tsx index 191c9e3ec7..d5796e89e6 100644 --- a/packages/client/src/components/HoverCard.tsx +++ b/packages/client/src/components/HoverCard.tsx @@ -36,7 +36,7 @@ const HoverCardContent: React.ForwardRefExoticComponent< sideOffset={sideOffset} style={{ ...nestedStyle, ...style }} className={cn( - 'border-border-light bg-surface-secondary text-text-primary data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-theme-menu-panel z-50 w-64 max-w-[min(calc(100vw-1rem),var(--radix-hover-card-content-available-width))] origin-(--radix-hover-card-content-transform-origin) border p-4 shadow-md outline-hidden', + 'border-border-light bg-surface-secondary text-text-primary data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-theme-menu-panel z-50 w-64 max-w-[min(calc(100vw-1rem),var(--radix-hover-card-content-available-width))] origin-(--radix-hover-card-content-transform-origin) border p-4 shadow-md outline-hidden motion-reduce:data-[state=closed]:animate-none motion-reduce:data-[state=open]:animate-none', className, )} {...props} diff --git a/packages/client/tailwind.preset.cjs b/packages/client/tailwind.preset.cjs index 8ec492cf54..4c6e7b1e67 100644 --- a/packages/client/tailwind.preset.cjs +++ b/packages/client/tailwind.preset.cjs @@ -139,12 +139,27 @@ module.exports = { '0%,70%,100%': { opacity: '1' }, '20%,50%': { opacity: '0' }, }, + /** Radix Collapsible exposes its own height variable, not the accordion one. Lives in + * the preset because chat components that ship from @librechat/chat animate with it. + * The fade rides along so the rows dissolve instead of squashing. Opening + * decelerates into place; closing accelerates away, because a decelerating + * close stalls over its final pixels before the unmount. */ + 'collapsible-down': { + from: { height: 0, opacity: 0 }, + to: { height: 'var(--radix-collapsible-content-height)', opacity: 1 }, + }, + 'collapsible-up': { + from: { height: 'var(--radix-collapsible-content-height)', opacity: 1 }, + to: { height: 0, opacity: 0 }, + }, }, animation: { 'loading-dot': 'loading-dot 1.2s ease-in-out var(--loading-dot-delay, 0ms) infinite', 'accordion-down': 'accordion-down 0.2s ease-out', 'accordion-up': 'accordion-up 0.2s ease-out', 'caret-blink': 'caret-blink 1.25s ease-out infinite', + 'collapsible-down': 'collapsible-down 0.3s cubic-bezier(0, 0, 0.2, 1)', + 'collapsible-up': 'collapsible-up 0.2s cubic-bezier(0.4, 0, 1, 1)', }, /** * `rounded-sm` through `rounded-3xl` are not restated here: `@librechat/client/theme.css`