@talogic/react 0.14.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,18 +4,26 @@ import { type PresenceAnimation } from './presence.recipe';
4
4
  export interface PresenceProps extends ComponentProps<'div'> {
5
5
  /** Shows the content when true. When it turns false, the exit animation plays before the content goes. */
6
6
  present: boolean;
7
- /** The motion: `fade` (default), `scale` or `drop`. */
7
+ /** The motion: `fade` (default), `scale`, `drop` or `expand`. */
8
8
  animation?: PresenceAnimation;
9
9
  /** Removes the content from the DOM after the exit animation. Default true. When false, it is hidden instead. */
10
10
  unmountOnExit?: boolean;
11
+ /**
12
+ * Plays the enter animation when the box is present on its first render. Default true. Set false for content that
13
+ * was there before the user acted, such as the rows of a list when the page loads: only a later enter animates.
14
+ */
15
+ initial?: boolean;
16
+ /** Called when the box has left: after its exit animation, or at once when it has none. */
17
+ onExitComplete?: () => void;
11
18
  }
12
19
  /**
13
20
  * Shows and hides a box with an enter and an exit animation, like Chakra's Presence. When `present` turns true the
14
21
  * box mounts and plays its enter animation. When `present` turns false it plays the exit animation, and only then
15
22
  * leaves the DOM (or hides, with `unmountOnExit={false}`). Use it for content that appears in place, such as a
16
- * notice, a details panel or a filter row. Overlays (dialogs, popovers, menus) already animate themselves.
23
+ * notice, a details panel or a filter row. For the items of a list, use {@link PresenceGroup}. Overlays (dialogs,
24
+ * popovers, menus) already animate themselves.
17
25
  *
18
- * @param props - `present`, `animation`, `unmountOnExit` and any `div` props.
26
+ * @param props - `present`, `animation`, `unmountOnExit`, `initial`, `onExitComplete` and any `div` props.
19
27
  * @returns The animated box, or nothing once it has left.
20
28
  */
21
- export declare function Presence({ present, animation, unmountOnExit, className, onAnimationEnd, ...props }: PresenceProps): import("react").JSX.Element | null;
29
+ export declare function Presence({ present, animation, unmountOnExit, initial, onExitComplete, className, style, onAnimationEnd, ...props }: PresenceProps): import("react").JSX.Element | null;
@@ -1,8 +1,9 @@
1
1
  /** The motion of a {@link Presence}. */
2
- export type PresenceAnimation = 'fade' | 'scale' | 'drop';
2
+ export type PresenceAnimation = 'fade' | 'scale' | 'drop' | 'expand';
3
3
  /**
4
4
  * The enter and exit classes of each {@link PresenceAnimation}: `fade` fades, `scale` grows from 96 % while it
5
- * fades (like popovers), `drop` falls 6 px into place while it fades (like the navigation menu). Reduced motion
6
- * keeps only the fade.
5
+ * fades (like popovers), `drop` falls 6 px into place while it fades (like the navigation menu), `expand` grows to
6
+ * its own height while it fades, so the content under it slides (like a field added to a form). Reduced motion keeps
7
+ * only the fade.
7
8
  */
8
9
  export declare const presenceClassName: Record<PresenceAnimation, string>;