@clicktap/ui 0.14.16 → 0.14.18

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.
@@ -3,7 +3,7 @@ import { Dispatch, Key, SetStateAction, ReactNode } from 'react';
3
3
  import { MotionStyle } from 'framer-motion';
4
4
  import { SlotsToClasses } from '../../types/SlotsToClasses';
5
5
  type ContextMenuAnimationState = 'unmounted' | 'hidden' | 'visible';
6
- export interface PopoverProps extends Omit<AriaPopoverProps, 'children' | 'style'> {
6
+ export interface PopoverProps extends Omit<AriaPopoverProps, 'children' | 'style' | 'onAnimationStart'> {
7
7
  animation: ContextMenuAnimationState;
8
8
  children: ReactNode;
9
9
  onAction?: (key: Key) => void;
@@ -6,7 +6,7 @@ import type { SlotsToClasses } from '../../types/SlotsToClasses';
6
6
  type ContextMenuAnimationState = 'unmounted' | 'hidden' | 'visible';
7
7
 
8
8
  export interface PopoverProps
9
- extends Omit<AriaPopoverProps, 'children' | 'style'> {
9
+ extends Omit<AriaPopoverProps, 'children' | 'style' | 'onAnimationStart'> {
10
10
  animation: ContextMenuAnimationState;
11
11
  children: ReactNode;
12
12
  onAction?: (key: Key) => void;
@@ -1,7 +1,7 @@
1
1
  import { Key } from 'react';
2
2
  import { DialogProps as UIDialogProps } from 'react-aria-components';
3
3
  import { MotionStyle, Variants } from 'framer-motion';
4
- export type DialogProps = UIDialogProps & {
4
+ export type DialogProps = Omit<UIDialogProps, 'onAnimationStart'> & {
5
5
  key?: Key;
6
6
  style?: MotionStyle;
7
7
  animationVariants?: Variants;
@@ -2,7 +2,7 @@ import type { Key } from 'react';
2
2
  import type { DialogProps as UIDialogProps } from 'react-aria-components';
3
3
  import { MotionStyle, Variants } from 'framer-motion';
4
4
 
5
- export type DialogProps = UIDialogProps & {
5
+ export type DialogProps = Omit<UIDialogProps, 'onAnimationStart'> & {
6
6
  key?: Key;
7
7
  style?: MotionStyle;
8
8
  animationVariants?: Variants;
@@ -1,7 +1,7 @@
1
1
  import { Key } from 'react';
2
2
  import { DialogProps } from 'react-aria-components';
3
3
  import { MotionStyle, Variants } from 'framer-motion';
4
- export type DrawerProps = DialogProps & {
4
+ export type DrawerProps = Omit<DialogProps, 'onAnimationStart'> & {
5
5
  direction?: 'top' | 'right' | 'bottom' | 'left';
6
6
  key?: Key;
7
7
  style?: MotionStyle;
@@ -2,7 +2,7 @@ import type { Key } from 'react';
2
2
  import type { DialogProps } from 'react-aria-components';
3
3
  import type { MotionStyle, Variants } from 'framer-motion';
4
4
 
5
- export type DrawerProps = DialogProps & {
5
+ export type DrawerProps = Omit<DialogProps, 'onAnimationStart'> & {
6
6
  direction?: 'top' | 'right' | 'bottom' | 'left';
7
7
  key?: Key;
8
8
  style?: MotionStyle;
@@ -1 +1 @@
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
+ 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,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import { forwardRef, useId } from 'react';
4
- import type { CSSProperties, Dispatch, ReactNode, SetStateAction } from 'react';
4
+ import type { Dispatch, ReactNode, Ref, 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,16 +10,17 @@ 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
- const ForwardedModalOverlay = forwardRef<HTMLDivElement, ModalOverlayProps>(
14
- ({ style, ...props }, ref) => {
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
+
15
20
  return (
16
21
  // Pass only static styles to framer-motion
17
- <UIModalOverlay
18
- // eslint-disable-next-line react/jsx-props-no-spreading
19
- {...props}
20
- ref={ref}
21
- style={style as CSSProperties}
22
- />
22
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, react/jsx-props-no-spreading
23
+ <UIModalOverlay {...props} ref={ref} style={ariaStyle} />
23
24
  );
24
25
  }
25
26
  );
@@ -1,7 +1,7 @@
1
1
  import { Key, ReactNode } from 'react';
2
2
  import { ModalOverlayProps as UiModalOverlayProps, ModalRenderProps } from 'react-aria-components';
3
3
  import { MotionStyle, Variant } from 'framer-motion';
4
- export interface ModalOverlayProps extends Omit<UiModalOverlayProps, 'children' | 'style'> {
4
+ export interface ModalOverlayProps extends Omit<UiModalOverlayProps, 'children' | 'style' | 'onAnimationStart'> {
5
5
  key?: Key;
6
6
  style?: MotionStyle;
7
7
  animationVariants?: {
@@ -6,7 +6,7 @@ import type {
6
6
  import type { MotionStyle, Variant } from 'framer-motion';
7
7
 
8
8
  export interface ModalOverlayProps
9
- extends Omit<UiModalOverlayProps, 'children' | 'style'> {
9
+ extends Omit<UiModalOverlayProps, 'children' | 'style' | 'onAnimationStart'> {
10
10
  key?: Key;
11
11
  style?: MotionStyle;
12
12
  animationVariants?: { visible: Variant; hidden: Variant };
@@ -269,3 +269,4 @@ interface SelectComponent {
269
269
  export const Select = forwardRef(SelectInner) as SelectComponent;
270
270
 
271
271
  export default Select;
272
+
@@ -37,10 +37,10 @@ export const Example: Story = {
37
37
  autoFocus: {
38
38
  control: 'boolean',
39
39
  },
40
- type: {
41
- options: ['button', 'submit', 'reset'],
42
- control: { type: 'radio' },
43
- },
40
+ // type: {
41
+ // options: ['button', 'submit', 'reset'],
42
+ // control: { type: 'radio' },
43
+ // },
44
44
  excludeFromTabOrder: {
45
45
  control: 'boolean',
46
46
  },
@@ -73,7 +73,7 @@ export const Example: Story = {
73
73
  autoFocus: false,
74
74
  defaultSelected: false,
75
75
  excludeFromTabOrder: false,
76
- type: 'button',
76
+ // type: 'button',
77
77
  children: 'Press me',
78
78
  onPress: action('onPress'),
79
79
  onPressStart: action('onPressStart'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clicktap/ui",
3
- "version": "0.14.16",
3
+ "version": "0.14.18",
4
4
  "private": false,
5
5
  "author": "Clicktap",
6
6
  "description": "A library of React UI components and low-level hooks.",
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const TabsOrientationContext: import('react').Context<import('react-aria').Orientation | undefined>;
3
- export default TabsOrientationContext;