Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat(ui): scrollbar (#3136)

Fake-Userff6585b273e9
diff --git a/js/app/packages/app/component/next-soup/soup-view/filters-bar/soup-filters-bar.tsx b/js/app/packages/app/component/next-soup/soup-view/filters-bar/soup-filters-bar.tsx
index 070589b8c9..5c978c89aa 100644
--- a/js/app/packages/app/component/next-soup/soup-view/filters-bar/soup-filters-bar.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/filters-bar/soup-filters-bar.tsx
@@ -60,13 +60,7 @@ export const SoupFiltersBar = () => {
return (
<Show when={!isMobile()}>
- <div
- class="flex items-start gap-2 border-b border-edge-muted w-full"
- classList={{
- 'p-2': isSearchView(),
- 'px-2 py-1.5': !isSearchView(),
- }}
- >
+ <div class="flex items-start gap-2 border-b border-edge-muted w-full px-2 py-1.5">
<UnifiedFilterDropdown />
<ActiveFilterChips
filters={activeFiltersList()}
diff --git a/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx b/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
index 0855826e70..7ad8f8a5ae 100644
--- a/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
@@ -283,56 +283,43 @@ export const SoupView = (props: SoupViewProps) => {
<SplitHeaderLeft>
<div
class={cn('h-full flex gap-3 items-center', {
- 'shrink-0':
- !narrowSearchExpanded() && !isComponentListView('search'),
- 'flex-1 min-w-0':
- narrowSearchExpanded() || isComponentListView('search'),
+ 'shrink-0': !narrowSearchExpanded(),
+ 'flex-1 min-w-0': narrowSearchExpanded(),
})}
>
+ <Show when={!isMobile()}>
+ <h1 class="font-semibold text-ink select-none text-sm shrink-0">
+ {props.viewName}
+ </h1>
+ </Show>
<Show
- when={isComponentListView('search')}
- fallback={
- <>
- <Show when={!isMobile()}>
- <h1 class="font-semibold text-ink select-none text-sm shrink-0">
- {props.viewName}
- </h1>
- </Show>
- <Show when={!narrowSearchExpanded()}>
- <Show when={!isMobile()}>
- <CollapsibleHeaderItem
- id="tabs"
- priority={1}
- expanded={() => <SoupViewTabs />}
- collapsed={() => <CollapsedSoupViewTabs />}
- containerClass="h-full"
- />
- </Show>
- <Show when={!isMobile()}>
- <SoupViewCreateButton />
- </Show>
- <Show when={isMobile()}>
- <MobileFilterDrawer />
- </Show>
- </Show>
- <Show when={narrowSearchExpanded()}>
- <div class="flex-1 min-w-0">
- <SoupSearchbar
- variant="secondary"
- autoFocus
- initialValue={props.initialSearchText}
- onDismiss={() => setNarrowSearchExpanded(false)}
- />
- </div>
- </Show>
- </>
+ when={
+ !narrowSearchExpanded() && !isComponentListView('search')
}
>
+ <Show when={!isMobile()}>
+ <CollapsibleHeaderItem
+ id="tabs"
+ priority={1}
+ expanded={() => <SoupViewTabs />}
+ collapsed={() => <CollapsedSoupViewTabs />}
+ containerClass="h-full"
+ />
+ </Show>
+ <Show when={!isMobile()}>
+ <SoupViewCreateButton />
+ </Show>
+ <Show when={isMobile()}>
+ <MobileFilterDrawer />
+ </Show>
+ </Show>
+ <Show when={narrowSearchExpanded()}>
<div class="flex-1 min-w-0">
<SoupSearchbar
variant="secondary"
- placeholder="Search, @mention contacts"
+ autoFocus
initialValue={props.initialSearchText}
+ onDismiss={() => setNarrowSearchExpanded(false)}
/>
</div>
</Show>
@@ -342,7 +329,18 @@ export const SoupView = (props: SoupViewProps) => {
<Show when={isMobile() && !narrowSearchExpanded()}>
<SettingsButton />
</Show>
- <Show when={!isComponentListView('search')}>
+ <Show
+ when={!isComponentListView('search')}
+ fallback={
+ <div class="w-60">
+ <SoupSearchbar
+ variant="secondary"
+ placeholder="Search, @mention contacts"
+ initialValue={props.initialSearchText}
+ />
+ </div>
+ }
+ >
<CollapsibleHeaderItem
id="search"
priority={0}
@@ -351,7 +349,7 @@ export const SoupView = (props: SoupViewProps) => {
if (!isCollapsed) setNarrowSearchExpanded(false);
}}
expanded={() => (
- <div class="w-52">
+ <div class="w-60">
<SoupSearchbar
variant="secondary"
initialValue={props.initialSearchText}
diff --git a/js/app/packages/block-channel/component/NewChannelBlockAdapter.tsx b/js/app/packages/block-channel/component/NewChannelBlockAdapter.tsx
index 92ae9469b3..2b4f6786c8 100644
--- a/js/app/packages/block-channel/component/NewChannelBlockAdapter.tsx
+++ b/js/app/packages/block-channel/component/NewChannelBlockAdapter.tsx
@@ -1,7 +1,3 @@
-import {
- ChatWithAgentButton,
- toChatChannelType,
-} from '@app/component/ChatWithAgentButton';
import { useBlockEntityCommands } from '@app/component/next-soup/actions';
import { useMaybePreviewPanel } from '@app/component/PreviewPanel';
import { SplitHeaderRight } from '@app/component/split-layout/components/SplitHeader';
@@ -85,7 +81,6 @@ function NewTop(props: { channelId: string }) {
const { activeTab, setActiveTab } = useChannelTab();
const channelName = useChannelName(props.channelId);
const channelType = useChannelType(props.channelId);
- const chatChannelType = () => toChatChannelType(channelType());
const participantsQuery = useChannelParticipantsQuery(() => props.channelId);
const call = useCall(() => props.channelId);
const participants = () =>
@@ -118,24 +113,10 @@ function NewTop(props: { channelId: string }) {
activeTab={activeTab()}
onTabChange={setActiveTab}
/>
- <Show when={chatChannelType() || ENABLE_CALLS()}>
+ <Show when={ENABLE_CALLS()}>
<SplitHeaderRight>
<div class="flex items-center gap-1.5">
- <Show when={chatChannelType()}>
- {(type) => (
- <ChatWithAgentButton
- entity={{
- type: 'channel',
- id: props.channelId,
- name: channelName() ?? 'Channel',
- channelType: type(),
- }}
- />
- )}
- </Show>
- <Show when={ENABLE_CALLS()}>
- <ChannelCallButton channelId={props.channelId} />
- </Show>
+ <ChannelCallButton channelId={props.channelId} />
</div>
</SplitHeaderRight>
</Show>
diff --git a/js/app/packages/core/component/CustomScrollbar.tsx b/js/app/packages/core/component/CustomScrollbar.tsx
index 74ce890a77..d1cb829445 100644
--- a/js/app/packages/core/component/CustomScrollbar.tsx
+++ b/js/app/packages/core/component/CustomScrollbar.tsx
@@ -14,6 +14,12 @@ interface CustomScrollbarProps {
horizontal?: boolean;
}
+const THUMB_SIZE = 200;
+const GUTTER_SIZE = 8;
+const THUMB_INSET = 3;
+const THUMB_THICKNESS = 2;
+const EDGE_INSET = 3;
+
export function CustomScrollbar(props: CustomScrollbarProps) {
return (
<Show when={props.enabled ?? true} fallback={null}>
@@ -29,9 +35,7 @@ function InnerCustomScrollbar(props: CustomScrollbarProps) {
const [scrollSize, setScrollSize] = createSignal(0);
const [clientSize, setClientSize] = createSignal(0);
const [isDragging, setIsDragging] = createSignal(false);
- const [scrollStart, setScrollStart] = createSignal(0);
const [isScrolling, setIsScrolling] = createSignal(false);
- const [isHovering, setIsHovering] = createSignal(false);
const [scrollLabelVisible, setScrollLabelVisible] = createSignal(
props.labelVisibilityDebounceMs === Infinity
@@ -42,7 +46,7 @@ function InnerCustomScrollbar(props: CustomScrollbarProps) {
props.labelVisibilityDebounceMs ?? 300
);
- const debouncedHideScrollbar = debounce(() => setIsScrolling(false), 800);
+ const debouncedHideScrollbar = debounce(() => setIsScrolling(false), 500);
const updateScrollMetrics = () => {
const container = props.scrollContainer();
@@ -69,20 +73,12 @@ function InnerCustomScrollbar(props: CustomScrollbarProps) {
return Math.max(0, Math.min(max, max + scrollPos()));
};
- const thumbSize = () => {
- const cSize = clientSize();
- const sSize = scrollSize();
- if (sSize <= cSize) return 0;
- return Math.max(20, (cSize / sSize) * cSize);
- };
-
const thumbOffset = () => {
const cSize = clientSize();
const max = maxScroll();
if (max <= 0) return 0;
- const tSize = thumbSize();
- const trackSpace = Math.max(0, cSize - tSize);
- return (scrollOffset() / max) * trackSpace;
+ const maxTop = Math.max(0, cSize - THUMB_SIZE - THUMB_INSET * 2);
+ return THUMB_INSET + (scrollOffset() / max) * maxTop;
};
const isVisible = () => scrollSize() > clientSize();
@@ -113,73 +109,19 @@ function InnerCustomScrollbar(props: CustomScrollbarProps) {
});
});
- const handleMouseDown = (e: MouseEvent) => {
- e.preventDefault();
- e.stopPropagation();
-
+ const scrollToPointer = (clientPos: number, gutterRect: DOMRect) => {
const container = props.scrollContainer();
if (!container) return;
-
- setIsDragging(true);
- setScrollStart(scrollOffset());
-
- let isDraggingLocal = true;
- const handleMouseMove = (moveEvent: MouseEvent) => {
- if (!isDraggingLocal) return;
-
- const delta = horiz()
- ? moveEvent.clientX - e.clientX
- : moveEvent.clientY - e.clientY;
- const trackSize = clientSize();
- const max = maxScroll();
- if (max <= 0) return;
-
- const tSize = thumbSize();
- const trackSpace = trackSize - tSize;
- if (trackSpace <= 0) return;
-
- const scrollRatio = delta / trackSpace;
- let newPos = Math.max(
- 0,
- Math.min(max, scrollStart() + scrollRatio * max)
- );
-
- if (props.reverse && !horiz()) newPos = newPos - max;
-
- if (horiz()) {
- container.scrollLeft = newPos;
- } else {
- container.scrollTop = newPos;
- }
- setScrollPos(newPos);
- };
-
- const handleMouseUp = () => {
- isDraggingLocal = false;
- setIsDragging(false);
- document.removeEventListener('mousemove', handleMouseMove);
- document.removeEventListener('mouseup', handleMouseUp);
- };
-
- document.addEventListener('mousemove', handleMouseMove);
- document.addEventListener('mouseup', handleMouseUp);
- };
-
- const handleTrackClick = (e: MouseEvent) => {
- const container = props.scrollContainer();
- if (!container) return;
-
- const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();
- const clickPos = horiz() ? e.clientX - rect.left : e.clientY - rect.top;
- const trackSize = horiz() ? rect.width : rect.height;
const max = maxScroll();
if (max <= 0) return;
-
- const scrollRatio = clickPos / trackSize;
- let newPos = Math.max(0, Math.min(max, scrollRatio * max));
-
+ const cSize = clientSize();
+ const maxTop = Math.max(0, cSize - THUMB_SIZE - THUMB_INSET * 2);
+ if (maxTop <= 0) return;
+ const start = horiz() ? gutterRect.left : gutterRect.top;
+ const localPos = clientPos - start - THUMB_SIZE / 2;
+ const clamped = Math.max(0, Math.min(maxTop, localPos - THUMB_INSET));
+ let newPos = (clamped / maxTop) * max;
if (props.reverse && !horiz()) newPos = newPos - max;
-
if (horiz()) {
container.scrollLeft = newPos;
} else {
@@ -188,73 +130,83 @@ function InnerCustomScrollbar(props: CustomScrollbarProps) {
setScrollPos(newPos);
};
- const getThumbOpacity = () => {
- if (isDragging()) return 1;
- if (isHovering()) return 1;
- if (isScrolling()) return 1;
- return 0;
+ const handlePointerDown = (e: PointerEvent) => {
+ if (e.button !== 0) return;
+ e.preventDefault();
+ const gutter = e.currentTarget as HTMLElement;
+ gutter.setPointerCapture(e.pointerId);
+ setIsDragging(true);
+ setIsScrolling(true);
+ const rect = gutter.getBoundingClientRect();
+ scrollToPointer(horiz() ? e.clientX : e.clientY, rect);
};
- const getThumbScale = () => {
- if (horiz()) {
- if (isDragging()) return 'scaleY(4)';
- if (isHovering()) return 'scaleY(2)';
- if (isScrolling()) return 'scaleY(2)';
- return 'scaleY(1)';
+ const handlePointerMove = (e: PointerEvent) => {
+ const gutter = e.currentTarget as HTMLElement;
+ if (!gutter.hasPointerCapture(e.pointerId)) return;
+ setIsScrolling(true);
+ debouncedHideScrollbar();
+ const rect = gutter.getBoundingClientRect();
+ scrollToPointer(horiz() ? e.clientX : e.clientY, rect);
+ };
+
+ const handlePointerUp = (e: PointerEvent) => {
+ const gutter = e.currentTarget as HTMLElement;
+ if (gutter.hasPointerCapture(e.pointerId)) {
+ gutter.releasePointerCapture(e.pointerId);
}
- if (isDragging()) return 'scaleX(4)';
- if (isHovering()) return 'scaleX(2)';
- if (isScrolling()) return 'scaleX(2)';
- return 'scaleX(1)';
+ setIsDragging(false);
};
return (
<Show when={isVisible()}>
<div
class={cn(
- 'absolute pointer-events-auto overflow-visible bg-transparent',
- horiz() ? 'bottom-0 inset-x-0 h-px' : 'right-0 inset-y-0 w-px',
+ 'absolute pointer-events-auto',
+ horiz() ? 'bottom-0 inset-x-0' : 'right-0 inset-y-0',
props.class
)}
- onMouseEnter={() => setIsHovering(true)}
- onMouseLeave={() => setIsHovering(false)}
+ style={
+ horiz()
+ ? { height: `${GUTTER_SIZE}px`, 'touch-action': 'none' }
+ : { width: `${GUTTER_SIZE}px`, 'touch-action': 'none' }
+ }
+ onPointerDown={handlePointerDown}
+ onPointerMove={handlePointerMove}
+ onPointerUp={handlePointerUp}
+ onPointerCancel={handlePointerUp}
+ aria-hidden="true"
>
- {/* Track */}
- <div
- class="absolute inset-0 bg-transparent"
- onClick={handleTrackClick}
- />
{/* Thumb */}
<div
- class="absolute cursor-grab active:cursor-grabbing"
+ class="absolute"
style={
horiz()
? {
- left: `${thumbOffset()}px`,
- width: `${thumbSize()}px`,
- height: '1px',
- bottom: '0',
- 'background-color': 'var(--color-accent)',
- 'transform-origin': 'center bottom',
- opacity: getThumbOpacity(),
- transform: getThumbScale(),
- transition:
- 'opacity 200ms ease-out, transform 200ms ease-out',
+ transform: `translateX(${thumbOffset()}px)`,
+ width: `${THUMB_SIZE}px`,
+ height: `${THUMB_THICKNESS}px`,
+ bottom: `${EDGE_INSET}px`,
+ left: '0',
+ 'background-color': 'var(--c4)',
+ 'border-radius': '1px',
+ 'pointer-events': 'none',
+ opacity: isDragging() || isScrolling() ? 1 : 0,
+ transition: 'opacity 150ms ease-in-out',
}
: {
- top: `${thumbOffset()}px`,
- height: `${thumbSize()}px`,
- width: '1px',
- right: '0',
- 'background-color': 'var(--color-accent)',
- 'transform-origin': 'right center',
- opacity: getThumbOpacity(),
- transform: getThumbScale(),
- transition:
- 'opacity 200ms ease-out, transform 200ms ease-out',
+ transform: `translateY(${thumbOffset()}px)`,
+ height: `${THUMB_SIZE}px`,
+ width: `${THUMB_THICKNESS}px`,
+ right: `${EDGE_INSET}px`,
+ top: '0',
+ 'background-color': 'var(--c4)',
+ 'border-radius': '1px',
+ 'pointer-events': 'none',
+ opacity: isDragging() || isScrolling() ? 1 : 0,
+ transition: 'opacity 150ms ease-in-out',
}
}
- onMouseDown={handleMouseDown}
/>
<Show when={props.getLabel}>
<div
@@ -263,7 +215,7 @@ function InnerCustomScrollbar(props: CustomScrollbarProps) {
props.labelClass
)}
style={{
- top: `${thumbOffset() + thumbSize() / 2}px`,
+ top: `${thumbOffset() + THUMB_SIZE / 2}px`,
opacity: scrollLabelVisible() ? 1 : 0,
}}
>
diff --git a/js/app/packages/theme/components/ThemeEditorAdvanced.tsx b/js/app/packages/theme/components/ThemeEditorAdvanced.tsx
index 24fc1b3db5..baaf9f1063 100644
--- a/js/app/packages/theme/components/ThemeEditorAdvanced.tsx
+++ b/js/app/packages/theme/components/ThemeEditorAdvanced.tsx
@@ -4,6 +4,7 @@ import type { ThemeReactiveColor } from '../types/themeTypes';
import { themeReactive } from '../signals/themeReactive';
import { ColorSwatch } from './ColorSwatch';
import { isMobile } from '@core/mobile/isMobile';
+import { Scroll } from '@ui';
const displayType = () => 'hex';
@@ -43,23 +44,13 @@ export function ThemeEditorAdvanced(){
style={{
'height': isMobile() ? '280px' : '390px', /* match themeEditorBasic height */
'font-size': 'var(--text-xs)',
- 'scrollbar-width': 'none',
'position': 'relative',
'overflow': 'hidden',
'font-weight': 300,
'display': 'block',
}}
>
- <div
- style="
- overscroll-behavior: none;
- box-sizing: border-box;
- scrollbar-width: none;
- overflow-y: auto;
- height: 100%;
- width: 100%;
- "
- >
+ <Scroll style={{ 'overscroll-behavior': 'none' }}>
<div
style="
background-color: var(--b3);
@@ -188,7 +179,7 @@ export function ThemeEditorAdvanced(){
}}
</For>
</div>
- </div>
+ </Scroll>
</div>
</>
);
diff --git a/js/app/packages/theme/components/ThemeList.tsx b/js/app/packages/theme/components/ThemeList.tsx
index 339fab3378..360bdadd85 100644
--- a/js/app/packages/theme/components/ThemeList.tsx
+++ b/js/app/packages/theme/components/ThemeList.tsx
@@ -98,9 +98,9 @@ export function ThemeList() {
</>
)}
</For>
- </div>
- </Panel.Body>
- </>
+ </div>
+ </Panel.Body>
+ </>
);
}
diff --git a/js/app/packages/ui/components/Panel.tsx b/js/app/packages/ui/components/Panel.tsx
index d6522b96ee..f4a0f375d6 100644
--- a/js/app/packages/ui/components/Panel.tsx
+++ b/js/app/packages/ui/components/Panel.tsx
@@ -2,6 +2,7 @@ import type { ParentProps } from 'solid-js';
import { Show, splitProps } from 'solid-js';
import type { SurfaceProps } from './Surface';
import { cn } from '../utils/classname';
+import { Scroll } from './Scroll';
import { Surface } from './Surface';
/**
@@ -63,16 +64,21 @@ type BodyProps = ParentProps<{ class?: string; scroll?: boolean }>;
Panel.Body = (props: BodyProps) => (
<Show when={props.children}>
- <div
- class={cn(
- 'relative min-h-0 min-w-0 scrollbar-hidden',
- props.scroll ? 'overflow-auto' : 'overflow-hidden',
- props.class,
- )}
- style={{ 'grid-area': 'body' }}
+ <Show
+ when={props.scroll}
+ fallback={
+ <div
+ class={cn('relative min-h-0 min-w-0 overflow-hidden', props.class)}
+ style={{ 'grid-area': 'body' }}
+ >
+ {props.children}
+ </div>
+ }
>
- {props.children}
- </div>
+ <Scroll class={props.class} style={{ 'grid-area': 'body' }}>
+ {props.children}
+ </Scroll>
+ </Show>
</Show>
);
diff --git a/js/app/packages/ui/components/Scroll.tsx b/js/app/packages/ui/components/Scroll.tsx
index e69de29bb2..a7bb087fa5 100644
--- a/js/app/packages/ui/components/Scroll.tsx
+++ b/js/app/packages/ui/components/Scroll.tsx
@@ -0,0 +1,124 @@
+import { createSignal, onCleanup, onMount } from 'solid-js';
+import type { JSX } from 'solid-js';
+
+const THUMB_WIDTH = 2;
+const HIDE_DELAY = 500;
+const GUTTER_WIDTH = 8;
+const THUMB_HEIGHT = 200;
+const THUMB_INSET = (GUTTER_WIDTH - THUMB_WIDTH) * 0.5;
+
+export function Scroll(props: JSX.HTMLAttributes<HTMLDivElement>) {
+ const [visible, setVisible] = createSignal(false);
+ const [translateY, setTranslateY] = createSignal(THUMB_INSET);
+ let hideTimer: ReturnType<typeof setTimeout> | undefined;
+ let contentRef!: HTMLDivElement;
+ let gutterRef!: HTMLDivElement;
+ let scrollRef!: HTMLDivElement;
+ let maxScroll = 0;
+ let maxTop = 0;
+
+ function update() {
+ setTranslateY(THUMB_INSET + (maxScroll > 0 ? (scrollRef.scrollTop / maxScroll) * maxTop : 0));
+ }
+
+ function reveal() {
+ setVisible(true);
+ clearTimeout(hideTimer);
+ hideTimer = setTimeout(() => setVisible(false), HIDE_DELAY);
+ }
+
+ function config() {
+ const ch = scrollRef.clientHeight;
+ maxScroll = Math.max(0, scrollRef.scrollHeight - ch);
+ maxTop = Math.max(0, ch - THUMB_HEIGHT - THUMB_INSET * 2);
+ update();
+ }
+
+ function handleScroll() {
+ update();
+ reveal();
+ }
+
+ function seek(localY: number) {
+ if (maxScroll <= 0 || maxTop <= 0) { return; }
+ scrollRef.scrollTop = Math.max(0, Math.min(maxTop, localY - THUMB_HEIGHT / 2 - THUMB_INSET)) / maxTop * maxScroll;
+ reveal();
+ }
+
+ function handlePointerDown(e: PointerEvent) {
+ if (e.button !== 0) { return; }
+ e.preventDefault();
+ gutterRef.setPointerCapture(e.pointerId);
+ seek(e.offsetY);
+ }
+
+ function handlePointerMove(e: PointerEvent) {
+ if (!gutterRef.hasPointerCapture(e.pointerId)) { return; }
+ seek(e.offsetY);
+ }
+
+ onMount(() => {
+ const ro = new ResizeObserver(config);
+ ro.observe(scrollRef);
+ ro.observe(contentRef);
+
+ onCleanup(() => {
+ ro.disconnect();
+ clearTimeout(hideTimer);
+ });
+ });
+
+ return (
+ <div
+ {...props}
+ style={{
+ 'position': 'relative',
+ 'min-height': '0',
+ 'min-width': '0',
+ 'height': '100%',
+ 'width': '100%',
+ }}
+ >
+ <div
+ ref={scrollRef}
+ onScroll={handleScroll}
+ style={{
+ 'scrollbar-width': 'none',
+ 'overflow-y': 'auto',
+ 'height': '100%',
+ }}
+ >
+ <div ref={contentRef}>{props.children}</div>
+ </div>
+ <div
+ ref={gutterRef}
+ onPointerDown={handlePointerDown}
+ onPointerMove={handlePointerMove}
+ aria-hidden="true"
+ style={{
+ 'width': `${GUTTER_WIDTH}px`,
+ 'touch-action': 'none',
+ 'position': 'absolute',
+ 'height': '100%',
+ 'right': '0',
+ 'top': '0',
+ }}
+ >
+ <div
+ style={{
+ 'transform': `translateY(${translateY()}px)`,
+ 'transition': 'opacity 150ms ease-in-out',
+ 'border-radius': `${THUMB_WIDTH * 0.5}px`,
+ 'background-color': 'var(--c4)',
+ 'height': `${THUMB_HEIGHT}px`,
+ 'opacity': visible() ? 1 : 0,
+ 'right': `${THUMB_INSET}px`,
+ 'width': `${THUMB_WIDTH}px`,
+ 'pointer-events': 'none',
+ 'position': 'absolute',
+ }}
+ />
+ </div>
+ </div>
+ );
+}
diff --git a/js/app/packages/ui/index.ts b/js/app/packages/ui/index.ts
index 023f3543e9..57310b7495 100644
--- a/js/app/packages/ui/index.ts
+++ b/js/app/packages/ui/index.ts
@@ -1,22 +1,17 @@
/* components */
-export {
- Avatar,
- AvatarGroup,
- type AvatarSize,
- type AvatarProps,
- type AvatarGroupSize,
- type AvatarGroupProps,
-} from './components/Avatar';
export { SegmentedControl } from './components/SegmentedControl';
export { TabbedControl } from './components/TabbedControl';
+export { Avatar, AvatarGroup } from './components/Avatar';
export { Keyboard } from './components/Keyboard';
+export { Surface } from './components/Surface';
export { Dialog } from './components/Dialog';
-export { Panel } from './components/Panel';
export { Button } from './components/Button';
+export { Scroll } from './components/Scroll';
+export { Panel } from './components/Panel';
export { Layer } from './components/Layer';
-export { Surface } from './components/Surface';
/* types */
+export type { AvatarSize, AvatarProps, AvatarGroupSize, AvatarGroupProps } from './components/Avatar';
export type { DialogProps } from './components/Dialog';
export type { PanelProps } from './components/Panel';