feat: Implement inertial horizontal scrolling for carousel components and enhance text selection handling

This commit is contained in:
2026-05-17 16:22:57 +10:00
parent b9b0dce40b
commit af02b215f4
6 changed files with 424 additions and 11 deletions

View File

@@ -35,6 +35,7 @@ export const MessageTextBody = as<'div', css.MessageTextBodyVariants & { notice?
size="T400"
priority={notice ? '300' : '400'}
className={classNames(css.MessageTextBody({ preWrap, jumboEmoji, emote }), className)}
data-allow-text-selection="true"
{...props}
ref={ref}
/>

View File

@@ -215,6 +215,8 @@ export const MessageTextBody = recipe({
overflow: 'clip',
overflowY: 'clip',
lineHeight: '1.5',
userSelect: 'text',
WebkitUserSelect: 'text',
},
variants: {
preWrap: {

View File

@@ -60,10 +60,12 @@ export const PageNavHeader = as<'header', css.PageNavHeaderVariants>(
export function PageNavContent({
scrollRef,
scrollProps,
children,
}: {
children: ReactNode;
scrollRef?: MutableRefObject<HTMLDivElement | null>;
scrollProps?: React.ComponentProps<typeof Scroll>;
}) {
return (
<Box grow="Yes" direction="Column">
@@ -74,6 +76,7 @@ export function PageNavContent({
size="300"
hideTrack
visibility="Hover"
{...scrollProps}
>
<div className={css.PageNavContent}>{children}</div>
</Scroll>