Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/calm-dialogs-rise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tailor-platform/app-shell": patch
---

`Dialog` opens with a small upward slide alongside its fade and zoom, and closes faster (150ms, eased in) with a matching slide down, so opening and closing read more clearly. Both animations are skipped under `prefers-reduced-motion`.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

exports[`Dialog > snapshots > closed dialog (trigger only) 1`] = `"<button type="button" tabindex="0" data-base-ui-click-trigger="" id="base-ui-_r_1_" aria-haspopup="dialog" aria-expanded="false" data-slot="dialog-trigger">Open</button>"`;

exports[`Dialog > snapshots > open dialog with header 1`] = `"<div aria-hidden="true" data-base-ui-inert=""><button type="button" tabindex="0" data-base-ui-click-trigger="" id="base-ui-_r_3_" aria-haspopup="dialog" aria-expanded="true" data-slot="dialog-trigger" data-popup-open="" aria-controls="_r_2_">Open</button></div><div id="_r_4_" data-base-ui-portal="" data-slot="dialog-portal"><div role="presentation" data-base-ui-inert="" style="position: fixed; inset: 0; user-select: none;" aria-hidden="true"></div><div data-open="" role="presentation" style="user-select: none;" data-slot="dialog-overlay" class="astw:data-open:animate-in astw:data-ending-style:animate-out astw:data-ending-style:fade-out-0 astw:data-open:fade-in-0 astw:fill-mode-forwards astw:fixed astw:inset-0 astw:z-(--z-overlay) astw:bg-black/50" aria-hidden="true" data-base-ui-inert=""></div><span data-type="inside" style="clip-path: inset(50%); overflow: hidden; white-space: nowrap; border: 0px; padding: 0px; width: 1px; height: 1px; margin: -1px; position: fixed; top: 0px; left: 0px;" aria-hidden="true" tabindex="0" data-base-ui-focus-guard="" data-base-ui-inert=""></span><div data-open="" id="_r_2_" role="dialog" tabindex="-1" data-base-ui-focusable="" style="--nested-dialogs: 0;" data-slot="dialog-content" class="astw:bg-card astw:data-open:animate-in astw:data-ending-style:animate-out astw:data-ending-style:fade-out-0 astw:data-open:fade-in-0 astw:data-ending-style:zoom-out-95 astw:data-open:zoom-in-95 astw:fill-mode-forwards astw:fixed astw:top-[50%] astw:left-[50%] astw:z-(--z-overlay) astw:grid astw:w-full astw:max-w-[calc(100%-2rem)] astw:translate-x-[-50%] astw:translate-y-[-50%] astw:gap-4 astw:rounded-lg astw:border astw:border-border astw:p-6 astw:shadow-lg astw:duration-200 astw:sm:max-w-lg" aria-labelledby="base-ui-_r_5_" aria-describedby="base-ui-_r_6_"><div data-slot="dialog-header" class="astw:flex astw:flex-col astw:gap-2 astw:text-center astw:sm:text-left"><h2 id="base-ui-_r_5_" data-slot="dialog-title" class="astw:text-lg astw:leading-none astw:font-semibold">Dialog Title</h2><p id="base-ui-_r_6_" data-slot="dialog-description" class="astw:text-muted-foreground astw:text-sm">Dialog description text</p></div><button type="button" tabindex="0" class="astw:ring-offset-bg astw:focus:ring-ring astw:data-open:bg-accent astw:data-open:text-muted-foreground astw:absolute astw:top-4 astw:right-4 astw:rounded-xs astw:opacity-70 astw:transition-opacity astw:hover:opacity-100 astw:focus:ring-2 astw:focus:ring-offset-2 astw:focus:outline-hidden astw:disabled:pointer-events-none astw:[&amp;_svg]:pointer-events-none astw:[&amp;_svg]:shrink-0 astw:[&amp;_svg:not([class*='size-'])]:size-4"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-x" aria-hidden="true"><path d="M18 6 6 18"></path><path d="m6 6 12 12"></path></svg><span class="astw:sr-only">Close</span></button></div><span data-type="inside" style="clip-path: inset(50%); overflow: hidden; white-space: nowrap; border: 0px; padding: 0px; width: 1px; height: 1px; margin: -1px; position: fixed; top: 0px; left: 0px;" aria-hidden="true" tabindex="0" data-base-ui-focus-guard="" data-base-ui-inert=""></span></div>"`;
exports[`Dialog > snapshots > open dialog with header 1`] = `"<div aria-hidden="true" data-base-ui-inert=""><button type="button" tabindex="0" data-base-ui-click-trigger="" id="base-ui-_r_3_" aria-haspopup="dialog" aria-expanded="true" data-slot="dialog-trigger" data-popup-open="" aria-controls="_r_2_">Open</button></div><div id="_r_4_" data-base-ui-portal="" data-slot="dialog-portal"><div role="presentation" data-base-ui-inert="" style="position: fixed; inset: 0; user-select: none;" aria-hidden="true"></div><div data-open="" role="presentation" style="user-select: none;" data-slot="dialog-overlay" class="astw:data-open:animate-in astw:data-ending-style:animate-out astw:data-ending-style:fade-out-0 astw:data-open:fade-in-0 astw:fill-mode-forwards astw:fixed astw:inset-0 astw:z-(--z-overlay) astw:bg-black/50 astw:duration-200 astw:data-ending-style:duration-150 astw:motion-reduce:animate-none" aria-hidden="true" data-base-ui-inert=""></div><span data-type="inside" style="clip-path: inset(50%); overflow: hidden; white-space: nowrap; border: 0px; padding: 0px; width: 1px; height: 1px; margin: -1px; position: fixed; top: 0px; left: 0px;" aria-hidden="true" tabindex="0" data-base-ui-focus-guard="" data-base-ui-inert=""></span><div data-open="" id="_r_2_" role="dialog" tabindex="-1" data-base-ui-focusable="" style="--nested-dialogs: 0;" data-slot="dialog-content" class="astw:bg-card astw:data-open:animate-in astw:data-ending-style:animate-out astw:data-ending-style:fade-out-0 astw:data-open:fade-in-0 astw:data-ending-style:zoom-out-95 astw:data-open:zoom-in-95 astw:data-open:slide-in-from-bottom-2 astw:data-ending-style:slide-out-to-bottom-2 astw:ease-out astw:data-ending-style:ease-in astw:data-ending-style:duration-150 astw:motion-reduce:animate-none astw:fill-mode-forwards astw:fixed astw:top-[50%] astw:left-[50%] astw:z-(--z-overlay) astw:grid astw:w-full astw:max-w-[calc(100%-2rem)] astw:translate-x-[-50%] astw:translate-y-[-50%] astw:gap-4 astw:rounded-lg astw:border astw:border-border astw:p-6 astw:shadow-lg astw:duration-200 astw:sm:max-w-lg" aria-labelledby="base-ui-_r_5_" aria-describedby="base-ui-_r_6_"><div data-slot="dialog-header" class="astw:flex astw:flex-col astw:gap-2 astw:text-center astw:sm:text-left"><h2 id="base-ui-_r_5_" data-slot="dialog-title" class="astw:text-lg astw:leading-none astw:font-semibold">Dialog Title</h2><p id="base-ui-_r_6_" data-slot="dialog-description" class="astw:text-muted-foreground astw:text-sm">Dialog description text</p></div><button type="button" tabindex="0" class="astw:ring-offset-bg astw:focus:ring-ring astw:data-open:bg-accent astw:data-open:text-muted-foreground astw:absolute astw:top-4 astw:right-4 astw:rounded-xs astw:opacity-70 astw:transition-opacity astw:hover:opacity-100 astw:focus:ring-2 astw:focus:ring-offset-2 astw:focus:outline-hidden astw:disabled:pointer-events-none astw:[&amp;_svg]:pointer-events-none astw:[&amp;_svg]:shrink-0 astw:[&amp;_svg:not([class*='size-'])]:size-4"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-x" aria-hidden="true"><path d="M18 6 6 18"></path><path d="m6 6 12 12"></path></svg><span class="astw:sr-only">Close</span></button></div><span data-type="inside" style="clip-path: inset(50%); overflow: hidden; white-space: nowrap; border: 0px; padding: 0px; width: 1px; height: 1px; margin: -1px; position: fixed; top: 0px; left: 0px;" aria-hidden="true" tabindex="0" data-base-ui-focus-guard="" data-base-ui-inert=""></span></div>"`;

