@adam-milo/ui 1.0.124 → 1.0.126

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.
Files changed (51) hide show
  1. package/dist/index107.cjs +1 -1
  2. package/dist/index107.js +5 -1
  3. package/dist/index108.cjs +1 -1
  4. package/dist/index108.js +1 -1
  5. package/dist/index109.cjs +1 -1
  6. package/dist/index109.js +1 -3
  7. package/dist/index110.cjs +1 -1
  8. package/dist/index110.js +3 -2
  9. package/dist/index111.cjs +1 -1
  10. package/dist/index111.js +2 -1
  11. package/dist/index112.cjs +1 -1
  12. package/dist/index112.js +1 -1
  13. package/dist/index113.cjs +1 -1
  14. package/dist/index113.js +1 -1
  15. package/dist/index114.cjs +1 -1
  16. package/dist/index114.js +1 -1
  17. package/dist/index115.cjs +1 -1
  18. package/dist/index115.js +1 -1
  19. package/dist/index116.cjs +1 -1
  20. package/dist/index116.js +1 -1
  21. package/dist/index117.cjs +1 -1
  22. package/dist/index117.js +1 -1
  23. package/dist/index118.cjs +1 -1
  24. package/dist/index118.js +1 -1
  25. package/dist/index119.cjs +1 -1
  26. package/dist/index119.js +1 -5
  27. package/dist/index120.cjs +1 -1
  28. package/dist/index120.js +1 -1
  29. package/dist/index121.cjs +1 -1
  30. package/dist/index121.js +1 -1
  31. package/dist/index122.cjs +1 -1
  32. package/dist/index122.js +1 -1
  33. package/dist/index123.cjs +1 -1
  34. package/dist/index123.js +1 -1
  35. package/dist/index125.cjs +1 -1
  36. package/dist/index125.js +1 -1
  37. package/dist/index126.cjs +1 -1
  38. package/dist/index126.js +1 -1
  39. package/dist/index44.cjs +1 -1
  40. package/dist/index44.js +10 -10
  41. package/dist/index75.cjs +1 -1
  42. package/dist/index75.js +1 -1
  43. package/dist/index81.cjs +1 -1
  44. package/dist/index81.js +1 -1
  45. package/dist/index85.cjs +1 -1
  46. package/dist/index85.js +1 -1
  47. package/dist/src/components/overlays/dialog/Dialog.component.d.ts.map +1 -1
  48. package/dist/src/components/overlays/dialog/Dialog.types.d.ts +1 -0
  49. package/dist/src/components/overlays/dialog/Dialog.types.d.ts.map +1 -1
  50. package/dist/styles.css +1 -1
  51. package/package.json +1 -1
