Skip to content

Commit 1819eda

Browse files
add back animated prop
1 parent 49297cc commit 1819eda

File tree

9 files changed

+9
-17
lines changed

9 files changed

+9
-17
lines changed

.changeset/two-glasses-fix.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ The entire Qwik UI library now does not execute code until interaction.
1414

1515
- The default behavior is a single item open at a time.
1616

17-
- The `animated` prop has been deprecated in favor of `heightAnimation`.
18-
1917
- `onSelectIndexChange$` has been deprecated and removed in favor of `onChange$`.
2018

2119
- `onFocusIndexChange$` has been deprecated and removed. Let us know if you have a use case for this.

apps/website/src/routes/docs/headless/accordion/examples/animation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default component$(() => {
66
const items = [1, 2, 3];
77

88
return (
9-
<Accordion.Root heightAnimation>
9+
<Accordion.Root animated>
1010
{items.map((item) => (
1111
<Accordion.Item class="collapsible" key={item}>
1212
<Accordion.Header>

apps/website/src/routes/docs/headless/accordion/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ The component itself can also be disabled by setting the `disabled` prop to true
135135

136136
### Height Animation
137137

138-
To animate the height of the content, set the `heightAnimation` prop to `true`.
138+
To animate the height of the content, set the `animated` prop to `true`.
139139

140140
<Showcase name="animation" />
141141

apps/website/src/routes/docs/headless/collapsible/examples/animation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default component$(() => {
88

99
return (
1010
<div>
11-
<Collapsible.Root class="collapsible" bind:open={isOpen} heightAnimation>
11+
<Collapsible.Root class="collapsible" bind:open={isOpen} animated>
1212
<Collapsible.Trigger class="collapsible-trigger">
1313
<span>Trigger</span>
1414
<LuChevronDown class="collapsible-transition" />

apps/website/src/routes/docs/headless/collapsible/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ To animate the height of the content, we can use a keyframe animation on the hei
118118

119119
### Height Animation
120120

121-
To animate the height of the content, set the `heightAnimation` prop to `true`.
121+
To animate the height of the content, set the `animated` prop to `true`.
122122

123123
<Showcase name="animation" />
124124

packages/kit-headless/src/components/accordion/accordion-inline.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ export type AccordionRootProps = PropsOf<'div'> & {
3333
collapsible?: boolean;
3434

3535
/** If true, the accordion is animated. */
36-
heightAnimation?: boolean;
37-
38-
/**
39-
* @deprecated Use the heightAnimation prop instead.
40-
*/
4136
animated?: boolean;
4237
};
4338

packages/kit-headless/src/components/accordion/accordion-item.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export const HAccordionItem = component$(
105105
disabled={context.disabled || props.disabled}
106106
collapsible={context.collapsible}
107107
accordionItem
108-
heightAnimation={context.isAnimatedSig.value}
108+
animated={context.isAnimatedSig.value}
109109
{...props}
110110
>
111111
<Slot />

packages/kit-headless/src/components/accordion/accordion-root.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@ export const HAccordionRootImpl = component$((props: AccordionRootProps) => {
1919
disabled,
2020
collapsible = true,
2121
animated,
22-
heightAnimation,
2322
...rest
2423
} = props;
2524

2625
const selectedIndexSig = useSignal<number>(initialIndex ?? -1);
2726
const triggerRefsArray = useSignal<Array<Signal>>([]);
28-
const isAnimatedSig = useSignal<boolean>(animated === true || heightAnimation === true);
27+
const isAnimatedSig = useSignal<boolean>(animated === true);
2928
const isMultipleSig = useSignal<boolean>(multiple || props.behavior === 'multi');
3029

3130
const itemsMapSig = useComputed$(() => {

packages/kit-headless/src/components/collapsible/collapsible.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export type CollapsibleProps = PropsOf<'div'> & {
2626
triggerRef?: Signal<HTMLButtonElement>;
2727
collapsible?: boolean;
2828
accordionItem?: boolean;
29-
heightAnimation?: boolean;
29+
animated?: boolean;
3030
};
3131

3232
export const HCollapsible = component$((props: CollapsibleProps) => {
@@ -40,7 +40,7 @@ export const HCollapsible = component$((props: CollapsibleProps) => {
4040
collapsible = true,
4141
open,
4242
accordionItem,
43-
heightAnimation,
43+
animated,
4444
...rest
4545
} = props;
4646

@@ -50,7 +50,7 @@ export const HCollapsible = component$((props: CollapsibleProps) => {
5050
const defaultTriggerRef = useSignal<HTMLButtonElement>();
5151
const triggerRef = givenTriggerRef ?? defaultTriggerRef;
5252
const contentRef = useSignal<HTMLElement>();
53-
const isAnimatedSig = useSignal<boolean>(heightAnimation === true);
53+
const isAnimatedSig = useSignal<boolean>(animated === true);
5454

5555
const contentHeightSig = useSignal<number | null>(null);
5656

0 commit comments

Comments
 (0)