Skip to content

Commit

Permalink
reduce example duration
Browse files Browse the repository at this point in the history
  • Loading branch information
kyledurand committed May 21, 2024
1 parent a0e0235 commit 9764968
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export const WithDelay = {
open={open}
id="inline-collapsible"
variant="inline"
transition={{delay: '5000'}}
transition={{delay: '500'}}
>
<p style={{whiteSpace: 'nowrap'}}>Non breaking text</p>
</Collapsible>
Expand Down
3 changes: 2 additions & 1 deletion polaris-react/src/components/Collapsible/Collapsible.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, {useState, useRef, useEffect, useCallback} from 'react';
import type {ReactNode, TransitionEvent} from 'react';
import {createVar} from '@shopify/polaris-tokens';
import type {MotionDurationScale} from '@shopify/polaris-tokens';

import {classNames} from '../../utilities/css';
Expand Down Expand Up @@ -72,7 +73,7 @@ export function Collapsible({
const transitionDisabled = isTransitionDisabled(transition);

const transitionStyles = typeof transition === 'object' && {
transitionDelay: `var(--p-motion-duration-${transition.delay})`,
transitionDelay: createVar(`motion-duration-${transition.delay ?? '0'}`),
transitionDuration: transition.duration,
transitionTimingFunction: transition.timingFunction,
};
Expand Down

0 comments on commit 9764968

Please sign in to comment.