@clicktap/ui 0.14.15 → 0.14.16

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.
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{forwardRef as p,useId as v}from"react";import{ModalOverlay as y}from"react-aria-components";import{motion as h,AnimatePresence as b}from"framer-motion";import{useDialogTrigger as x}from"../DialogTrigger/DialogTrigger.js";import{cn as M}from"../../utils/cn.js";const O=p(({style:i,...e},t)=>{const n=typeof i=="function"?i(e):i;return o(y,{...e,ref:t,style:n})}),g=h.create(O);function a({animate:i,animation:e,setAnimation:t,className:n,animationVariants:d,children:l,...m}){const s=v(),{key:c,...f}=m;return o(g,{isExiting:e==="hidden",onAnimationComplete:u=>{t(r=>u==="hidden"&&r==="hidden"?"unmounted":r)},variants:d||{hidden:{opacity:0,backdropFilter:"blur(0px)",transition:{delay:.08}},visible:{opacity:1,backdropFilter:"blur(8px)"}},initial:"hidden",animate:i,exit:"hidden",className:M("bg-black/30","fixed top-0 left-0","z-50","w-screen h-[var(--visual-viewport-height)]",n),...f,children:l},c||s)}function j(i){const{isOpen:e}=i,{animation:t,setAnimation:n}=x();return e!==void 0?o(b,{children:e&&o(a,{...i,animate:"visible",animation:t,setAnimation:n})}):o(a,{...i,animate:t,animation:t,setAnimation:n})}export{j as ModalOverlay,j as default};
1
+ import{jsx as o}from"react/jsx-runtime";import{forwardRef as u,useId as v}from"react";import{ModalOverlay as h}from"react-aria-components";import{motion as y,AnimatePresence as b}from"framer-motion";import{useDialogTrigger as x}from"../DialogTrigger/DialogTrigger.js";import{cn as M}from"../../utils/cn.js";const O=u(({style:i,...r},e)=>o(h,{...r,ref:e,style:i})),g=y.create(O);function a({animate:i,animation:r,setAnimation:e,className:t,animationVariants:d,children:l,...s}){const m=v(),{key:c,...f}=s;return o(g,{isExiting:r==="hidden",onAnimationComplete:p=>{e(n=>p==="hidden"&&n==="hidden"?"unmounted":n)},variants:d||{hidden:{opacity:0,backdropFilter:"blur(0px)",transition:{delay:.08}},visible:{opacity:1,backdropFilter:"blur(8px)"}},initial:"hidden",animate:i,exit:"hidden",className:M("bg-black/30","fixed top-0 left-0","z-50","w-screen h-[var(--visual-viewport-height)]",t),...f,children:l},c||m)}function j(i){const{isOpen:r}=i,{animation:e,setAnimation:t}=x();return r!==void 0?o(b,{children:r&&o(a,{...i,animate:"visible",animation:e,setAnimation:t})}):o(a,{...i,animate:e,animation:e,setAnimation:t})}export{j as ModalOverlay,j as default};
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import { forwardRef, useId } from 'react';
4
- import type { Dispatch, ReactNode, Ref, SetStateAction } from 'react';
4
+ import type { CSSProperties, Dispatch, ReactNode, SetStateAction } from 'react';
5
5
  import { ModalOverlay as UIModalOverlay } from 'react-aria-components';
6
6
  import { AnimatePresence, motion } from 'framer-motion';
7
7
  import { useDialogTrigger } from '../DialogTrigger/DialogTrigger';
@@ -10,17 +10,16 @@ import type { DriverAnimationState } from '../DialogTrigger/DialogTrigger.types'
10
10
  import { cn } from '../../utils/cn';
11
11
  import type { ModalOverlayProps } from './ModalOverlay.types';
12
12
 
13
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
- const ForwardedModalOverlay = forwardRef<HTMLElement, any>(
15
- ({ style, ...props }, ref: Ref<HTMLElement>) => {
16
- // Separate the dynamic style logic
17
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
18
- const ariaStyle = typeof style === 'function' ? style(props) : style;
19
-
13
+ const ForwardedModalOverlay = forwardRef<HTMLDivElement, ModalOverlayProps>(
14
+ ({ style, ...props }, ref) => {
20
15
  return (
21
16
  // Pass only static styles to framer-motion
22
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, react/jsx-props-no-spreading
23
- <UIModalOverlay {...props} ref={ref} style={ariaStyle} />
17
+ <UIModalOverlay
18
+ // eslint-disable-next-line react/jsx-props-no-spreading
19
+ {...props}
20
+ ref={ref}
21
+ style={style as CSSProperties}
22
+ />
24
23
  );
25
24
  }
26
25
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clicktap/ui",
3
- "version": "0.14.15",
3
+ "version": "0.14.16",
4
4
  "private": false,
5
5
  "author": "Clicktap",
6
6
  "description": "A library of React UI components and low-level hooks.",