diff --git a/packages/dify-ui/src/alert-dialog/index.stories.tsx b/packages/dify-ui/src/alert-dialog/index.stories.tsx index c8dcc6ac533..d00328270b9 100644 --- a/packages/dify-ui/src/alert-dialog/index.stories.tsx +++ b/packages/dify-ui/src/alert-dialog/index.stories.tsx @@ -13,7 +13,7 @@ import { } from '.' import { Button } from '../button' -const triggerButtonClassName = 'rounded-lg border border-divider-subtle bg-components-button-secondary-bg px-3 py-1.5 text-sm text-text-secondary shadow-xs hover:bg-state-base-hover' +const triggerButtonClassName = 'rounded-lg border border-divider-subtle bg-components-button-secondary-bg px-3 py-1.5 text-sm text-text-secondary shadow-xs outline-hidden hover:bg-state-base-hover focus-visible:ring-2 focus-visible:ring-state-accent-solid' const meta = { title: 'Base/UI/AlertDialog', diff --git a/packages/dify-ui/src/collapsible/index.stories.tsx b/packages/dify-ui/src/collapsible/index.stories.tsx index 291297e981d..4376161beb7 100644 --- a/packages/dify-ui/src/collapsible/index.stories.tsx +++ b/packages/dify-ui/src/collapsible/index.stories.tsx @@ -97,7 +97,7 @@ export const Controlled: Story = {
+
+ ) +} + export const Default: Story = { render: () => ( } + render={ ), } + +const InsideScrollingContentDemo = () => { + const [open, setOpen] = React.useState(false) + + return ( + + } + > + Review release notes + + + + + + + + + + + + + + + + + + setOpen(false)} /> + + + + + ) +} + +export const InsideScrollingContent: Story = { + render: () => , +} diff --git a/packages/dify-ui/src/dialog/index.tsx b/packages/dify-ui/src/dialog/index.tsx index 9e08da21e58..5db0dbca358 100644 --- a/packages/dify-ui/src/dialog/index.tsx +++ b/packages/dify-ui/src/dialog/index.tsx @@ -8,6 +8,63 @@ export const Dialog = BaseDialog.Root export const DialogTrigger = BaseDialog.Trigger export const DialogTitle = BaseDialog.Title export const DialogDescription = BaseDialog.Description +export const DialogPortal = BaseDialog.Portal + +type DialogBackdropProps = Omit & { + className?: string +} + +export function DialogBackdrop({ + className, + ...props +}: DialogBackdropProps) { + return ( + + ) +} + +type DialogViewportProps = Omit & { + className?: string +} + +export function DialogViewport({ + className, + ...props +}: DialogViewportProps) { + return ( + + ) +} + +type DialogPopupProps = Omit & { + className?: string +} + +export function DialogPopup({ + className, + ...props +}: DialogPopupProps) { + return ( + + ) +} type DialogCloseButtonProps = Omit @@ -21,7 +78,7 @@ export function DialogCloseButton({ aria-label={ariaLabel} {...props} className={cn( - 'absolute top-6 end-6 z-10 flex h-5 w-5 cursor-pointer items-center justify-center rounded-2xl hover:bg-state-base-hover focus-visible:bg-state-base-hover focus-visible:ring-2 focus-visible:ring-state-accent-solid focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50', + 'absolute top-6 end-6 z-10 flex h-5 w-5 cursor-pointer items-center justify-center rounded-2xl hover:bg-state-base-hover focus-visible:ring-2 focus-visible:ring-state-accent-solid focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50', className, )} > @@ -44,24 +101,16 @@ export function DialogContent({ backdropProps, }: DialogContentProps) { return ( - - + + - {children} - - + + ) } diff --git a/packages/dify-ui/src/dropdown-menu/index.stories.tsx b/packages/dify-ui/src/dropdown-menu/index.stories.tsx index e0dcfaf123e..7d5baafb6ef 100644 --- a/packages/dify-ui/src/dropdown-menu/index.stories.tsx +++ b/packages/dify-ui/src/dropdown-menu/index.stories.tsx @@ -21,7 +21,7 @@ import { const TriggerButton = ({ label = 'Open Menu' }: { label?: string }) => ( } + render={ @@ -204,7 +204,7 @@ export const InContextMenu: Story = { render={( - {index === pinnedCount - 1 && index !== appRows.length - 1 && ( -
- )} -
- ))} - - - - - - - - - ) - }, -} diff --git a/packages/dify-ui/src/switch/index.stories.tsx b/packages/dify-ui/src/switch/index.stories.tsx index 40e9ca6e519..a3176016daa 100644 --- a/packages/dify-ui/src/switch/index.stories.tsx +++ b/packages/dify-ui/src/switch/index.stories.tsx @@ -225,7 +225,7 @@ const LoadingDemo = () => { return (