@adam-milo/ui 1.0.80 β 1.0.82
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/dist/index102.cjs +1 -1
- package/dist/index102.js +3 -2
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +2 -1
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +1 -1
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +1 -4
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +1 -1
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +1 -1
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +1 -1
- package/dist/index109.cjs +1 -1
- package/dist/index109.js +1 -3
- package/dist/index110.cjs +1 -1
- package/dist/index110.js +1 -1
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +1 -1
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +1 -3
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +4 -1
- package/dist/index114.cjs +1 -1
- package/dist/index114.js +3 -1
- package/dist/index115.cjs +1 -1
- package/dist/index115.js +1 -1
- package/dist/index117.cjs +1 -1
- package/dist/index117.js +1 -1
- package/dist/index118.cjs +1 -1
- package/dist/index118.js +1 -1
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +2 -2
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +2 -2
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +6 -6
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +6 -6
- package/dist/index4.cjs +1 -1
- package/dist/index4.js +2 -2
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +3 -3
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +1 -1
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +1 -1
- package/dist/src/components/core/icon-button/IconButton.component.d.ts.map +1 -1
- package/dist/src/components/core/icon-button/IconButton.types.d.ts +4 -0
- package/dist/src/components/core/icon-button/IconButton.types.d.ts.map +1 -1
- package/dist/src/components/forms/autocomplete/Autocomplete.component.d.ts.map +1 -1
- package/dist/src/components/forms/input/Input.component.d.ts.map +1 -1
- package/dist/src/components/forms/otp-input/OTPInput.component.d.ts.map +1 -1
- package/dist/src/components/forms/phone-input/PhoneInput.component.d.ts.map +1 -1
- package/dist/src/components/forms/textarea/Textarea.component.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index102.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("react/jsx-runtime");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),r=require("./index103.cjs"),t=require("./index101.cjs"),o=require("./index114.cjs"),c=require("react/jsx-runtime");exports.createCollection=function(n){const l=n+"CollectionProvider",[i,s]=r.createContextScope(l),[u,a]=i(l,{collectionRef:{current:null},itemMap:new Map}),f=r=>{const{scope:t,children:o}=r,n=e.useRef(null),l=e.useRef(new Map).current;return c.jsx(u,{scope:t,itemMap:l,collectionRef:n,children:o})};f.displayName=l;const d=n+"CollectionSlot",p=o.createSlot(d),m=e.forwardRef((e,r)=>{const{scope:o,children:n}=e,l=a(d,o),i=t.useComposedRefs(r,l.collectionRef);return c.jsx(p,{ref:i,children:n})});m.displayName=d;const x=n+"CollectionItemSlot",R="data-radix-collection-item",C=o.createSlot(x),S=e.forwardRef((r,o)=>{const{scope:n,children:l,...i}=r,s=e.useRef(null),u=t.useComposedRefs(o,s),f=a(x,n);return e.useEffect(()=>(f.itemMap.set(s,{ref:s,...i}),()=>{f.itemMap.delete(s)})),c.jsx(C,{[R]:"",ref:u,children:l})});return S.displayName=x,[{Provider:f,Slot:m,ItemSlot:S},function(r){const t=a(n+"CollectionConsumer",r);return e.useCallback(()=>{const e=t.collectionRef.current;if(!e)return[];const r=Array.from(e.querySelectorAll(`[${R}]`));return Array.from(t.itemMap.values()).sort((e,t)=>r.indexOf(e.ref.current)-r.indexOf(t.ref.current))},[t.collectionRef,t.itemMap])},s]};
|
package/dist/index102.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
return
|
|
1
|
+
import e from"react";import{createContextScope as r}from"./index103.js";import{useComposedRefs as t}from"./index101.js";import{createSlot as o}from"./index114.js";import{jsx as n}from"react/jsx-runtime";function c(c){const l=c+"CollectionProvider",[i,f]=r(l),[s,a]=i(l,{collectionRef:{current:null},itemMap:/* @__PURE__ */new Map}),m=r=>{const{scope:t,children:o}=r,c=e.useRef(null),l=e.useRef(/* @__PURE__ */new Map).current;/* @__PURE__ */
|
|
2
|
+
return n(s,{scope:t,itemMap:l,collectionRef:c,children:o})};m.displayName=l;const u=c+"CollectionSlot",d=o(u),p=e.forwardRef((e,r)=>{const{scope:o,children:c}=e,l=a(u,o),i=t(r,l.collectionRef);/* @__PURE__ */
|
|
3
|
+
return n(d,{ref:i,children:c})});p.displayName=u;const R=c+"CollectionItemSlot",x="data-radix-collection-item",M=o(R),h=e.forwardRef((r,o)=>{const{scope:c,children:l,...i}=r,f=e.useRef(null),s=t(o,f),m=a(R,c);return e.useEffect(()=>(m.itemMap.set(f,{ref:f,...i}),()=>{m.itemMap.delete(f)})),/* @__PURE__ */n(M,{[x]:"",ref:s,children:l})});return h.displayName=R,[{Provider:m,Slot:p,ItemSlot:h},function(r){const t=a(c+"CollectionConsumer",r);return e.useCallback(()=>{const e=t.collectionRef.current;if(!e)return[];const r=Array.from(e.querySelectorAll(`[${x}]`));return Array.from(t.itemMap.values()).sort((e,t)=>r.indexOf(e.ref.current)-r.indexOf(t.ref.current))},[t.collectionRef,t.itemMap])},f]}export{c as createCollection};
|
package/dist/index103.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("react/jsx-runtime");function o(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const o in e)if("default"!==o){const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:()=>e[o]})}return t.default=e,Object.freeze(t)}const r=o(e);function n(...e){const t=e[0];if(1===e.length)return t;const o=()=>{const o=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const n=o.reduce((t,{useScope:o,scopeName:r})=>({...t,...o(e)[`__scope${r}`]}),{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return o.scopeName=t.scopeName,o}exports.createContextScope=function(e,o=[]){let c=[];const s=()=>{const t=c.map(e=>r.createContext(e));return function(o){const n=o?.[e]||t;return r.useMemo(()=>({[`__scope${e}`]:{...o,[e]:n}}),[o,n])}};return s.scopeName=e,[function(o,n){const s=r.createContext(n),u=c.length;c=[...c,n];const i=o=>{const{scope:n,children:c,...i}=o,a=n?.[e]?.[u]||s,p=r.useMemo(()=>i,Object.values(i));return t.jsx(a.Provider,{value:p,children:c})};return i.displayName=o+"Provider",[i,function(t,c){const i=c?.[e]?.[u]||s,a=r.useContext(i);if(a)return a;if(void 0!==n)return n;throw new Error(`\`${t}\` must be used within \`${o}\``)}]},n(s,...o)]};
|
package/dist/index103.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import*as e from"react";import{
|
|
1
|
+
import*as e from"react";import{jsx as t}from"react/jsx-runtime";function o(o,r=[]){let c=[];const s=()=>{const t=c.map(t=>e.createContext(t));return function(n){const r=n?.[o]||t;return e.useMemo(()=>({[`__scope${o}`]:{...n,[o]:r}}),[n,r])}};return s.scopeName=o,[function(n,r){const s=e.createContext(r),u=c.length;c=[...c,r];const i=n=>{const{scope:r,children:c,...i}=n,m=r?.[o]?.[u]||s,p=e.useMemo(()=>i,Object.values(i));/* @__PURE__ */
|
|
2
|
+
return t(m.Provider,{value:p,children:c})};return i.displayName=n+"Provider",[i,function(t,c){const i=c?.[o]?.[u]||s,m=e.useContext(i);if(m)return m;if(void 0!==r)return r;throw new Error(`\`${t}\` must be used within \`${n}\``)}]},n(s,...r)]}function n(...t){const o=t[0];if(1===t.length)return o;const n=()=>{const n=t.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(t){const r=n.reduce((e,{useScope:o,scopeName:n})=>({...e,...o(t)[`__scope${n}`]}),{});return e.useMemo(()=>({[`__scope${o.scopeName}`]:r}),[r])}};return n.scopeName=o.scopeName,n}export{o as createContextScope};
|
package/dist/index104.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./index100.cjs"),n=require("./index107.cjs"),r=require("./index101.cjs"),s=require("./index108.cjs"),i=require("./index115.cjs"),o=require("react/jsx-runtime");function u(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const n in e)if("default"!==n){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}return t.default=e,Object.freeze(t)}const a=u(e);var c,d="dismissableLayer.update",l="dismissableLayer.pointerDownOutside",f="dismissableLayer.focusOutside",v=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),p=a.forwardRef((e,u)=>{const{disableOutsidePointerEvents:p=!1,onEscapeKeyDown:m,onPointerDownOutside:y,onFocusOutside:h,onInteractOutside:w,onDismiss:D,...C}=e,O=a.useContext(v),[P,g]=a.useState(null),x=P?.ownerDocument??globalThis?.document,[,L]=a.useState({}),j=r.useComposedRefs(u,e=>g(e)),R=Array.from(O.layers),[S]=[...O.layersWithOutsidePointerEventsDisabled].slice(-1),T=R.indexOf(S),q=P?R.indexOf(P):-1,B=O.layersWithOutsidePointerEventsDisabled.size>0,W=q>=T,k=function(e,t=globalThis?.document){const n=s.useCallbackRef(e),r=a.useRef(!1),i=a.useRef(()=>{});return a.useEffect(()=>{const e=e=>{if(e.target&&!r.current){let r=function(){b(l,n,s,{discrete:!0})};const s={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",i.current),i.current=r,t.addEventListener("click",i.current,{once:!0})):r()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",e),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}(e=>{const t=e.target,n=[...O.branches].some(e=>e.contains(t));W&&!n&&(y?.(e),w?.(e),e.defaultPrevented||D?.())},x),z=function(e,t=globalThis?.document){const n=s.useCallbackRef(e),r=a.useRef(!1);return a.useEffect(()=>{const e=e=>{if(e.target&&!r.current){b(f,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{const t=e.target;[...O.branches].some(e=>e.contains(t))||(h?.(e),w?.(e),e.defaultPrevented||D?.())},x);return i.useEscapeKeydown(e=>{q===O.layers.size-1&&(m?.(e),!e.defaultPrevented&&D&&(e.preventDefault(),D()))},x),a.useEffect(()=>{if(P)return p&&(0===O.layersWithOutsidePointerEventsDisabled.size&&(c=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),O.layersWithOutsidePointerEventsDisabled.add(P)),O.layers.add(P),E(),()=>{p&&1===O.layersWithOutsidePointerEventsDisabled.size&&(x.body.style.pointerEvents=c)}},[P,x,p,O]),a.useEffect(()=>()=>{P&&(O.layers.delete(P),O.layersWithOutsidePointerEventsDisabled.delete(P),E())},[P,O]),a.useEffect(()=>{const e=()=>L({});return document.addEventListener(d,e),()=>document.removeEventListener(d,e)},[]),o.jsx(n.Primitive.div,{...C,ref:j,style:{pointerEvents:B?W?"auto":"none":void 0,...e.style},onFocusCapture:t.composeEventHandlers(e.onFocusCapture,z.onFocusCapture),onBlurCapture:t.composeEventHandlers(e.onBlurCapture,z.onBlurCapture),onPointerDownCapture:t.composeEventHandlers(e.onPointerDownCapture,k.onPointerDownCapture)})});p.displayName="DismissableLayer";var m=a.forwardRef((e,t)=>{const s=a.useContext(v),i=a.useRef(null),u=r.useComposedRefs(t,i);return a.useEffect(()=>{const e=i.current;if(e)return s.branches.add(e),()=>{s.branches.delete(e)}},[s.branches]),o.jsx(n.Primitive.div,{...e,ref:u})});function E(){const e=new CustomEvent(d);document.dispatchEvent(e)}function b(e,t,r,{discrete:s}){const i=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),s?n.dispatchDiscreteCustomEvent(i,o):i.dispatchEvent(o)}m.displayName="DismissableLayerBranch";var y=p,h=m;exports.Branch=h,exports.DismissableLayer=p,exports.DismissableLayerBranch=m,exports.Root=y;
|
package/dist/index104.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as e from"react";import{composeEventHandlers as t}from"./index100.js";import{Primitive as n,dispatchDiscreteCustomEvent as r}from"./index107.js";import{useComposedRefs as s}from"./index101.js";import{useCallbackRef as o}from"./index108.js";import{useEscapeKeydown as i}from"./index115.js";import{jsx as a}from"react/jsx-runtime";var u,c="dismissableLayer.update",d="dismissableLayer.pointerDownOutside",l="dismissableLayer.focusOutside",f=e.createContext({layers:/* @__PURE__ */new Set,layersWithOutsidePointerEventsDisabled:/* @__PURE__ */new Set,branches:/* @__PURE__ */new Set}),v=e.forwardRef((r,v)=>{const{disableOutsidePointerEvents:m=!1,onEscapeKeyDown:y,onPointerDownOutside:b,onFocusOutside:w,onInteractOutside:h,onDismiss:D,...C}=r,L=e.useContext(f),[P,O]=e.useState(null),x=P?.ownerDocument??globalThis?.document,[,g]=e.useState({}),W=s(v,e=>O(e)),j=Array.from(L.layers),[R]=[...L.layersWithOutsidePointerEventsDisabled].slice(-1),T=j.indexOf(R),B=P?j.indexOf(P):-1,F=L.layersWithOutsidePointerEventsDisabled.size>0,S=B>=T,k=function(t,n=globalThis?.document){const r=o(t),s=e.useRef(!1),i=e.useRef(()=>{});return e.useEffect(()=>{const e=e=>{if(e.target&&!s.current){let t=function(){p(d,r,s,{discrete:!0})};const s={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",i.current),i.current=t,n.addEventListener("click",i.current,{once:!0})):t()}else n.removeEventListener("click",i.current);s.current=!1},t=window.setTimeout(()=>{n.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",i.current)}},[n,r]),{onPointerDownCapture:()=>s.current=!0}}(e=>{const t=e.target,n=[...L.branches].some(e=>e.contains(t));S&&!n&&(b?.(e),h?.(e),e.defaultPrevented||D?.())},x),z=function(t,n=globalThis?.document){const r=o(t),s=e.useRef(!1);return e.useEffect(()=>{const e=e=>{if(e.target&&!s.current){p(l,r,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)},[n,r]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}(e=>{const t=e.target;[...L.branches].some(e=>e.contains(t))||(w?.(e),h?.(e),e.defaultPrevented||D?.())},x);return i(e=>{B===L.layers.size-1&&(y?.(e),!e.defaultPrevented&&D&&(e.preventDefault(),D()))},x),e.useEffect(()=>{if(P)return m&&(0===L.layersWithOutsidePointerEventsDisabled.size&&(u=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),L.layersWithOutsidePointerEventsDisabled.add(P)),L.layers.add(P),E(),()=>{m&&1===L.layersWithOutsidePointerEventsDisabled.size&&(x.body.style.pointerEvents=u)}},[P,x,m,L]),e.useEffect(()=>()=>{P&&(L.layers.delete(P),L.layersWithOutsidePointerEventsDisabled.delete(P),E())},[P,L]),e.useEffect(()=>{const e=()=>g({});return document.addEventListener(c,e),()=>document.removeEventListener(c,e)},[]),/* @__PURE__ */a(n.div,{...C,ref:W,style:{pointerEvents:F?S?"auto":"none":void 0,...r.style},onFocusCapture:t(r.onFocusCapture,z.onFocusCapture),onBlurCapture:t(r.onBlurCapture,z.onBlurCapture),onPointerDownCapture:t(r.onPointerDownCapture,k.onPointerDownCapture)})});v.displayName="DismissableLayer";var m=e.forwardRef((t,r)=>{const o=e.useContext(f),i=e.useRef(null),u=s(r,i);return e.useEffect(()=>{const e=i.current;if(e)return o.branches.add(e),()=>{o.branches.delete(e)}},[o.branches]),/* @__PURE__ */a(n.div,{...t,ref:u})});function E(){const e=new CustomEvent(c);document.dispatchEvent(e)}function p(e,t,n,{discrete:s}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),s?r(o,i):o.dispatchEvent(i)}m.displayName="DismissableLayerBranch";var y=v,b=m;export{b as Branch,v as DismissableLayer,m as DismissableLayerBranch,y as Root};
|
package/dist/index105.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("react-dom"),r=require("./index107.cjs"),o=require("./index110.cjs"),n=require("react/jsx-runtime");function c(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const i=c(e);var a=i.forwardRef((e,c)=>{const{container:a,...u}=e,[s,l]=i.useState(!1);o.useLayoutEffect(()=>l(!0),[]);const d=a||s&&globalThis?.document?.body;return d?t.createPortal(n.jsx(r.Primitive.div,{...u,ref:c}),d):null});a.displayName="Portal",exports.Portal=a;
|
package/dist/index105.js
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
import*as
|
|
2
|
-
return u(b,{scope:t,anchor:i,onAnchorChange:n,children:o})};A.displayName=y;var j="PopperAnchor",S=e.forwardRef((r,t)=>{const{__scopePopper:o,virtualRef:i,...n}=r,a=P(j,o),s=e.useRef(null),d=l(t,s),p=e.useRef(null);return e.useEffect(()=>{const e=p.current;p.current=i?.current||s.current,e!==p.current&&a.onAnchorChange(p.current)}),i?null:/* @__PURE__ */u(f.div,{...n,ref:d})});S.displayName=j;var $="PopperContent",[O,_]=w($),C=e.forwardRef((p,c)=>{const{__scopePopper:y,side:w="bottom",sideOffset:v=0,align:b="center",alignOffset:A=0,arrowPadding:j=0,avoidCollisions:S=!0,collisionBoundary:_=[],collisionPadding:C=0,sticky:H="partial",hideWhenDetached:R=!1,updatePositionStrategy:W="optimized",onPlaced:X,...z}=p,D=P($,y),[k,B]=e.useState(null),F=l(c,e=>B(e)),[I,L]=e.useState(null),M=g(I),q=M?.width??0,G=M?.height??0,J=w+("center"!==b?"-"+b:""),K="number"==typeof C?C:{top:0,right:0,bottom:0,left:0,...C},Q=Array.isArray(_)?_:[_],T=Q.length>0,U={padding:K,boundary:Q.filter(Y),altBoundary:T},{refs:V,floatingStyles:Z,placement:ee,isPositioned:re,middlewareData:te}=r({strategy:"fixed",placement:J,whileElementsMounted:(...e)=>x(...e,{animationFrame:"always"===W}),elements:{reference:D.anchor},middleware:[t({mainAxis:v+G,alignmentAxis:A}),S&&o({mainAxis:!0,crossAxis:!1,limiter:"partial"===H?d():void 0,...U}),S&&i({...U}),n({...U,apply:({elements:e,rects:r,availableWidth:t,availableHeight:o})=>{const{width:i,height:n}=r.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${t}px`),a.setProperty("--radix-popper-available-height",`${o}px`),a.setProperty("--radix-popper-anchor-width",`${i}px`),a.setProperty("--radix-popper-anchor-height",`${n}px`)}}),I&&a({element:I,padding:j}),E({arrowWidth:q,arrowHeight:G}),R&&s({strategy:"referenceHidden",...U})]}),[oe,ie]=N(ee),ne=m(X);h(()=>{re&&ne?.()},[re,ne]);const ae=te.arrow?.x,se=te.arrow?.y,de=0!==te.arrow?.centerOffset,[pe,le]=e.useState();return h(()=>{k&&le(window.getComputedStyle(k).zIndex)},[k]),/* @__PURE__ */u("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:re?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:pe,"--radix-popper-transform-origin":[te.transformOrigin?.x,te.transformOrigin?.y].join(" "),...te.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:p.dir,children:/* @__PURE__ */u(O,{scope:y,placedSide:oe,onArrowChange:L,arrowX:ae,arrowY:se,shouldHideArrow:de,children:/* @__PURE__ */u(f.div,{"data-side":oe,"data-align":ie,...z,ref:F,style:{...z.style,animation:re?void 0:"none"}})})})});C.displayName=$;var H="PopperArrow",R={top:"bottom",right:"left",bottom:"top",left:"right"},W=e.forwardRef(function(e,r){const{__scopePopper:t,...o}=e,i=_(H,t),n=R[i.placedSide];
|
|
3
|
-
/* @__PURE__ */
|
|
4
|
-
return u("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[n]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:/* @__PURE__ */u(p,{...o,ref:r,style:{...o.style,display:"block"}})})});function Y(e){return null!==e}W.displayName=H;var E=e=>({name:"transformOrigin",options:e,fn(r){const{placement:t,rects:o,middlewareData:i}=r,n=0!==i.arrow?.centerOffset,a=n?0:e.arrowWidth,s=n?0:e.arrowHeight,[d,p]=N(t),l={start:"0%",center:"50%",end:"100%"}[p],c=(i.arrow?.x??0)+a/2,f=(i.arrow?.y??0)+s/2;let m="",h="";return"bottom"===d?(m=n?l:`${c}px`,h=-s+"px"):"top"===d?(m=n?l:`${c}px`,h=`${o.floating.height+s}px`):"right"===d?(m=-s+"px",h=n?l:`${f}px`):"left"===d&&(m=`${o.floating.width+s}px`,h=n?l:`${f}px`),{data:{x:m,y:h}}}});function N(e){const[r,t="center"]=e.split("-");return[r,t]}var X=A,z=S,D=C,k=W;export{z as Anchor,k as Arrow,D as Content,A as Popper,S as PopperAnchor,W as PopperArrow,C as PopperContent,X as Root,v as createPopperScope};
|
|
1
|
+
import*as r from"react";import o from"react-dom";import{Primitive as t}from"./index107.js";import{useLayoutEffect as e}from"./index110.js";import{jsx as a}from"react/jsx-runtime";var m=r.forwardRef((m,i)=>{const{container:s,...f}=m,[n,c]=r.useState(!1);e(()=>c(!0),[]);const d=s||n&&globalThis?.document?.body;return d?o.createPortal(/* @__PURE__ */a(t.div,{...f,ref:i}),d):null});m.displayName="Portal";export{m as Portal};
|
package/dist/index106.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),n=require("./index101.cjs"),t=require("./index110.cjs");function r(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const t in e)if("default"!==t){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}return n.default=e,Object.freeze(n)}const o=r(e);var i=e=>{const{present:r,children:i}=e,s=function(e){const[n,r]=o.useState(),i=o.useRef(null),s=o.useRef(e),c=o.useRef("none"),a=e?"mounted":"unmounted",[d,l]=function(e,n){return o.useReducer((e,t)=>n[e][t]??e,e)}(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return o.useEffect(()=>{const e=u(i.current);c.current="mounted"===d?e:"none"},[d]),t.useLayoutEffect(()=>{const n=i.current,t=s.current;if(t!==e){const r=c.current,o=u(n);if(e)l("MOUNT");else if("none"===o||"none"===n?.display)l("UNMOUNT");else{l(t&&r!==o?"ANIMATION_OUT":"UNMOUNT")}s.current=e}},[e,l]),t.useLayoutEffect(()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const o=u(i.current).includes(CSS.escape(r.animationName));if(r.target===n&&o&&(l("ANIMATION_END"),!s.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},o=e=>{e.target===n&&(c.current=u(i.current))};return n.addEventListener("animationstart",o),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",o),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}l("ANIMATION_END")},[n,l]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:o.useCallback(e=>{i.current=e?getComputedStyle(e):null,r(e)},[])}}(r),c="function"==typeof i?i({present:s.isPresent}):o.Children.only(i),a=n.useComposedRefs(s.ref,function(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning;if(t)return e.ref;if(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning,t)return e.props.ref;return e.props.ref||e.ref}(c));return"function"==typeof i||s.isPresent?o.cloneElement(c,{ref:a}):null};function u(e){return e?.animationName||"none"}i.displayName="Presence",exports.Presence=i;
|
package/dist/index106.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as e from"react";import{useComposedRefs as n}from"./index101.js";import{useLayoutEffect as t}from"./index110.js";var r=r=>{const{present:i,children:u}=r,s=function(n){const[r,i]=e.useState(),u=e.useRef(null),s=e.useRef(n),a=e.useRef("none"),c=n?"mounted":"unmounted",[d,m]=function(n,t){return e.useReducer((e,n)=>t[e][n]??e,n)}(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=o(u.current);a.current="mounted"===d?e:"none"},[d]),t(()=>{const e=u.current,t=s.current;if(t!==n){const r=a.current,i=o(e);if(n)m("MOUNT");else if("none"===i||"none"===e?.display)m("UNMOUNT");else{m(t&&r!==i?"ANIMATION_OUT":"UNMOUNT")}s.current=n}},[n,m]),t(()=>{if(r){let e;const n=r.ownerDocument.defaultView??window,t=t=>{const i=o(u.current).includes(CSS.escape(t.animationName));if(t.target===r&&i&&(m("ANIMATION_END"),!s.current)){const t=r.style.animationFillMode;r.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===r.style.animationFillMode&&(r.style.animationFillMode=t)})}},i=e=>{e.target===r&&(a.current=o(u.current))};return r.addEventListener("animationstart",i),r.addEventListener("animationcancel",t),r.addEventListener("animationend",t),()=>{n.clearTimeout(e),r.removeEventListener("animationstart",i),r.removeEventListener("animationcancel",t),r.removeEventListener("animationend",t)}}m("ANIMATION_END")},[r,m]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:e.useCallback(e=>{u.current=e?getComputedStyle(e):null,i(e)},[])}}(i),a="function"==typeof u?u({present:s.isPresent}):e.Children.only(u),c=n(s.ref,function(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning;if(t)return e.ref;if(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning,t)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof u||s.isPresent?e.cloneElement(a,{ref:c}):null};function o(e){return e?.animationName||"none"}r.displayName="Presence";export{r as Presence};
|
package/dist/index107.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("react-dom"),r=require("./index114.cjs"),i=require("react/jsx-runtime");function n(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const o=n(e),c=n(t);var u=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const n=r.createSlot(`Primitive.${t}`),c=o.forwardRef((e,r)=>{const{asChild:o,...c}=e,u=o?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),i.jsx(u,{...c,ref:r})});return c.displayName=`Primitive.${t}`,{...e,[t]:c}},{});exports.Primitive=u,exports.dispatchDiscreteCustomEvent=function(e,t){e&&c.flushSync(()=>e.dispatchEvent(t))};
|
package/dist/index107.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as r from"react";import*as i from"react-dom";import{createSlot as t}from"./index114.js";import{jsx as e}from"react/jsx-runtime";var o=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((i,o)=>{const n=t(`Primitive.${o}`),a=r.forwardRef((r,i)=>{const{asChild:t,...a}=r,m=t?n:o;return"undefined"!=typeof window&&(window[/* @__PURE__ */Symbol.for("radix-ui")]=!0),/* @__PURE__ */e(m,{...a,ref:i})});return a.displayName=`Primitive.${o}`,{...i,[o]:a}},{});function n(r,t){r&&i.flushSync(()=>r.dispatchEvent(t))}export{o as Primitive,n as dispatchDiscreteCustomEvent};
|
package/dist/index108.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function e(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const t=e(require("react"));exports.useCallbackRef=function(e){const r=t.useRef(e);return t.useEffect(()=>{r.current=e}),t.useMemo(()=>(...e)=>r.current?.(...e),[])};
|
package/dist/index108.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as e from"react";function r(r){const t=e.useRef(r);return e.useEffect(()=>{t.current=r}),e.useMemo(()=>(...e)=>t.current?.(...e),[])}export{r as useCallbackRef};
|
package/dist/index109.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./index110.cjs");function r(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const n=r(e);var o=n[" useInsertionEffect ".trim().toString()]||t.useLayoutEffect;exports.useControllableState=function({prop:e,defaultProp:t,onChange:r=()=>{},caller:u}){const[c,f,s]=function({defaultProp:e,onChange:t}){const[r,u]=n.useState(e),c=n.useRef(r),f=n.useRef(t);return o(()=>{f.current=t},[t]),n.useEffect(()=>{c.current!==r&&(f.current?.(r),c.current=r)},[r,c]),[r,u,f]}({defaultProp:t,onChange:r}),i=void 0!==e,a=i?e:c;{const t=n.useRef(void 0!==e);n.useEffect(()=>{const e=t.current;if(e!==i){}t.current=i},[i,u])}const l=n.useCallback(t=>{if(i){const r=function(e){return"function"==typeof e}(t)?t(e):t;r!==e&&s.current?.(r)}else f(t)},[i,e,f,s]);return[a,l]};
|
package/dist/index109.js
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
import*as
|
|
2
|
-
return e(t,{...l,ref:i,children:n.isValidElement(r)?n.cloneElement(r,void 0,o):null})}/* @__PURE__ */
|
|
3
|
-
return e(t,{...l,ref:i,children:o})});return i.displayName=`${r}.Slot`,i}function o(e){const t=n.forwardRef((e,t)=>{const{children:i,...o}=e;if(n.isValidElement(i)){const e=function(n){let r=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,e=r&&"isReactWarning"in r&&r.isReactWarning;if(e)return n.ref;if(r=Object.getOwnPropertyDescriptor(n,"ref")?.get,e=r&&"isReactWarning"in r&&r.isReactWarning,e)return n.props.ref;return n.props.ref||n.ref}(i),l=function(n,r){const e={...r};for(const t in r){const i=n[t],o=r[t];/^on[A-Z]/.test(t)?i&&o?e[t]=(...n)=>{const r=o(...n);return i(...n),r}:i&&(e[t]=i):"style"===t?e[t]={...i,...o}:"className"===t&&(e[t]=[i,o].filter(Boolean).join(" "))}return{...n,...e}}(o,i.props);return i.type!==n.Fragment&&(l.ref=t?r(t,e):e),n.cloneElement(i,l)}return n.Children.count(i)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var l=/* @__PURE__ */Symbol("radix.slottable");function c(n){const r=({children:n})=>/* @__PURE__ */e(t,{children:n});return r.displayName=`${n}.Slottable`,r.__radixId=l,r}function s(r){return n.isValidElement(r)&&"function"==typeof r.type&&"__radixId"in r.type&&r.type.__radixId===l}export{i as createSlot,c as createSlottable};
|
|
1
|
+
import*as e from"react";import{useLayoutEffect as t}from"./index110.js";var r=e[" useInsertionEffect ".trim().toString()]||t;function n({prop:t,defaultProp:n,onChange:o=()=>{},caller:u}){const[c,f,s]=function({defaultProp:t,onChange:n}){const[o,u]=e.useState(t),c=e.useRef(o),f=e.useRef(n);return r(()=>{f.current=n},[n]),e.useEffect(()=>{c.current!==o&&(f.current?.(o),c.current=o)},[o,c]),[o,u,f]}({defaultProp:n,onChange:o}),a=void 0!==t,i=a?t:c;{const r=e.useRef(void 0!==t);e.useEffect(()=>{const e=r.current;if(e!==a){}r.current=a},[a,u])}const p=e.useCallback(e=>{if(a){const r=function(e){return"function"==typeof e}(e)?e(t):e;r!==t&&s.current?.(r)}else f(e)},[a,t,f,s]);return[i,p]}export{n as useControllableState};
|
package/dist/index110.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function e(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const t=e(require("react"));var r=globalThis?.document?t.useLayoutEffect:()=>{};exports.useLayoutEffect=r;
|
package/dist/index110.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as t from"react";var a=globalThis?.document?t.useLayoutEffect:()=>{};export{a as useLayoutEffect};
|
package/dist/index111.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),r=require("./index107.cjs"),t=require("react/jsx-runtime");function o(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const t in e)if("default"!==t){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}return r.default=e,Object.freeze(r)}const i=o(e);var n=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),a=i.forwardRef((e,o)=>t.jsx(r.Primitive.span,{...e,ref:o,style:{...n,...e.style}}));a.displayName="VisuallyHidden";var s=a;exports.Root=s,exports.VISUALLY_HIDDEN_STYLES=n,exports.VisuallyHidden=a;
|
package/dist/index111.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as r from"react";import{Primitive as e}from"./
|
|
1
|
+
import*as r from"react";import{Primitive as e}from"./index107.js";import{jsx as a}from"react/jsx-runtime";var i=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),o=r.forwardRef((r,o)=>/* @__PURE__ */a(e.span,{...r,ref:o,style:{...i,...r.style}}));o.displayName="VisuallyHidden";var t=o;export{t as Root,i as VISUALLY_HIDDEN_STYLES,o as VisuallyHidden};
|
package/dist/index112.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./index110.cjs");function r(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const n=r(e);var o=n[" useId ".trim().toString()]||(()=>{}),u=0;exports.useId=function(e){const[r,c]=n.useState(o());return t.useLayoutEffect(()=>{c(e=>e??String(u++))},[e]),r?`radix-${r}`:""};
|
package/dist/index112.js
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
return n(s,{scope:t,itemMap:l,collectionRef:c,children:o})};m.displayName=l;const u=c+"CollectionSlot",d=o(u),p=e.forwardRef((e,r)=>{const{scope:o,children:c}=e,l=a(u,o),i=t(r,l.collectionRef);/* @__PURE__ */
|
|
3
|
-
return n(d,{ref:i,children:c})});p.displayName=u;const R=c+"CollectionItemSlot",x="data-radix-collection-item",M=o(R),h=e.forwardRef((r,o)=>{const{scope:c,children:l,...i}=r,f=e.useRef(null),s=t(o,f),m=a(R,c);return e.useEffect(()=>(m.itemMap.set(f,{ref:f,...i}),()=>{m.itemMap.delete(f)})),/* @__PURE__ */n(M,{[x]:"",ref:s,children:l})});return h.displayName=R,[{Provider:m,Slot:p,ItemSlot:h},function(r){const t=a(c+"CollectionConsumer",r);return e.useCallback(()=>{const e=t.collectionRef.current;if(!e)return[];const r=Array.from(e.querySelectorAll(`[${x}]`));return Array.from(t.itemMap.values()).sort((e,t)=>r.indexOf(e.ref.current)-r.indexOf(t.ref.current))},[t.collectionRef,t.itemMap])},f]}export{c as createCollection};
|
|
1
|
+
import*as t from"react";import{useLayoutEffect as r}from"./index110.js";var e=t[" useId ".trim().toString()]||(()=>{}),o=0;function i(i){const[a,n]=t.useState(e());return r(()=>{n(t=>t??String(o++))},[i]),a?`radix-${a}`:""}export{i as useId};
|
package/dist/index113.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),r=require("./index116.cjs"),t=require("./index117.cjs"),o=require("./index101.cjs"),i=require("./index103.cjs"),n=require("./index107.cjs"),a=require("./index108.cjs"),s=require("./index110.cjs"),p=require("./index118.cjs"),l=require("react/jsx-runtime"),d=require("./index119.cjs");function c(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const t in e)if("default"!==t){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}return r.default=e,Object.freeze(r)}const f=c(e);var u="Popper",[h,x]=i.createContextScope(u),[g,m]=h(u),y=e=>{const{__scopePopper:r,children:t}=e,[o,i]=f.useState(null);return l.jsx(g,{scope:r,anchor:o,onAnchorChange:i,children:t})};y.displayName=u;var w="PopperAnchor",P=f.forwardRef((e,r)=>{const{__scopePopper:t,virtualRef:i,...a}=e,s=m(w,t),p=f.useRef(null),d=o.useComposedRefs(r,p),c=f.useRef(null);return f.useEffect(()=>{const e=c.current;c.current=i?.current||p.current,e!==c.current&&s.onAnchorChange(c.current)}),i?null:l.jsx(n.Primitive.div,{...a,ref:d})});P.displayName=w;var b="PopperContent",[v,j]=h(b),S=f.forwardRef((e,t)=>{const{__scopePopper:i,side:c="bottom",sideOffset:u=0,align:h="center",alignOffset:x=0,arrowPadding:g=0,avoidCollisions:y=!0,collisionBoundary:w=[],collisionPadding:P=0,sticky:j="partial",hideWhenDetached:S=!1,updatePositionStrategy:A="optimized",onPlaced:O,...C}=e,_=m(b,i),[H,z]=f.useState(null),E=o.useComposedRefs(t,e=>z(e)),[W,Y]=f.useState(null),D=p.useSize(W),N=D?.width??0,X=D?.height??0,k=c+("center"!==h?"-"+h:""),F="number"==typeof P?P:{top:0,right:0,bottom:0,left:0,...P},M=Array.isArray(w)?w:[w],B=M.length>0,I={padding:F,boundary:M.filter(q),altBoundary:B},{refs:L,floatingStyles:T,placement:U,isPositioned:G,middlewareData:J}=r.useFloating({strategy:"fixed",placement:k,whileElementsMounted:(...e)=>d.autoUpdate(...e,{animationFrame:"always"===A}),elements:{reference:_.anchor},middleware:[r.offset({mainAxis:u+X,alignmentAxis:x}),y&&r.shift({mainAxis:!0,crossAxis:!1,limiter:"partial"===j?r.limitShift():void 0,...I}),y&&r.flip({...I}),r.size({...I,apply:({elements:e,rects:r,availableWidth:t,availableHeight:o})=>{const{width:i,height:n}=r.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${t}px`),a.setProperty("--radix-popper-available-height",`${o}px`),a.setProperty("--radix-popper-anchor-width",`${i}px`),a.setProperty("--radix-popper-anchor-height",`${n}px`)}}),W&&r.arrow({element:W,padding:g}),R({arrowWidth:N,arrowHeight:X}),S&&r.hide({strategy:"referenceHidden",...I})]}),[K,Q]=$(U),V=a.useCallbackRef(O);s.useLayoutEffect(()=>{G&&V?.()},[G,V]);const Z=J.arrow?.x,ee=J.arrow?.y,re=0!==J.arrow?.centerOffset,[te,oe]=f.useState();return s.useLayoutEffect(()=>{H&&oe(window.getComputedStyle(H).zIndex)},[H]),l.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:G?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:te,"--radix-popper-transform-origin":[J.transformOrigin?.x,J.transformOrigin?.y].join(" "),...J.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(v,{scope:i,placedSide:K,onArrowChange:Y,arrowX:Z,arrowY:ee,shouldHideArrow:re,children:l.jsx(n.Primitive.div,{"data-side":K,"data-align":Q,...C,ref:E,style:{...C.style,animation:G?void 0:"none"}})})})});S.displayName=b;var A="PopperArrow",O={top:"bottom",right:"left",bottom:"top",left:"right"},C=f.forwardRef(function(e,r){const{__scopePopper:o,...i}=e,n=j(A,o),a=O[n.placedSide];return l.jsx("span",{ref:n.onArrowChange,style:{position:"absolute",left:n.arrowX,top:n.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[n.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[n.placedSide],visibility:n.shouldHideArrow?"hidden":void 0},children:l.jsx(t.Root,{...i,ref:r,style:{...i.style,display:"block"}})})});function q(e){return null!==e}C.displayName=A;var R=e=>({name:"transformOrigin",options:e,fn(r){const{placement:t,rects:o,middlewareData:i}=r,n=0!==i.arrow?.centerOffset,a=n?0:e.arrowWidth,s=n?0:e.arrowHeight,[p,l]=$(t),d={start:"0%",center:"50%",end:"100%"}[l],c=(i.arrow?.x??0)+a/2,f=(i.arrow?.y??0)+s/2;let u="",h="";return"bottom"===p?(u=n?d:`${c}px`,h=-s+"px"):"top"===p?(u=n?d:`${c}px`,h=`${o.floating.height+s}px`):"right"===p?(u=-s+"px",h=n?d:`${f}px`):"left"===p&&(u=`${o.floating.width+s}px`,h=n?d:`${f}px`),{data:{x:u,y:h}}}});function $(e){const[r,t="center"]=e.split("-");return[r,t]}var _=y,H=P,z=S,E=C;exports.Anchor=H,exports.Arrow=E,exports.Content=z,exports.Popper=y,exports.PopperAnchor=P,exports.PopperArrow=C,exports.PopperContent=S,exports.Root=_,exports.createPopperScope=x;
|
package/dist/index113.js
CHANGED
|
@@ -1 +1,4 @@
|
|
|
1
|
-
import*as e from"react";
|
|
1
|
+
import*as e from"react";import{useFloating as r,offset as t,shift as o,flip as i,size as n,arrow as a,hide as s,limitShift as d}from"./index116.js";import{Root as p}from"./index117.js";import{useComposedRefs as l}from"./index101.js";import{createContextScope as c}from"./index103.js";import{Primitive as f}from"./index107.js";import{useCallbackRef as m}from"./index108.js";import{useLayoutEffect as h}from"./index110.js";import{useSize as g}from"./index118.js";import{jsx as u}from"react/jsx-runtime";import{autoUpdate as x}from"./index119.js";var y="Popper",[w,v]=c(y),[b,P]=w(y),A=r=>{const{__scopePopper:t,children:o}=r,[i,n]=e.useState(null);/* @__PURE__ */
|
|
2
|
+
return u(b,{scope:t,anchor:i,onAnchorChange:n,children:o})};A.displayName=y;var j="PopperAnchor",S=e.forwardRef((r,t)=>{const{__scopePopper:o,virtualRef:i,...n}=r,a=P(j,o),s=e.useRef(null),d=l(t,s),p=e.useRef(null);return e.useEffect(()=>{const e=p.current;p.current=i?.current||s.current,e!==p.current&&a.onAnchorChange(p.current)}),i?null:/* @__PURE__ */u(f.div,{...n,ref:d})});S.displayName=j;var $="PopperContent",[O,_]=w($),C=e.forwardRef((p,c)=>{const{__scopePopper:y,side:w="bottom",sideOffset:v=0,align:b="center",alignOffset:A=0,arrowPadding:j=0,avoidCollisions:S=!0,collisionBoundary:_=[],collisionPadding:C=0,sticky:H="partial",hideWhenDetached:R=!1,updatePositionStrategy:W="optimized",onPlaced:X,...z}=p,D=P($,y),[k,B]=e.useState(null),F=l(c,e=>B(e)),[I,L]=e.useState(null),M=g(I),q=M?.width??0,G=M?.height??0,J=w+("center"!==b?"-"+b:""),K="number"==typeof C?C:{top:0,right:0,bottom:0,left:0,...C},Q=Array.isArray(_)?_:[_],T=Q.length>0,U={padding:K,boundary:Q.filter(Y),altBoundary:T},{refs:V,floatingStyles:Z,placement:ee,isPositioned:re,middlewareData:te}=r({strategy:"fixed",placement:J,whileElementsMounted:(...e)=>x(...e,{animationFrame:"always"===W}),elements:{reference:D.anchor},middleware:[t({mainAxis:v+G,alignmentAxis:A}),S&&o({mainAxis:!0,crossAxis:!1,limiter:"partial"===H?d():void 0,...U}),S&&i({...U}),n({...U,apply:({elements:e,rects:r,availableWidth:t,availableHeight:o})=>{const{width:i,height:n}=r.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${t}px`),a.setProperty("--radix-popper-available-height",`${o}px`),a.setProperty("--radix-popper-anchor-width",`${i}px`),a.setProperty("--radix-popper-anchor-height",`${n}px`)}}),I&&a({element:I,padding:j}),E({arrowWidth:q,arrowHeight:G}),R&&s({strategy:"referenceHidden",...U})]}),[oe,ie]=N(ee),ne=m(X);h(()=>{re&&ne?.()},[re,ne]);const ae=te.arrow?.x,se=te.arrow?.y,de=0!==te.arrow?.centerOffset,[pe,le]=e.useState();return h(()=>{k&&le(window.getComputedStyle(k).zIndex)},[k]),/* @__PURE__ */u("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:re?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:pe,"--radix-popper-transform-origin":[te.transformOrigin?.x,te.transformOrigin?.y].join(" "),...te.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:p.dir,children:/* @__PURE__ */u(O,{scope:y,placedSide:oe,onArrowChange:L,arrowX:ae,arrowY:se,shouldHideArrow:de,children:/* @__PURE__ */u(f.div,{"data-side":oe,"data-align":ie,...z,ref:F,style:{...z.style,animation:re?void 0:"none"}})})})});C.displayName=$;var H="PopperArrow",R={top:"bottom",right:"left",bottom:"top",left:"right"},W=e.forwardRef(function(e,r){const{__scopePopper:t,...o}=e,i=_(H,t),n=R[i.placedSide];
|
|
3
|
+
/* @__PURE__ */
|
|
4
|
+
return u("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[n]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:/* @__PURE__ */u(p,{...o,ref:r,style:{...o.style,display:"block"}})})});function Y(e){return null!==e}W.displayName=H;var E=e=>({name:"transformOrigin",options:e,fn(r){const{placement:t,rects:o,middlewareData:i}=r,n=0!==i.arrow?.centerOffset,a=n?0:e.arrowWidth,s=n?0:e.arrowHeight,[d,p]=N(t),l={start:"0%",center:"50%",end:"100%"}[p],c=(i.arrow?.x??0)+a/2,f=(i.arrow?.y??0)+s/2;let m="",h="";return"bottom"===d?(m=n?l:`${c}px`,h=-s+"px"):"top"===d?(m=n?l:`${c}px`,h=`${o.floating.height+s}px`):"right"===d?(m=-s+"px",h=n?l:`${f}px`):"left"===d&&(m=`${o.floating.width+s}px`,h=n?l:`${f}px`),{data:{x:m,y:h}}}});function N(e){const[r,t="center"]=e.split("-");return[r,t]}var X=A,z=S,D=C,k=W;export{z as Anchor,k as Arrow,D as Content,A as Popper,S as PopperAnchor,W as PopperArrow,C as PopperContent,X as Root,v as createPopperScope};
|
package/dist/index114.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),r=require("./index101.cjs"),t=require("react/jsx-runtime");function n(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const t in e)if("default"!==t){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}return r.default=e,Object.freeze(r)}const o=n(e);function i(e){const t=o.forwardRef((e,t)=>{const{children:n,...i}=e;if(o.isValidElement(n)){const e=function(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,t=r&&"isReactWarning"in r&&r.isReactWarning;if(t)return e.ref;if(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,t=r&&"isReactWarning"in r&&r.isReactWarning,t)return e.props.ref;return e.props.ref||e.ref}(n),l=function(e,r){const t={...r};for(const n in r){const o=e[n],i=r[n];/^on[A-Z]/.test(n)?o&&i?t[n]=(...e)=>{const r=i(...e);return o(...e),r}:o&&(t[n]=o):"style"===n?t[n]={...o,...i}:"className"===n&&(t[n]=[o,i].filter(Boolean).join(" "))}return{...e,...t}}(i,n.props);return n.type!==o.Fragment&&(l.ref=t?r.composeRefs(t,e):e),o.cloneElement(n,l)}return o.Children.count(n)>1?o.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var l=Symbol("radix.slottable");function c(e){return o.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===l}exports.createSlot=function(e){const r=i(e),n=o.forwardRef((e,n)=>{const{children:i,...l}=e,s=o.Children.toArray(i),a=s.find(c);if(a){const e=a.props.children,i=s.map(r=>r===a?o.Children.count(e)>1?o.Children.only(null):o.isValidElement(e)?e.props.children:null:r);return t.jsx(r,{...l,ref:n,children:o.isValidElement(e)?o.cloneElement(e,void 0,i):null})}return t.jsx(r,{...l,ref:n,children:i})});return n.displayName=`${e}.Slot`,n},exports.createSlottable=function(e){const r=({children:e})=>t.jsx(t.Fragment,{children:e});return r.displayName=`${e}.Slottable`,r.__radixId=l,r};
|
package/dist/index114.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as n from"react";import{composeRefs as r}from"./index101.js";import{jsx as e,Fragment as t}from"react/jsx-runtime";function i(r){const t=/* @__PURE__ */o(r),i=n.forwardRef((r,i)=>{const{children:o,...l}=r,c=n.Children.toArray(o),a=c.find(s);if(a){const r=a.props.children,o=c.map(e=>e===a?n.Children.count(r)>1?n.Children.only(null):n.isValidElement(r)?r.props.children:null:e);/* @__PURE__ */
|
|
2
|
+
return e(t,{...l,ref:i,children:n.isValidElement(r)?n.cloneElement(r,void 0,o):null})}/* @__PURE__ */
|
|
3
|
+
return e(t,{...l,ref:i,children:o})});return i.displayName=`${r}.Slot`,i}function o(e){const t=n.forwardRef((e,t)=>{const{children:i,...o}=e;if(n.isValidElement(i)){const e=function(n){let r=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,e=r&&"isReactWarning"in r&&r.isReactWarning;if(e)return n.ref;if(r=Object.getOwnPropertyDescriptor(n,"ref")?.get,e=r&&"isReactWarning"in r&&r.isReactWarning,e)return n.props.ref;return n.props.ref||n.ref}(i),l=function(n,r){const e={...r};for(const t in r){const i=n[t],o=r[t];/^on[A-Z]/.test(t)?i&&o?e[t]=(...n)=>{const r=o(...n);return i(...n),r}:i&&(e[t]=i):"style"===t?e[t]={...i,...o}:"className"===t&&(e[t]=[i,o].filter(Boolean).join(" "))}return{...n,...e}}(o,i.props);return i.type!==n.Fragment&&(l.ref=t?r(t,e):e),n.cloneElement(i,l)}return n.Children.count(i)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var l=/* @__PURE__ */Symbol("radix.slottable");function c(n){const r=({children:n})=>/* @__PURE__ */e(t,{children:n});return r.displayName=`${n}.Slottable`,r.__radixId=l,r}function s(r){return n.isValidElement(r)&&"function"==typeof r.type&&"__radixId"in r.type&&r.type.__radixId===l}export{i as createSlot,c as createSlottable};
|
package/dist/index115.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./index108.cjs");function r(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const n=r(e);exports.useEscapeKeydown=function(e,r=globalThis?.document){const o=t.useCallbackRef(e);n.useEffect(()=>{const e=e=>{"Escape"===e.key&&o(e)};return r.addEventListener("keydown",e,{capture:!0}),()=>r.removeEventListener("keydown",e,{capture:!0})},[o,r])};
|
package/dist/index115.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{useCallbackRef as t}from"./
|
|
1
|
+
import*as e from"react";import{useCallbackRef as t}from"./index108.js";function n(n,o=globalThis?.document){const r=t(n);e.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return o.addEventListener("keydown",e,{capture:!0}),()=>o.removeEventListener("keydown",e,{capture:!0})},[r,o])}export{n as useEscapeKeydown};
|
package/dist/index117.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),r=require("./index107.cjs"),t=require("react/jsx-runtime");function o(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const t in e)if("default"!==t){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}return r.default=e,Object.freeze(r)}var i=o(e).forwardRef((e,o)=>{const{children:i,width:n=10,height:s=5,...c}=e;return t.jsx(r.Primitive.svg,{...c,ref:o,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?i:t.jsx("polygon",{points:"0,0 30,0 15,10"})})});i.displayName="Arrow";var n=i;exports.Arrow=i,exports.Root=n;
|
package/dist/index117.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as r from"react";import{Primitive as e}from"./
|
|
1
|
+
import*as r from"react";import{Primitive as e}from"./index107.js";import{jsx as i}from"react/jsx-runtime";var o=r.forwardRef((r,o)=>{const{children:t,width:a=10,height:n=5,...s}=r;/* @__PURE__ */
|
|
2
2
|
return i(e.svg,{...s,ref:o,width:a,height:n,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?t:/* @__PURE__ */i("polygon",{points:"0,0 30,0 15,10"})})});o.displayName="Arrow";var t=o;export{o as Arrow,t as Root};
|
package/dist/index118.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./index110.cjs");function r(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const o=r(e);exports.useSize=function(e){const[r,i]=o.useState(void 0);return t.useLayoutEffect(()=>{if(e){i({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,n;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,n=t.blockSize}else o=e.offsetWidth,n=e.offsetHeight;i({width:o,height:n})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}i(void 0)},[e]),r};
|
package/dist/index118.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{useLayoutEffect as r}from"./
|
|
1
|
+
import*as e from"react";import{useLayoutEffect as r}from"./index110.js";function t(t){const[i,o]=e.useState(void 0);return r(()=>{if(t){o({width:t.offsetWidth,height:t.offsetHeight});const e=new ResizeObserver(e=>{if(!Array.isArray(e))return;if(!e.length)return;const r=e[0];let i,s;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,s=t.blockSize}else i=t.offsetWidth,s=t.offsetHeight;o({width:i,height:s})});return e.observe(t,{box:"border-box"}),()=>e.unobserve(t)}o(void 0)},[t]),i}export{t as useSize};
|
package/dist/index14.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("react-dom"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("react-dom"),r=require("./index55.cjs"),n=require("@adam-milo/icons"),s=require("./index57.cjs"),o=require("./index68.cjs"),i={name:"United States",dialCode:"+1",flag:"πΊπΈ",mask:s.defaultPhoneMask},l=t.forwardRef(({label:l,error:d,helperText:c,fullWidth:u=!0,value:p="",onChange:h,countryCode:y,initialCountryCode:m,onCountryChange:f,countries:g,enableFormatting:x=!0,onValidationChange:w,disabled:S,required:b,placeholder:$,id:v,"data-cy":C,"data-testid":k,className:j,onFocus:D,onBlur:N,...P},E)=>{const[L,M]=t.useState(!1),[q,I]=t.useState(!1),[W,F]=t.useState(0),[R,B]=t.useState({top:0,left:0,width:0}),[T,V]=t.useState(()=>y??m??"US"),z=y??T,A=t.useId(),K=v||A,U=`${K}-error`,H=`${K}-helper`,O=`${K}-listbox`,G=t.useRef(null),J=t.useRef(null),Q=t.useRef(null),X=t.useRef(null),Y=C||"phone-input",Z=k||"phone-input",_=g.find(e=>e.code===z)||g[0]||i,ee=_.mask??s.defaultPhoneMask,te=$??ee.placeholder,ae=l&&b&&!l.includes("*")?`${l}*`:l,re=_.dialCode.replace(/\D/g,"").length,ne=s.getPhoneDigits(p),se=p.startsWith("+")?ne.slice(re):ne,oe=x?s.formatWithMask(se,ee):se;t.useLayoutEffect(()=>{if(!L||!J.current)return;const e=()=>{if(J.current){const e=J.current.getBoundingClientRect();B({top:e.bottom+8,left:e.left,width:Math.max(e.width,320)})}};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[L]),t.useEffect(()=>{const e=e=>{const t=e.target,a=G.current?.contains(t),r=Q.current?.contains(t);a||r||M(!1)};return L&&document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[L]);const ie=t.useCallback(e=>{void 0===y&&V(e.code),f?.(e);const t=s.getPhoneDigits(p),a=_.dialCode.replace(/\D/g,"").length,r=p.startsWith("+")?t.slice(a):t;h?.(`${e.dialCode}${r}`),M(!1),setTimeout(()=>{const e=G.current?.querySelector("input");e?.focus()},0)},[y,f,h,p,_.dialCode]),le=t.useCallback(e=>{switch(e.key){case"ArrowDown":e.preventDefault(),F(e=>Math.min(e+1,g.length-1));break;case"ArrowUp":e.preventDefault(),F(e=>Math.max(e-1,0));break;case"Enter":case" ":e.preventDefault(),ie(g[W]);break;case"Escape":e.preventDefault(),M(!1),X.current?.focus();break;case"Tab":M(!1)}},[g,W,ie]),de=S?"disabled":d?"error":q||L?"focus":"idle";return e.jsxs("div",{ref:G,className:r.cn(o.wrapperStyles,u&&o.wrapperFullWidthStyles),"data-cy":`${Y}-wrapper`,"data-testid":`${Z}-wrapper`,children:[l&&e.jsx("label",{htmlFor:K,className:o.labelStyles,"data-cy":`${Y}-label`,"data-testid":`${Z}-label`,children:ae}),e.jsxs("div",{ref:J,className:r.cn(o.containerBaseStyles,u&&o.containerFullWidthStyles,"focus"===de&&o.containerFocusStyles,"error"===de&&o.containerErrorStyles,"disabled"===de&&o.containerDisabledStyles,"idle"===de&&o.containerIdleStyles),"data-state":de,"data-cy":`${Y}-container`,"data-testid":`${Z}-container`,children:[e.jsxs("button",{ref:X,type:"button",className:o.triggerStyles,onClick:()=>!S&&M(!L),onKeyDown:e=>{if("Enter"===e.key||" "===e.key||"ArrowDown"===e.key){e.preventDefault(),M(!0);const t=g.findIndex(e=>e.code===z);F(-1===t?0:t)}},disabled:S,"aria-haspopup":"listbox","aria-expanded":L,"aria-controls":O,"aria-label":`Select country. Current: ${_.name}`,"data-cy":`${Y}-country-trigger`,"data-testid":`${Z}-country-trigger`,children:[e.jsx("span",{className:o.flagStyles,"aria-hidden":"true","data-cy":`${Y}-flag`,"data-testid":`${Z}-flag`,children:_.flag}),e.jsx(n.Icon,{name:"ChevronDownIcon",size:"sm",color:q||L?"clickable":"text",decorative:!0,"data-cy":`${Y}-chevron`})]}),e.jsx("span",{className:o.dialCodeStyles,"data-cy":`${Y}-dial-code`,"data-testid":`${Z}-dial-code`,children:_.dialCode}),e.jsx("input",{ref:E,id:K,type:"tel",inputMode:"numeric",value:oe,onChange:e=>{const t=e.target.value;if(x){const e=s.getPhoneDigits(t).slice(0,ee.maxLength);h?.(`${_.dialCode}${e}`);const a=e.length===ee.maxLength;w?.(a)}else{const e=t.replace(/[^0-9]/g,"");h?.(`${_.dialCode}${e}`);const a=e.length===ee.maxLength;w?.(a)}},onFocus:e=>{I(!0),D?.(e)},onBlur:e=>{I(!1),N?.(e)},placeholder:te,disabled:S,required:b,className:r.cn(o.inputStyles,j),"aria-invalid":d?"true":"false","aria-required":b?"true":void 0,"aria-describedby":d?U:c?H:void 0,"data-cy":Y,"data-testid":Z,...P})]}),L&&a.createPortal(e.jsx("div",{ref:Q,id:O,role:"listbox","aria-label":"Select country",className:o.dropdownStyles,style:{top:R.top,left:R.left,width:R.width,minWidth:"20rem"},tabIndex:-1,onKeyDown:le,"data-cy":`${Y}-dropdown`,"data-testid":`${Z}-dropdown`,children:e.jsx("div",{className:o.dropdownViewportStyles,children:g.map((t,a)=>e.jsxs("div",{role:"option","aria-selected":t.code===z,className:r.cn(o.optionBaseStyles,a===W&&o.optionHighlightedStyles,t.code===z&&o.optionSelectedStyles),onClick:()=>ie(t),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),ie(t))},onMouseEnter:()=>F(a),tabIndex:a===W?0:-1,"data-cy":`${Y}-option-${t.code.toLowerCase()}`,"data-testid":`${Z}-option-${t.code.toLowerCase()}`,children:[e.jsx("span",{className:o.optionFlagStyles,"aria-hidden":"true",children:t.flag}),e.jsx("span",{className:o.optionNameStyles,children:t.name}),e.jsx("span",{className:o.optionDialCodeStyles,children:t.dialCode})]},t.code))})}),document.body),d&&e.jsx("span",{id:U,className:o.errorStyles,role:"alert","data-cy":`${Y}-error`,"data-testid":`${Z}-error`,children:d}),c&&!d&&e.jsx("span",{id:H,className:o.helperStyles,"data-cy":`${Y}-helper`,"data-testid":`${Z}-helper`,children:c})]})});l.displayName="PhoneInput",exports.defaultPhoneMask=s.defaultPhoneMask,exports.formatWithMask=s.formatWithMask,exports.getPhoneDigits=s.getPhoneDigits,exports.isValidPhoneLength=s.isValidPhoneLength,exports.PhoneInput=l;
|
package/dist/index14.js
CHANGED
|
@@ -2,11 +2,11 @@ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{forwardRef as a,useStat
|
|
|
2
2
|
return e("div",{ref:xe,className:s(B,U&&A),"data-cy":`${Ee}-wrapper`,"data-testid":`${Le}-wrapper`,children:[a&&/* @__PURE__ */t("label",{htmlFor:ve,className:y,"data-cy":`${Ee}-label`,"data-testid":`${Le}-label`,children:Se}),
|
|
3
3
|
/* @__PURE__ */e("div",{ref:Ne,className:s(z,U&&W,"focus"===Ke&&F,"error"===Ke&&q,"disabled"===Ke&&S,"idle"===Ke&&M),"data-state":Ke,"data-cy":`${Ee}-container`,"data-testid":`${Le}-container`,children:[
|
|
4
4
|
/* @__PURE__ */e("button",{ref:De,type:"button",className:$,onClick:()=>!X&&le(!ie),onKeyDown:e=>{if("Enter"===e.key||" "===e.key||"ArrowDown"===e.key){e.preventDefault(),le(!0);const t=J.findIndex(e=>e.code===$e);pe(-1===t?0:t)}},disabled:X,"aria-haspopup":"listbox","aria-expanded":ie,"aria-controls":Ce,"aria-label":`Select country. Current: ${je.name}`,"data-cy":`${Ee}-country-trigger`,"data-testid":`${Le}-country-trigger`,children:[
|
|
5
|
-
/* @__PURE__ */t("span",{className:w,"data-cy":`${Ee}-flag`,"data-testid":`${Le}-flag`,children:je.flag}),
|
|
5
|
+
/* @__PURE__ */t("span",{className:w,"aria-hidden":"true","data-cy":`${Ee}-flag`,"data-testid":`${Le}-flag`,children:je.flag}),
|
|
6
6
|
/* @__PURE__ */t(u,{name:"ChevronDownIcon",size:"sm",color:ce||ie?"clickable":"text",decorative:!0,"data-cy":`${Ee}-chevron`})]}),
|
|
7
7
|
/* @__PURE__ */t("span",{className:v,"data-cy":`${Ee}-dial-code`,"data-testid":`${Le}-dial-code`,children:je.dialCode}),
|
|
8
8
|
/* @__PURE__ */t("input",{ref:de,id:ve,type:"tel",inputMode:"numeric",value:ze,onChange:e=>{const t=e.target.value;if(O){const e=m(t).slice(0,Ie.maxLength);R?.(`${je.dialCode}${e}`);const a=e.length===Ie.maxLength;Q?.(a)}else{const e=t.replace(/[^0-9]/g,"");R?.(`${je.dialCode}${e}`);const a=e.length===Ie.maxLength;Q?.(a)}},onFocus:e=>{se(!0),re?.(e)},onBlur:e=>{se(!1),ne?.(e)},placeholder:Me,disabled:X,required:Y,className:s(I,ae),"aria-invalid":f?"true":"false","aria-required":Y?"true":void 0,"aria-describedby":f?be:T?ge:void 0,"data-cy":Ee,"data-testid":Le,...oe})]}),ie&&c(
|
|
9
9
|
/* @__PURE__ */t("div",{ref:ke,id:Ce,role:"listbox","aria-label":"Select country",className:b,style:{top:me.top,left:me.left,width:me.width,minWidth:"20rem"},tabIndex:-1,onKeyDown:Be,"data-cy":`${Ee}-dropdown`,"data-testid":`${Le}-dropdown`,children:/* @__PURE__ */t("div",{className:g,children:J.map((a,r)=>/* @__PURE__ */e("div",{role:"option","aria-selected":a.code===$e,className:s(E,r===ue&&D,a.code===$e&&k),onClick:()=>Ae(a),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Ae(a))},onMouseEnter:()=>pe(r),tabIndex:r===ue?0:-1,"data-cy":`${Ee}-option-${a.code.toLowerCase()}`,"data-testid":`${Le}-option-${a.code.toLowerCase()}`,children:[
|
|
10
|
-
/* @__PURE__ */t("span",{className:C,children:a.flag}),
|
|
10
|
+
/* @__PURE__ */t("span",{className:C,"aria-hidden":"true",children:a.flag}),
|
|
11
11
|
/* @__PURE__ */t("span",{className:x,children:a.name}),
|
|
12
12
|
/* @__PURE__ */t("span",{className:N,children:a.dialCode})]},a.code))})}),document.body),f&&/* @__PURE__ */t("span",{id:be,className:L,role:"alert","data-cy":`${Ee}-error`,"data-testid":`${Le}-error`,children:f}),T&&!f&&/* @__PURE__ */t("span",{id:ge,className:j,"data-cy":`${Ee}-helper`,"data-testid":`${Le}-helper`,children:T})]})});T.displayName="PhoneInput";export{T as PhoneInput,p as defaultPhoneMask,h as formatWithMask,m as getPhoneDigits,f as isValidPhoneLength};
|
package/dist/index15.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("./index55.cjs"),r=require("./index69.cjs"),l=t.forwardRef(({length:l=4,label:s,value:i="",onChange:n,onComplete:c,error:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("./index55.cjs"),r=require("./index69.cjs"),l=t.forwardRef(({length:l=4,label:s,value:i="",onChange:n,onComplete:c,error:d,helperText:o,disabled:u=!1,autoFocus:p=!1,fullWidth:f=!1,centered:y=!1,type:b="numeric",size:g="lg",required:h=!1,"data-cy":m,"data-testid":$},v)=>{const x=t.useId(),S=`${x}-label`,k=`${x}-error`,D=`${x}-helper`,j=m||"otp-input",C=$||"otp-input",w="sm"===g?r.digitSizeSmStyles:r.digitSizeLgStyles,A=t.useRef([]),[I,E]=t.useState(()=>i.split("").slice(0,l).concat(Array(l).fill("")).slice(0,l));t.useEffect(()=>{const e=i.split("").slice(0,l).concat(Array(l).fill("")).slice(0,l);E(e)},[i,l]);const N=t.useCallback(e=>"numeric"===b?/^\d$/.test(e):/^[a-zA-Z0-9]$/.test(e),[b]),q=t.useCallback(e=>{E(e);const t=e.join("");n?.(t),e.every(e=>""!==e)&&e.length===l&&c?.(t)},[n,c,l]),z=t.useCallback(e=>{const t=A.current[e];t&&(t.focus(),t.select())},[]),P=t.useCallback((e,t)=>{const a=t.target.value;if(1===a.length&&N(a)){const t=[...I];t[e]=a,q(t),e<l-1&&z(e+1)}else if(a.length>1){const t=a.split("").filter(N),r=[...I];t.forEach((t,a)=>{e+a<l&&(r[e+a]=t)}),q(r);const s=r.findIndex(e=>""===e);z(-1===s?l-1:s)}},[I,l,N,q,z]),T=t.useCallback((e,t)=>{switch(t.key){case"Backspace":if(t.preventDefault(),I[e]){const t=[...I];t[e]="",q(t)}else if(e>0){const t=[...I];t[e-1]="",q(t),z(e-1)}break;case"Delete":if(t.preventDefault(),I[e]){const t=[...I];t[e]="",q(t)}break;case"ArrowLeft":t.preventDefault(),e>0&&z(e-1);break;case"ArrowRight":t.preventDefault(),e<l-1&&z(e+1);break;case"Home":t.preventDefault(),z(0);break;case"End":t.preventDefault(),z(l-1);break;default:if(1===t.key.length&&N(t.key)){t.preventDefault();const a=[...I];a[e]=t.key,q(a),e<l-1&&z(e+1)}}},[I,l,N,q,z]),B=t.useCallback((e,t)=>{t.preventDefault();const a=t.clipboardData.getData("text").split("").filter(N);if(0===a.length)return;const r=[...I];a.forEach((t,a)=>{e+a<l&&(r[e+a]=t)}),q(r);const s=r.findIndex(e=>""===e);z(-1===s?l-1:s)},[I,l,N,q,z]),O=t.useCallback(e=>{e.target.select()},[]);return t.useImperativeHandle(v,()=>({focus:()=>{const e=I.findIndex(e=>""===e);z(-1===e?l-1:e)},clear:()=>{const e=Array(l).fill("");q(e),z(0)},getValue:()=>I.join("")}),[I,l,z,q]),t.useEffect(()=>{p&&!u&&z(0)},[p,u,z]),e.jsxs("div",{className:a.cn(r.wrapperStyles,f&&r.wrapperFullWidthStyles),"data-cy":`${j}-wrapper`,"data-testid":`${C}-wrapper`,children:[s&&e.jsx("label",{id:S,className:a.cn(r.labelBaseStyles,d&&r.labelErrorStyles,u&&r.labelDisabledStyles),"data-cy":`${j}-label`,"data-testid":`${C}-label`,children:s}),e.jsx("div",{className:a.cn(r.containerBaseStyles,y&&r.containerCenteredStyles),role:"group","aria-labelledby":s?S:void 0,"aria-label":s?void 0:"OTP Input","data-cy":`${j}-container`,"data-testid":`${C}-container`,children:Array.from({length:l},(t,s)=>e.jsx("input",{ref:e=>{A.current[s]=e},type:"text",inputMode:"numeric"===b?"numeric":"text",pattern:"numeric"===b?"[0-9]*":"[a-zA-Z0-9]*",maxLength:1,value:I[s]||"",onChange:e=>P(s,e),onKeyDown:e=>T(s,e),onPaste:e=>B(s,e),onFocus:O,disabled:u,required:h,"aria-label":`Digit ${s+1} of ${l}`,"aria-invalid":d?"true":"false","aria-describedby":d?k:o?D:void 0,className:a.cn(r.digitBaseStyles,w,d&&r.digitErrorStyles),"data-otp-digit":!0,"data-cy":`${j}-digit-${s}`,"data-testid":`${C}-digit-${s}`,autoComplete:"one-time-code"},s))}),d&&e.jsx("span",{id:k,className:r.errorStyles,role:"alert","data-cy":`${j}-error`,"data-testid":`${C}-error`,children:d}),o&&!d&&e.jsx("span",{id:D,className:r.helperStyles,"data-cy":`${j}-helper`,"data-testid":`${C}-helper`,children:o})]})});l.displayName="OTPInput",exports.OTPInput=l;
|
package/dist/index15.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{forwardRef as a,useId as r,useRef as
|
|
2
|
-
/* @__PURE__ */t("div",{className:o(v,P&&b),role:"group","aria-label":k
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{forwardRef as a,useId as r,useRef as i,useState as l,useEffect as n,useCallback as c,useImperativeHandle as s}from"react";import{cn as o}from"./index55.js";import{errorStyles as d,helperStyles as p,labelDisabledStyles as u,labelErrorStyles as f,labelBaseStyles as m,digitErrorStyles as h,digitSizeSmStyles as y,digitSizeLgStyles as g,digitBaseStyles as $,containerCenteredStyles as b,containerBaseStyles as v,wrapperFullWidthStyles as D,wrapperStyles as x}from"./index69.js";const k=a(({length:a=4,label:k,value:A="",onChange:N,onComplete:w,error:j,helperText:I,disabled:C=!1,autoFocus:z=!1,fullWidth:E=!1,centered:P=!1,type:T="numeric",size:q="lg",required:F=!1,"data-cy":L,"data-testid":O},Z)=>{const B=r(),H=`${B}-label`,K=`${B}-error`,M=`${B}-helper`,R=L||"otp-input",V=O||"otp-input",W="sm"===q?y:g,G=i([]),[J,Q]=l(()=>A.split("").slice(0,a).concat(Array(a).fill("")).slice(0,a));n(()=>{const e=A.split("").slice(0,a).concat(Array(a).fill("")).slice(0,a);Q(e)},[A,a]);const S=c(e=>"numeric"===T?/^\d$/.test(e):/^[a-zA-Z0-9]$/.test(e),[T]),U=c(e=>{Q(e);const t=e.join("");N?.(t),e.every(e=>""!==e)&&e.length===a&&w?.(t)},[N,w,a]),X=c(e=>{const t=G.current[e];t&&(t.focus(),t.select())},[]),Y=c((e,t)=>{const r=t.target.value;if(1===r.length&&S(r)){const t=[...J];t[e]=r,U(t),e<a-1&&X(e+1)}else if(r.length>1){const t=r.split("").filter(S),i=[...J];t.forEach((t,r)=>{e+r<a&&(i[e+r]=t)}),U(i);const l=i.findIndex(e=>""===e);X(-1===l?a-1:l)}},[J,a,S,U,X]),_=c((e,t)=>{switch(t.key){case"Backspace":if(t.preventDefault(),J[e]){const t=[...J];t[e]="",U(t)}else if(e>0){const t=[...J];t[e-1]="",U(t),X(e-1)}break;case"Delete":if(t.preventDefault(),J[e]){const t=[...J];t[e]="",U(t)}break;case"ArrowLeft":t.preventDefault(),e>0&&X(e-1);break;case"ArrowRight":t.preventDefault(),e<a-1&&X(e+1);break;case"Home":t.preventDefault(),X(0);break;case"End":t.preventDefault(),X(a-1);break;default:if(1===t.key.length&&S(t.key)){t.preventDefault();const r=[...J];r[e]=t.key,U(r),e<a-1&&X(e+1)}}},[J,a,S,U,X]),ee=c((e,t)=>{t.preventDefault();const r=t.clipboardData.getData("text").split("").filter(S);if(0===r.length)return;const i=[...J];r.forEach((t,r)=>{e+r<a&&(i[e+r]=t)}),U(i);const l=i.findIndex(e=>""===e);X(-1===l?a-1:l)},[J,a,S,U,X]),te=c(e=>{e.target.select()},[]);return s(Z,()=>({focus:()=>{const e=J.findIndex(e=>""===e);X(-1===e?a-1:e)},clear:()=>{const e=Array(a).fill("");U(e),X(0)},getValue:()=>J.join("")}),[J,a,X,U]),n(()=>{z&&!C&&X(0)},[z,C,X]),/* @__PURE__ */e("div",{className:o(x,E&&D),"data-cy":`${R}-wrapper`,"data-testid":`${V}-wrapper`,children:[k&&/* @__PURE__ */t("label",{id:H,className:o(m,j&&f,C&&u),"data-cy":`${R}-label`,"data-testid":`${V}-label`,children:k}),
|
|
2
|
+
/* @__PURE__ */t("div",{className:o(v,P&&b),role:"group","aria-labelledby":k?H:void 0,"aria-label":k?void 0:"OTP Input","data-cy":`${R}-container`,"data-testid":`${V}-container`,children:Array.from({length:a},(e,r)=>/* @__PURE__ */t("input",{ref:e=>{G.current[r]=e},type:"text",inputMode:"numeric"===T?"numeric":"text",pattern:"numeric"===T?"[0-9]*":"[a-zA-Z0-9]*",maxLength:1,value:J[r]||"",onChange:e=>Y(r,e),onKeyDown:e=>_(r,e),onPaste:e=>ee(r,e),onFocus:te,disabled:C,required:F,"aria-label":`Digit ${r+1} of ${a}`,"aria-invalid":j?"true":"false","aria-describedby":j?K:I?M:void 0,className:o($,W,j&&h),"data-otp-digit":!0,"data-cy":`${R}-digit-${r}`,"data-testid":`${V}-digit-${r}`,autoComplete:"one-time-code"},r))}),j&&/* @__PURE__ */t("span",{id:K,className:d,role:"alert","data-cy":`${R}-error`,"data-testid":`${V}-error`,children:j}),I&&!j&&/* @__PURE__ */t("span",{id:M,className:p,"data-cy":`${R}-helper`,"data-testid":`${V}-helper`,children:I})]})});k.displayName="OTPInput";export{k as OTPInput};
|