Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathonRP committed Dec 18, 2024
1 parent 0aab524 commit bcb84a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 28 deletions.
23 changes: 2 additions & 21 deletions src/lib/components/motion/AnimatePresenceStack.svelte
Original file line number Diff line number Diff line change
@@ -1,29 +1,11 @@
<script>
import Box from "../Box.svelte";
import { Label } from "$lib/components/ui/label";
import { Switch } from "$lib/components/ui/switch";
import { AnimatePresence, AnimatePresenceLegacy } from "$lib/motion-start";
import { AnimatePresence } from "$lib/motion-start";
import Card from "$lib/components/Card.svelte";
let index = 0;
let use_legacy= false
$: mint = index + 1;
</script>
<div class="flex items-center space-x-2">
<Switch id="airplane-mode" bind:checked={use_legacy}/>
<Label for="airplane-mode">Use Legacy</Label>
</div>
{#if use_legacy}
<Box>
<div
class="w-64 h-64 relative bg-gray-700/40 rounded-lg flex justify-center items-center"
>
<AnimatePresenceLegacy initial={false} list={[{ key: index }]}>
<Card bind:index={mint} frontCard={false} />
<Card bind:index drag="x" frontCard={true} />
</AnimatePresenceLegacy>
</div>
</Box>
{:else}

<Box>
<div
class="w-64 h-64 relative bg-gray-700/40 rounded-lg flex justify-center items-center"
Expand All @@ -34,4 +16,3 @@
</AnimatePresence>
</div>
</Box>
{/if}
14 changes: 7 additions & 7 deletions src/lib/motion-start/components/AnimatePresence/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
based on [email protected],
Copyright (c) 2018 Framer B.V.
*/
export type { AnimatePresenceProps } from "./types.js";
export type { AnimatePresenceProps } from './types.js';
/**
* `AnimatePresence` enables the animation of components that have been removed from the tree.
*
* You can provide an array T[] to the `list` prop, where each item has to have a unique `key` attribute. Via slot prop `item`
*
* You can provide an array T[] to the `list` prop, where each item has to have a unique `key` attribute. Via slot prop `item`
* single items of the array are passed down to children, so that for each array item one component is rendered.
*
*
* Alternatively you can leave `list` undefined and supply a boolean to the `show` prop. If `true`, the child is rendered.
*
* @motion
Expand Down Expand Up @@ -41,6 +41,6 @@ export type { AnimatePresenceProps } from "./types.js";
*
* @public
*/
export type ConditionalGeneric<T> = T extends {key:any} ? T : { key: 1}; // Better handling of defaults and the optional list prop
export { default as AnimatePresence } from './AnimatePresenceTBA.svelte';
export { PresenceChild } from './PresenceChild/index.js';
export type ConditionalGeneric<T> = T extends { key: any } ? T : { key: 1 }; // Better handling of defaults and the optional list prop
export { default as AnimatePresence } from './AnimatePresence.svelte';
export { PresenceChild } from './PresenceChild/index.js';

0 comments on commit bcb84a0

Please sign in to comment.