diff --git a/packages/dify-ui/src/scroll-area/index.stories.tsx b/packages/dify-ui/src/scroll-area/index.stories.tsx index fa32ae048ca..84a0b6f4307 100644 --- a/packages/dify-ui/src/scroll-area/index.stories.tsx +++ b/packages/dify-ui/src/scroll-area/index.stories.tsx @@ -17,7 +17,7 @@ const meta = { layout: 'padded', docs: { description: { - component: 'Compound scroll container built on Base UI Scroll Area. The examples mirror the upstream anatomy and focus patterns while applying Dify UI tokens, panel surfaces, and scrollbar spacing. Base UI ScrollArea.Content defaults to min-width: fit-content, so vertical-only regions that should truncate long content must set min-width: 0 on the content slot.', + component: 'Compound scroll container built on Base UI Scroll Area. The examples mirror the upstream anatomy and focus patterns while applying Dify UI tokens and surface treatments. Base UI ScrollArea.Content defaults to min-width: fit-content, so vertical-only regions that should truncate long content must set min-width: 0 on the content slot.', }, }, }, @@ -27,27 +27,7 @@ const meta = { export default meta type Story = StoryObj -const scrollFadeRootClassName = cn( - 'has-[>_:first-child:focus-visible]:outline-2', - 'has-[>_:first-child:focus-visible]:outline-offset-0', - 'has-[>_:first-child:focus-visible]:outline-state-accent-solid', -) -const rootClassName = 'relative min-h-0 min-w-0' -const viewportClassName = 'h-full max-h-full max-w-full rounded-xl border border-divider-subtle bg-components-panel-bg' -const fadeViewportClassName = cn( - 'h-full max-h-full max-w-full rounded-xl bg-components-panel-bg outline-none focus-visible:outline-none', - 'mask-linear-[to_bottom,transparent_0,black_min(40px,var(--scroll-area-overflow-y-start)),black_calc(100%_-_min(40px,var(--scroll-area-overflow-y-end,40px))),transparent_100%] mask-no-repeat', -) -const scrollbarClassName = cn( - 'data-[orientation=vertical]:my-1 data-[orientation=vertical]:me-1', - 'data-[orientation=horizontal]:mx-1 data-[orientation=horizontal]:mb-1', -) -const verticalContentClassName = 'w-full max-w-full min-w-0' const verticalContentStyle = { minWidth: 0 } satisfies React.CSSProperties -const panelClassName = 'min-w-0 rounded-2xl border-[0.5px] border-components-panel-border bg-components-panel-bg shadow-lg shadow-shadow-shadow-5' -const pageClassName = 'min-w-0 rounded-[28px] border border-divider-subtle bg-background-body p-5' -const labelClassName = 'system-xs-medium-uppercase text-text-tertiary' -const headingClassName = 'system-md-semibold text-text-primary' const appRows = [ { name: 'Invoice Copilot', meta: 'Pinned', icon: 'i-ri-file-list-3-line', selected: true, pinned: true }, @@ -99,10 +79,10 @@ function StorySection({ className?: string }) { return ( -
+
-
{eyebrow}
-

{title}

+
{eyebrow}
+

{title}

{description}

@@ -122,7 +102,7 @@ function VerticalContent({ return ( {children} @@ -136,22 +116,20 @@ export const Anatomy: Story = { title="Base UI compound parts" description="The baseline story mirrors the official Scroll Area anatomy: Root, Viewport, Content, Scrollbar, and Thumb, with keyboard focus drawn by the viewport." > -
- - - - {articleParagraphs.map(paragraph => ( -

- {paragraph} -

- ))} -
-
- - - -
-
+ + + + {articleParagraphs.map(paragraph => ( +

+ {paragraph} +

+ ))} +
+
+ + + +
), } @@ -163,28 +141,26 @@ export const Vertical: Story = { title="Long form content" description="Vertical overflow keeps the official viewport focus pattern while constraining content width so text never leaks outside the frame." > -
- - - -
-
Article
-
Scrollable text region
-
- {Array.from({ length: 4 }, (_, groupIndex) => ( - articleParagraphs.map(paragraph => ( -

- {paragraph} -

- )) - ))} -
-
- - - -
-
+ + + +
+
Article
+
Scrollable text region
+
+ {Array.from({ length: 4 }, (_, groupIndex) => ( + articleParagraphs.map(paragraph => ( +

+ {paragraph} +

+ )) + ))} +
+
+ + + +
), } @@ -196,28 +172,26 @@ export const VerticalTruncation: Story = { title="Constrained content width" description="Use width constraints plus minWidth: 0 on ScrollArea.Content when a vertical-only list should keep vertical scrolling while truncating long labels instead of creating horizontal scroll." > -
- - - - {fileRows.map(file => ( -
- - - {file} - -
- ))} -
-
- - - -
-
+ + + + {fileRows.map(file => ( +
+ + + {file} + +
+ ))} +
+
+ + + +
), } @@ -229,24 +203,33 @@ export const ScrollFade: Story = { title="Viewport mask with root focus" description="This mirrors the Base UI scroll-fade example: the viewport owns the mask and the root owns the focus outline so the indicator is never clipped." > -
- - - - {Array.from({ length: 5 }, (_, groupIndex) => ( - articleParagraphs.map(paragraph => ( -

- {paragraph} -

- )) - ))} -
-
- - - -
-
+ _:first-child:focus-visible]:outline-2 has-[>_:first-child:focus-visible]:outline-offset-0 has-[>_:first-child:focus-visible]:outline-state-accent-solid', + )} + > + + + {Array.from({ length: 5 }, (_, groupIndex) => ( + articleParagraphs.map(paragraph => ( +

+ {paragraph} +

+ )) + ))} +
+
+ + + +
), } @@ -259,24 +242,22 @@ export const Horizontal: Story = { description="Horizontal overflow keeps Base UI's content sizing behavior and uses the same viewport focus treatment on the scrollable element." className="mx-auto max-w-190" > -
- - - -
- {gridCells.slice(0, 18).map(cell => ( -
- {cell} -
- ))} -
-
-
- - - -
-
+ + + +
+ {gridCells.slice(0, 18).map(cell => ( +
+ {cell} +
+ ))} +
+
+
+ + + +
), } @@ -288,28 +269,26 @@ export const BothAxes: Story = { title="Numbered grid" description="This follows the official two-axis example: both scrollbars are rendered and Corner reserves the intersection." > -
- - - -
- {gridCells.map(cell => ( -
- {cell} -
- ))} -
-
-
- - - - - - - -
-
+ + + +
+ {gridCells.map(cell => ( +
+ {cell} +
+ ))} +
+
+
+ + + + + + + +
), } @@ -324,54 +303,50 @@ export const AppSidebar: Story = { title="Main navigation list" description="A Dify-like sidebar keeps business UI outside the primitive while preserving the same Root, Viewport, Content, Scrollbar anatomy." > -
-
-
- - Explore -
-
- Web apps - {appRows.length} -
-
- - - - {appRows.map((row, index) => ( -
- - {index === pinnedCount - 1 && index !== appRows.length - 1 && ( -
- )} -
- ))} - - - - - - -
+
+
+ + Explore
+
+ Web apps + {appRows.length} +
+ + + + {appRows.map((row, index) => ( +
+ + {index === pinnedCount - 1 && index !== appRows.length - 1 && ( +
+ )} +
+ ))} + + + + + +
) diff --git a/web/app/components/billing/pricing/index.tsx b/web/app/components/billing/pricing/index.tsx index 5f8d4cc0974..07dddc408bc 100644 --- a/web/app/components/billing/pricing/index.tsx +++ b/web/app/components/billing/pricing/index.tsx @@ -28,15 +28,6 @@ type PricingProps = { onCancel: () => void } -const pricingScrollAreaClassNames = { - root: 'relative h-full w-full overflow-hidden', - viewport: 'overscroll-contain', - content: 'min-h-full min-w-[1200px]', - verticalScrollbar: 'data-[orientation=vertical]:my-2 data-[orientation=vertical]:me-1', - horizontalScrollbar: 'data-[orientation=horizontal]:mx-2 data-[orientation=horizontal]:mb-0.5', - corner: 'bg-saas-background', -} as const - const Pricing: FC = ({ onCancel, }) => { @@ -65,9 +56,9 @@ const Pricing: FC = ({ - - - + + +
@@ -92,16 +83,13 @@ const Pricing: FC = ({
- + - + - + diff --git a/web/app/components/explore/sidebar/index.tsx b/web/app/components/explore/sidebar/index.tsx index bbb6c37870e..408644a4ea8 100644 --- a/web/app/components/explore/sidebar/index.tsx +++ b/web/app/components/explore/sidebar/index.tsx @@ -23,12 +23,6 @@ import { useGetInstalledApps, useUninstallApp, useUpdateAppPinStatus } from '@/s import Item from './app-nav-item' import NoApps from './no-apps' -const expandedSidebarScrollAreaClassNames = { - content: 'space-y-0.5', - scrollbar: 'data-[orientation=vertical]:my-2 data-[orientation=vertical]:-me-3', - viewport: 'overscroll-contain', -} as const - const SideBar = () => { const { t } = useTranslation() const pathname = usePathname() @@ -116,7 +110,10 @@ const SideBar = () => {
{installedAppItems} diff --git a/web/app/components/header/account-setting/model-provider-page/model-selector/popup-layout.tsx b/web/app/components/header/account-setting/model-provider-page/model-selector/popup-layout.tsx index b1beed2345a..a5412e11b74 100644 --- a/web/app/components/header/account-setting/model-provider-page/model-selector/popup-layout.tsx +++ b/web/app/components/header/account-setting/model-provider-page/model-selector/popup-layout.tsx @@ -93,7 +93,7 @@ export function ModelSelectorScrollBody({ > {children} - + diff --git a/web/app/components/integrations/page.tsx b/web/app/components/integrations/page.tsx index 25ca6923004..d0d43539c8b 100644 --- a/web/app/components/integrations/page.tsx +++ b/web/app/components/integrations/page.tsx @@ -297,7 +297,6 @@ export default function IntegrationsPage({ slotClassNames={{ viewport: 'overscroll-contain', content: 'min-h-full', - scrollbar: 'data-[orientation=vertical]:my-1 data-[orientation=vertical]:me-1', }} >
diff --git a/web/app/components/integrations/tool-provider-list.tsx b/web/app/components/integrations/tool-provider-list.tsx index 04a81c4d7cb..d660545c499 100644 --- a/web/app/components/integrations/tool-provider-list.tsx +++ b/web/app/components/integrations/tool-provider-list.tsx @@ -245,7 +245,7 @@ const ProviderList = ({ )} - + diff --git a/web/app/components/main-nav/components/web-apps-section.tsx b/web/app/components/main-nav/components/web-apps-section.tsx index 65ea3a3564e..37f326241a8 100644 --- a/web/app/components/main-nav/components/web-apps-section.tsx +++ b/web/app/components/main-nav/components/web-apps-section.tsx @@ -226,7 +226,7 @@ const WebAppsSectionContent = () => { className="overflow-x-hidden" role="region" > - + {isPending && ( )} @@ -271,7 +271,7 @@ const WebAppsSectionContent = () => { )} - + diff --git a/web/app/components/plugins/plugin-page/plugin-tasks/components/plugin-task-list.tsx b/web/app/components/plugins/plugin-page/plugin-tasks/components/plugin-task-list.tsx index 76e7774c3ab..396a0351f73 100644 --- a/web/app/components/plugins/plugin-page/plugin-tasks/components/plugin-task-list.tsx +++ b/web/app/components/plugins/plugin-page/plugin-tasks/components/plugin-task-list.tsx @@ -41,7 +41,7 @@ function PluginTaskList({ label={t('task.installing', { ns: 'plugin' })} slotClassNames={{ viewport: 'max-h-[420px] overscroll-contain', - content: 'w-full! max-w-full! min-w-0! overflow-x-hidden!', + content: 'w-full! max-w-full! min-w-0! overflow-x-hidden! pr-3', }} > {runningPlugins.length > 0 && ( diff --git a/web/app/components/plugins/plugin-page/plugins-panel-results.tsx b/web/app/components/plugins/plugin-page/plugins-panel-results.tsx index b8a80ee2377..0b54ff40b4e 100644 --- a/web/app/components/plugins/plugin-page/plugins-panel-results.tsx +++ b/web/app/components/plugins/plugin-page/plugins-panel-results.tsx @@ -164,7 +164,7 @@ const PluginsPanelResults = ({ )} - + diff --git a/web/app/components/workflow/block-selector/trigger-plugin/item.tsx b/web/app/components/workflow/block-selector/trigger-plugin/item.tsx index 75e747d4180..988fc091e5b 100644 --- a/web/app/components/workflow/block-selector/trigger-plugin/item.tsx +++ b/web/app/components/workflow/block-selector/trigger-plugin/item.tsx @@ -180,7 +180,7 @@ const TriggerPluginItem: FC = ({ ))} - + diff --git a/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/detail-dialog.tsx b/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/detail-dialog.tsx index 409adff5d79..9a9407b9e61 100644 --- a/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/detail-dialog.tsx +++ b/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/detail-dialog.tsx @@ -235,7 +235,6 @@ export function AgentSkillDetailDialog({ slotClassNames={{ viewport: 'overscroll-contain outline-none focus-visible:outline-none mask-linear-[to_bottom,transparent_0,black_min(40px,var(--scroll-area-overflow-y-start)),black_calc(100%_-_min(40px,var(--scroll-area-overflow-y-end,40px))),transparent_100%] mask-no-repeat', content: 'flex min-h-full w-full max-w-full min-w-0 flex-col gap-2 px-6 pt-4 pb-0', - scrollbar: 'data-[orientation=vertical]:my-1 data-[orientation=vertical]:me-1', }} > {detail.filePreview && ( diff --git a/web/features/agent-v2/agent-detail/logs/components/logs-table.tsx b/web/features/agent-v2/agent-detail/logs/components/logs-table.tsx index ca5e6a6c03d..fd8140be430 100644 --- a/web/features/agent-v2/agent-detail/logs/components/logs-table.tsx +++ b/web/features/agent-v2/agent-detail/logs/components/logs-table.tsx @@ -41,7 +41,7 @@ export function AgentLogsTable({ return (
-
+
@@ -55,7 +55,7 @@ export function AgentLogsTable({ tabIndex={-1} className="overscroll-contain" > - + @@ -69,7 +69,7 @@ export function AgentLogsTable({
- + diff --git a/web/features/agent-v2/roster/page.tsx b/web/features/agent-v2/roster/page.tsx index 2527c0875b5..b207818ca6e 100644 --- a/web/features/agent-v2/roster/page.tsx +++ b/web/features/agent-v2/roster/page.tsx @@ -139,7 +139,7 @@ export default function RosterPage() { /> - + diff --git a/web/features/deployments/create-guide/ui/layout.tsx b/web/features/deployments/create-guide/ui/layout.tsx index 1e2fd448a81..dfecfba307f 100644 --- a/web/features/deployments/create-guide/ui/layout.tsx +++ b/web/features/deployments/create-guide/ui/layout.tsx @@ -167,7 +167,6 @@ export function GuideCard({ children, actions, contentScrollable = true }: { slotClassNames={{ viewport: 'overscroll-contain', content: 'min-h-full pt-0.5 pb-6', - scrollbar: 'data-[orientation=vertical]:-me-5 data-[orientation=vertical]:my-1', }} > {children}