@clicktap/ui 0.14.16 → 0.14.17

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,3 +1,3 @@
1
1
  import { PopoverProps } from './ContextMenu.types';
2
- export declare function ContextMenu({ children, key, onAction, setAnimation, animation, className, classNames, ...props }: PopoverProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function ContextMenu({ children, key, onAction, setAnimation, animation, className, classNames, onAnimationStart, ...props }: PopoverProps): import("react/jsx-runtime").JSX.Element;
3
3
  export default ContextMenu;
@@ -1 +1 @@
1
- import{jsx as t}from"react/jsx-runtime";import{Popover as x,Menu as h}from"react-aria-components";import{forwardRef as c}from"react";import{motion as _}from"framer-motion";import{cn as m}from"../../utils/cn.js";const b=c(({style:o,...e},n)=>{const r=typeof o=="function"?o(e):o;return t(x,{...e,ref:n,style:r})}),l=_.create(b);function P({children:o,key:e,onAction:n,setAnimation:r,animation:d="hidden",className:a,classNames:i,...u}){return t(l,{className:m("px-0 py-1.5","shadow-[0_10px_15px_-3px_rgba(0,0,0,0.1),0_4px_6px_-4px_rgba(0,0,0,0.1)]","rounded-md","w-56","bg-white","border border-solid border-slate-300",a),isExiting:d==="hidden",onAnimationComplete:f=>{r(p=>f==="hidden"&&p==="hidden"?"unmounted":p)},variants:{hidden:{opacity:0,y:-10},visible:{opacity:1,y:0}},initial:"hidden",animate:d,...u,children:t(h,{className:m("outline-none",i==null?void 0:i.menu),onAction:n,children:o})},e)}export{P as ContextMenu,P as default};
1
+ import{jsx as t}from"react/jsx-runtime";import{Popover as x,Menu as h}from"react-aria-components";import{forwardRef as c}from"react";import{motion as _}from"framer-motion";import{cn as m}from"../../utils/cn.js";const b=c(({style:o,...n},r)=>{const e=typeof o=="function"?o(n):o;return t(x,{...n,ref:r,style:e})}),l=_.create(b);function A({children:o,key:n,onAction:r,setAnimation:e,animation:d="hidden",className:a,classNames:i,onAnimationStart:y,...u}){return t(l,{className:m("px-0 py-1.5","shadow-[0_10px_15px_-3px_rgba(0,0,0,0.1),0_4px_6px_-4px_rgba(0,0,0,0.1)]","rounded-md","w-56","bg-white","border border-solid border-slate-300",a),isExiting:d==="hidden",onAnimationComplete:f=>{e(p=>f==="hidden"&&p==="hidden"?"unmounted":p)},variants:{hidden:{opacity:0,y:-10},visible:{opacity:1,y:0}},initial:"hidden",animate:d,...u,children:t(h,{className:m("outline-none",i==null?void 0:i.menu),onAction:r,children:o})},n)}export{A as ContextMenu,A as default};
@@ -32,6 +32,7 @@ export function ContextMenu({
32
32
  animation = 'hidden',
33
33
  className,
34
34
  classNames,
35
+ onAnimationStart,
35
36
  ...props
36
37
  }: PopoverProps) {
37
38
  return (
@@ -1,3 +1,3 @@
1
1
  import { DialogProps } from './Dialog.types';
2
- export declare function Dialog({ className, children, animationVariants, ...props }: DialogProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function Dialog({ className, children, animationVariants, onAnimationStart, ...props }: DialogProps): import("react/jsx-runtime").JSX.Element;
3
3
  export default Dialog;
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{forwardRef as i}from"react";import{Dialog as s}from"react-aria-components";import{motion as l}from"framer-motion";import{cn as m}from"../../utils/cn.js";const f=i(({style:a,animationVariants:o,...r},t)=>{const n=typeof a=="function"?a(r):a;return e(s,{...r,ref:t,style:n})}),c=l.create(f);function x({className:a,children:o,animationVariants:r,...t}){return e(c,{className:m("p-8 outline-0 max-w-max w-screen absolute top-2/4 left-2/4","shadow-[0_8px_24px_rgba(0,0,0,0.1)] rounded-lg bg-white border border-solid border-slate-400","transform -translate-x-1/2 -translate-y-1/2",a),...t,variants:r||{hidden:{transform:"translate(-50%, -50%) scale(0.8)",transition:{ease:"backIn"}},visible:{transform:"translate(-50%, -50%) scale(1)",transition:{ease:"backOut"}}},children:o})}export{x as Dialog,x as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{forwardRef as i}from"react";import{Dialog as s}from"react-aria-components";import{motion as l}from"framer-motion";import{cn as m}from"../../utils/cn.js";const f=i(({style:a,animationVariants:r,...t},n)=>{const o=typeof a=="function"?a(t):a;return e(s,{...t,ref:n,style:o})}),c=l.create(f);function x({className:a,children:r,animationVariants:t,onAnimationStart:n,...o}){return e(c,{className:m("p-8 outline-0 max-w-max w-screen absolute top-2/4 left-2/4","shadow-[0_8px_24px_rgba(0,0,0,0.1)] rounded-lg bg-white border border-solid border-slate-400","transform -translate-x-1/2 -translate-y-1/2",a),...o,variants:t||{hidden:{transform:"translate(-50%, -50%) scale(0.8)",transition:{ease:"backIn"}},visible:{transform:"translate(-50%, -50%) scale(1)",transition:{ease:"backOut"}}},children:r})}export{x as Dialog,x as default};
@@ -28,6 +28,7 @@ export function Dialog({
28
28
  className,
29
29
  children,
30
30
  animationVariants,
31
+ onAnimationStart,
31
32
  ...props
32
33
  }: DialogProps) {
33
34
  return (
@@ -1,3 +1,3 @@
1
1
  import { DrawerProps } from './Drawer.types';
2
- export declare function Drawer({ direction, children, className, animationVariants, ...props }: DrawerProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function Drawer({ direction, children, className, animationVariants, onAnimationStart, ...props }: DrawerProps): import("react/jsx-runtime").JSX.Element;
3
3
  export default Drawer;
@@ -1 +1 @@
1
- import{jsx as i}from"react/jsx-runtime";import{forwardRef as s}from"react";import{Dialog as n}from"react-aria-components";import{motion as d}from"framer-motion";import{cn as b}from"../../utils/cn.js";const m={top:{hidden:{y:"-100%",transition:{ease:"easeIn"}},visible:{y:0,transition:{ease:"easeOut"}}},bottom:{hidden:{y:"100%",transition:{ease:"easeIn"}},visible:{y:0,transition:{ease:"easeOut"}}},right:{hidden:{x:"100%",transition:{ease:"easeIn"}},visible:{x:0,transition:{ease:"easeOut"}}},left:{hidden:{x:"-100%",transition:{ease:"easeIn"}},visible:{x:0,transition:{ease:"easeOut"}}}},h=s(({style:t,size:r="20rem",...e},a)=>{const o=typeof t=="function"?t(e):{...t,"--drawer-size":`${r}`};return i(n,{...e,ref:a,style:o})}),l=d.create(h);function g({direction:t="right",children:r,className:e,animationVariants:a,...o}){return i(l,{className:b("fixed p-8 outline-0 bg-white","border-solid border-slate-200","max-w-full max-h-[var(--visual-viewport-height)]",t==="top"&&"top-0 left-0 right-0 bottom-auto border-b shadow-[0_8px_24px_rgba(0,0,0,0.1)] h-[var(--drawer-size)]",t==="right"&&"top-0 left-auto bottom-0 right-0 border-l shadow-[-8px_0_24px_rgba(0,0,0,0.1)] w-[var(--drawer-size)]",t==="bottom"&&"bottom-0 left-0 right-0 top-auto border-t shadow-[0_-8px_24px_rgba(0,0,0,0.1)] h-[var(--drawer-size)]",t==="left"&&"top-0 bottom-0 left-0 right-auto border-r shadow-[8px_0_24px_rgba(0,0,0,0.1)] w-[var(--drawer-size)]",e),"data-direction":t,variants:a||m[t],...o,children:r})}export{g as Drawer,g as default};
1
+ import{jsx as i}from"react/jsx-runtime";import{forwardRef as n}from"react";import{Dialog as d}from"react-aria-components";import{motion as m}from"framer-motion";import{cn as b}from"../../utils/cn.js";const h={top:{hidden:{y:"-100%",transition:{ease:"easeIn"}},visible:{y:0,transition:{ease:"easeOut"}}},bottom:{hidden:{y:"100%",transition:{ease:"easeIn"}},visible:{y:0,transition:{ease:"easeOut"}}},right:{hidden:{x:"100%",transition:{ease:"easeIn"}},visible:{x:0,transition:{ease:"easeOut"}}},left:{hidden:{x:"-100%",transition:{ease:"easeIn"}},visible:{x:0,transition:{ease:"easeOut"}}}},l=n(({style:t,size:r="20rem",...e},a)=>{const o=typeof t=="function"?t(e):{...t,"--drawer-size":`${r}`};return i(d,{...e,ref:a,style:o})}),p=m.create(l);function v({direction:t="right",children:r,className:e,animationVariants:a,onAnimationStart:o,...s}){return i(p,{className:b("fixed p-8 outline-0 bg-white","border-solid border-slate-200","max-w-full max-h-[var(--visual-viewport-height)]",t==="top"&&"top-0 left-0 right-0 bottom-auto border-b shadow-[0_8px_24px_rgba(0,0,0,0.1)] h-[var(--drawer-size)]",t==="right"&&"top-0 left-auto bottom-0 right-0 border-l shadow-[-8px_0_24px_rgba(0,0,0,0.1)] w-[var(--drawer-size)]",t==="bottom"&&"bottom-0 left-0 right-0 top-auto border-t shadow-[0_-8px_24px_rgba(0,0,0,0.1)] h-[var(--drawer-size)]",t==="left"&&"top-0 bottom-0 left-0 right-auto border-r shadow-[8px_0_24px_rgba(0,0,0,0.1)] w-[var(--drawer-size)]",e),"data-direction":t,variants:a||h[t],...s,children:r})}export{v as Drawer,v as default};
@@ -95,6 +95,7 @@ export function Drawer({
95
95
  children,
96
96
  className,
97
97
  animationVariants,
98
+ onAnimationStart,
98
99
  ...props
99
100
  }: DrawerProps) {
100
101
  return (
@@ -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 n}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,...t},e)=>n(h,{...t,ref:e,style:i})),g=y.create(O);function a({animate:i,animation:t,setAnimation:e,className:o,animationVariants:d,onAnimationStart:k,children:l,...m}){const s=v(),{key:c,...f}=m;return n(g,{isExiting:t==="hidden",onAnimationComplete:p=>{e(r=>p==="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)]",o),...f,children:l},c||s)}function z(i){const{isOpen:t}=i,{animation:e,setAnimation:o}=x();return t!==void 0?n(b,{children:t&&n(a,{...i,animate:"visible",animation:e,setAnimation:o})}):n(a,{...i,animate:e,animation:e,setAnimation:o})}export{z as ModalOverlay,z as default};
@@ -32,6 +32,7 @@ function InnerModalOverlay({
32
32
  setAnimation,
33
33
  className,
34
34
  animationVariants,
35
+ onAnimationStart,
35
36
  children,
36
37
  ...props
37
38
  }: ModalOverlayProps & {
@@ -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.17",
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;