|
8 | 8 | import { prefersReducedMotion } from "svelte/motion"; |
9 | 9 | import { accordionItem } from "./theme"; |
10 | 10 |
|
11 | | - let { children, header, arrowup, arrowdown, open = $bindable(false), transitionType = slide, transitionParams, class: className, classes }: AccordionItemProps = $props(); |
| 11 | + let { children, header, arrowup, arrowdown, open = $bindable(false), transition = slide, transitionParams, class: className, classes }: AccordionItemProps = $props(); |
12 | 12 |
|
13 | 13 | // Get context - it will be undefined if used outside Accordion |
14 | 14 | const ctx = getAccordionContext(); |
|
22 | 22 | inactive: classes?.inactive || ctx?.classes?.inactive |
23 | 23 | }); |
24 | 24 |
|
25 | | - const ctxTransitionType = $derived(ctx?.transitionType ?? transitionType); |
26 | | - // Check if transitionType is explicitly set to undefined in props |
27 | | - const useTransition = $derived(transitionType === "none" ? false : ctxTransitionType === "none" ? false : true); |
| 25 | + const ctxTransitionType = $derived(ctx?.transition ?? transition); |
| 26 | + // Check if transition is explicitly set to undefined in props |
| 27 | + const useTransition = $derived(transition === "none" ? false : ctxTransitionType === "none" ? false : true); |
28 | 28 |
|
29 | 29 | // Get respectReducedMotion from context (defaults to true) |
30 | 30 | const ctxRespectReducedMotion = $derived(ctx?.respectReducedMotion ?? true); |
|
81 | 81 | </h2> |
82 | 82 |
|
83 | 83 | {#if useTransition} |
84 | | - {#if open && transitionType !== "none"} |
85 | | - <div data-part="content-wrapper" class={contentWrapperCls} transition:transitionType={effectiveTransitionParams as ParamsType}> |
| 84 | + {#if open && transition !== "none"} |
| 85 | + <div data-part="content-wrapper" class={contentWrapperCls} transition:transition={effectiveTransitionParams as ParamsType}> |
86 | 86 | <div data-part="content" class={content({ class: clsx(theme?.content, finalClasses.content) })}> |
87 | 87 | {@render children()} |
88 | 88 | </div> |
|
107 | 107 | @prop arrowup |
108 | 108 | @prop arrowdown |
109 | 109 | @prop open = $bindable(false) |
110 | | -@prop transitionType = slide |
| 110 | +@prop transition = slide |
111 | 111 | @prop transitionParams |
112 | 112 | @prop class: className |
113 | 113 | @prop classes |
|
0 commit comments