package/dist/index44.js CHANGED
@@ -1,10 +1,10 @@
1
- import{jsx as a,jsxs as t}from"react/jsx-runtime";import{forwardRef as e}from"react";import*as d from"@radix-ui/react-dialog";import{cn as i}from"./index58.js";import{closeButtonStyles as s,iconVariantColor as o,iconRootStyles as l,overlayBgStyles as r,overlayRootStyles as c,contentTopOffsetMobileStyles as n,contentVariantVerifyStyles as m,contentStyles as y,contentWrapperTopOffsetMobileStyles as N,contentWrapperVerifyMobileStyles as g,contentWrapperStyles as p,headerCenteredStyles as f,headerStyles as u,footerStyles as v,titleStyles as h,descriptionStyles as b}from"./index93.js";import{Icon as C}from"@adam-milo/icons";const D=d.Root,x=d.Trigger,O=d.Portal,j=d.Close,T=e(({className:t,"data-cy":e,"data-testid":o,...l},r)=>{const c=e||"dialog-close-button",n=o||"dialog-close-button";/* @__PURE__ */
2
- return a(d.Close,{ref:r,className:i(s,t),"data-cy":c,"data-testid":n,"aria-label":"Close dialog",...l,children:/* @__PURE__ */a(C,{name:"Cross2Icon",size:"sm",decorative:!0})})});T.displayName="DialogCloseButton";const I=({children:t,variant:e="default",className:d,"data-cy":s,"data-testid":r,...c})=>{const n=s||"dialog-icon",m=r||"dialog-icon";/* @__PURE__ */
3
- return a("div",{className:i(l,o[e],d),"data-cy":n,"data-testid":m,"aria-hidden":"true",...c,children:t})};I.displayName="DialogIcon";const M=e(({className:t,variant:e="default","data-cy":s,"data-testid":o,...l},n)=>{const m=s||"dialog-overlay",y=o||"dialog-overlay";/* @__PURE__ */
4
- return a(d.Overlay,{ref:n,className:i(c,r[e],t),"data-cy":m,"data-testid":y,...l})});M.displayName=d.Overlay.displayName;const P=e(({className:e,children:s,contentVariant:o="default",overlayVariant:l="default",fullWidthOnMobile:r=!1,topOffsetOnMobile:c=!1,contentPadding:f,style:u,"aria-describedby":v,"data-cy":h,"data-testid":b,...C},D)=>{const x=h||"dialog-content",j=b||"dialog-content",T=r||"verify"===o,I="verify"===o||r&&c;/* @__PURE__ */
5
- return t(O,{children:[!I&&/* @__PURE__ */a(M,{variant:l}),
6
- /* @__PURE__ */a("div",{className:i(p,T&&g,I&&N),...I&&{"data-dialog-top-offset-mobile":""},children:/* @__PURE__ */a(d.Content,{ref:D,className:i(y,"verify"===o&&m,I&&n,e),style:f||u?{...u,...f&&{padding:f}}:void 0,"aria-describedby":v??void 0,"data-cy":x,"data-testid":j,"data-content-variant":o,...C,children:s})})]})});P.displayName=d.Content.displayName;const V=({centered:t=!1,className:e,"data-cy":d,"data-testid":s,...o})=>{const l=d||"dialog-header",r=s||"dialog-header";/* @__PURE__ */
7
- return a("div",{className:i(u,t&&f,e),"data-cy":l,"data-testid":r,...o})};V.displayName="DialogHeader";const z=({className:t,"data-cy":e,"data-testid":d,...s})=>{const o=e||"dialog-footer",l=d||"dialog-footer";/* @__PURE__ */
8
- return a("div",{className:i(v,t),"data-cy":o,"data-testid":l,...s})};z.displayName="DialogFooter";const B=e(({className:t,"data-cy":e,"data-testid":s,...o},l)=>{const r=e||"dialog-title",c=s||"dialog-title";/* @__PURE__ */
9
- return a(d.Title,{ref:l,className:i(h,t),"data-cy":r,"data-testid":c,...o})});B.displayName=d.Title.displayName;const F=e(({className:t,"data-cy":e,"data-testid":s,...o},l)=>{const r=e||"dialog-description",c=s||"dialog-description";/* @__PURE__ */
10
- return a(d.Description,{ref:l,className:i(b,t),"data-cy":r,"data-testid":c,...o})});F.displayName=d.Description.displayName;export{D as Dialog,j as DialogClose,T as DialogCloseButton,P as DialogContent,F as DialogDescription,z as DialogFooter,V as DialogHeader,I as DialogIcon,M as DialogOverlay,O as DialogPortal,B as DialogTitle,x as DialogTrigger};
1
+ import{jsx as a,jsxs as t}from"react/jsx-runtime";import{forwardRef as e}from"react";import*as d from"@radix-ui/react-dialog";import{cn as i}from"./index58.js";import{closeButtonStyles as s,iconVariantColor as o,iconRootStyles as l,overlayBgStyles as r,overlayRootStyles as c,contentTopOffsetMobileStyles as n,contentVariantVerifyStyles as m,contentStyles as y,contentWrapperTopOffsetMobileStyles as N,contentWrapperVerifyMobileStyles as p,contentWrapperStyles as f,headerCenteredStyles as g,headerStyles as u,footerStyles as v,titleStyles as b,descriptionStyles as h}from"./index93.js";import{Icon as D}from"@adam-milo/icons";const C=d.Root,O=d.Trigger,x=d.Portal,j=d.Close,I=e(({className:t,"data-cy":e,"data-testid":o,...l},r)=>{const c=e||"dialog-close-button",n=o||"dialog-close-button";/* @__PURE__ */
2
+ return a(d.Close,{ref:r,className:i(s,t),"data-cy":c,"data-testid":n,"aria-label":"Close dialog",...l,children:/* @__PURE__ */a(D,{name:"Cross2Icon",size:"sm",decorative:!0})})});I.displayName="DialogCloseButton";const P=({children:t,variant:e="default",className:d,"data-cy":s,"data-testid":r,...c})=>{const n=s||"dialog-icon",m=r||"dialog-icon";/* @__PURE__ */
3
+ return a("div",{className:i(l,o[e],d),"data-cy":n,"data-testid":m,"aria-hidden":"true",...c,children:t})};P.displayName="DialogIcon";const T=e(({className:t,variant:e="default","data-cy":s,"data-testid":o,...l},n)=>{const m=s||"dialog-overlay",y=o||"dialog-overlay";/* @__PURE__ */
4
+ return a(d.Overlay,{ref:n,className:i(c,r[e],t),"data-cy":m,"data-testid":y,...l})});T.displayName=d.Overlay.displayName;const M=e(({className:e,children:s,contentVariant:o="default",overlayVariant:l="default",fullWidthOnMobile:r=!1,topOffsetOnMobile:c=!1,contentPadding:g,disableOutsideClose:u=!1,style:v,"aria-describedby":b,"data-cy":h,"data-testid":D,...C},O)=>{const j=h||"dialog-content",I=D||"dialog-content",P=r||"verify"===o,M="verify"===o||r&&c,V=u?{onPointerDownOutside:a=>a.preventDefault(),onInteractOutside:a=>a.preventDefault()}:{};/* @__PURE__ */
5
+ return t(x,{children:[!M&&/* @__PURE__ */a(T,{variant:l}),
6
+ /* @__PURE__ */a("div",{className:i(f,P&&p,M&&N),...M&&{"data-dialog-top-offset-mobile":""},children:/* @__PURE__ */a(d.Content,{ref:O,className:i(y,"verify"===o&&m,M&&n,e),style:g||v?{...v,...g&&{padding:g}}:void 0,"aria-describedby":b??void 0,"data-cy":j,"data-testid":I,"data-content-variant":o,...V,...C,children:s})})]})});M.displayName=d.Content.displayName;const V=({centered:t=!1,className:e,"data-cy":d,"data-testid":s,...o})=>{const l=d||"dialog-header",r=s||"dialog-header";/* @__PURE__ */
7
+ return a("div",{className:i(u,t&&g,e),"data-cy":l,"data-testid":r,...o})};V.displayName="DialogHeader";const w=({className:t,"data-cy":e,"data-testid":d,...s})=>{const o=e||"dialog-footer",l=d||"dialog-footer";/* @__PURE__ */
8
+ return a("div",{className:i(v,t),"data-cy":o,"data-testid":l,...s})};w.displayName="DialogFooter";const z=e(({className:t,"data-cy":e,"data-testid":s,...o},l)=>{const r=e||"dialog-title",c=s||"dialog-title";/* @__PURE__ */
9
+ return a(d.Title,{ref:l,className:i(b,t),"data-cy":r,"data-testid":c,...o})});z.displayName=d.Title.displayName;const B=e(({className:t,"data-cy":e,"data-testid":s,...o},l)=>{const r=e||"dialog-description",c=s||"dialog-description";/* @__PURE__ */
10
+ return a(d.Description,{ref:l,className:i(h,t),"data-cy":r,"data-testid":c,...o})});B.displayName=d.Description.displayName;export{C as Dialog,j as DialogClose,I as DialogCloseButton,M as DialogContent,B as DialogDescription,w as DialogFooter,V as DialogHeader,P as DialogIcon,T as DialogOverlay,x as DialogPortal,z as DialogTitle,O as DialogTrigger};
package/dist/index75.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),r=require("./index119.cjs");exports.FormTooltip=function({content:n,triggerClassName:o,contentClassName:s,dataCyPrefix:c,dataTestIdPrefix:i}){const[a,l]=t.useState(!1),u=t.useRef(!1),d=t.useRef(!1),x=t.useRef(null),f=t.useRef(null),m=t.useCallback(e=>{d.current||!e&&u.current||l(e)},[]),p=t.useCallback(()=>{d.current=!0,x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{d.current=!1},300)},[]),g=t.useCallback(()=>{l(e=>{const t=!e;return u.current=t,t})},[]);return t.useEffect(()=>{if(!a||!u.current)return;const e=e=>{f.current?.contains(e.target)||(u.current=!1,d.current=!1,l(!1))};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[a]),t.useEffect(()=>()=>{x.current&&clearTimeout(x.current)},[]),e.jsx(r.Provider,{delayDuration:200,children:e.jsxs(r.Root,{open:a,onOpenChange:m,children:[e.jsx(r.Trigger,{asChild:!0,children:e.jsx("button",{ref:f,type:"button",className:o,"aria-label":"More information",onPointerDown:p,onClick:g,"data-cy":`${c}-tooltip-trigger`,"data-testid":`${i}-tooltip-trigger`,children:e.jsxs("svg",{className:"w-3 h-3",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsx("circle",{cx:"6",cy:"6",r:"5.5",stroke:"currentColor",strokeWidth:"1",fill:"none"}),e.jsx("path",{d:"M6 5.5V8.5",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round"}),e.jsx("circle",{cx:"6",cy:"4",r:"0.5",fill:"currentColor"})]})})}),e.jsx(r.Portal,{children:e.jsxs(r.Content,{className:s,side:"top",sideOffset:4,"data-cy":`${c}-tooltip-content`,"data-testid":`${i}-tooltip-content`,children:[n,e.jsx(r.Arrow,{className:"fill-text"})]})})]})})};
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),r=require("./index107.cjs");exports.FormTooltip=function({content:n,triggerClassName:o,contentClassName:s,dataCyPrefix:c,dataTestIdPrefix:i}){const[a,l]=t.useState(!1),u=t.useRef(!1),d=t.useRef(!1),x=t.useRef(null),f=t.useRef(null),m=t.useCallback(e=>{d.current||!e&&u.current||l(e)},[]),p=t.useCallback(()=>{d.current=!0,x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{d.current=!1},300)},[]),g=t.useCallback(()=>{l(e=>{const t=!e;return u.current=t,t})},[]);return t.useEffect(()=>{if(!a||!u.current)return;const e=e=>{f.current?.contains(e.target)||(u.current=!1,d.current=!1,l(!1))};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[a]),t.useEffect(()=>()=>{x.current&&clearTimeout(x.current)},[]),e.jsx(r.Provider,{delayDuration:200,children:e.jsxs(r.Root,{open:a,onOpenChange:m,children:[e.jsx(r.Trigger,{asChild:!0,children:e.jsx("button",{ref:f,type:"button",className:o,"aria-label":"More information",onPointerDown:p,onClick:g,"data-cy":`${c}-tooltip-trigger`,"data-testid":`${i}-tooltip-trigger`,children:e.jsxs("svg",{className:"w-3 h-3",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsx("circle",{cx:"6",cy:"6",r:"5.5",stroke:"currentColor",strokeWidth:"1",fill:"none"}),e.jsx("path",{d:"M6 5.5V8.5",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round"}),e.jsx("circle",{cx:"6",cy:"4",r:"0.5",fill:"currentColor"})]})})}),e.jsx(r.Portal,{children:e.jsxs(r.Content,{className:s,side:"top",sideOffset:4,"data-cy":`${c}-tooltip-content`,"data-testid":`${i}-tooltip-content`,children:[n,e.jsx(r.Arrow,{className:"fill-text"})]})})]})})};
package/dist/index75.js CHANGED
@@ -1,4 +1,4 @@
1
- import{jsx as t,jsxs as r}from"react/jsx-runtime";import{useState as e,useRef as n,useCallback as o,useEffect as c}from"react";import{Provider as i,Root as a,Trigger as l,Portal as s,Content as u,Arrow as d}from"./index119.js";function m({content:m,triggerClassName:p,contentClassName:f,dataCyPrefix:h,dataTestIdPrefix:g}){const[w,x]=e(!1),C=n(!1),y=n(!1),k=n(null),v=n(null),N=o(t=>{y.current||!t&&C.current||x(t)},[]),T=o(()=>{y.current=!0,k.current&&clearTimeout(k.current),k.current=setTimeout(()=>{y.current=!1},300)},[]),$=o(()=>{x(t=>{const r=!t;return C.current=r,r})},[]);return c(()=>{if(!w||!C.current)return;const t=t=>{v.current?.contains(t.target)||(C.current=!1,y.current=!1,x(!1))};return document.addEventListener("pointerdown",t),()=>document.removeEventListener("pointerdown",t)},[w]),c(()=>()=>{k.current&&clearTimeout(k.current)},[]),/* @__PURE__ */t(i,{delayDuration:200,children:/* @__PURE__ */r(a,{open:w,onOpenChange:N,children:[
1
+ import{jsx as t,jsxs as r}from"react/jsx-runtime";import{useState as e,useRef as n,useCallback as o,useEffect as c}from"react";import{Provider as i,Root as a,Trigger as l,Portal as s,Content as u,Arrow as d}from"./index107.js";function m({content:m,triggerClassName:p,contentClassName:f,dataCyPrefix:h,dataTestIdPrefix:g}){const[w,x]=e(!1),C=n(!1),y=n(!1),k=n(null),v=n(null),N=o(t=>{y.current||!t&&C.current||x(t)},[]),T=o(()=>{y.current=!0,k.current&&clearTimeout(k.current),k.current=setTimeout(()=>{y.current=!1},300)},[]),$=o(()=>{x(t=>{const r=!t;return C.current=r,r})},[]);return c(()=>{if(!w||!C.current)return;const t=t=>{v.current?.contains(t.target)||(C.current=!1,y.current=!1,x(!1))};return document.addEventListener("pointerdown",t),()=>document.removeEventListener("pointerdown",t)},[w]),c(()=>()=>{k.current&&clearTimeout(k.current)},[]),/* @__PURE__ */t(i,{delayDuration:200,children:/* @__PURE__ */r(a,{open:w,onOpenChange:N,children:[
2
2
  /* @__PURE__ */t(l,{asChild:!0,children:/* @__PURE__ */t("button",{ref:v,type:"button",className:p,"aria-label":"More information",onPointerDown:T,onClick:$,"data-cy":`${h}-tooltip-trigger`,"data-testid":`${g}-tooltip-trigger`,children:/* @__PURE__ */r("svg",{className:"w-3 h-3",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[
3
3
  /* @__PURE__ */t("circle",{cx:"6",cy:"6",r:"5.5",stroke:"currentColor",strokeWidth:"1",fill:"none"}),
4
4
  /* @__PURE__ */t("path",{d:"M6 5.5V8.5",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round"}),
package/dist/index81.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=["flex items-center gap-0 border-b border-transparent h-full","max-sm:w-full max-sm:overflow-x-auto max-sm:[scrollbar-width:none] max-sm:[&::-webkit-scrollbar]:hidden"].join(" "),t=["inline-flex items-center p-0 gap-0 rounded-lg bg-[rgba(255,255,255,0.43)] border border-white","max-sm:w-full max-sm:justify-start max-sm:overflow-x-auto max-sm:[scrollbar-width:none] max-sm:[&::-webkit-scrollbar]:hidden"].join(" "),r=["inline-flex items-center p-1 gap-1 rounded-[0.75rem] bg-[var(--color-bg-secondary,#F3F3F5)] border border-[var(--Grey-Grey-01,#F7F9FB)]","w-full justify-start overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"].join(" "),o=["flex items-center justify-center whitespace-nowrap h-[5.3125rem] py-3 px-4 gap-2.5 min-[1320px]:w-[14.79rem]","text-[1.375rem] font-bold tracking-[0.0825rem] text-[#8C8C9C]","border-0 bg-transparent cursor-pointer select-none -mb-px","[border-bottom-width:4px] [border-bottom-style:solid] [border-bottom-color:transparent]","transition-[color,transform] duration-300 ease-in-out","tabs-trigger-focus focus-visible:z-10","disabled:cursor-not-allowed disabled:opacity-50 disabled:pointer-events-none","data-[state=active]:text-[var(--color-clickable)] data-[state=active]:[border-bottom-color:transparent]","hover:text-[var(--color-clickable)]"].join(" "),a=["inline-flex items-center justify-center whitespace-nowrap w-[9.78rem] h-[3.375rem] rounded-lg text-[1.25rem] font-semibold","border-none bg-transparent text-[var(--color-clickable)] cursor-pointer select-none","transition-[background-color,color,box-shadow,transform] duration-500 ease-in-out","tabs-trigger-focus focus-visible:z-10","disabled:cursor-not-allowed disabled:opacity-50 disabled:pointer-events-none","data-[state=active]:bg-[rgba(255,255,255,0.85)] data-[state=active]:text-[var(--color-clickable)] data-[state=active]:shadow-[0_4px_16px_0_rgba(0,0,0,0.05)] data-[state=active]:scale-[1.02]","hover:bg-[rgba(255,255,255,0.5)] [&:hover]:data-[state=active]:bg-[rgba(255,255,255,0.85)]"].join(" "),s=["inline-flex flex-1 items-center justify-center whitespace-nowrap rounded-[0.5rem] py-2 px-3 text-sm font-semibold","border-none bg-transparent text-[var(--color-clickable)] cursor-pointer select-none","transition-[background-color,color,box-shadow,transform] duration-300 ease-in-out","tabs-trigger-focus focus-visible:z-10","disabled:cursor-not-allowed disabled:opacity-50 disabled:pointer-events-none","data-[state=active]:bg-white data-[state=active]:text-[var(--color-clickable)] data-[state=active]:shadow-[0_4px_16px_0_rgba(0,0,0,0.05)] data-[state=active]:scale-[1.02]","hover:bg-[rgba(255,255,255,0.7)] [&:hover]:data-[state=active]:bg-white"].join(" ");exports.contentStyles="mt-2",exports.listFullWidthStyles="w-full [&>button]:flex-1 [&>button]:min-w-0 [&>button]:basis-0",exports.listMobileStyles=r,exports.listStyles=e,exports.listTableStyles=t,exports.triggerMobileStyles=s,exports.triggerStyles=o,exports.triggerTableStyles=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=["flex items-center gap-0 border-b border-transparent h-full","max-sm:w-full max-sm:overflow-x-auto max-sm:[scrollbar-width:none] max-sm:[&::-webkit-scrollbar]:hidden"].join(" "),t=["inline-flex items-center p-0 gap-0 rounded-lg bg-[rgba(255,255,255,0.43)] border border-white","max-sm:w-full max-sm:justify-start max-sm:overflow-x-auto max-sm:[scrollbar-width:none] max-sm:[&::-webkit-scrollbar]:hidden"].join(" "),r=["inline-flex items-center p-1 gap-1 rounded-[0.75rem] bg-[var(--color-bg-secondary,#F3F3F5)] border border-[var(--Grey-Grey-01,#F7F9FB)]","w-full justify-start overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"].join(" "),o=["flex items-center justify-center whitespace-nowrap h-[5.3125rem] py-3 px-4 gap-2.5 min-[1320px]:w-[14.79rem]","text-[1.375rem] font-bold tracking-[0.0825rem] text-[#8C8C9C]","border-0 bg-transparent cursor-pointer select-none -mb-px","[border-bottom-width:4px] [border-bottom-style:solid] [border-bottom-color:transparent]","transition-[color,transform] duration-300 ease-in-out","tabs-trigger-focus focus-visible:z-10","disabled:cursor-not-allowed disabled:opacity-50 disabled:pointer-events-none","data-[state=active]:text-[var(--color-clickable)] data-[state=active]:[border-bottom-color:transparent]","hover:text-[var(--color-clickable)]"].join(" "),a=["inline-flex items-center justify-center whitespace-nowrap w-[9.78rem] h-[3.375rem] rounded-lg text-[1.25rem] font-semibold","border-none bg-transparent text-[var(--color-clickable)] cursor-pointer select-none","transition-[background-color,color,box-shadow,transform] duration-500 ease-in-out","tabs-trigger-focus focus-visible:z-10","disabled:cursor-not-allowed disabled:opacity-50 disabled:pointer-events-none","data-[state=active]:bg-[rgba(255,255,255,0.85)] data-[state=active]:text-[var(--color-clickable)] data-[state=active]:shadow-[0_4px_16px_0_rgba(0,0,0,0.05)]","hover:bg-[rgba(255,255,255,0.5)] [&:hover]:data-[state=active]:bg-[rgba(255,255,255,0.85)]"].join(" "),s=["inline-flex flex-1 items-center justify-center whitespace-nowrap rounded-[0.5rem] py-2 px-3 text-sm font-semibold","border-none bg-transparent text-[var(--color-clickable)] cursor-pointer select-none","transition-[background-color,color,box-shadow,transform] duration-300 ease-in-out","tabs-trigger-focus focus-visible:z-10","disabled:cursor-not-allowed disabled:opacity-50 disabled:pointer-events-none","data-[state=active]:bg-white data-[state=active]:text-[var(--color-clickable)] data-[state=active]:shadow-[0_4px_16px_0_rgba(0,0,0,0.05)]","hover:bg-[rgba(255,255,255,0.7)] [&:hover]:data-[state=active]:bg-white"].join(" ");exports.contentStyles="mt-2",exports.listFullWidthStyles="w-full [&>button]:flex-1 [&>button]:min-w-0 [&>button]:basis-0",exports.listMobileStyles=r,exports.listStyles=e,exports.listTableStyles=t,exports.triggerMobileStyles=s,exports.triggerStyles=o,exports.triggerTableStyles=a;
package/dist/index81.js CHANGED
@@ -1 +1 @@
1
- const e=["flex items-center gap-0 border-b border-transparent h-full","max-sm:w-full max-sm:overflow-x-auto max-sm:[scrollbar-width:none] max-sm:[&::-webkit-scrollbar]:hidden"].join(" "),t=["inline-flex items-center p-0 gap-0 rounded-lg bg-[rgba(255,255,255,0.43)] border border-white","max-sm:w-full max-sm:justify-start max-sm:overflow-x-auto max-sm:[scrollbar-width:none] max-sm:[&::-webkit-scrollbar]:hidden"].join(" "),r=["inline-flex items-center p-1 gap-1 rounded-[0.75rem] bg-[var(--color-bg-secondary,#F3F3F5)] border border-[var(--Grey-Grey-01,#F7F9FB)]","w-full justify-start overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"].join(" "),o="w-full [&>button]:flex-1 [&>button]:min-w-0 [&>button]:basis-0",a=["flex items-center justify-center whitespace-nowrap h-[5.3125rem] py-3 px-4 gap-2.5 min-[1320px]:w-[14.79rem]","text-[1.375rem] font-bold tracking-[0.0825rem] text-[#8C8C9C]","border-0 bg-transparent cursor-pointer select-none -mb-px","[border-bottom-width:4px] [border-bottom-style:solid] [border-bottom-color:transparent]","transition-[color,transform] duration-300 ease-in-out","tabs-trigger-focus focus-visible:z-10","disabled:cursor-not-allowed disabled:opacity-50 disabled:pointer-events-none","data-[state=active]:text-[var(--color-clickable)] data-[state=active]:[border-bottom-color:transparent]","hover:text-[var(--color-clickable)]"].join(" "),n=["inline-flex items-center justify-center whitespace-nowrap w-[9.78rem] h-[3.375rem] rounded-lg text-[1.25rem] font-semibold","border-none bg-transparent text-[var(--color-clickable)] cursor-pointer select-none","transition-[background-color,color,box-shadow,transform] duration-500 ease-in-out","tabs-trigger-focus focus-visible:z-10","disabled:cursor-not-allowed disabled:opacity-50 disabled:pointer-events-none","data-[state=active]:bg-[rgba(255,255,255,0.85)] data-[state=active]:text-[var(--color-clickable)] data-[state=active]:shadow-[0_4px_16px_0_rgba(0,0,0,0.05)] data-[state=active]:scale-[1.02]","hover:bg-[rgba(255,255,255,0.5)] [&:hover]:data-[state=active]:bg-[rgba(255,255,255,0.85)]"].join(" "),s=["inline-flex flex-1 items-center justify-center whitespace-nowrap rounded-[0.5rem] py-2 px-3 text-sm font-semibold","border-none bg-transparent text-[var(--color-clickable)] cursor-pointer select-none","transition-[background-color,color,box-shadow,transform] duration-300 ease-in-out","tabs-trigger-focus focus-visible:z-10","disabled:cursor-not-allowed disabled:opacity-50 disabled:pointer-events-none","data-[state=active]:bg-white data-[state=active]:text-[var(--color-clickable)] data-[state=active]:shadow-[0_4px_16px_0_rgba(0,0,0,0.05)] data-[state=active]:scale-[1.02]","hover:bg-[rgba(255,255,255,0.7)] [&:hover]:data-[state=active]:bg-white"].join(" "),i="mt-2";export{i as contentStyles,o as listFullWidthStyles,r as listMobileStyles,e as listStyles,t as listTableStyles,s as triggerMobileStyles,a as triggerStyles,n as triggerTableStyles};
1
+ const e=["flex items-center gap-0 border-b border-transparent h-full","max-sm:w-full max-sm:overflow-x-auto max-sm:[scrollbar-width:none] max-sm:[&::-webkit-scrollbar]:hidden"].join(" "),t=["inline-flex items-center p-0 gap-0 rounded-lg bg-[rgba(255,255,255,0.43)] border border-white","max-sm:w-full max-sm:justify-start max-sm:overflow-x-auto max-sm:[scrollbar-width:none] max-sm:[&::-webkit-scrollbar]:hidden"].join(" "),r=["inline-flex items-center p-1 gap-1 rounded-[0.75rem] bg-[var(--color-bg-secondary,#F3F3F5)] border border-[var(--Grey-Grey-01,#F7F9FB)]","w-full justify-start overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"].join(" "),o="w-full [&>button]:flex-1 [&>button]:min-w-0 [&>button]:basis-0",a=["flex items-center justify-center whitespace-nowrap h-[5.3125rem] py-3 px-4 gap-2.5 min-[1320px]:w-[14.79rem]","text-[1.375rem] font-bold tracking-[0.0825rem] text-[#8C8C9C]","border-0 bg-transparent cursor-pointer select-none -mb-px","[border-bottom-width:4px] [border-bottom-style:solid] [border-bottom-color:transparent]","transition-[color,transform] duration-300 ease-in-out","tabs-trigger-focus focus-visible:z-10","disabled:cursor-not-allowed disabled:opacity-50 disabled:pointer-events-none","data-[state=active]:text-[var(--color-clickable)] data-[state=active]:[border-bottom-color:transparent]","hover:text-[var(--color-clickable)]"].join(" "),n=["inline-flex items-center justify-center whitespace-nowrap w-[9.78rem] h-[3.375rem] rounded-lg text-[1.25rem] font-semibold","border-none bg-transparent text-[var(--color-clickable)] cursor-pointer select-none","transition-[background-color,color,box-shadow,transform] duration-500 ease-in-out","tabs-trigger-focus focus-visible:z-10","disabled:cursor-not-allowed disabled:opacity-50 disabled:pointer-events-none","data-[state=active]:bg-[rgba(255,255,255,0.85)] data-[state=active]:text-[var(--color-clickable)] data-[state=active]:shadow-[0_4px_16px_0_rgba(0,0,0,0.05)]","hover:bg-[rgba(255,255,255,0.5)] [&:hover]:data-[state=active]:bg-[rgba(255,255,255,0.85)]"].join(" "),i=["inline-flex flex-1 items-center justify-center whitespace-nowrap rounded-[0.5rem] py-2 px-3 text-sm font-semibold","border-none bg-transparent text-[var(--color-clickable)] cursor-pointer select-none","transition-[background-color,color,box-shadow,transform] duration-300 ease-in-out","tabs-trigger-focus focus-visible:z-10","disabled:cursor-not-allowed disabled:opacity-50 disabled:pointer-events-none","data-[state=active]:bg-white data-[state=active]:text-[var(--color-clickable)] data-[state=active]:shadow-[0_4px_16px_0_rgba(0,0,0,0.05)]","hover:bg-[rgba(255,255,255,0.7)] [&:hover]:data-[state=active]:bg-white"].join(" "),s="mt-2";export{s as contentStyles,o as listFullWidthStyles,r as listMobileStyles,e as listStyles,t as listTableStyles,i as triggerMobileStyles,a as triggerStyles,n as triggerTableStyles};
package/dist/index85.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("react-dom"),r=require("./index107.cjs"),n=require("./index108.cjs"),o=require("./index109.cjs"),s=require("./index110.cjs"),i=require("./index111.cjs"),a=require("./index112.cjs"),c=require("./index113.cjs"),u=require("./index114.cjs"),d=require("./index115.cjs"),l=require("./index116.cjs"),p=require("./index117.cjs"),f=require("./index118.cjs"),v=require("react/jsx-runtime");function w(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 m=w(e),x=w(t);var T="ToastProvider",[y,E,h]=o.createCollection("Toast"),[b]=s.createContextScope("Toast",[h]),[C,g]=b(T),P=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:o="right",swipeThreshold:s=50,children:i}=e,[a,c]=m.useState(null),[u,d]=m.useState(0),l=m.useRef(!1),p=m.useRef(!1);return r.trim(),v.jsx(y.Provider,{scope:t,children:v.jsx(C,{scope:t,label:r,duration:n,swipeDirection:o,swipeThreshold:s,toastCount:u,viewport:a,onViewportChange:c,onToastAdd:m.useCallback(()=>d(e=>e+1),[]),onToastRemove:m.useCallback(()=>d(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:l,isClosePausedRef:p,children:i})})};P.displayName=T;var R="ToastViewport",j=["F8"],D="toast.viewportPause",S="toast.viewportResume",L=m.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:o=j,label:s="Notifications ({hotkey})",...a}=e,c=g(R,r),d=E(r),l=m.useRef(null),p=m.useRef(null),f=m.useRef(null),w=m.useRef(null),x=n.useComposedRefs(t,w,c.onViewportChange),T=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),h=c.toastCount>0;m.useEffect(()=>{const e=e=>{0!==o.length&&o.every(t=>e[t]||e.code===t)&&w.current?.focus()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[o]),m.useEffect(()=>{const e=l.current,t=w.current;if(h&&e&&t){const r=()=>{if(!c.isClosePausedRef.current){const e=new CustomEvent(D);t.dispatchEvent(e),c.isClosePausedRef.current=!0}},n=()=>{if(c.isClosePausedRef.current){const e=new CustomEvent(S);t.dispatchEvent(e),c.isClosePausedRef.current=!1}},o=t=>{!e.contains(t.relatedTarget)&&n()},s=()=>{e.contains(document.activeElement)||n()};return e.addEventListener("focusin",r),e.addEventListener("focusout",o),e.addEventListener("pointermove",r),e.addEventListener("pointerleave",s),window.addEventListener("blur",r),window.addEventListener("focus",n),()=>{e.removeEventListener("focusin",r),e.removeEventListener("focusout",o),e.removeEventListener("pointermove",r),e.removeEventListener("pointerleave",s),window.removeEventListener("blur",r),window.removeEventListener("focus",n)}}},[h,c.isClosePausedRef]);const b=m.useCallback(({tabbingDirection:e})=>{const t=d().map(t=>{const r=t.ref.current,n=[r,...Y(r)];return"forwards"===e?n:n.reverse()});return("forwards"===e?t.reverse():t).flat()},[d]);return m.useEffect(()=>{const e=w.current;if(e){const t=t=>{const r=t.altKey||t.ctrlKey||t.metaKey;if("Tab"===t.key&&!r){const r=document.activeElement,n=t.shiftKey;if(t.target===e&&n)return void p.current?.focus();const o=b({tabbingDirection:n?"backwards":"forwards"}),s=o.findIndex(e=>e===r);z(o.slice(s+1))?t.preventDefault():n?p.current?.focus():f.current?.focus()}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}},[d,b]),v.jsxs(i.Branch,{ref:l,role:"region","aria-label":s.replace("{hotkey}",T),tabIndex:-1,style:{pointerEvents:h?void 0:"none"},children:[h&&v.jsx(_,{ref:p,onFocusFromOutsideViewport:()=>{z(b({tabbingDirection:"forwards"}))}}),v.jsx(y.Slot,{scope:r,children:v.jsx(u.Primitive.ol,{tabIndex:-1,...a,ref:x})}),h&&v.jsx(_,{ref:f,onFocusFromOutsideViewport:()=>{z(b({tabbingDirection:"backwards"}))}})]})});L.displayName=R;var F="ToastFocusProxy",_=m.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...o}=e,s=g(F,r);return v.jsx(f.VisuallyHidden,{tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:e=>{const t=e.relatedTarget;!s.viewport?.contains(t)&&n()}})});_.displayName=F;var N="Toast",k=m.forwardRef((e,t)=>{const{forceMount:n,open:o,defaultOpen:s,onOpenChange:i,...a}=e,[u,p]=l.useControllableState({prop:o,defaultProp:s??!0,onChange:i,caller:N});return v.jsx(c.Presence,{present:n||u,children:v.jsx(q,{open:u,...a,ref:t,onClose:()=>p(!1),onPause:d.useCallbackRef(e.onPause),onResume:d.useCallbackRef(e.onResume),onSwipeStart:r.composeEventHandlers(e.onSwipeStart,e=>{e.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:r.composeEventHandlers(e.onSwipeMove,e=>{const{x:t,y:r}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","move"),e.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${r}px`)}),onSwipeCancel:r.composeEventHandlers(e.onSwipeCancel,e=>{e.currentTarget.setAttribute("data-swipe","cancel"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:r.composeEventHandlers(e.onSwipeEnd,e=>{const{x:t,y:r}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","end"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${r}px`),p(!1)})})})});k.displayName=N;var[A,M]=b(N,{onClose(){}}),q=m.forwardRef((e,t)=>{const{__scopeToast:o,type:s="foreground",duration:a,open:c,onClose:l,onEscapeKeyDown:p,onPause:f,onResume:w,onSwipeStart:T,onSwipeMove:E,onSwipeCancel:h,onSwipeEnd:b,...C}=e,P=g(N,o),[R,j]=m.useState(null),L=n.useComposedRefs(t,e=>j(e)),F=m.useRef(null),_=m.useRef(null),k=a||P.duration,M=m.useRef(0),q=m.useRef(k),K=m.useRef(0),{onToastAdd:H,onToastRemove:O}=P,V=d.useCallbackRef(()=>{const e=R?.contains(document.activeElement);e&&P.viewport?.focus(),l()}),$=m.useCallback(e=>{e&&e!==1/0&&(window.clearTimeout(K.current),M.current=(new Date).getTime(),K.current=window.setTimeout(V,e))},[V]);m.useEffect(()=>{const e=P.viewport;if(e){const t=()=>{$(q.current),w?.()},r=()=>{const e=(new Date).getTime()-M.current;q.current=q.current-e,window.clearTimeout(K.current),f?.()};return e.addEventListener(D,r),e.addEventListener(S,t),()=>{e.removeEventListener(D,r),e.removeEventListener(S,t)}}},[P.viewport,k,f,w,$]),m.useEffect(()=>{c&&!P.isClosePausedRef.current&&$(k)},[c,k,P.isClosePausedRef,$]),m.useEffect(()=>(H(),()=>O()),[H,O]);const U=m.useMemo(()=>R?X(R):null,[R]);return P.viewport?v.jsxs(v.Fragment,{children:[U&&v.jsx(I,{__scopeToast:o,role:"status","aria-live":"foreground"===s?"assertive":"polite",children:U}),v.jsx(A,{scope:o,onClose:V,children:x.createPortal(v.jsx(y.ItemSlot,{scope:o,children:v.jsx(i.Root,{asChild:!0,onEscapeKeyDown:r.composeEventHandlers(p,()=>{P.isFocusedToastEscapeKeyDownRef.current||V(),P.isFocusedToastEscapeKeyDownRef.current=!1}),children:v.jsx(u.Primitive.li,{tabIndex:0,"data-state":c?"open":"closed","data-swipe-direction":P.swipeDirection,...C,ref:L,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:r.composeEventHandlers(e.onKeyDown,e=>{"Escape"===e.key&&(p?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(P.isFocusedToastEscapeKeyDownRef.current=!0,V()))}),onPointerDown:r.composeEventHandlers(e.onPointerDown,e=>{0===e.button&&(F.current={x:e.clientX,y:e.clientY})}),onPointerMove:r.composeEventHandlers(e.onPointerMove,e=>{if(!F.current)return;const t=e.clientX-F.current.x,r=e.clientY-F.current.y,n=Boolean(_.current),o=["left","right"].includes(P.swipeDirection),s=["left","up"].includes(P.swipeDirection)?Math.min:Math.max,i=o?s(0,t):0,a=o?0:s(0,r),c="touch"===e.pointerType?10:2,u={x:i,y:a},d={originalEvent:e,delta:u};n?(_.current=u,B("toast.swipeMove",E,d,{discrete:!1})):W(u,P.swipeDirection,c)?(_.current=u,B("toast.swipeStart",T,d,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(r)>c)&&(F.current=null)}),onPointerUp:r.composeEventHandlers(e.onPointerUp,e=>{const t=_.current,r=e.target;if(r.hasPointerCapture(e.pointerId)&&r.releasePointerCapture(e.pointerId),_.current=null,F.current=null,t){const r=e.currentTarget,n={originalEvent:e,delta:t};W(t,P.swipeDirection,P.swipeThreshold)?B("toast.swipeEnd",b,n,{discrete:!0}):B("toast.swipeCancel",h,n,{discrete:!0}),r.addEventListener("click",e=>e.preventDefault(),{once:!0})}})})})}),P.viewport)})]}):null}),I=e=>{const{__scopeToast:t,children:r,...n}=e,o=g(N,t),[s,i]=m.useState(!1),[c,u]=m.useState(!1);return function(e=()=>{}){const t=d.useCallbackRef(e);p.useLayoutEffect(()=>{let e=0,r=0;return e=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(r)}},[t])}(()=>i(!0)),m.useEffect(()=>{const e=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(e)},[]),c?null:v.jsx(a.Portal,{asChild:!0,children:v.jsx(f.VisuallyHidden,{...n,children:s&&v.jsxs(v.Fragment,{children:[o.label," ",r]})})})},K=m.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return v.jsx(u.Primitive.div,{...n,ref:t})});K.displayName="ToastTitle";var H=m.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return v.jsx(u.Primitive.div,{...n,ref:t})});H.displayName="ToastDescription";var O=m.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?v.jsx(U,{altText:r,asChild:!0,children:v.jsx($,{...n,ref:t})}):null});O.displayName="ToastAction";var V="ToastClose",$=m.forwardRef((e,t)=>{const{__scopeToast:n,...o}=e,s=M(V,n);return v.jsx(U,{asChild:!0,children:v.jsx(u.Primitive.button,{type:"button",...o,ref:t,onClick:r.composeEventHandlers(e.onClick,s.onClose)})})});$.displayName=V;var U=m.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...o}=e;return v.jsx(u.Primitive.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...o,ref:t})});function X(e){const t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),function(e){return e.nodeType===e.ELEMENT_NODE}(e)){const r=e.ariaHidden||e.hidden||"none"===e.style.display,n=""===e.dataset.radixToastAnnounceExclude;if(!r)if(n){const r=e.dataset.radixToastAnnounceAlt;r&&t.push(r)}else t.push(...X(e))}}),t}function B(e,t,r,{discrete:n}){const o=r.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?u.dispatchDiscreteCustomEvent(o,s):o.dispatchEvent(s)}var W=(e,t,r=0)=>{const n=Math.abs(e.x),o=Math.abs(e.y),s=n>o;return"left"===t||"right"===t?s&&n>r:!s&&o>r};function Y(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function z(e){const t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}var G=P,J=L,Q=k,Z=K,ee=H,te=O,re=$;exports.Action=te,exports.Close=re,exports.Description=ee,exports.Provider=G,exports.Root=Q,exports.Title=Z,exports.Toast=k,exports.ToastAction=O,exports.ToastClose=$,exports.ToastDescription=H,exports.ToastProvider=P,exports.ToastTitle=K,exports.ToastViewport=L,exports.Viewport=J;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("react-dom"),r=require("./index108.cjs"),n=require("./index109.cjs"),o=require("./index110.cjs"),s=require("./index111.cjs"),i=require("./index112.cjs"),a=require("./index113.cjs"),c=require("./index114.cjs"),u=require("./index115.cjs"),d=require("./index116.cjs"),l=require("./index117.cjs"),p=require("./index118.cjs"),f=require("./index119.cjs"),v=require("react/jsx-runtime");function w(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 m=w(e),x=w(t);var T="ToastProvider",[y,E,h]=o.createCollection("Toast"),[b]=s.createContextScope("Toast",[h]),[C,g]=b(T),P=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:o="right",swipeThreshold:s=50,children:i}=e,[a,c]=m.useState(null),[u,d]=m.useState(0),l=m.useRef(!1),p=m.useRef(!1);return r.trim(),v.jsx(y.Provider,{scope:t,children:v.jsx(C,{scope:t,label:r,duration:n,swipeDirection:o,swipeThreshold:s,toastCount:u,viewport:a,onViewportChange:c,onToastAdd:m.useCallback(()=>d(e=>e+1),[]),onToastRemove:m.useCallback(()=>d(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:l,isClosePausedRef:p,children:i})})};P.displayName=T;var R="ToastViewport",j=["F8"],D="toast.viewportPause",S="toast.viewportResume",L=m.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:o=j,label:s="Notifications ({hotkey})",...a}=e,c=g(R,r),d=E(r),l=m.useRef(null),p=m.useRef(null),f=m.useRef(null),w=m.useRef(null),x=n.useComposedRefs(t,w,c.onViewportChange),T=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),h=c.toastCount>0;m.useEffect(()=>{const e=e=>{0!==o.length&&o.every(t=>e[t]||e.code===t)&&w.current?.focus()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[o]),m.useEffect(()=>{const e=l.current,t=w.current;if(h&&e&&t){const r=()=>{if(!c.isClosePausedRef.current){const e=new CustomEvent(D);t.dispatchEvent(e),c.isClosePausedRef.current=!0}},n=()=>{if(c.isClosePausedRef.current){const e=new CustomEvent(S);t.dispatchEvent(e),c.isClosePausedRef.current=!1}},o=t=>{!e.contains(t.relatedTarget)&&n()},s=()=>{e.contains(document.activeElement)||n()};return e.addEventListener("focusin",r),e.addEventListener("focusout",o),e.addEventListener("pointermove",r),e.addEventListener("pointerleave",s),window.addEventListener("blur",r),window.addEventListener("focus",n),()=>{e.removeEventListener("focusin",r),e.removeEventListener("focusout",o),e.removeEventListener("pointermove",r),e.removeEventListener("pointerleave",s),window.removeEventListener("blur",r),window.removeEventListener("focus",n)}}},[h,c.isClosePausedRef]);const b=m.useCallback(({tabbingDirection:e})=>{const t=d().map(t=>{const r=t.ref.current,n=[r,...Y(r)];return"forwards"===e?n:n.reverse()});return("forwards"===e?t.reverse():t).flat()},[d]);return m.useEffect(()=>{const e=w.current;if(e){const t=t=>{const r=t.altKey||t.ctrlKey||t.metaKey;if("Tab"===t.key&&!r){const r=document.activeElement,n=t.shiftKey;if(t.target===e&&n)return void p.current?.focus();const o=b({tabbingDirection:n?"backwards":"forwards"}),s=o.findIndex(e=>e===r);z(o.slice(s+1))?t.preventDefault():n?p.current?.focus():f.current?.focus()}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}},[d,b]),v.jsxs(i.Branch,{ref:l,role:"region","aria-label":s.replace("{hotkey}",T),tabIndex:-1,style:{pointerEvents:h?void 0:"none"},children:[h&&v.jsx(_,{ref:p,onFocusFromOutsideViewport:()=>{z(b({tabbingDirection:"forwards"}))}}),v.jsx(y.Slot,{scope:r,children:v.jsx(u.Primitive.ol,{tabIndex:-1,...a,ref:x})}),h&&v.jsx(_,{ref:f,onFocusFromOutsideViewport:()=>{z(b({tabbingDirection:"backwards"}))}})]})});L.displayName=R;var F="ToastFocusProxy",_=m.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...o}=e,s=g(F,r);return v.jsx(f.VisuallyHidden,{tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:e=>{const t=e.relatedTarget;!s.viewport?.contains(t)&&n()}})});_.displayName=F;var N="Toast",k=m.forwardRef((e,t)=>{const{forceMount:n,open:o,defaultOpen:s,onOpenChange:i,...a}=e,[u,p]=l.useControllableState({prop:o,defaultProp:s??!0,onChange:i,caller:N});return v.jsx(c.Presence,{present:n||u,children:v.jsx(q,{open:u,...a,ref:t,onClose:()=>p(!1),onPause:d.useCallbackRef(e.onPause),onResume:d.useCallbackRef(e.onResume),onSwipeStart:r.composeEventHandlers(e.onSwipeStart,e=>{e.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:r.composeEventHandlers(e.onSwipeMove,e=>{const{x:t,y:r}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","move"),e.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${r}px`)}),onSwipeCancel:r.composeEventHandlers(e.onSwipeCancel,e=>{e.currentTarget.setAttribute("data-swipe","cancel"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:r.composeEventHandlers(e.onSwipeEnd,e=>{const{x:t,y:r}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","end"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${r}px`),p(!1)})})})});k.displayName=N;var[A,M]=b(N,{onClose(){}}),q=m.forwardRef((e,t)=>{const{__scopeToast:o,type:s="foreground",duration:a,open:c,onClose:l,onEscapeKeyDown:p,onPause:f,onResume:w,onSwipeStart:T,onSwipeMove:E,onSwipeCancel:h,onSwipeEnd:b,...C}=e,P=g(N,o),[R,j]=m.useState(null),L=n.useComposedRefs(t,e=>j(e)),F=m.useRef(null),_=m.useRef(null),k=a||P.duration,M=m.useRef(0),q=m.useRef(k),K=m.useRef(0),{onToastAdd:H,onToastRemove:O}=P,V=d.useCallbackRef(()=>{const e=R?.contains(document.activeElement);e&&P.viewport?.focus(),l()}),$=m.useCallback(e=>{e&&e!==1/0&&(window.clearTimeout(K.current),M.current=(new Date).getTime(),K.current=window.setTimeout(V,e))},[V]);m.useEffect(()=>{const e=P.viewport;if(e){const t=()=>{$(q.current),w?.()},r=()=>{const e=(new Date).getTime()-M.current;q.current=q.current-e,window.clearTimeout(K.current),f?.()};return e.addEventListener(D,r),e.addEventListener(S,t),()=>{e.removeEventListener(D,r),e.removeEventListener(S,t)}}},[P.viewport,k,f,w,$]),m.useEffect(()=>{c&&!P.isClosePausedRef.current&&$(k)},[c,k,P.isClosePausedRef,$]),m.useEffect(()=>(H(),()=>O()),[H,O]);const U=m.useMemo(()=>R?X(R):null,[R]);return P.viewport?v.jsxs(v.Fragment,{children:[U&&v.jsx(I,{__scopeToast:o,role:"status","aria-live":"foreground"===s?"assertive":"polite",children:U}),v.jsx(A,{scope:o,onClose:V,children:x.createPortal(v.jsx(y.ItemSlot,{scope:o,children:v.jsx(i.Root,{asChild:!0,onEscapeKeyDown:r.composeEventHandlers(p,()=>{P.isFocusedToastEscapeKeyDownRef.current||V(),P.isFocusedToastEscapeKeyDownRef.current=!1}),children:v.jsx(u.Primitive.li,{tabIndex:0,"data-state":c?"open":"closed","data-swipe-direction":P.swipeDirection,...C,ref:L,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:r.composeEventHandlers(e.onKeyDown,e=>{"Escape"===e.key&&(p?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(P.isFocusedToastEscapeKeyDownRef.current=!0,V()))}),onPointerDown:r.composeEventHandlers(e.onPointerDown,e=>{0===e.button&&(F.current={x:e.clientX,y:e.clientY})}),onPointerMove:r.composeEventHandlers(e.onPointerMove,e=>{if(!F.current)return;const t=e.clientX-F.current.x,r=e.clientY-F.current.y,n=Boolean(_.current),o=["left","right"].includes(P.swipeDirection),s=["left","up"].includes(P.swipeDirection)?Math.min:Math.max,i=o?s(0,t):0,a=o?0:s(0,r),c="touch"===e.pointerType?10:2,u={x:i,y:a},d={originalEvent:e,delta:u};n?(_.current=u,B("toast.swipeMove",E,d,{discrete:!1})):W(u,P.swipeDirection,c)?(_.current=u,B("toast.swipeStart",T,d,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(r)>c)&&(F.current=null)}),onPointerUp:r.composeEventHandlers(e.onPointerUp,e=>{const t=_.current,r=e.target;if(r.hasPointerCapture(e.pointerId)&&r.releasePointerCapture(e.pointerId),_.current=null,F.current=null,t){const r=e.currentTarget,n={originalEvent:e,delta:t};W(t,P.swipeDirection,P.swipeThreshold)?B("toast.swipeEnd",b,n,{discrete:!0}):B("toast.swipeCancel",h,n,{discrete:!0}),r.addEventListener("click",e=>e.preventDefault(),{once:!0})}})})})}),P.viewport)})]}):null}),I=e=>{const{__scopeToast:t,children:r,...n}=e,o=g(N,t),[s,i]=m.useState(!1),[c,u]=m.useState(!1);return function(e=()=>{}){const t=d.useCallbackRef(e);p.useLayoutEffect(()=>{let e=0,r=0;return e=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(r)}},[t])}(()=>i(!0)),m.useEffect(()=>{const e=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(e)},[]),c?null:v.jsx(a.Portal,{asChild:!0,children:v.jsx(f.VisuallyHidden,{...n,children:s&&v.jsxs(v.Fragment,{children:[o.label," ",r]})})})},K=m.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return v.jsx(u.Primitive.div,{...n,ref:t})});K.displayName="ToastTitle";var H=m.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return v.jsx(u.Primitive.div,{...n,ref:t})});H.displayName="ToastDescription";var O=m.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?v.jsx(U,{altText:r,asChild:!0,children:v.jsx($,{...n,ref:t})}):null});O.displayName="ToastAction";var V="ToastClose",$=m.forwardRef((e,t)=>{const{__scopeToast:n,...o}=e,s=M(V,n);return v.jsx(U,{asChild:!0,children:v.jsx(u.Primitive.button,{type:"button",...o,ref:t,onClick:r.composeEventHandlers(e.onClick,s.onClose)})})});$.displayName=V;var U=m.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...o}=e;return v.jsx(u.Primitive.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...o,ref:t})});function X(e){const t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),function(e){return e.nodeType===e.ELEMENT_NODE}(e)){const r=e.ariaHidden||e.hidden||"none"===e.style.display,n=""===e.dataset.radixToastAnnounceExclude;if(!r)if(n){const r=e.dataset.radixToastAnnounceAlt;r&&t.push(r)}else t.push(...X(e))}}),t}function B(e,t,r,{discrete:n}){const o=r.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?u.dispatchDiscreteCustomEvent(o,s):o.dispatchEvent(s)}var W=(e,t,r=0)=>{const n=Math.abs(e.x),o=Math.abs(e.y),s=n>o;return"left"===t||"right"===t?s&&n>r:!s&&o>r};function Y(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function z(e){const t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}var G=P,J=L,Q=k,Z=K,ee=H,te=O,re=$;exports.Action=te,exports.Close=re,exports.Description=ee,exports.Provider=G,exports.Root=Q,exports.Title=Z,exports.Toast=k,exports.ToastAction=O,exports.ToastClose=$,exports.ToastDescription=H,exports.ToastProvider=P,exports.ToastTitle=K,exports.ToastViewport=L,exports.Viewport=J;
package/dist/index85.js CHANGED
@@ -1,4 +1,4 @@
1
- import*as e from"react";import*as t from"react-dom";import{composeEventHandlers as r}from"./index107.js";import{useComposedRefs as n}from"./index108.js";import{createCollection as o}from"./index109.js";import{createContextScope as s}from"./index110.js";import{Branch as i,Root as a}from"./index111.js";import{Portal as c}from"./index112.js";import{Presence as d}from"./index113.js";import{Primitive as u,dispatchDiscreteCustomEvent as l}from"./index114.js";import{useCallbackRef as p}from"./index115.js";import{useControllableState as f}from"./index116.js";import{useLayoutEffect as m}from"./index117.js";import{VisuallyHidden as w}from"./index118.js";import{jsx as v,jsxs as y,Fragment as T}from"react/jsx-runtime";var E="ToastProvider",[h,x,g]=o("Toast"),[C]=s("Toast",[g]),[b,R]=C(E),P=t=>{const{__scopeToast:r,label:n="Notification",duration:o=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:a}=t,[c,d]=e.useState(null),[u,l]=e.useState(0),p=e.useRef(!1),f=e.useRef(!1);return n.trim(),/* @__PURE__ */v(h.Provider,{scope:r,children:/* @__PURE__ */v(b,{scope:r,label:n,duration:o,swipeDirection:s,swipeThreshold:i,toastCount:u,viewport:c,onViewportChange:d,onToastAdd:e.useCallback(()=>l(e=>e+1),[]),onToastRemove:e.useCallback(()=>l(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:f,children:a})})};P.displayName=E;var D="ToastViewport",L=["F8"],S="toast.viewportPause",_="toast.viewportResume",F=e.forwardRef((t,r)=>{const{__scopeToast:o,hotkey:s=L,label:a="Notifications ({hotkey})",...c}=t,d=R(D,o),l=x(o),p=e.useRef(null),f=e.useRef(null),m=e.useRef(null),w=e.useRef(null),T=n(r,w,d.onViewportChange),E=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=d.toastCount>0;e.useEffect(()=>{const e=e=>{0!==s.length&&s.every(t=>e[t]||e.code===t)&&w.current?.focus()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[s]),e.useEffect(()=>{const e=p.current,t=w.current;if(g&&e&&t){const r=()=>{if(!d.isClosePausedRef.current){const e=new CustomEvent(S);t.dispatchEvent(e),d.isClosePausedRef.current=!0}},n=()=>{if(d.isClosePausedRef.current){const e=new CustomEvent(_);t.dispatchEvent(e),d.isClosePausedRef.current=!1}},o=t=>{!e.contains(t.relatedTarget)&&n()},s=()=>{e.contains(document.activeElement)||n()};return e.addEventListener("focusin",r),e.addEventListener("focusout",o),e.addEventListener("pointermove",r),e.addEventListener("pointerleave",s),window.addEventListener("blur",r),window.addEventListener("focus",n),()=>{e.removeEventListener("focusin",r),e.removeEventListener("focusout",o),e.removeEventListener("pointermove",r),e.removeEventListener("pointerleave",s),window.removeEventListener("blur",r),window.removeEventListener("focus",n)}}},[g,d.isClosePausedRef]);const C=e.useCallback(({tabbingDirection:e})=>{const t=l().map(t=>{const r=t.ref.current,n=[r,...z(r)];return"forwards"===e?n:n.reverse()});return("forwards"===e?t.reverse():t).flat()},[l]);return e.useEffect(()=>{const e=w.current;if(e){const t=t=>{const r=t.altKey||t.ctrlKey||t.metaKey;if("Tab"===t.key&&!r){const r=document.activeElement,n=t.shiftKey;if(t.target===e&&n)return void f.current?.focus();const o=C({tabbingDirection:n?"backwards":"forwards"}),s=o.findIndex(e=>e===r);G(o.slice(s+1))?t.preventDefault():n?f.current?.focus():m.current?.focus()}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}},[l,C]),/* @__PURE__ */y(i,{ref:p,role:"region","aria-label":a.replace("{hotkey}",E),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&/* @__PURE__ */v(k,{ref:f,onFocusFromOutsideViewport:()=>{G(C({tabbingDirection:"forwards"}))}}),
1
+ import*as e from"react";import*as t from"react-dom";import{composeEventHandlers as r}from"./index108.js";import{useComposedRefs as n}from"./index109.js";import{createCollection as o}from"./index110.js";import{createContextScope as s}from"./index111.js";import{Branch as i,Root as a}from"./index112.js";import{Portal as c}from"./index113.js";import{Presence as d}from"./index114.js";import{Primitive as u,dispatchDiscreteCustomEvent as l}from"./index115.js";import{useCallbackRef as p}from"./index116.js";import{useControllableState as f}from"./index117.js";import{useLayoutEffect as m}from"./index118.js";import{VisuallyHidden as w}from"./index119.js";import{jsx as v,jsxs as y,Fragment as T}from"react/jsx-runtime";var E="ToastProvider",[h,x,g]=o("Toast"),[C]=s("Toast",[g]),[b,R]=C(E),P=t=>{const{__scopeToast:r,label:n="Notification",duration:o=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:a}=t,[c,d]=e.useState(null),[u,l]=e.useState(0),p=e.useRef(!1),f=e.useRef(!1);return n.trim(),/* @__PURE__ */v(h.Provider,{scope:r,children:/* @__PURE__ */v(b,{scope:r,label:n,duration:o,swipeDirection:s,swipeThreshold:i,toastCount:u,viewport:c,onViewportChange:d,onToastAdd:e.useCallback(()=>l(e=>e+1),[]),onToastRemove:e.useCallback(()=>l(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:f,children:a})})};P.displayName=E;var D="ToastViewport",L=["F8"],S="toast.viewportPause",_="toast.viewportResume",F=e.forwardRef((t,r)=>{const{__scopeToast:o,hotkey:s=L,label:a="Notifications ({hotkey})",...c}=t,d=R(D,o),l=x(o),p=e.useRef(null),f=e.useRef(null),m=e.useRef(null),w=e.useRef(null),T=n(r,w,d.onViewportChange),E=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=d.toastCount>0;e.useEffect(()=>{const e=e=>{0!==s.length&&s.every(t=>e[t]||e.code===t)&&w.current?.focus()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[s]),e.useEffect(()=>{const e=p.current,t=w.current;if(g&&e&&t){const r=()=>{if(!d.isClosePausedRef.current){const e=new CustomEvent(S);t.dispatchEvent(e),d.isClosePausedRef.current=!0}},n=()=>{if(d.isClosePausedRef.current){const e=new CustomEvent(_);t.dispatchEvent(e),d.isClosePausedRef.current=!1}},o=t=>{!e.contains(t.relatedTarget)&&n()},s=()=>{e.contains(document.activeElement)||n()};return e.addEventListener("focusin",r),e.addEventListener("focusout",o),e.addEventListener("pointermove",r),e.addEventListener("pointerleave",s),window.addEventListener("blur",r),window.addEventListener("focus",n),()=>{e.removeEventListener("focusin",r),e.removeEventListener("focusout",o),e.removeEventListener("pointermove",r),e.removeEventListener("pointerleave",s),window.removeEventListener("blur",r),window.removeEventListener("focus",n)}}},[g,d.isClosePausedRef]);const C=e.useCallback(({tabbingDirection:e})=>{const t=l().map(t=>{const r=t.ref.current,n=[r,...z(r)];return"forwards"===e?n:n.reverse()});return("forwards"===e?t.reverse():t).flat()},[l]);return e.useEffect(()=>{const e=w.current;if(e){const t=t=>{const r=t.altKey||t.ctrlKey||t.metaKey;if("Tab"===t.key&&!r){const r=document.activeElement,n=t.shiftKey;if(t.target===e&&n)return void f.current?.focus();const o=C({tabbingDirection:n?"backwards":"forwards"}),s=o.findIndex(e=>e===r);G(o.slice(s+1))?t.preventDefault():n?f.current?.focus():m.current?.focus()}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}},[l,C]),/* @__PURE__ */y(i,{ref:p,role:"region","aria-label":a.replace("{hotkey}",E),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&/* @__PURE__ */v(k,{ref:f,onFocusFromOutsideViewport:()=>{G(C({tabbingDirection:"forwards"}))}}),
2
2
  /* @__PURE__ */v(h.Slot,{scope:o,children:/* @__PURE__ */v(u.ol,{tabIndex:-1,...c,ref:T})}),g&&/* @__PURE__ */v(k,{ref:m,onFocusFromOutsideViewport:()=>{G(C({tabbingDirection:"backwards"}))}})]})});F.displayName=D;var N="ToastFocusProxy",k=e.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...o}=e,s=R(N,r);/* @__PURE__ */
3
3
  return v(w,{tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:e=>{const t=e.relatedTarget;!s.viewport?.contains(t)&&n()}})});k.displayName=N;var A="Toast",I=e.forwardRef((e,t)=>{const{forceMount:n,open:o,defaultOpen:s,onOpenChange:i,...a}=e,[c,u]=f({prop:o,defaultProp:s??!0,onChange:i,caller:A});/* @__PURE__ */
4
4
  return v(d,{present:n||c,children:/* @__PURE__ */v(j,{open:c,...a,ref:t,onClose:()=>u(!1),onPause:p(e.onPause),onResume:p(e.onResume),onSwipeStart:r(e.onSwipeStart,e=>{e.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:r(e.onSwipeMove,e=>{const{x:t,y:r}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","move"),e.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${r}px`)}),onSwipeCancel:r(e.onSwipeCancel,e=>{e.currentTarget.setAttribute("data-swipe","cancel"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:r(e.onSwipeEnd,e=>{const{x:t,y:r}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","end"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${r}px`),u(!1)})})})});I.displayName=A;var[M,K]=C(A,{onClose(){}}),j=e.forwardRef((o,s)=>{const{__scopeToast:i,type:c="foreground",duration:d,open:l,onClose:f,onEscapeKeyDown:m,onPause:w,onResume:E,onSwipeStart:x,onSwipeMove:g,onSwipeCancel:C,onSwipeEnd:b,...P}=o,D=R(A,i),[L,F]=e.useState(null),N=n(s,e=>F(e)),k=e.useRef(null),I=e.useRef(null),K=d||D.duration,j=e.useRef(0),V=e.useRef(K),$=e.useRef(0),{onToastAdd:U,onToastRemove:X}=D,q=p(()=>{const e=L?.contains(document.activeElement);e&&D.viewport?.focus(),f()}),H=e.useCallback(e=>{e&&e!==1/0&&(window.clearTimeout($.current),j.current=/* @__PURE__ */(new Date).getTime(),$.current=window.setTimeout(q,e))},[q]);e.useEffect(()=>{const e=D.viewport;if(e){const t=()=>{H(V.current),E?.()},r=()=>{const e=/* @__PURE__ */(new Date).getTime()-j.current;V.current=V.current-e,window.clearTimeout($.current),w?.()};return e.addEventListener(S,r),e.addEventListener(_,t),()=>{e.removeEventListener(S,r),e.removeEventListener(_,t)}}},[D.viewport,K,w,E,H]),e.useEffect(()=>{l&&!D.isClosePausedRef.current&&H(K)},[l,K,D.isClosePausedRef,H]),e.useEffect(()=>(U(),()=>X()),[U,X]);const z=e.useMemo(()=>L?W(L):null,[L]);return D.viewport?/* @__PURE__ */y(T,{children:[z&&/* @__PURE__ */v(O,{__scopeToast:i,role:"status","aria-live":"foreground"===c?"assertive":"polite",children:z}),
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/overlays/dialog/Dialog.component.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAG1D,OAAO,KAAK,EACV,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,gBAAgB,CAAC;AAoBxB,eAAO,MAAM,MAAM,iDAAuB,CAAC;AAE3C,eAAO,MAAM,aAAa,kIAA0B,CAAC;AAErD,eAAO,MAAM,YAAY,uDAAyB,CAAC;AAEnD,eAAO,MAAM,WAAW,gIAAwB,CAAC;AAEjD,eAAO,MAAM,iBAAiB,sHAmB5B,CAAC;AAGH,eAAO,MAAM,UAAU;+FAOpB,eAAe;;CAejB,CAAC;AAGF,eAAO,MAAM,aAAa,+GAqBzB,CAAC;AAGF,eAAO,MAAM,aAAa,+GA8DzB,CAAC;AAGF,eAAO,MAAM,YAAY;sFAMtB,iBAAiB;;CAYnB,CAAC;AAGF,eAAO,MAAM,YAAY;4EAKtB,iBAAiB;;CAYnB,CAAC;AAGF,eAAO,MAAM,WAAW,iHAevB,CAAC;AAGF,eAAO,MAAM,iBAAiB,yHAgB5B,CAAC;AAGH,YAAY,EACV,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"Dialog.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/overlays/dialog/Dialog.component.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAG1D,OAAO,KAAK,EACV,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,gBAAgB,CAAC;AAoBxB,eAAO,MAAM,MAAM,iDAAuB,CAAC;AAE3C,eAAO,MAAM,aAAa,kIAA0B,CAAC;AAErD,eAAO,MAAM,YAAY,uDAAyB,CAAC;AAEnD,eAAO,MAAM,WAAW,gIAAwB,CAAC;AAEjD,eAAO,MAAM,iBAAiB,sHAmB5B,CAAC;AAGH,eAAO,MAAM,UAAU;+FAOpB,eAAe;;CAejB,CAAC;AAGF,eAAO,MAAM,aAAa,+GAqBzB,CAAC;AAGF,eAAO,MAAM,aAAa,+GAsEzB,CAAC;AAGF,eAAO,MAAM,YAAY;sFAMtB,iBAAiB;;CAYnB,CAAC;AAGF,eAAO,MAAM,YAAY;4EAKtB,iBAAiB;;CAYnB,CAAC;AAGF,eAAO,MAAM,WAAW,iHAevB,CAAC;AAGF,eAAO,MAAM,iBAAiB,yHAgB5B,CAAC;AAGH,YAAY,EACV,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC"}
@@ -23,6 +23,7 @@ export interface DialogContentProps extends Omit<HTMLAttributes<HTMLDivElement>,
23
23
  fullWidthOnMobile?: boolean;
24
24
  topOffsetOnMobile?: boolean;
25
25
  contentPadding?: string;
26
+ disableOutsideClose?: boolean;
26
27
  'data-cy'?: string;
27
28
  'data-testid'?: string;
28
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/overlays/dialog/Dialog.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7E,MAAM,WAAW,sBAAuB,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC3E,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,gBAAgB,CAAC;AAEhE,MAAM,WAAW,kBAAmB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACxE,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,QAAQ,CAAC;AAExD,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAChG,cAAc,CAAC,EAAE,oBAAoB,CAAC;IACtC,cAAc,CAAC,EAAE,oBAAoB,CAAC;IACtC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC7E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAC,kBAAkB,CAAC;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,sBAAuB,SAAQ,cAAc,CAAC,oBAAoB,CAAC;IAClF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
1
+ {"version":3,"file":"Dialog.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/overlays/dialog/Dialog.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7E,MAAM,WAAW,sBAAuB,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC3E,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,gBAAgB,CAAC;AAEhE,MAAM,WAAW,kBAAmB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACxE,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,QAAQ,CAAC;AAExD,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAChG,cAAc,CAAC,EAAE,oBAAoB,CAAC;IACtC,cAAc,CAAC,EAAE,oBAAoB,CAAC;IACtC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC7E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAC,kBAAkB,CAAC;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,sBAAuB,SAAQ,cAAc,CAAC,oBAAoB,CAAC;IAClF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}