chore: switch to use of svelte native prefersReducedMotion media
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
-->
|
||||
<script lang="ts">
|
||||
import type { Filter } from '$shared/lib';
|
||||
import { motion } from '$shared/lib';
|
||||
import { Badge } from '$shared/shadcn/ui/badge';
|
||||
import { buttonVariants } from '$shared/shadcn/ui/button';
|
||||
import { Checkbox } from '$shared/shadcn/ui/checkbox';
|
||||
@@ -20,6 +19,7 @@ import {
|
||||
import { Label } from '$shared/shadcn/ui/label';
|
||||
import ChevronDownIcon from '@lucide/svelte/icons/chevron-down';
|
||||
import { cubicOut } from 'svelte/easing';
|
||||
import { prefersReducedMotion } from 'svelte/motion';
|
||||
import { slide } from 'svelte/transition';
|
||||
|
||||
interface PropertyFilterProps {
|
||||
@@ -37,7 +37,7 @@ let isOpen = $state(true);
|
||||
// Animation config respects user preferences - zero duration if reduced motion enabled
|
||||
// Local modifier prevents animation on initial render, only animates user interactions
|
||||
const slideConfig = $derived({
|
||||
duration: motion.reduced ? 0 : 250,
|
||||
duration: prefersReducedMotion.current ? 0 : 250,
|
||||
easing: cubicOut,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user