exports[`Dialog > snapshots > open dialog with header and footer 1`] = `"<div aria-hidden="true" data-base-ui-inert=""><button type="button" tabindex="0" data-base-ui-click-trigger="" id="base-ui-_r_8_" aria-haspopup="dialog" aria-expanded="true" data-slot="dialog-trigger" data-popup-open="" aria-controls="_r_7_">Open</button></div><div id="_r_9_" data-base-ui-portal="" data-slot="dialog-portal"><div role="presentation" data-base-ui-inert="" style="position: fixed; inset: 0; user-select: none;" aria-hidden="true"></div><div data-open="" role="presentation" style="user-select: none;" data-slot="dialog-overlay" class="astw:data-open:animate-in astw:data-ending-style:animate-out astw:data-ending-style:fade-out-0 astw:data-open:fade-in-0 astw:fill-mode-forwards astw:fixed astw:inset-0 astw:z-(--z-overlay) astw:bg-black/50" aria-hidden="true" data-base-ui-inert=""></div><span data-type="inside" style="clip-path: inset(50%); overflow: hidden; white-space: nowrap; border: 0px; padding: 0px; width: 1px; height: 1px; margin: -1px; position: fixed; top: 0px; left: 0px;" aria-hidden="true" tabindex="0" data-base-ui-focus-guard="" data-base-ui-inert=""></span><div data-open="" id="_r_7_" role="dialog" tabindex="-1" data-base-ui-focusable="" style="--nested-dialogs: 0;" data-slot="dialog-content" class="astw:bg-card astw:data-open:animate-in astw:data-ending-style:animate-out astw:data-ending-style:fade-out-0 astw:data-open:fade-in-0 astw:data-ending-style:zoom-out-95 astw:data-open:zoom-in-95 astw:fill-mode-forwards astw:fixed astw:top-[50%] astw:left-[50%] astw:z-(--z-overlay) astw:grid astw:w-full astw:max-w-[calc(100%-2rem)] astw:translate-x-[-50%] astw:translate-y-[-50%] astw:gap-4 astw:rounded-lg astw:border astw:border-border astw:p-6 astw:shadow-lg astw:duration-200 astw:sm:max-w-lg" aria-labelledby="base-ui-_r_a_" aria-describedby="base-ui-_r_b_"><div data-slot="dialog-header" class="astw:flex astw:flex-col astw:gap-2 astw:text-center astw:sm:text-left"><h2 id="base-ui-_r_a_" data-slot="dialog-title" class="astw:text-lg astw:leading-none astw:font-semibold">Confirm Action</h2><p id="base-ui-_r_b_" data-slot="dialog-description" class="astw:text-muted-foreground astw:text-sm">Are you sure?</p></div><div data-slot="dialog-footer" class="astw:flex astw:flex-col-reverse astw:gap-2 astw:sm:flex-row astw:sm:justify-end"><button>Cancel</button><button>Confirm</button></div><button type="button" tabindex="0" class="astw:ring-offset-bg astw:focus:ring-ring astw:data-open:bg-accent astw:data-open:text-muted-foreground astw:absolute astw:top-4 astw:right-4 astw:rounded-xs astw:opacity-70 astw:transition-opacity astw:hover:opacity-100 astw:focus:ring-2 astw:focus:ring-offset-2 astw:focus:outline-hidden astw:disabled:pointer-events-none astw:[&amp;_svg]:pointer-events-none astw:[&amp;_svg]:shrink-0 astw:[&amp;_svg:not([class*='size-'])]:size-4"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-x" aria-hidden="true"><path d="M18 6 6 18"></path><path d="m6 6 12 12"></path></svg><span class="astw:sr-only">Close</span></button></div><span data-type="inside" style="clip-path: inset(50%); overflow: hidden; white-space: nowrap; border: 0px; padding: 0px; width: 1px; height: 1px; margin: -1px; position: fixed; top: 0px; left: 0px;" aria-hidden="true" tabindex="0" data-base-ui-focus-guard="" data-base-ui-inert=""></span></div>"`;
exports[`Dialog > snapshots > open dialog with header and footer 1`] = `"<div aria-hidden="true" data-base-ui-inert=""><button type="button" tabindex="0" data-base-ui-click-trigger="" id="base-ui-_r_8_" aria-haspopup="dialog" aria-expanded="true" data-slot="dialog-trigger" data-popup-open="" aria-controls="_r_7_">Open</button></div><div id="_r_9_" data-base-ui-portal="" data-slot="dialog-portal"><div role="presentation" data-base-ui-inert="" style="position: fixed; inset: 0; user-select: none;" aria-hidden="true"></div><div data-open="" role="presentation" style="user-select: none;" data-slot="dialog-overlay" class="astw:data-open:animate-in astw:data-ending-style:animate-out astw:data-ending-style:fade-out-0 astw:data-open:fade-in-0 astw:fill-mode-forwards astw:fixed astw:inset-0 astw:z-(--z-overlay) astw:bg-black/50 astw:duration-200 astw:data-ending-style:duration-150 astw:motion-reduce:animate-none" aria-hidden="true" data-base-ui-inert=""></div><span data-type="inside" style="clip-path: inset(50%); overflow: hidden; white-space: nowrap; border: 0px; padding: 0px; width: 1px; height: 1px; margin: -1px; position: fixed; top: 0px; left: 0px;" aria-hidden="true" tabindex="0" data-base-ui-focus-guard="" data-base-ui-inert=""></span><div data-open="" id="_r_7_" role="dialog" tabindex="-1" data-base-ui-focusable="" style="--nested-dialogs: 0;" data-slot="dialog-content" class="astw:bg-card astw:data-open:animate-in astw:data-ending-style:animate-out astw:data-ending-style:fade-out-0 astw:data-open:fade-in-0 astw:data-ending-style:zoom-out-95 astw:data-open:zoom-in-95 astw:data-open:slide-in-from-bottom-2 astw:data-ending-style:slide-out-to-bottom-2 astw:ease-out astw:data-ending-style:ease-in astw:data-ending-style:duration-150 astw:motion-reduce:animate-none astw:fill-mode-forwards astw:fixed astw:top-[50%] astw:left-[50%] astw:z-(--z-overlay) astw:grid astw:w-full astw:max-w-[calc(100%-2rem)] astw:translate-x-[-50%] astw:translate-y-[-50%] astw:gap-4 astw:rounded-lg astw:border astw:border-border astw:p-6 astw:shadow-lg astw:duration-200 astw:sm:max-w-lg" aria-labelledby="base-ui-_r_a_" aria-describedby="base-ui-_r_b_"><div data-slot="dialog-header" class="astw:flex astw:flex-col astw:gap-2 astw:text-center astw:sm:text-left"><h2 id="base-ui-_r_a_" data-slot="dialog-title" class="astw:text-lg astw:leading-none astw:font-semibold">Confirm Action</h2><p id="base-ui-_r_b_" data-slot="dialog-description" class="astw:text-muted-foreground astw:text-sm">Are you sure?</p></div><div data-slot="dialog-footer" class="astw:flex astw:flex-col-reverse astw:gap-2 astw:sm:flex-row astw:sm:justify-end"><button>Cancel</button><button>Confirm</button></div><button type="button" tabindex="0" class="astw:ring-offset-bg astw:focus:ring-ring astw:data-open:bg-accent astw:data-open:text-muted-foreground astw:absolute astw:top-4 astw:right-4 astw:rounded-xs astw:opacity-70 astw:transition-opacity astw:hover:opacity-100 astw:focus:ring-2 astw:focus:ring-offset-2 astw:focus:outline-hidden astw:disabled:pointer-events-none astw:[&amp;_svg]:pointer-events-none astw:[&amp;_svg]:shrink-0 astw:[&amp;_svg:not([class*='size-'])]:size-4"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-x" aria-hidden="true"><path d="M18 6 6 18"></path><path d="m6 6 12 12"></path></svg><span class="astw:sr-only">Close</span></button></div><span data-type="inside" style="clip-path: inset(50%); overflow: hidden; white-space: nowrap; border: 0px; padding: 0px; width: 1px; height: 1px; margin: -1px; position: fixed; top: 0px; left: 0px;" aria-hidden="true" tabindex="0" data-base-ui-focus-guard="" data-base-ui-inert=""></span></div>"`;
4 changes: 2 additions & 2 deletions packages/core/src/components/dialog/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function Overlay({ className, ...props }: React.ComponentProps<typeof BaseDialog
<BaseDialog.Backdrop
data-slot="dialog-overlay"
className={cn(
"astw:data-open:animate-in astw:data-ending-style:animate-out astw:data-ending-style:fade-out-0 astw:data-open:fade-in-0 astw:fill-mode-forwards astw:fixed astw:inset-0 astw:z-(--z-overlay) astw:bg-black/50",
"astw:data-open:animate-in astw:data-ending-style:animate-out astw:data-ending-style:fade-out-0 astw:data-open:fade-in-0 astw:fill-mode-forwards astw:fixed astw:inset-0 astw:z-(--z-overlay) astw:bg-black/50 astw:duration-200 astw:data-ending-style:duration-150 astw:motion-reduce:animate-none",
className,
)}
{...props}
Expand All @@ -80,7 +80,7 @@ function Content({ className, children, ...props }: React.ComponentProps<typeof
<BaseDialog.Popup
data-slot="dialog-content"
className={cn(
"astw:bg-card astw:data-open:animate-in astw:data-ending-style:animate-out astw:data-ending-style:fade-out-0 astw:data-open:fade-in-0 astw:data-ending-style:zoom-out-95 astw:data-open:zoom-in-95 astw:fill-mode-forwards astw:fixed astw:top-[50%] astw:left-[50%] astw:z-(--z-overlay) astw:grid astw:w-full astw:max-w-[calc(100%-2rem)] astw:translate-x-[-50%] astw:translate-y-[-50%] astw:gap-4 astw:rounded-lg astw:border astw:border-border astw:p-6 astw:shadow-lg astw:duration-200 astw:sm:max-w-lg",
"astw:bg-card astw:data-open:animate-in astw:data-ending-style:animate-out astw:data-ending-style:fade-out-0 astw:data-open:fade-in-0 astw:data-ending-style:zoom-out-95 astw:data-open:zoom-in-95 astw:data-open:slide-in-from-bottom-2 astw:data-ending-style:slide-out-to-bottom-2 astw:ease-out astw:data-ending-style:ease-in astw:data-ending-style:duration-150 astw:motion-reduce:animate-none astw:fill-mode-forwards astw:fixed astw:top-[50%] astw:left-[50%] astw:z-(--z-overlay) astw:grid astw:w-full astw:max-w-[calc(100%-2rem)] astw:translate-x-[-50%] astw:translate-y-[-50%] astw:gap-4 astw:rounded-lg astw:border astw:border-border astw:p-6 astw:shadow-lg astw:duration-200 astw:sm:max-w-lg",
className,
)}
{...props}
Expand Down
Loading