@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.
- package/components/ContextMenu/ContextMenu.types.d.ts +1 -1
- package/components/ContextMenu/ContextMenu.types.ts +1 -1
- package/components/Dialog/Dialog.types.d.ts +1 -1
- package/components/Dialog/Dialog.types.ts +1 -1
- package/components/Drawer/Drawer.types.d.ts +1 -1
- package/components/Drawer/Drawer.types.ts +1 -1
- package/components/ModalOverlay/ModalOverlay.js +1 -1
- package/components/ModalOverlay/ModalOverlay.tsx +10 -9
- package/components/ModalOverlay/ModalOverlay.types.d.ts +1 -1
- package/components/ModalOverlay/ModalOverlay.types.ts +1 -1
- package/components/Select/Select.tsx +1 -0
- package/components/ToggleButton/ToggleButton.stories.tsx +5 -5
- package/package.json +1 -1
- package/components/Tabs/Tabs.context.d.ts +0 -3
|
@@ -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
|
|
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 {
|
|
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
|
-
|
|
14
|
-
|
|
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
|
-
|
|
18
|
-
|
|
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 };
|
|
@@ -37,10 +37,10 @@ export const Example: Story = {
|
|
|
37
37
|
autoFocus: {
|
|
38
38
|
control: 'boolean',
|
|
39
39
|
},
|
|
40
|
-
type: {
|
|
41
|
-
|
|
42
|
-
|
|
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