@clicktap/ui 0.31.10 → 0.31.11

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 a,jsxs as c,Fragment as d}from"react/jsx-runtime";import{Checkbox as g}from"react-aria-components";import{cn as u}from"../../utils/cn.js";function p({control:t,isHovered:b,isFocused:n,isDisabled:e,isIndeterminate:o,isInvalid:r,isSelected:l,isPressed:f,classNames:x,...h}){return t?typeof t=="function"?t({isHovered:b,isFocused:n,isDisabled:e,isIndeterminate:o,isInvalid:r,isSelected:l,isPressed:f,...h}):t:a("div",{className:u("flex items-center justify-center","w-6 h-6","border border-solid border-slate-300 rounded","transition-all duration-200 ease-in-out","checkbox-control",b&&["border-slate-400"],n&&["border-slate-400 outline-2 outline outline-slate-200"],(e||e&&o)&&["border-slate-200 bg-slate-100"],r&&["bg-slate-100 text-red-600 border-red-500"],r&&b&&["border-red-600"],r&&n&&["border-red-600 outline-red-200"],r&&l&&o&&["bg-red-500 border-red-500"],r&&l&&o&&f&&["bg-red-600 border-red-600"],(l||o)&&["border-slate-300 bg-slate-300"],(l||o)&&f&&["border-slate-400 bg-slate-400"],x?.control),children:a("svg",{viewBox:"0 0 18 18","aria-hidden":"true",style:{strokeDasharray:"22px",strokeDashoffset:l||o?44:66},className:u("w-4 h-4 fill-none","stroke-white stroke-[3px]","transition-all duration-200 ease-in-out",e&&o&&["stroke-none fill-slate-300"],o&&["stroke-none fill-white"]),children:o?a("rect",{x:1,y:7.5,width:15,height:3}):a("polyline",{points:"1 9 7 14 15 4"})})})}function w({children:t,slots:b,className:n,classNames:e,...o}){return a(g,{className:u("flex items-center gap-2","text-xs text-slate-500 forced-color-adjust-none disabled:text-slate-400 group","invalid:text-red-500",n),...o,children:r=>c(d,{children:[a(p,{control:b?.control,classNames:e,...r}),typeof t=="function"?t(r):t]})})}export{w as Checkbox,w as default};
1
+ import{jsx as a,jsxs as h,Fragment as d}from"react/jsx-runtime";import{Checkbox as s}from"react-aria-components";import{cn as f}from"../../utils/cn.js";function p({control:t,isHovered:n,isFocused:b,isDisabled:e,isIndeterminate:o,isInvalid:r,isSelected:l,isPressed:u,classNames:x,...c}){return t?typeof t=="function"?t({isHovered:n,isFocused:b,isDisabled:e,isIndeterminate:o,isInvalid:r,isSelected:l,isPressed:u,...c}):t:a("div",{className:f("flex items-center justify-center","w-6 h-6","border border-solid border-slate-300 rounded","transition-all duration-200 ease-in-out","checkbox-control",n&&["border-slate-400"],b&&["border-slate-400 outline-2 outline outline-slate-200"],(e||e&&o)&&["border-slate-200 bg-slate-100"],r&&["bg-slate-100 text-red-600 border-red-500"],r&&n&&["border-red-600"],r&&b&&["border-red-600 outline-red-200"],r&&l&&o&&["bg-red-500 border-red-500"],r&&l&&o&&u&&["bg-red-600 border-red-600"],(l||o)&&["border-slate-300 bg-slate-300"],(l||o)&&u&&["border-slate-400 bg-slate-400"],x?.control),children:a("svg",{viewBox:"0 0 18 18","aria-hidden":"true",style:{strokeDasharray:"22px",strokeDashoffset:l||o?44:66},className:f("w-4 h-4 fill-none","stroke-white stroke-[3px]","transition-all duration-200 ease-in-out",e&&o&&["stroke-none fill-slate-300"],o&&["stroke-none fill-white"]),children:o?a("rect",{x:1,y:7.5,width:15,height:3}):a("polyline",{points:"1 9 7 14 15 4"})})})}function y({children:t,slots:n,className:b,classNames:e,...o}){return a(s,{className:f("flex items-center gap-2 cursor-pointer","text-xs text-slate-500 forced-color-adjust-none disabled:text-slate-400 disabled:cursor-not-allowed group","invalid:text-red-500",b),...o,children:r=>h(d,{children:[a(p,{control:n?.control,classNames:e,...r}),typeof t=="function"?t(r):t]})})}export{y as Checkbox,y as default};
@@ -1 +1 @@
1
- "use client";import{jsx as i}from"react/jsx-runtime";import{forwardRef as x,useId as C,useEffect as I,useCallback as b}from"react";import{ModalOverlay as g}from"react-aria-components";import{motion as N,AnimatePresence as k}from"framer-motion";import{useDialogTrigger as R}from"../DialogTrigger/DialogTrigger.js";import{cn as S}from"../../utils/cn.js";const T="body > [inert]:not(#__next):not([data-overlay-container])";function F(t){return Object.keys(t).some(n=>n.startsWith("__react"))}function p(){document.querySelectorAll(T).forEach(t=>t.removeAttribute("inert"))}function j(t){return!!(t.closest("[data-overlay-container]")||t.closest("#__next"))}const q=x(({style:t,children:n,...o},r)=>{const s=typeof t=="function"?t(o):t;return i(g,{...o,ref:r,style:s,children:n})});let m=null;function z(){return typeof window>"u"?null:(m||(m=N.create(q)),m)}const O=z();function h({animate:t,animation:n,setAnimation:o,className:r,animationVariants:s,isDismissable:l=!0,children:v,...M}){const E=C();I(()=>{p();const e=new MutationObserver(u=>{for(const d of u)if(d.type==="attributes"&&d.attributeName==="inert"){const f=d.target;f.parentElement===document.body?p():F(f)||f.removeAttribute("inert")}});return e.observe(document.body,{attributes:!0,attributeFilter:["inert"],subtree:!0}),()=>e.disconnect()},[]);const{key:w,shouldCloseOnInteractOutside:c,onOpenChange:a,..._}=M,A=b(e=>c?c(e):j(e),[c]),P=b(e=>{l&&e.target===e.currentTarget&&a&&a(!1)},[l,a]),y={isDismissable:l,shouldCloseOnInteractOutside:A,onOpenChange:a,onPointerDown:P,className:S("bg-black/30 backdrop-blur-sm","fixed top-0 left-0","z-[1000]","w-screen h-[var(--visual-viewport-height)]",r),..._};return O?i(O,{isExiting:n==="hidden",onAnimationComplete:e=>{o(u=>e==="hidden"&&u==="hidden"?"unmounted":u)},variants:s||{hidden:{opacity:0,transition:{delay:.08}},visible:{opacity:1}},initial:"hidden",animate:t,exit:"hidden",...y,children:v},w||E):i(g,{...y,children:v})}function H(t){const{isOpen:n}=t,{animation:o,setAnimation:r}=R();return n!==void 0?i(k,{children:n&&i(h,{...t,animate:"visible",animation:o,setAnimation:r})}):i(h,{...t,animate:o,animation:o,setAnimation:r})}export{H as ModalOverlay,H as default};
1
+ "use client";import{jsx as i}from"react/jsx-runtime";import{forwardRef as P,useId as I,useEffect as N,useCallback as p,useContext as S}from"react";import{ModalOverlay as M,OverlayTriggerStateContext as k}from"react-aria-components";import{motion as T,AnimatePresence as R}from"framer-motion";import{useDialogTrigger as F}from"../DialogTrigger/DialogTrigger.js";import{cn as j}from"../../utils/cn.js";const q="body > [inert]:not(#__next):not([data-overlay-container])";function z(e){return Object.keys(e).some(n=>n.startsWith("__react"))}function O(){document.querySelectorAll(q).forEach(e=>e.removeAttribute("inert"))}function D(e){return!!(e.closest("[data-overlay-container]")||e.closest("#__next"))}const L=P(({style:e,children:n,...o},r)=>{const l=typeof e=="function"?e(o):e;return i(M,{...o,ref:r,style:l,children:n})});let m=null;function W(){return typeof window>"u"?null:(m||(m=T.create(L)),m)}const h=W();function g({animate:e,animation:n,setAnimation:o,className:r,animationVariants:l,isDismissable:u=!0,children:v,...E}){const w=I();N(()=>{O();const t=new MutationObserver(s=>{for(const d of s)if(d.type==="attributes"&&d.attributeName==="inert"){const f=d.target;f.parentElement===document.body?O():z(f)||f.removeAttribute("inert")}});return t.observe(document.body,{attributes:!0,attributeFilter:["inert"],subtree:!0}),()=>t.disconnect()},[]);const{key:x,shouldCloseOnInteractOutside:c,onOpenChange:a,...C}=E,_=p(t=>c?c(t):D(t),[c]),y=S(k),A=p(t=>{!u||t.target!==t.currentTarget||(a?a(!1):y?.close())},[u,a,y]),b={isDismissable:u,shouldCloseOnInteractOutside:_,onOpenChange:a,onPointerDown:A,className:j("bg-black/30 backdrop-blur-sm","fixed top-0 left-0","z-[1000]","w-screen h-[var(--visual-viewport-height)]",r),...C};return h?i(h,{isExiting:n==="hidden",onAnimationComplete:t=>{o(s=>t==="hidden"&&s==="hidden"?"unmounted":s)},variants:l||{hidden:{opacity:0,transition:{delay:.08}},visible:{opacity:1}},initial:"hidden",animate:e,exit:"hidden",...b,children:v},x||w):i(M,{...b,children:v})}function Q(e){const{isOpen:n}=e,{animation:o,setAnimation:r}=F();return n!==void 0?i(R,{children:n&&i(g,{...e,animate:"visible",animation:o,setAnimation:r})}):i(g,{...e,animate:o,animation:o,setAnimation:r})}export{Q as ModalOverlay,Q as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clicktap/ui",
3
- "version": "0.31.10",
3
+ "version": "0.31.11",
4
4
  "private": false,
5
5
  "author": "Clicktap",
6
6
  "description": "A library of React UI components and low-level hooks.",