@spark-ui/components 17.14.0 → 17.14.2

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 (47) hide show
  1. package/dist/avatar/index.js +1 -1
  2. package/dist/avatar/index.mjs +1 -1
  3. package/dist/button/index.js +1 -1
  4. package/dist/button/index.mjs +1 -1
  5. package/dist/{button-CNabSkd_.mjs → button-D49vse7F.mjs} +6 -2
  6. package/dist/{button-CNabSkd_.mjs.map → button-D49vse7F.mjs.map} +1 -1
  7. package/dist/{button-Tv2N8_24.js → button-pz6WB_vb.js} +2 -2
  8. package/dist/{button-Tv2N8_24.js.map → button-pz6WB_vb.js.map} +1 -1
  9. package/dist/carousel/index.js +1 -1
  10. package/dist/carousel/index.mjs +1 -1
  11. package/dist/combobox/index.js +1 -1
  12. package/dist/combobox/index.mjs +2 -2
  13. package/dist/dialog/index.js +1 -1
  14. package/dist/dialog/index.mjs +1 -1
  15. package/dist/drawer/index.js +1 -1
  16. package/dist/drawer/index.mjs +1 -1
  17. package/dist/dropdown/index.js +1 -1
  18. package/dist/dropdown/index.mjs +1 -1
  19. package/dist/file-upload/index.js +1 -1
  20. package/dist/file-upload/index.mjs +2 -2
  21. package/dist/icon-button/index.js +1 -1
  22. package/dist/icon-button/index.mjs +1 -1
  23. package/dist/{icon-button-CTe0v0g7.js → icon-button-BKVPOP0K.js} +2 -2
  24. package/dist/{icon-button-CTe0v0g7.js.map → icon-button-BKVPOP0K.js.map} +1 -1
  25. package/dist/{icon-button-DVbKK2_a.mjs → icon-button-Bw0k4nKs.mjs} +2 -2
  26. package/dist/{icon-button-DVbKK2_a.mjs.map → icon-button-Bw0k4nKs.mjs.map} +1 -1
  27. package/dist/pagination/index.js +1 -1
  28. package/dist/pagination/index.mjs +2 -2
  29. package/dist/popover/index.js +1 -1
  30. package/dist/popover/index.mjs +1 -1
  31. package/dist/{popover-83FABwMs.mjs → popover-B11eXklt.mjs} +2 -2
  32. package/dist/{popover-83FABwMs.mjs.map → popover-B11eXklt.mjs.map} +1 -1
  33. package/dist/{popover-Daknmg_Z.js → popover-CWZCAwhW.js} +2 -2
  34. package/dist/{popover-Daknmg_Z.js.map → popover-CWZCAwhW.js.map} +1 -1
  35. package/dist/scrolling-list/index.js +1 -1
  36. package/dist/scrolling-list/index.mjs +2 -2
  37. package/dist/stepper/index.js +1 -1
  38. package/dist/stepper/index.mjs +1 -1
  39. package/dist/table/index.js +1 -1
  40. package/dist/table/index.mjs +1 -1
  41. package/dist/tabs/index.js +1 -1
  42. package/dist/tabs/index.mjs +3 -3
  43. package/dist/toast/index.js +1 -1
  44. package/dist/toast/index.js.map +1 -1
  45. package/dist/toast/index.mjs +4 -4
  46. package/dist/toast/index.mjs.map +1 -1
  47. package/package.json +5 -5
@@ -1,8 +1,8 @@
1
1
  import { VisuallyHidden as e } from "../visually-hidden/index.mjs";
2
2
  import { t } from "../icon-D05Uqh8_.mjs";
3
3
  import { t as n } from "../spinner-DULLiM6a.mjs";
4
- import { t as r } from "../icon-button-DVbKK2_a.mjs";
5
- import { t as i } from "../popover-83FABwMs.mjs";
4
+ import { t as r } from "../icon-button-Bw0k4nKs.mjs";
5
+ import { t as i } from "../popover-B11eXklt.mjs";
6
6
  import { cva as a, cx as o } from "class-variance-authority";
7
7
  import { Children as s, Fragment as c, createContext as l, isValidElement as u, useContext as d, useEffect as f, useId as p, useLayoutEffect as m, useRef as h, useState as g } from "react";
8
8
  import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-C91j1N6u.js`);const e=require(`../icon-CRPcdgYp.js`),t=require(`../DialogContent.styles-CAhJtUud.js`),n=require(`../icon-button-CTe0v0g7.js`),r=require(`../useRenderSlot-C4UVWhDN.js`);let i=require(`class-variance-authority`),a=require(`react`),o=require(`react/jsx-runtime`),s=require(`@spark-ui/hooks/use-merge-refs`),c=require(`@spark-ui/hooks/use-scroll-overflow`),l=require(`@spark-ui/icons/Close`),u=require(`@base-ui/react/dialog`);var d=(0,a.createContext)(null),f=({children:e,withFade:t=!1})=>{let[n,r]=(0,a.useState)(!1);return(0,o.jsx)(d,{value:{isFullScreen:n,setIsFullScreen:r,withFade:t},children:e})},p=()=>{let e=(0,a.useContext)(d);if(!e)throw Error(`useDialog must be used within a Dialog provider`);return e},m=({withFade:e=!1,onOpenChange:t,...n})=>{let r=t?(e,n)=>{t(e)}:void 0;return(0,o.jsx)(f,{withFade:e,children:(0,o.jsx)(u.Dialog.Root,{"data-spark-component":`dialog`,onOpenChange:r,...n})})};m.createHandle=u.Dialog.createHandle,m.displayName=`Dialog.Root`;var h=({children:e,className:t,inset:n=!1,ref:r,...l})=>{let u=(0,a.useRef)(null),d=(0,s.useMergeRefs)(r,u),{withFade:f}=p(),{overflow:m}=(0,c.useScrollOverflow)(u);return(0,o.jsx)(`div`,{"data-spark-component":`dialog-body`,ref:d,className:(0,i.cx)(`focus-visible:u-outline relative grow overflow-y-auto outline-hidden`,`transition-all duration-300`,{"px-xl py-lg":!n},t),style:{...f&&{maskImage:`linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 44px, rgba(0, 0, 0, 1) calc(100% - 44px), rgba(0, 0, 0, 0))`,maskSize:`100% calc(100% + ${m.top?`0px`:`44px`} + ${m.bottom?`0px`:`44px`})`,maskPosition:`0 ${m.top?`0px`:`-44px`}`}},...l,children:e})};h.displayName=`Dialog.Body`;var g=({asChild:e=!1,...t})=>{let n=r.t(e,`button`);return(0,o.jsx)(u.Dialog.Close,{"data-spark-component":`dialog-close`,render:n,...t})},_=({"aria-label":t,className:r,size:a=`md`,intent:s=`neutral`,design:c=`ghost`,children:u=(0,o.jsx)(l.Close,{}),ref:d,...f})=>(0,o.jsx)(g,{"data-spark-component":`dialog-close-button`,"data-part":`close`,ref:d,className:(0,i.cx)([`absolute`,`top-md`,`right-xl`],r),asChild:!0,...f,children:(0,o.jsx)(n.t,{intent:s,size:a,design:c,"aria-label":t,children:(0,o.jsx)(e.t,{children:u})})}),v=Object.assign(_,{id:`CloseButton`});_.displayName=`Dialog.CloseButton`;var y=({className:e,isNarrow:n=!1,size:r=`md`,ref:s,...c})=>{let{setIsFullScreen:l}=p();return(0,a.useEffect)(()=>(r===`fullscreen`&&l(!0),()=>l(!1)),[l,r]),(0,o.jsx)(u.Dialog.Popup,{ref:s,"data-spark-component":`dialog-content`,role:`dialog`,className:a=>(0,i.cx)(t.t({isNarrow:n,size:r,className:typeof e==`function`?e(a):e})),...c})};y.displayName=`Dialog.Content`;var b=e=>(0,o.jsx)(u.Dialog.Description,{"data-spark-component":`dialog-description`,...e});b.displayName=`Dialog.Description`;var x=({children:e,className:t,ref:n,...r})=>(0,o.jsx)(`footer`,{"data-spark-component":`dialog-footer`,ref:n,className:(0,i.cx)(t,[`px-xl`,`py-lg`]),...r,children:e});x.displayName=`Dialog.Footer`;var S=({children:e,className:t,ref:n,...r})=>(0,o.jsx)(`header`,{"data-spark-component":`dialog-header`,ref:n,className:(0,i.cx)(t,[`px-xl`,`py-lg`]),...r,children:e});S.displayName=`Dialog.Header`;var C=({className:e,...t})=>(0,o.jsx)(u.Dialog.Backdrop,{"data-spark-component":`dialog-overlay`,className:t=>(0,i.cx)(`z-overlay size-screen fixed inset-0`,`bg-overlay/dim-1`,`data-starting-style:animate-fade-in`,`data-ending-style:animate-fade-out`,typeof e==`function`?e(t):e),...t});C.displayName=`Dialog.Overlay`;var w=({className:e,...t})=>(0,o.jsx)(u.Dialog.Portal,{"data-spark-component":`dialog-portal`,className:(0,i.cx)(e,`z-modal absolute`),...t});w.displayName=`Dialog.Portal`;var T=({className:e,ref:t,...n})=>(0,o.jsx)(u.Dialog.Title,{"data-spark-component":`dialog-title`,ref:t,className:(0,i.cx)(`text-headline-1 text-on-surface`,`group-has-data-[part=close]:pr-3xl`,e),...n});T.displayName=`Dialog.Title`;var E=({asChild:e=!1,...t})=>{let n=r.t(e,`button`);return(0,o.jsx)(u.Dialog.Trigger,{"data-spark-component":`dialog-trigger`,render:n,...t})};E.displayName=`Dialog.Trigger`;var D=Object.assign(m,{Trigger:E,Portal:w,Overlay:C,Content:y,Header:S,Body:h,Footer:x,Close:g,CloseButton:v,Title:T,Description:b});D.displayName=`Dialog`,exports.Dialog=D;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-C91j1N6u.js`);const e=require(`../icon-CRPcdgYp.js`),t=require(`../DialogContent.styles-CAhJtUud.js`),n=require(`../icon-button-BKVPOP0K.js`),r=require(`../useRenderSlot-C4UVWhDN.js`);let i=require(`class-variance-authority`),a=require(`react`),o=require(`react/jsx-runtime`),s=require(`@spark-ui/hooks/use-merge-refs`),c=require(`@spark-ui/hooks/use-scroll-overflow`),l=require(`@spark-ui/icons/Close`),u=require(`@base-ui/react/dialog`);var d=(0,a.createContext)(null),f=({children:e,withFade:t=!1})=>{let[n,r]=(0,a.useState)(!1);return(0,o.jsx)(d,{value:{isFullScreen:n,setIsFullScreen:r,withFade:t},children:e})},p=()=>{let e=(0,a.useContext)(d);if(!e)throw Error(`useDialog must be used within a Dialog provider`);return e},m=({withFade:e=!1,onOpenChange:t,...n})=>{let r=t?(e,n)=>{t(e)}:void 0;return(0,o.jsx)(f,{withFade:e,children:(0,o.jsx)(u.Dialog.Root,{"data-spark-component":`dialog`,onOpenChange:r,...n})})};m.createHandle=u.Dialog.createHandle,m.displayName=`Dialog.Root`;var h=({children:e,className:t,inset:n=!1,ref:r,...l})=>{let u=(0,a.useRef)(null),d=(0,s.useMergeRefs)(r,u),{withFade:f}=p(),{overflow:m}=(0,c.useScrollOverflow)(u);return(0,o.jsx)(`div`,{"data-spark-component":`dialog-body`,ref:d,className:(0,i.cx)(`focus-visible:u-outline relative grow overflow-y-auto outline-hidden`,`transition-all duration-300`,{"px-xl py-lg":!n},t),style:{...f&&{maskImage:`linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 44px, rgba(0, 0, 0, 1) calc(100% - 44px), rgba(0, 0, 0, 0))`,maskSize:`100% calc(100% + ${m.top?`0px`:`44px`} + ${m.bottom?`0px`:`44px`})`,maskPosition:`0 ${m.top?`0px`:`-44px`}`}},...l,children:e})};h.displayName=`Dialog.Body`;var g=({asChild:e=!1,...t})=>{let n=r.t(e,`button`);return(0,o.jsx)(u.Dialog.Close,{"data-spark-component":`dialog-close`,render:n,...t})},_=({"aria-label":t,className:r,size:a=`md`,intent:s=`neutral`,design:c=`ghost`,children:u=(0,o.jsx)(l.Close,{}),ref:d,...f})=>(0,o.jsx)(g,{"data-spark-component":`dialog-close-button`,"data-part":`close`,ref:d,className:(0,i.cx)([`absolute`,`top-md`,`right-xl`],r),asChild:!0,...f,children:(0,o.jsx)(n.t,{intent:s,size:a,design:c,"aria-label":t,children:(0,o.jsx)(e.t,{children:u})})}),v=Object.assign(_,{id:`CloseButton`});_.displayName=`Dialog.CloseButton`;var y=({className:e,isNarrow:n=!1,size:r=`md`,ref:s,...c})=>{let{setIsFullScreen:l}=p();return(0,a.useEffect)(()=>(r===`fullscreen`&&l(!0),()=>l(!1)),[l,r]),(0,o.jsx)(u.Dialog.Popup,{ref:s,"data-spark-component":`dialog-content`,role:`dialog`,className:a=>(0,i.cx)(t.t({isNarrow:n,size:r,className:typeof e==`function`?e(a):e})),...c})};y.displayName=`Dialog.Content`;var b=e=>(0,o.jsx)(u.Dialog.Description,{"data-spark-component":`dialog-description`,...e});b.displayName=`Dialog.Description`;var x=({children:e,className:t,ref:n,...r})=>(0,o.jsx)(`footer`,{"data-spark-component":`dialog-footer`,ref:n,className:(0,i.cx)(t,[`px-xl`,`py-lg`]),...r,children:e});x.displayName=`Dialog.Footer`;var S=({children:e,className:t,ref:n,...r})=>(0,o.jsx)(`header`,{"data-spark-component":`dialog-header`,ref:n,className:(0,i.cx)(t,[`px-xl`,`py-lg`]),...r,children:e});S.displayName=`Dialog.Header`;var C=({className:e,...t})=>(0,o.jsx)(u.Dialog.Backdrop,{"data-spark-component":`dialog-overlay`,className:t=>(0,i.cx)(`z-overlay size-screen fixed inset-0`,`bg-overlay/dim-1`,`data-starting-style:animate-fade-in`,`data-ending-style:animate-fade-out`,typeof e==`function`?e(t):e),...t});C.displayName=`Dialog.Overlay`;var w=({className:e,...t})=>(0,o.jsx)(u.Dialog.Portal,{"data-spark-component":`dialog-portal`,className:(0,i.cx)(e,`z-modal absolute`),...t});w.displayName=`Dialog.Portal`;var T=({className:e,ref:t,...n})=>(0,o.jsx)(u.Dialog.Title,{"data-spark-component":`dialog-title`,ref:t,className:(0,i.cx)(`text-headline-1 text-on-surface`,`group-has-data-[part=close]:pr-3xl`,e),...n});T.displayName=`Dialog.Title`;var E=({asChild:e=!1,...t})=>{let n=r.t(e,`button`);return(0,o.jsx)(u.Dialog.Trigger,{"data-spark-component":`dialog-trigger`,render:n,...t})};E.displayName=`Dialog.Trigger`;var D=Object.assign(m,{Trigger:E,Portal:w,Overlay:C,Content:y,Header:S,Body:h,Footer:x,Close:g,CloseButton:v,Title:T,Description:b});D.displayName=`Dialog`,exports.Dialog=D;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "../icon-D05Uqh8_.mjs";
2
2
  import { t } from "../DialogContent.styles-BSxCCi-u.mjs";
3
- import { t as n } from "../icon-button-DVbKK2_a.mjs";
3
+ import { t as n } from "../icon-button-Bw0k4nKs.mjs";
4
4
  import { t as r } from "../useRenderSlot-DKIwoqpO.mjs";
5
5
  import { cx as i } from "class-variance-authority";
6
6
  import { createContext as a, useContext as o, useEffect as s, useRef as c, useState as l } from "react";
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-C91j1N6u.js`);const e=require(`../icon-CRPcdgYp.js`),t=require(`../icon-button-CTe0v0g7.js`),n=require(`../useRenderSlot-C4UVWhDN.js`);let r=require(`class-variance-authority`),i=require(`react`),a=require(`react/jsx-runtime`),o=require(`@spark-ui/hooks/use-merge-refs`),s=require(`@spark-ui/hooks/use-scroll-overflow`),c=require(`@spark-ui/icons/Close`),l=require(`@base-ui/react/dialog`);var u=(0,i.createContext)(null),d=({children:e,withFade:t=!1})=>(0,a.jsx)(u,{value:{withFade:t},children:e}),f=()=>{let e=(0,i.useContext)(u);if(!e)throw Error(`useDrawer must be used within a Drawer provider`);return e},p=({onOpenChange:e,withFade:t=!1,...n})=>{let r=e?(t,n)=>{e(t)}:void 0;return(0,a.jsx)(d,{withFade:t,children:(0,a.jsx)(l.Dialog.Root,{"data-spark-component":`drawer`,onOpenChange:r,...n})})};p.displayName=`Drawer.Root`;var m=(0,r.cva)([`grow`,`overflow-y-auto`,`outline-hidden`,`focus-visible:u-outline`],{variants:{inset:{true:``,false:`px-xl py-lg`}},defaultVariants:{inset:!1}}),h=({children:e,inset:t=!1,className:n,ref:r,...c})=>{let l=(0,i.useRef)(null),u=(0,o.useMergeRefs)(r,l),{withFade:d}=f(),{overflow:p}=(0,s.useScrollOverflow)(l);return(0,a.jsx)(`div`,{"data-spark-component":`drawer-body`,ref:u,className:m({inset:t,className:n}),style:{...d&&{maskImage:`linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 44px, rgba(0, 0, 0, 1) calc(100% - 44px), rgba(0, 0, 0, 0))`,maskSize:`100% calc(100% + ${p.top?`0px`:`44px`} + ${p.bottom?`0px`:`44px`})`,maskPosition:`0 ${p.top?`0px`:`-44px`}`}},...c,children:e})};h.displayName=`Drawer.Body`;var g=({asChild:e=!1,...t})=>{let r=n.t(e,`button`);return(0,a.jsx)(l.Dialog.Close,{"data-spark-component":`drawer-close`,render:r,...t})};g.displayName=`Drawer.Close`;var _=({"aria-label":n,className:i,size:o=`md`,intent:s=`neutral`,design:l=`ghost`,children:u=(0,a.jsx)(c.Close,{}),ref:d,...f})=>(0,a.jsx)(g,{"data-spark-component":`drawer-close-button`,ref:d,className:(0,r.cx)([`absolute`,`top-sm`,`right-xl`],i),asChild:!0,...f,children:(0,a.jsx)(t.t,{intent:s,size:o,design:l,"aria-label":n,children:(0,a.jsx)(e.t,{children:u})})});_.displayName=`Drawer.CloseButton`;var v=(0,r.cva)([`fixed z-modal flex flex-col bg-surface shadow-md`,`data-open:animation-duration-400 data-closed:animation-duration-200`,`data-nested-dialog-open:after:pointer-events-none`,`after:bg-transparent`,`after:transition-all`,`after:duration-200`,`data-nested-dialog-open:after:inset-0`,`data-nested-dialog-open:after:absolute`,`data-nested-dialog-open:after:rounded-[inherit]`,`data-nested-dialog-open:after:bg-overlay/dim-3`],{variants:{size:{sm:``,md:``,lg:``,fluid:``,fullscreen:`h-screen w-screen`},side:{right:[`inset-y-0 right-0`,`data-open:animate-slide-in-right `,`data-closed:animate-slide-out-right`],left:[`inset-y-0 left-0`,`data-open:animate-slide-in-left`,`data-closed:animate-slide-out-left`],top:[`top-0 left-0`,`w-screen`,`data-open:animate-slide-in-top`,`data-closed:animate-slide-out-top`],bottom:[`bottom-0 left-0`,`w-screen`,`data-open:animate-slide-in-bottom`,`data-closed:animate-slide-out-bottom`]}},compoundVariants:[{side:[`right`,`left`],size:`sm`,class:[`w-sz-480`,`max-w-full`]},{side:[`right`,`left`],size:`md`,class:[`w-sz-672`,`max-w-full`]},{side:[`right`,`left`],size:`lg`,class:[`w-sz-864`,`max-w-full`]},{side:[`left`,`right`],size:`fluid`,class:[`w-auto`,`max-w-full`]},{side:[`top`,`bottom`],size:`sm`,class:[`h-sz-480`,`max-h-full`]},{side:[`top`,`bottom`],size:`md`,class:[`h-sz-672`,`max-h-full`]},{side:[`top`,`bottom`],size:`lg`,class:[`h-sz-864`,`max-h-full`]},{side:[`top`,`bottom`],size:`fluid`,class:[`h-auto`,`max-h-full`]}],defaultVariants:{side:`right`,size:`md`}}),y=({className:e,size:t=`md`,side:n=`right`,ref:i,...o})=>(0,a.jsx)(l.Dialog.Popup,{ref:i,"data-spark-component":`drawer-content`,role:`dialog`,className:i=>(0,r.cx)(v({size:t,side:n,className:typeof e==`function`?e(i):e})),...o});y.displayName=`Drawer.Content`;var b=e=>(0,a.jsx)(l.Dialog.Description,{"data-spark-component":`drawer-description`,...e});b.displayName=`Drawer.Description`;var x=({className:e,ref:t,...n})=>(0,a.jsx)(`footer`,{"data-spark-component":`drawer-footer`,ref:t,className:(0,r.cx)([`px-xl`,`py-lg`],e),...n});x.displayName=`Drawer.Footer`;var S=({children:e,className:t,ref:n,...i})=>(0,a.jsx)(`header`,{"data-spark-component":`drawer-header`,ref:n,className:(0,r.cx)([`px-xl`,`py-lg`],t),...i,children:e});S.displayName=`Dialog.Header`;var C=({className:e,...t})=>(0,a.jsx)(l.Dialog.Backdrop,{"data-spark-component":`drawer-overlay`,className:t=>(0,r.cx)(`z-overlay fixed top-0 left-0 h-screen w-screen`,`bg-overlay/dim-1`,`data-starting-style:animate-fade-in`,`data-ending-style:animate-fade-out`,typeof e==`function`?e(t):e),...t});C.displayName=`Drawer.Overlay`;var w=({className:e,...t})=>(0,a.jsx)(l.Dialog.Portal,{"data-spark-component":`drawer-portal`,className:(0,r.cx)(e,`z-modal absolute`),...t});w.displayName=`Drawer.Portal`;var T=({className:e,...t})=>(0,a.jsx)(l.Dialog.Title,{"data-spark-component":`drawer-title`,className:(0,r.cx)(`text-headline-2 text-on-surface`,e),...t});T.displayName=`Drawer.Title`;var E=({asChild:e=!1,...t})=>{let r=n.t(e,`button`);return(0,a.jsx)(l.Dialog.Trigger,{"data-spark-component":`drawer-trigger`,render:r,...t})};E.displayName=`Drawer.Trigger`;var D=Object.assign(p,{Trigger:E,Portal:w,Overlay:C,Content:y,Header:S,Body:h,Footer:x,Close:g,CloseButton:_,Title:T,Description:b});D.displayName=`Drawer`,E.displayName=`Drawer.Trigger`,w.displayName=`Drawer.Portal`,C.displayName=`Drawer.Overlay`,y.displayName=`Drawer.Content`,S.displayName=`Drawer.Header`,h.displayName=`Drawer.Body`,x.displayName=`Drawer.Footer`,g.displayName=`Drawer.Close`,_.displayName=`Drawer.CloseButton`,T.displayName=`Drawer.Title`,b.displayName=`Drawer.Description`,exports.Drawer=D;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-C91j1N6u.js`);const e=require(`../icon-CRPcdgYp.js`),t=require(`../icon-button-BKVPOP0K.js`),n=require(`../useRenderSlot-C4UVWhDN.js`);let r=require(`class-variance-authority`),i=require(`react`),a=require(`react/jsx-runtime`),o=require(`@spark-ui/hooks/use-merge-refs`),s=require(`@spark-ui/hooks/use-scroll-overflow`),c=require(`@spark-ui/icons/Close`),l=require(`@base-ui/react/dialog`);var u=(0,i.createContext)(null),d=({children:e,withFade:t=!1})=>(0,a.jsx)(u,{value:{withFade:t},children:e}),f=()=>{let e=(0,i.useContext)(u);if(!e)throw Error(`useDrawer must be used within a Drawer provider`);return e},p=({onOpenChange:e,withFade:t=!1,...n})=>{let r=e?(t,n)=>{e(t)}:void 0;return(0,a.jsx)(d,{withFade:t,children:(0,a.jsx)(l.Dialog.Root,{"data-spark-component":`drawer`,onOpenChange:r,...n})})};p.displayName=`Drawer.Root`;var m=(0,r.cva)([`grow`,`overflow-y-auto`,`outline-hidden`,`focus-visible:u-outline`],{variants:{inset:{true:``,false:`px-xl py-lg`}},defaultVariants:{inset:!1}}),h=({children:e,inset:t=!1,className:n,ref:r,...c})=>{let l=(0,i.useRef)(null),u=(0,o.useMergeRefs)(r,l),{withFade:d}=f(),{overflow:p}=(0,s.useScrollOverflow)(l);return(0,a.jsx)(`div`,{"data-spark-component":`drawer-body`,ref:u,className:m({inset:t,className:n}),style:{...d&&{maskImage:`linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 44px, rgba(0, 0, 0, 1) calc(100% - 44px), rgba(0, 0, 0, 0))`,maskSize:`100% calc(100% + ${p.top?`0px`:`44px`} + ${p.bottom?`0px`:`44px`})`,maskPosition:`0 ${p.top?`0px`:`-44px`}`}},...c,children:e})};h.displayName=`Drawer.Body`;var g=({asChild:e=!1,...t})=>{let r=n.t(e,`button`);return(0,a.jsx)(l.Dialog.Close,{"data-spark-component":`drawer-close`,render:r,...t})};g.displayName=`Drawer.Close`;var _=({"aria-label":n,className:i,size:o=`md`,intent:s=`neutral`,design:l=`ghost`,children:u=(0,a.jsx)(c.Close,{}),ref:d,...f})=>(0,a.jsx)(g,{"data-spark-component":`drawer-close-button`,ref:d,className:(0,r.cx)([`absolute`,`top-sm`,`right-xl`],i),asChild:!0,...f,children:(0,a.jsx)(t.t,{intent:s,size:o,design:l,"aria-label":n,children:(0,a.jsx)(e.t,{children:u})})});_.displayName=`Drawer.CloseButton`;var v=(0,r.cva)([`fixed z-modal flex flex-col bg-surface shadow-md`,`data-open:animation-duration-400 data-closed:animation-duration-200`,`data-nested-dialog-open:after:pointer-events-none`,`after:bg-transparent`,`after:transition-all`,`after:duration-200`,`data-nested-dialog-open:after:inset-0`,`data-nested-dialog-open:after:absolute`,`data-nested-dialog-open:after:rounded-[inherit]`,`data-nested-dialog-open:after:bg-overlay/dim-3`],{variants:{size:{sm:``,md:``,lg:``,fluid:``,fullscreen:`h-screen w-screen`},side:{right:[`inset-y-0 right-0`,`data-open:animate-slide-in-right `,`data-closed:animate-slide-out-right`],left:[`inset-y-0 left-0`,`data-open:animate-slide-in-left`,`data-closed:animate-slide-out-left`],top:[`top-0 left-0`,`w-screen`,`data-open:animate-slide-in-top`,`data-closed:animate-slide-out-top`],bottom:[`bottom-0 left-0`,`w-screen`,`data-open:animate-slide-in-bottom`,`data-closed:animate-slide-out-bottom`]}},compoundVariants:[{side:[`right`,`left`],size:`sm`,class:[`w-sz-480`,`max-w-full`]},{side:[`right`,`left`],size:`md`,class:[`w-sz-672`,`max-w-full`]},{side:[`right`,`left`],size:`lg`,class:[`w-sz-864`,`max-w-full`]},{side:[`left`,`right`],size:`fluid`,class:[`w-auto`,`max-w-full`]},{side:[`top`,`bottom`],size:`sm`,class:[`h-sz-480`,`max-h-full`]},{side:[`top`,`bottom`],size:`md`,class:[`h-sz-672`,`max-h-full`]},{side:[`top`,`bottom`],size:`lg`,class:[`h-sz-864`,`max-h-full`]},{side:[`top`,`bottom`],size:`fluid`,class:[`h-auto`,`max-h-full`]}],defaultVariants:{side:`right`,size:`md`}}),y=({className:e,size:t=`md`,side:n=`right`,ref:i,...o})=>(0,a.jsx)(l.Dialog.Popup,{ref:i,"data-spark-component":`drawer-content`,role:`dialog`,className:i=>(0,r.cx)(v({size:t,side:n,className:typeof e==`function`?e(i):e})),...o});y.displayName=`Drawer.Content`;var b=e=>(0,a.jsx)(l.Dialog.Description,{"data-spark-component":`drawer-description`,...e});b.displayName=`Drawer.Description`;var x=({className:e,ref:t,...n})=>(0,a.jsx)(`footer`,{"data-spark-component":`drawer-footer`,ref:t,className:(0,r.cx)([`px-xl`,`py-lg`],e),...n});x.displayName=`Drawer.Footer`;var S=({children:e,className:t,ref:n,...i})=>(0,a.jsx)(`header`,{"data-spark-component":`drawer-header`,ref:n,className:(0,r.cx)([`px-xl`,`py-lg`],t),...i,children:e});S.displayName=`Dialog.Header`;var C=({className:e,...t})=>(0,a.jsx)(l.Dialog.Backdrop,{"data-spark-component":`drawer-overlay`,className:t=>(0,r.cx)(`z-overlay fixed top-0 left-0 h-screen w-screen`,`bg-overlay/dim-1`,`data-starting-style:animate-fade-in`,`data-ending-style:animate-fade-out`,typeof e==`function`?e(t):e),...t});C.displayName=`Drawer.Overlay`;var w=({className:e,...t})=>(0,a.jsx)(l.Dialog.Portal,{"data-spark-component":`drawer-portal`,className:(0,r.cx)(e,`z-modal absolute`),...t});w.displayName=`Drawer.Portal`;var T=({className:e,...t})=>(0,a.jsx)(l.Dialog.Title,{"data-spark-component":`drawer-title`,className:(0,r.cx)(`text-headline-2 text-on-surface`,e),...t});T.displayName=`Drawer.Title`;var E=({asChild:e=!1,...t})=>{let r=n.t(e,`button`);return(0,a.jsx)(l.Dialog.Trigger,{"data-spark-component":`drawer-trigger`,render:r,...t})};E.displayName=`Drawer.Trigger`;var D=Object.assign(p,{Trigger:E,Portal:w,Overlay:C,Content:y,Header:S,Body:h,Footer:x,Close:g,CloseButton:_,Title:T,Description:b});D.displayName=`Drawer`,E.displayName=`Drawer.Trigger`,w.displayName=`Drawer.Portal`,C.displayName=`Drawer.Overlay`,y.displayName=`Drawer.Content`,S.displayName=`Drawer.Header`,h.displayName=`Drawer.Body`,x.displayName=`Drawer.Footer`,g.displayName=`Drawer.Close`,_.displayName=`Drawer.CloseButton`,T.displayName=`Drawer.Title`,b.displayName=`Drawer.Description`,exports.Drawer=D;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "../icon-D05Uqh8_.mjs";
2
- import { t } from "../icon-button-DVbKK2_a.mjs";
2
+ import { t } from "../icon-button-Bw0k4nKs.mjs";
3
3
  import { t as n } from "../useRenderSlot-DKIwoqpO.mjs";
4
4
  import { cva as r, cx as i } from "class-variance-authority";
5
5
  import { createContext as a, useContext as o, useRef as s } from "react";
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-C91j1N6u.js`);const e=require(`../visually-hidden/index.js`),t=require(`../icon-CRPcdgYp.js`),n=require(`../popover-Daknmg_Z.js`);let r=require(`class-variance-authority`),i=require(`react`),a=require(`react/jsx-runtime`),o=require(`@spark-ui/icons/ArrowHorizontalDown`),s=require(`@spark-ui/hooks/use-merge-refs`),c=require(`@spark-ui/components/form-field`),l=require(`@spark-ui/icons/Check`),u=require(`downshift`);var d=({itemsMap:e,defaultValue:t,value:n,onValueChange:r,open:i,onOpenChange:a,defaultOpen:o,multiple:s,id:c,labelId:l})=>{let d=[...e.values()],f=(0,u.useMultipleSelection)({selectedItems:n!=null&&s?d.filter(e=>s?n.includes(e.value):n===e.value):void 0,initialSelectedItems:t!=null&&s?d.filter(e=>s?t.includes(e.value):t===e.value):void 0,onSelectedItemsChange:({selectedItems:e})=>{e!=null&&s&&r?.(e.map(e=>e.value))}});return{...(0,u.useSelect)({items:d,isItemDisabled:e=>e.disabled,itemToString:e=>e?e.text:``,id:c,labelId:l,isOpen:i,onIsOpenChange:({isOpen:e})=>{e!=null&&a?.(e)},initialIsOpen:o??!1,stateReducer:(e,{changes:t,type:n})=>{if(!s)return t;let{selectedItems:r,removeSelectedItem:i,addSelectedItem:a}=f;switch(n){case u.useSelect.stateChangeTypes.ToggleButtonKeyDownEnter:case u.useSelect.stateChangeTypes.ToggleButtonKeyDownSpaceButton:case u.useSelect.stateChangeTypes.ItemClick:return t.selectedItem!=null&&(r.some(e=>e.value===t.selectedItem?.value)?i(t.selectedItem):a(t.selectedItem)),{...t,isOpen:!0,highlightedIndex:e.highlightedIndex};default:return t}},selectedItem:n!=null&&!s?e.get(n)||null:void 0,initialSelectedItem:(t!=null||n!=null)&&!s?e.get(t)||null:void 0,onSelectedItemChange:({selectedItem:e})=>{e?.value!=null&&!s&&r?.(e?.value)},scrollIntoView:e=>{e&&e.scrollIntoView({block:`nearest`})}}),...f,selectedItems:[...new Set(f.selectedItems)]}};function f(e,t){let n=0;for(let[r]of e.entries()){if(r===t)return n;n++}return-1}var p=(e,t)=>{let n=0;for(let r of e.keys()){if(n===t)return r;n++}},m=(e,t)=>{let n=p(e,t);return n===void 0?void 0:e.get(n)},h=e=>e?e.type.displayName:``,g=(e,t=[])=>(i.Children.forEach(e,e=>{if((0,i.isValidElement)(e)){if(h(e)===`Dropdown.Item`){let n=e.props;t.push({value:n.value,disabled:!!n.disabled,text:_(n.children)})}e.props.children&&g(e.props.children,t)}}),t),_=(e,t=``)=>typeof e==`string`?e:(i.Children.forEach(e,e=>{(0,i.isValidElement)(e)&&(h(e)===`Dropdown.ItemText`&&(t=e.props.children),e.props.children&&_(e.props.children,t))}),t),v=e=>{let t=new Map;return g(e).forEach(e=>{t.set(e.value,e)}),t},y=(e,t)=>i.Children.toArray(e).some(e=>(0,i.isValidElement)(e)?h(e)===t?!0:e.props.children?y(e.props.children,t):!1:!1),b=(0,i.createContext)(null),x=`:dropdown`,S=({children:e,defaultValue:t,value:r,onValueChange:o,open:s,onOpenChange:l,defaultOpen:u,multiple:f=!1,disabled:p=!1,readOnly:h=!1,state:g})=>{let[_,S]=(0,i.useState)(v(e)),[C,w]=(0,i.useState)(y(e,`Dropdown.Popover`)),[T,E]=(0,i.useState)(`mouse`),D=(0,c.useFormFieldControl)(),O=D.state||g,k=`${x}-label-${(0,i.useId)()}`,A=`${x}-input-${(0,i.useId)()}`,j=D.id||A,M=D.labelId||k,N=D.disabled??p,P=D.readOnly??h,F=d({itemsMap:_,defaultValue:t,value:r,onValueChange:o,open:s,onOpenChange:l,defaultOpen:u,multiple:f,id:j,labelId:M});(0,i.useEffect)(()=>{let t=v(e),n=[..._.values()],r=[...t.values()];(n.length!==r.length||n.some((e,t)=>{let n=e.value!==r[t]?.value,i=e.text!==r[t]?.text;return n||i}))&&S(t)},[e]);let[I,L]=C?[n.t,{open:!0}]:[i.Fragment,{}];return(0,a.jsx)(b,{value:{multiple:f,disabled:N,readOnly:P,...F,itemsMap:_,highlightedItem:m(_,F.highlightedIndex),hasPopover:C,setHasPopover:w,state:O,lastInteractionType:T,setLastInteractionType:E},children:(0,a.jsx)(I,{...L,children:e})})},C=()=>{let e=(0,i.useContext)(b);if(!e)throw Error(`useDropdownContext must be used within a Dropdown provider`);return e},w=({children:e,...t})=>(0,a.jsx)(S,{...t,children:e});w.displayName=`Dropdown`;var T=({className:e,ref:t})=>(0,a.jsx)(`div`,{ref:t,className:(0,r.cx)(`my-md border-b-sm border-outline`,e)});T.displayName=`Dropdown.Divider`;var E=(0,i.createContext)(null),D=({children:e})=>(0,a.jsx)(E,{value:{labelId:`${x}-group-label-${(0,i.useId)()}`},children:e}),O=()=>{let e=(0,i.useContext)(E);if(!e)throw Error(`useDropdownGroupContext must be used within a DropdownGroup provider`);return e},k=({children:e,ref:t,...n})=>(0,a.jsx)(D,{children:(0,a.jsx)(A,{ref:t,...n,children:e})}),A=({children:e,className:t,ref:n})=>{let{labelId:i}=O();return(0,a.jsx)(`div`,{ref:n,role:`group`,"aria-labelledby":i,className:(0,r.cx)(t),children:e})};k.displayName=`Dropdown.Group`;var j=(0,i.createContext)(null),M=({value:e,disabled:t=!1,children:n})=>{let{multiple:r,itemsMap:o,selectedItem:s,selectedItems:c}=C(),[l,u]=(0,i.useState)(void 0),d=f(o,e),p={disabled:t,value:e,text:_(n)};return(0,a.jsx)(j,{value:{textId:l,setTextId:u,isSelected:r?c.some(t=>t.value===e):s?.value===e,itemData:p,index:d,disabled:t},children:n})},N=()=>{let e=(0,i.useContext)(j);if(!e)throw Error(`useDropdownItemContext must be used within a DropdownItem provider`);return e},P=({children:e,ref:t,...n})=>{let{value:r,disabled:i}=n;return(0,a.jsx)(M,{value:r,disabled:i,children:(0,a.jsx)(I,{ref:t,...n,children:e})})},F=(0,r.cva)(`px-lg py-md text-body-1`,{variants:{selected:{true:`font-bold`},disabled:{true:`opacity-dim-3 cursor-not-allowed`,false:`cursor-pointer`},highlighted:{true:``},interactionType:{mouse:``,keyboard:``}},compoundVariants:[{highlighted:!0,interactionType:`mouse`,class:`bg-surface-hovered`},{highlighted:!0,interactionType:`keyboard`,class:`u-outline`}]}),I=({className:e,disabled:t=!1,value:n,children:i,ref:o})=>{let{getItemProps:c,highlightedItem:l,lastInteractionType:u}=C(),{textId:d,index:f,itemData:p,isSelected:m}=N(),h=l?.value===n,{ref:g,..._}=c({item:p,index:f});return(0,a.jsx)(`li`,{ref:(0,s.useMergeRefs)(o,g),className:(0,r.cx)(F({selected:m,disabled:t,highlighted:h,interactionType:u,className:e})),..._,"aria-selected":m,"aria-labelledby":d,children:i},n)};P.displayName=`Dropdown.Item`;var L=({className:e,children:n,label:i,ref:o})=>{let{disabled:s,isSelected:c}=N(),u=n||(0,a.jsx)(t.t,{size:`sm`,children:(0,a.jsx)(l.Check,{"aria-label":i})});return(0,a.jsx)(`span`,{ref:o,className:(0,r.cx)(`min-h-sz-16 min-w-sz-16 flex`,s&&`opacity-dim-3`,e),children:c&&u})};L.displayName=`Dropdown.ItemIndicator`;var R=({children:e,className:t,ref:n,...o})=>{let{isOpen:c,getMenuProps:l,hasPopover:u,setLastInteractionType:d}=C(),{ref:f,...p}=l({onMouseMove:()=>{d(`mouse`)}}),m=(0,i.useRef)(null),h=(0,s.useMergeRefs)(n,f,m);return(0,i.useLayoutEffect)(()=>{u&&m.current&&m.current.parentElement&&(m.current.parentElement.style.pointerEvents=c?``:`none`,m.current.style.pointerEvents=c?``:`none`)},[c,u]),(0,a.jsx)(`ul`,{ref:h,className:(0,r.cx)(t,`flex flex-col`,c?`pointer-events-auto! block`:`pointer-events-none invisible absolute max-h-0 min-h-0 overflow-hidden opacity-0`,u&&c&&`p-lg`),...o,...p,"data-spark-component":`dropdown-items`,children:e})};R.displayName=`Dropdown.Items`;var z=({children:e,ref:t})=>{let n=`${x}-item-text-${(0,i.useId)()}`,{setTextId:o}=N();return(0,i.useEffect)(()=>(o(n),()=>o(void 0))),(0,a.jsx)(`span`,{id:n,className:(0,r.cx)(`inline`),ref:t,children:e})};z.displayName=`Dropdown.ItemText`;var B=({children:e,className:t,ref:n})=>{let{labelId:i}=O();return(0,a.jsx)(`div`,{ref:n,id:i,className:(0,r.cx)(`px-md py-sm text-body-2 text-neutral italic`,t),children:e})};B.displayName=`Dropdown.Label`;var V=({children:e})=>(0,a.jsx)(t.t,{size:`sm`,className:`shrink-0`,children:e});V.displayName=`Dropdown.LeadingIcon`;var H=({children:e,matchTriggerWidth:t=!0,sideOffset:o=4,className:s,elevation:c=`dropdown`,ref:l,...u})=>{let d=C();return(0,i.useEffect)(()=>(d.setHasPopover(!0),()=>d.setHasPopover(!1)),[]),(0,a.jsx)(n.t.Content,{ref:l,inset:!0,asChild:!0,matchTriggerWidth:t,elevation:c,className:(0,r.cx)(`relative`,s),sideOffset:o,onOpenAutoFocus:e=>{e.preventDefault()},...u,"data-spark-component":`dropdown-popover`,children:e})};H.displayName=`Dropdown.Popover`;var U=({children:e,...t})=>(0,a.jsx)(n.t.Portal,{...t,children:e});U.displayName=`Dropdown.Portal`;var W=(0,r.cva)([`flex w-full items-center justify-between`,`min-h-sz-44 rounded-input bg-surface text-on-surface px-lg`,`text-body-1`,`ring-1 outline-hidden ring-inset focus:ring-2 focus:ring-focus`],{variants:{state:{undefined:`ring-outline`,error:`ring-error`,alert:`ring-alert`,success:`ring-success`},disabled:{true:`disabled:bg-on-surface/dim-5 cursor-not-allowed text-on-surface/dim-3`},readOnly:{true:`disabled:bg-on-surface/dim-5 cursor-not-allowed text-on-surface/dim-3`}},compoundVariants:[{disabled:!1,state:void 0,class:`default:hover:ring-outline-high`}]}),G=({"aria-label":c,children:l,className:u,ref:d})=>{let{getToggleButtonProps:f,getDropdownProps:p,getLabelProps:m,hasPopover:h,disabled:g,readOnly:_,state:v,setLastInteractionType:y,isOpen:b}=C(),[x,S]=h?[n.t.Trigger,{asChild:!0}]:[i.Fragment,{}],{ref:w,...T}=f({...p(),onKeyDown:e=>{y(`keyboard`),e.key===`Escape`&&b&&e.stopPropagation()}}),E=T[`aria-expanded`],D=(0,s.useMergeRefs)(d,w);return(0,a.jsxs)(a.Fragment,{children:[c&&(0,a.jsx)(e.VisuallyHidden,{children:(0,a.jsx)(`label`,{...m(),children:c})}),(0,a.jsx)(x,{...S,children:(0,a.jsxs)(`button`,{type:`button`,ref:D,disabled:g||_,className:W({className:u,state:v,disabled:g,readOnly:_}),...T,"data-spark-component":`dropdown-trigger`,children:[(0,a.jsx)(`span`,{className:`gap-md flex items-center justify-start`,children:l}),(0,a.jsx)(t.t,{className:(0,r.cx)(`ml-md shrink-0 rotate-0 transition duration-100 ease-in`,{"rotate-180":E}),size:`sm`,children:(0,a.jsx)(o.ArrowHorizontalDown,{})})]})})]})};G.displayName=`Dropdown.Trigger`;var K=({children:e,className:t,placeholder:n,ref:i})=>{let{selectedItem:o,multiple:s,selectedItems:c}=C(),l=!!(s?c.length:o),u=s?c[0]?.text:o?.text,d=c.length>1?`, +${c.length-1}`:``;return(0,a.jsxs)(`span`,{ref:i,className:(0,r.cx)(`flex shrink items-center text-left`,t),children:[(0,a.jsx)(`span`,{className:(0,r.cx)(`line-clamp-1 flex-1 overflow-hidden break-all text-ellipsis`,!l&&`text-on-surface/dim-1`),children:l?e||u:n}),d&&(0,a.jsx)(`span`,{children:d})]})};K.displayName=`Dropdown.Value`;var q=Object.assign(w,{Group:k,Item:P,Items:R,ItemText:z,ItemIndicator:L,Label:B,Popover:H,Divider:T,Trigger:G,Value:K,LeadingIcon:V,Portal:U});q.displayName=`Dropdown`,k.displayName=`Dropdown.Group`,R.displayName=`Dropdown.Items`,P.displayName=`Dropdown.Item`,z.displayName=`Dropdown.ItemText`,L.displayName=`Dropdown.ItemIndicator`,B.displayName=`Dropdown.Label`,H.displayName=`Dropdown.Popover`,T.displayName=`Dropdown.Divider`,G.displayName=`Dropdown.Trigger`,K.displayName=`Dropdown.Value`,V.displayName=`Dropdown.LeadingIcon`,U.displayName=`Dropdown.Portal`,exports.Dropdown=q,exports.DropdownProvider=S,exports.useDropdownContext=C;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-C91j1N6u.js`);const e=require(`../visually-hidden/index.js`),t=require(`../icon-CRPcdgYp.js`),n=require(`../popover-CWZCAwhW.js`);let r=require(`class-variance-authority`),i=require(`react`),a=require(`react/jsx-runtime`),o=require(`@spark-ui/icons/ArrowHorizontalDown`),s=require(`@spark-ui/hooks/use-merge-refs`),c=require(`@spark-ui/components/form-field`),l=require(`@spark-ui/icons/Check`),u=require(`downshift`);var d=({itemsMap:e,defaultValue:t,value:n,onValueChange:r,open:i,onOpenChange:a,defaultOpen:o,multiple:s,id:c,labelId:l})=>{let d=[...e.values()],f=(0,u.useMultipleSelection)({selectedItems:n!=null&&s?d.filter(e=>s?n.includes(e.value):n===e.value):void 0,initialSelectedItems:t!=null&&s?d.filter(e=>s?t.includes(e.value):t===e.value):void 0,onSelectedItemsChange:({selectedItems:e})=>{e!=null&&s&&r?.(e.map(e=>e.value))}});return{...(0,u.useSelect)({items:d,isItemDisabled:e=>e.disabled,itemToString:e=>e?e.text:``,id:c,labelId:l,isOpen:i,onIsOpenChange:({isOpen:e})=>{e!=null&&a?.(e)},initialIsOpen:o??!1,stateReducer:(e,{changes:t,type:n})=>{if(!s)return t;let{selectedItems:r,removeSelectedItem:i,addSelectedItem:a}=f;switch(n){case u.useSelect.stateChangeTypes.ToggleButtonKeyDownEnter:case u.useSelect.stateChangeTypes.ToggleButtonKeyDownSpaceButton:case u.useSelect.stateChangeTypes.ItemClick:return t.selectedItem!=null&&(r.some(e=>e.value===t.selectedItem?.value)?i(t.selectedItem):a(t.selectedItem)),{...t,isOpen:!0,highlightedIndex:e.highlightedIndex};default:return t}},selectedItem:n!=null&&!s?e.get(n)||null:void 0,initialSelectedItem:(t!=null||n!=null)&&!s?e.get(t)||null:void 0,onSelectedItemChange:({selectedItem:e})=>{e?.value!=null&&!s&&r?.(e?.value)},scrollIntoView:e=>{e&&e.scrollIntoView({block:`nearest`})}}),...f,selectedItems:[...new Set(f.selectedItems)]}};function f(e,t){let n=0;for(let[r]of e.entries()){if(r===t)return n;n++}return-1}var p=(e,t)=>{let n=0;for(let r of e.keys()){if(n===t)return r;n++}},m=(e,t)=>{let n=p(e,t);return n===void 0?void 0:e.get(n)},h=e=>e?e.type.displayName:``,g=(e,t=[])=>(i.Children.forEach(e,e=>{if((0,i.isValidElement)(e)){if(h(e)===`Dropdown.Item`){let n=e.props;t.push({value:n.value,disabled:!!n.disabled,text:_(n.children)})}e.props.children&&g(e.props.children,t)}}),t),_=(e,t=``)=>typeof e==`string`?e:(i.Children.forEach(e,e=>{(0,i.isValidElement)(e)&&(h(e)===`Dropdown.ItemText`&&(t=e.props.children),e.props.children&&_(e.props.children,t))}),t),v=e=>{let t=new Map;return g(e).forEach(e=>{t.set(e.value,e)}),t},y=(e,t)=>i.Children.toArray(e).some(e=>(0,i.isValidElement)(e)?h(e)===t?!0:e.props.children?y(e.props.children,t):!1:!1),b=(0,i.createContext)(null),x=`:dropdown`,S=({children:e,defaultValue:t,value:r,onValueChange:o,open:s,onOpenChange:l,defaultOpen:u,multiple:f=!1,disabled:p=!1,readOnly:h=!1,state:g})=>{let[_,S]=(0,i.useState)(v(e)),[C,w]=(0,i.useState)(y(e,`Dropdown.Popover`)),[T,E]=(0,i.useState)(`mouse`),D=(0,c.useFormFieldControl)(),O=D.state||g,k=`${x}-label-${(0,i.useId)()}`,A=`${x}-input-${(0,i.useId)()}`,j=D.id||A,M=D.labelId||k,N=D.disabled??p,P=D.readOnly??h,F=d({itemsMap:_,defaultValue:t,value:r,onValueChange:o,open:s,onOpenChange:l,defaultOpen:u,multiple:f,id:j,labelId:M});(0,i.useEffect)(()=>{let t=v(e),n=[..._.values()],r=[...t.values()];(n.length!==r.length||n.some((e,t)=>{let n=e.value!==r[t]?.value,i=e.text!==r[t]?.text;return n||i}))&&S(t)},[e]);let[I,L]=C?[n.t,{open:!0}]:[i.Fragment,{}];return(0,a.jsx)(b,{value:{multiple:f,disabled:N,readOnly:P,...F,itemsMap:_,highlightedItem:m(_,F.highlightedIndex),hasPopover:C,setHasPopover:w,state:O,lastInteractionType:T,setLastInteractionType:E},children:(0,a.jsx)(I,{...L,children:e})})},C=()=>{let e=(0,i.useContext)(b);if(!e)throw Error(`useDropdownContext must be used within a Dropdown provider`);return e},w=({children:e,...t})=>(0,a.jsx)(S,{...t,children:e});w.displayName=`Dropdown`;var T=({className:e,ref:t})=>(0,a.jsx)(`div`,{ref:t,className:(0,r.cx)(`my-md border-b-sm border-outline`,e)});T.displayName=`Dropdown.Divider`;var E=(0,i.createContext)(null),D=({children:e})=>(0,a.jsx)(E,{value:{labelId:`${x}-group-label-${(0,i.useId)()}`},children:e}),O=()=>{let e=(0,i.useContext)(E);if(!e)throw Error(`useDropdownGroupContext must be used within a DropdownGroup provider`);return e},k=({children:e,ref:t,...n})=>(0,a.jsx)(D,{children:(0,a.jsx)(A,{ref:t,...n,children:e})}),A=({children:e,className:t,ref:n})=>{let{labelId:i}=O();return(0,a.jsx)(`div`,{ref:n,role:`group`,"aria-labelledby":i,className:(0,r.cx)(t),children:e})};k.displayName=`Dropdown.Group`;var j=(0,i.createContext)(null),M=({value:e,disabled:t=!1,children:n})=>{let{multiple:r,itemsMap:o,selectedItem:s,selectedItems:c}=C(),[l,u]=(0,i.useState)(void 0),d=f(o,e),p={disabled:t,value:e,text:_(n)};return(0,a.jsx)(j,{value:{textId:l,setTextId:u,isSelected:r?c.some(t=>t.value===e):s?.value===e,itemData:p,index:d,disabled:t},children:n})},N=()=>{let e=(0,i.useContext)(j);if(!e)throw Error(`useDropdownItemContext must be used within a DropdownItem provider`);return e},P=({children:e,ref:t,...n})=>{let{value:r,disabled:i}=n;return(0,a.jsx)(M,{value:r,disabled:i,children:(0,a.jsx)(I,{ref:t,...n,children:e})})},F=(0,r.cva)(`px-lg py-md text-body-1`,{variants:{selected:{true:`font-bold`},disabled:{true:`opacity-dim-3 cursor-not-allowed`,false:`cursor-pointer`},highlighted:{true:``},interactionType:{mouse:``,keyboard:``}},compoundVariants:[{highlighted:!0,interactionType:`mouse`,class:`bg-surface-hovered`},{highlighted:!0,interactionType:`keyboard`,class:`u-outline`}]}),I=({className:e,disabled:t=!1,value:n,children:i,ref:o})=>{let{getItemProps:c,highlightedItem:l,lastInteractionType:u}=C(),{textId:d,index:f,itemData:p,isSelected:m}=N(),h=l?.value===n,{ref:g,..._}=c({item:p,index:f});return(0,a.jsx)(`li`,{ref:(0,s.useMergeRefs)(o,g),className:(0,r.cx)(F({selected:m,disabled:t,highlighted:h,interactionType:u,className:e})),..._,"aria-selected":m,"aria-labelledby":d,children:i},n)};P.displayName=`Dropdown.Item`;var L=({className:e,children:n,label:i,ref:o})=>{let{disabled:s,isSelected:c}=N(),u=n||(0,a.jsx)(t.t,{size:`sm`,children:(0,a.jsx)(l.Check,{"aria-label":i})});return(0,a.jsx)(`span`,{ref:o,className:(0,r.cx)(`min-h-sz-16 min-w-sz-16 flex`,s&&`opacity-dim-3`,e),children:c&&u})};L.displayName=`Dropdown.ItemIndicator`;var R=({children:e,className:t,ref:n,...o})=>{let{isOpen:c,getMenuProps:l,hasPopover:u,setLastInteractionType:d}=C(),{ref:f,...p}=l({onMouseMove:()=>{d(`mouse`)}}),m=(0,i.useRef)(null),h=(0,s.useMergeRefs)(n,f,m);return(0,i.useLayoutEffect)(()=>{u&&m.current&&m.current.parentElement&&(m.current.parentElement.style.pointerEvents=c?``:`none`,m.current.style.pointerEvents=c?``:`none`)},[c,u]),(0,a.jsx)(`ul`,{ref:h,className:(0,r.cx)(t,`flex flex-col`,c?`pointer-events-auto! block`:`pointer-events-none invisible absolute max-h-0 min-h-0 overflow-hidden opacity-0`,u&&c&&`p-lg`),...o,...p,"data-spark-component":`dropdown-items`,children:e})};R.displayName=`Dropdown.Items`;var z=({children:e,ref:t})=>{let n=`${x}-item-text-${(0,i.useId)()}`,{setTextId:o}=N();return(0,i.useEffect)(()=>(o(n),()=>o(void 0))),(0,a.jsx)(`span`,{id:n,className:(0,r.cx)(`inline`),ref:t,children:e})};z.displayName=`Dropdown.ItemText`;var B=({children:e,className:t,ref:n})=>{let{labelId:i}=O();return(0,a.jsx)(`div`,{ref:n,id:i,className:(0,r.cx)(`px-md py-sm text-body-2 text-neutral italic`,t),children:e})};B.displayName=`Dropdown.Label`;var V=({children:e})=>(0,a.jsx)(t.t,{size:`sm`,className:`shrink-0`,children:e});V.displayName=`Dropdown.LeadingIcon`;var H=({children:e,matchTriggerWidth:t=!0,sideOffset:o=4,className:s,elevation:c=`dropdown`,ref:l,...u})=>{let d=C();return(0,i.useEffect)(()=>(d.setHasPopover(!0),()=>d.setHasPopover(!1)),[]),(0,a.jsx)(n.t.Content,{ref:l,inset:!0,asChild:!0,matchTriggerWidth:t,elevation:c,className:(0,r.cx)(`relative`,s),sideOffset:o,onOpenAutoFocus:e=>{e.preventDefault()},...u,"data-spark-component":`dropdown-popover`,children:e})};H.displayName=`Dropdown.Popover`;var U=({children:e,...t})=>(0,a.jsx)(n.t.Portal,{...t,children:e});U.displayName=`Dropdown.Portal`;var W=(0,r.cva)([`flex w-full items-center justify-between`,`min-h-sz-44 rounded-input bg-surface text-on-surface px-lg`,`text-body-1`,`ring-1 outline-hidden ring-inset focus:ring-2 focus:ring-focus`],{variants:{state:{undefined:`ring-outline`,error:`ring-error`,alert:`ring-alert`,success:`ring-success`},disabled:{true:`disabled:bg-on-surface/dim-5 cursor-not-allowed text-on-surface/dim-3`},readOnly:{true:`disabled:bg-on-surface/dim-5 cursor-not-allowed text-on-surface/dim-3`}},compoundVariants:[{disabled:!1,state:void 0,class:`default:hover:ring-outline-high`}]}),G=({"aria-label":c,children:l,className:u,ref:d})=>{let{getToggleButtonProps:f,getDropdownProps:p,getLabelProps:m,hasPopover:h,disabled:g,readOnly:_,state:v,setLastInteractionType:y,isOpen:b}=C(),[x,S]=h?[n.t.Trigger,{asChild:!0}]:[i.Fragment,{}],{ref:w,...T}=f({...p(),onKeyDown:e=>{y(`keyboard`),e.key===`Escape`&&b&&e.stopPropagation()}}),E=T[`aria-expanded`],D=(0,s.useMergeRefs)(d,w);return(0,a.jsxs)(a.Fragment,{children:[c&&(0,a.jsx)(e.VisuallyHidden,{children:(0,a.jsx)(`label`,{...m(),children:c})}),(0,a.jsx)(x,{...S,children:(0,a.jsxs)(`button`,{type:`button`,ref:D,disabled:g||_,className:W({className:u,state:v,disabled:g,readOnly:_}),...T,"data-spark-component":`dropdown-trigger`,children:[(0,a.jsx)(`span`,{className:`gap-md flex items-center justify-start`,children:l}),(0,a.jsx)(t.t,{className:(0,r.cx)(`ml-md shrink-0 rotate-0 transition duration-100 ease-in`,{"rotate-180":E}),size:`sm`,children:(0,a.jsx)(o.ArrowHorizontalDown,{})})]})})]})};G.displayName=`Dropdown.Trigger`;var K=({children:e,className:t,placeholder:n,ref:i})=>{let{selectedItem:o,multiple:s,selectedItems:c}=C(),l=!!(s?c.length:o),u=s?c[0]?.text:o?.text,d=c.length>1?`, +${c.length-1}`:``;return(0,a.jsxs)(`span`,{ref:i,className:(0,r.cx)(`flex shrink items-center text-left`,t),children:[(0,a.jsx)(`span`,{className:(0,r.cx)(`line-clamp-1 flex-1 overflow-hidden break-all text-ellipsis`,!l&&`text-on-surface/dim-1`),children:l?e||u:n}),d&&(0,a.jsx)(`span`,{children:d})]})};K.displayName=`Dropdown.Value`;var q=Object.assign(w,{Group:k,Item:P,Items:R,ItemText:z,ItemIndicator:L,Label:B,Popover:H,Divider:T,Trigger:G,Value:K,LeadingIcon:V,Portal:U});q.displayName=`Dropdown`,k.displayName=`Dropdown.Group`,R.displayName=`Dropdown.Items`,P.displayName=`Dropdown.Item`,z.displayName=`Dropdown.ItemText`,L.displayName=`Dropdown.ItemIndicator`,B.displayName=`Dropdown.Label`,H.displayName=`Dropdown.Popover`,T.displayName=`Dropdown.Divider`,G.displayName=`Dropdown.Trigger`,K.displayName=`Dropdown.Value`,V.displayName=`Dropdown.LeadingIcon`,U.displayName=`Dropdown.Portal`,exports.Dropdown=q,exports.DropdownProvider=S,exports.useDropdownContext=C;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  import { VisuallyHidden as e } from "../visually-hidden/index.mjs";
2
2
  import { t } from "../icon-D05Uqh8_.mjs";
3
- import { t as n } from "../popover-83FABwMs.mjs";
3
+ import { t as n } from "../popover-B11eXklt.mjs";
4
4
  import { cva as r, cx as i } from "class-variance-authority";
5
5
  import { Children as a, Fragment as o, createContext as s, isValidElement as c, useContext as l, useEffect as u, useId as d, useLayoutEffect as f, useRef as p, useState as m } from "react";
6
6
  import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-C91j1N6u.js`),t=require(`../slot/index.js`),n=require(`../icon-CRPcdgYp.js`),r=require(`../button-Tv2N8_24.js`),i=require(`../icon-button-CTe0v0g7.js`),a=require(`../progress-DBD2FiQ1.js`);let o=require(`class-variance-authority`),s=require(`react`);s=e.t(s);let c=require(`react/jsx-runtime`),l=require(`@spark-ui/components/form-field`),u=require(`@spark-ui/hooks/use-combined-state`),d=require(`@spark-ui/icons/Close`),f=require(`@spark-ui/icons/CvOutline`),p=require(`@spark-ui/icons/FilePdfOutline`),m=require(`@spark-ui/icons/ImageOutline`),h=require(`@spark-ui/icons/PlayOutline`),g=require(`@spark-ui/icons/WarningOutline`);var _={TOO_MANY_FILES:`TOO_MANY_FILES`,FILE_INVALID_TYPE:`FILE_INVALID_TYPE`,FILE_TOO_LARGE:`FILE_TOO_LARGE`,FILE_TOO_SMALL:`FILE_TOO_SMALL`,FILE_INVALID:`FILE_INVALID`,FILE_EXISTS:`FILE_EXISTS`};function v(e,t){return t?t.split(`,`).map(e=>e.trim()).some(t=>{if(t.includes(`/`)){if(t.endsWith(`/*`)){let n=t.slice(0,-2);return e.type.startsWith(n+`/`)}return e.type===t}if(t.startsWith(`.`)){let n=t.toLowerCase();return e.name.toLowerCase().endsWith(n)}let n=`.`+t.toLowerCase();return e.name.toLowerCase().endsWith(n)}):!0}function y(e,t,n,r){let i=r||b();return t!==void 0&&e.size<t?{valid:!1,error:`File "${e.name}" is too small. Minimum size is ${x(t,i)}.`}:n!==void 0&&e.size>n?{valid:!1,error:`File "${e.name}" is too large. Maximum size is ${x(n,i)}.`}:{valid:!0}}function b(){return typeof navigator<`u`&&navigator.language?navigator.language:`en`}function x(e,t){let n=t||b(),r=n;if(n.length===2&&(r=n===`fr`?`fr-FR`:`en-US`),e===0)return new Intl.NumberFormat(r,{style:`unit`,unit:`byte`,unitDisplay:`long`,minimumFractionDigits:0,maximumFractionDigits:0}).format(0);let i=1024,a=Math.floor(Math.log(e)/Math.log(i)),o=[`byte`,`kilobyte`,`megabyte`,`gigabyte`][a]||`byte`,s=e/i**+a,c=a===0?`long`:`short`;return new Intl.NumberFormat(r,{style:`unit`,unit:o,unitDisplay:c,minimumFractionDigits:0,maximumFractionDigits:2}).format(s)}function S(e){let t=e.type.toLowerCase(),n=e.name.toLowerCase();return t.startsWith(`image/`)||/\.(jpg|jpeg|png|gif|bmp|webp|svg|ico)$/i.test(n)?(0,s.createElement)(m.ImageOutline):t===`application/pdf`||n.endsWith(`.pdf`)?(0,s.createElement)(p.FilePdfOutline):t.startsWith(`video/`)||/\.(mp4|avi|mov|wmv|flv|webm|mkv)$/i.test(n)?(0,s.createElement)(h.PlayOutline):(0,s.createElement)(f.CvOutline)}function C(e){if(!e)return!1;if(e.tabIndex>=0)return!0;let t=String(e.contentEditable)===`true`;return e instanceof HTMLInputElement||e instanceof HTMLButtonElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLAnchorElement&&!!e.href||t}function w(e,t){for(let t of e)if(C(t))return t;return t.current?t.current:null}function T({defaultValue:e=[],value:t,onFileAccept:n,onFileReject:r,onFileChange:i,multiple:a=!0,accept:o,maxFiles:c,maxFileSize:l,minFileSize:d,disabled:f=!1,readOnly:p=!1,locale:m}){let h=m||(typeof navigator<`u`&&navigator.language?navigator.language:`en`),[g,b]=(0,u.useCombinedState)(t,e),x=g??[],S=b,[C,w]=(0,s.useState)([]);return{files:x,rejectedFiles:C,addFiles:e=>{if(f||p)return;w([]);let t=[],s=(e,t)=>t.some(t=>t.name===e.name&&t.size===e.size),u=(e,n)=>{let r=t.find(t=>t.file.name===e.name&&t.file.size===e.size);r?r.errors.includes(n)||r.errors.push(n):t.push({file:e,errors:[n]})};S(f=>{let p=f??[],m=c===void 0?void 0:c-p.length;m!==void 0&&m<=0&&e.forEach(e=>{u(e,_.TOO_MANY_FILES)});let g=e;o&&(e.filter(e=>!v(e,o)).forEach(e=>{u(e,_.FILE_INVALID_TYPE)}),g=e.filter(e=>v(e,o)));let b=g;(d!==void 0||l!==void 0)&&(b=g.filter(e=>y(e,d,l,h).valid?!0:(l!==void 0&&e.size>l?u(e,_.FILE_TOO_LARGE):d!==void 0&&e.size<d?u(e,_.FILE_TOO_SMALL):u(e,_.FILE_INVALID),!1)));let x=new Map,S=b.filter(e=>{let t=`${e.name}-${e.size}`;return s(e,p)||x.has(t)?(u(e,_.FILE_EXISTS),!1):(x.set(t,e),!0)}),C=a?S:S.slice(0,1);m!==void 0&&(m<=0?C=[]:C.length>m&&(C.forEach(e=>{u(e,_.TOO_MANY_FILES)}),C=[]));let T=a?[...p,...C]:C,E=[...t];return w(E),C.length>0&&n&&n({files:C}),E.length>0&&r&&r({files:E}),i&&i({acceptedFiles:T,rejectedFiles:E}),T})},removeFile:e=>{f||p||S(t=>{let n=(t??[]).filter((t,n)=>n!==e),r=C;return c!==void 0&&n.length<c&&(r=C.filter(e=>!e.errors.includes(_.TOO_MANY_FILES)),w(r)),i&&i({acceptedFiles:n,rejectedFiles:r}),n})},removeRejectedFile:e=>{f||p||w(t=>t.filter((t,n)=>n!==e))},clearFiles:()=>{f||p||(S([]),w([]),i&&i({acceptedFiles:[],rejectedFiles:[]}))},clearRejectedFiles:()=>{w([])},maxFilesReached:c!==void 0&&x.length>=c}}var E=(0,s.createContext)(null),D=`:file-upload`,O=({asChild:e=!1,children:t,defaultValue:n=[],value:r,onFileAccept:i,onFileReject:a,onFileChange:o,multiple:u=!0,accept:d,maxFiles:f,maxFileSize:p,minFileSize:m,disabled:h=!1,readOnly:g=!1,locale:_})=>{let v=(0,l.useFormFieldControl)(),y=(0,s.useId)(),b=v.id||`${D}-${y}`,x=v.name,S=(0,s.useRef)(null),C=(0,s.useRef)(null),w=(0,s.useRef)(null),O=(0,s.useRef)([]),k=(0,s.useRef)([]),A=v.disabled??h,j=v.readOnly??g,{files:M,rejectedFiles:N,addFiles:P,removeFile:F,removeRejectedFile:I,clearFiles:L,clearRejectedFiles:R,maxFilesReached:z}=T({defaultValue:n,value:r,onFileAccept:i,onFileReject:a,onFileChange:o,multiple:u,accept:d,maxFiles:f,maxFileSize:p,minFileSize:m,disabled:A,readOnly:j,locale:_});return(0,c.jsx)(E,{value:{inputRef:S,files:M,rejectedFiles:N,addFiles:P,removeFile:F,removeRejectedFile:I,clearFiles:()=>{L(),O.current=[]},clearRejectedFiles:()=>{R(),k.current=[]},triggerRef:C,dropzoneRef:w,deleteButtonRefs:O,rejectedFileDeleteButtonRefs:k,multiple:u,maxFiles:f,maxFilesReached:z,disabled:A,readOnly:j,locale:_||(typeof navigator<`u`&&navigator.language?navigator.language:`en`),description:v.description,isInvalid:v.isInvalid,isRequired:v.isRequired},children:(0,c.jsxs)(`div`,{className:`relative`,children:[t,(0,c.jsx)(`input`,{ref:S,type:`file`,tabIndex:-1,id:b,multiple:u,name:x,accept:d,disabled:A,readOnly:j&&!A,required:v.isRequired,"aria-invalid":v.isInvalid,"aria-describedby":v.description,"aria-label":v.labelId?void 0:`Upload files`,className:`sr-only`,onChange:e=>{if(e.target.files&&!A&&!j){P(Array.from(e.target.files));try{e.target.value=``}catch{}}}})]})})};O.displayName=`FileUpload`;var k=()=>{let e=(0,s.useContext)(E);if(!e)throw Error(`useFileUploadContext must be used within a FileUpload provider`);return e},A=({className:e,file:t,onClick:r,...a})=>{let{removeFile:l,triggerRef:u,dropzoneRef:f,deleteButtonRefs:p,inputRef:m,disabled:h,readOnly:g,files:_}=k(),v=(0,s.useRef)(null),y=_.findIndex(e=>e.name===t.name&&e.size===t.size);return(0,c.jsx)(i.t,{ref:e=>{if(v.current=e,e){for(;p.current.length<=y;)p.current.push(null);p.current[y]=e}else p.current[y]&&(p.current[y]=null)},"data-spark-component":`file-upload-item-delete-trigger`,className:(0,o.cx)(e),onClick:e=>{h||g||(l(y),requestAnimationFrame(()=>{let e=p.current.filter(Boolean);if(e.length>0){let t=e[Math.min(y,e.length-1)];t&&t.focus()}else{let e=w([u.current,f.current],m);e&&e.focus()}}),r?.(e))},disabled:h||g,size:`sm`,design:`contrast`,intent:`surface`,...a,children:(0,c.jsx)(n.t,{size:`sm`,children:(0,c.jsx)(d.Close,{})})})};A.displayName=`FileUpload.ItemDeleteTrigger`;var j=({className:e,file:t,uploadProgress:r,deleteButtonAriaLabel:i,progressAriaLabel:l,...u})=>{let{locale:d}=k(),[f,p]=(0,s.useState)(r!==void 0);(0,s.useEffect)(()=>{p(r!==void 0)},[r]);let m=(0,s.useCallback)(()=>{p(!1)},[]);return(0,c.jsxs)(`li`,{"data-spark-component":`file-upload-accepted-file`,className:(0,o.cx)(`relative`,`default:bg-surface default:border-sm default:border-outline default:p-md default:rounded-md`,`gap-md flex items-center justify-between default:w-full`,e),...u,children:[(0,c.jsx)(`div`,{className:`size-sz-36 bg-support-container flex items-center justify-center rounded-md`,children:(0,c.jsx)(n.t,{size:`md`,children:S(t)})}),(0,c.jsxs)(`div`,{className:`gap-md relative flex min-w-0 flex-1 flex-row items-center justify-between self-stretch`,children:[(0,c.jsx)(`p`,{className:`text-body-2 truncate font-medium`,children:t.name}),(0,c.jsx)(`p`,{className:`text-caption opacity-dim-1`,children:x(t.size,d)}),f&&r!==void 0&&(0,c.jsx)(`div`,{className:`absolute bottom-0 left-0 w-full`,children:(0,c.jsx)(a.t,{value:r,max:100,"aria-label":l,onComplete:m})})]}),(0,c.jsx)(A,{"aria-label":i,file:t})]})};j.displayName=`FileUpload.AcceptedFile`;var M=({children:e})=>{let{files:t=[],rejectedFiles:n=[],locale:r}=k();return(0,c.jsx)(c.Fragment,{children:e({acceptedFiles:t,rejectedFiles:n,formatFileSize:x,locale:r})})};M.displayName=`FileUpload.Context`;var N=(0,s.createContext)(!1),P=()=>(0,s.useContext)(N);function F({children:e,className:t,unstyled:n=!1}){let r=k(),i=(0,s.useRef)(null);if(!r)throw Error(`FileUploadDropzone must be used inside <FileUpload>`);let a=e=>{if(e.preventDefault(),e.stopPropagation(),e.currentTarget.setAttribute(`data-drag-over`,`false`),r.disabled||r.readOnly)return;let t=e.dataTransfer.files,n=[];t&&(n=Array.isArray(t)?[...t]:Array.from(t)),n.length>0&&r.addFiles(n)},l=()=>{!r.disabled&&!r.readOnly&&r.inputRef.current?.click()},u=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),!r.disabled&&!r.readOnly&&r.inputRef.current?.click())},d=r.disabled||r.readOnly;return(0,c.jsx)(N,{value:!0,children:(0,c.jsx)(`div`,{ref:e=>{i.current=e,r.dropzoneRef&&(r.dropzoneRef.current=e)},role:`button`,tabIndex:d?-1:0,"aria-disabled":r.disabled?!0:void 0,"aria-describedby":r.description,"aria-invalid":r.isInvalid,"aria-required":r.isRequired,onClick:l,onKeyDown:u,onDrop:a,onDragOver:e=>{e.preventDefault()},className:n?t:(0,o.cx)(`default:bg-surface default:border-sm default:border-outline default:relative default:rounded-lg default:border-dashed`,`gap-lg flex flex-col items-center justify-center text-center`,`default:p-xl`,`transition-colors duration-200`,!d&&`default:hover:bg-surface-hovered`,`data-[drag-over=true]:border-outline-high data-[drag-over=true]:bg-surface-hovered data-[drag-over=true]:border-solid`,r.disabled&&`cursor-not-allowed opacity-50`,r.readOnly&&!r.disabled&&`cursor-default`,t),onDragEnter:e=>{d||e.currentTarget.setAttribute(`data-drag-over`,`true`)},onDragLeave:e=>{e.currentTarget.setAttribute(`data-drag-over`,`false`)},children:e})})}F.displayName=`FileUploadDropzone`;var I=({className:e,file:t,fallback:n=`📄`,...r})=>{let[i,a]=(0,s.useState)(!1),[l,u]=(0,s.useState)(!1),[d,f]=(0,s.useState)(null),p=t.type.startsWith(`image/`);return(0,s.useEffect)(()=>{if(!p){f(null);return}let e=URL.createObjectURL(t);return f(e),()=>{URL.revokeObjectURL(e)}},[t,p]),!p||i?(0,c.jsx)(`div`,{"data-spark-component":`file-upload-preview-image`,className:(0,o.cx)(`bg-neutral-container flex items-center justify-center rounded-md`,e),...r,children:n}):(0,c.jsxs)(`div`,{"data-spark-component":`file-upload-preview-image`,className:(0,o.cx)(`bg-neutral-container overflow-hidden`,e),...r,children:[(0,c.jsx)(`img`,{src:d,alt:t.name,className:(0,o.cx)(`size-full object-cover`,!l&&`opacity-0`),onLoad:()=>u(!0),onError:()=>a(!0)}),!l&&(0,c.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:n})]})};I.displayName=`FileUpload.PreviewImage`;var L=({className:e,rejectedFile:t,onClick:r,...a})=>{let{removeRejectedFile:l,triggerRef:u,dropzoneRef:f,rejectedFileDeleteButtonRefs:p,inputRef:m,disabled:h,readOnly:g,rejectedFiles:_}=k(),v=(0,s.useRef)(null),y=_.findIndex(e=>e.file.name===t.file.name&&e.file.size===t.file.size);return(0,c.jsx)(i.t,{ref:e=>{if(v.current=e,e){for(;p.current.length<=y;)p.current.push(null);p.current[y]=e}else p.current[y]&&(p.current[y]=null)},"data-spark-component":`file-upload-rejected-file-delete-trigger`,className:(0,o.cx)(e),onClick:e=>{h||g||(l(y),requestAnimationFrame(()=>{let e=p.current.filter(Boolean);if(e.length>0){let t=e[Math.min(y,e.length-1)];t&&t.focus()}else{let e=w([u.current,f.current],m);e&&e.focus()}}),r?.(e))},disabled:h||g,size:`sm`,design:`contrast`,intent:`surface`,...a,children:(0,c.jsx)(n.t,{size:`sm`,children:(0,c.jsx)(d.Close,{})})})};L.displayName=`FileUpload.RejectedFileDeleteTrigger`;var R=({className:e,rejectedFile:t,renderError:r,deleteButtonAriaLabel:i,...a})=>{let{locale:s}=k();return(0,c.jsxs)(`li`,{"data-spark-component":`file-upload-rejected-file`,className:(0,o.cx)(`relative`,`default:bg-surface default:border-sm default:border-outline default:p-md default:rounded-md`,`gap-md flex items-center justify-between default:w-full`,`border-error border-md`,e),...a,children:[(0,c.jsx)(`div`,{className:`size-sz-36 bg-error-container flex items-center justify-center rounded-md`,children:(0,c.jsx)(n.t,{size:`md`,className:`text-error`,children:(0,c.jsx)(g.WarningOutline,{})})}),(0,c.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,c.jsxs)(`div`,{className:`gap-md flex flex-col`,children:[(0,c.jsxs)(`div`,{className:`gap-md flex flex-row items-center justify-between`,children:[(0,c.jsx)(`p`,{className:`text-body-2 truncate font-medium`,children:t.file.name}),(0,c.jsx)(`p`,{className:`text-caption opacity-dim-1`,children:x(t.file.size,s)})]}),(0,c.jsx)(`div`,{className:`gap-xs flex flex-col`,children:t.errors.map((e,t)=>(0,c.jsx)(`div`,{className:`text-caption text-error`,"data-error-code":e,children:r(e)},t))})]})}),(0,c.jsx)(L,{"aria-label":i,rejectedFile:t})]})};R.displayName=`FileUpload.RejectedFile`;var z=({className:e,children:n,asChild:i=!1,unstyled:a=!1,design:s=`filled`,intent:l=`support`,size:u=`md`,shape:d=`rounded`,ref:f,...p})=>{let{inputRef:m,triggerRef:h,disabled:g,readOnly:_,description:v,isInvalid:y,isRequired:b}=k(),x=P(),S=e=>{e.stopPropagation(),e.preventDefault(),!g&&!_&&m.current?.click()},C=e=>{h&&(h.current=e),f&&(typeof f==`function`?f(e):f.current=e)},w,T;return x?(w=`span`,T={ref:C,"data-spark-component":`file-upload-trigger`,className:a?e:r.n({design:s,intent:l,size:u,shape:d,disabled:g||_,className:e})}):(w=i?t.Slot:a?`button`:r.t,T={ref:C,type:`button`,design:s,intent:l,size:u,shape:d,"data-spark-component":`file-upload-trigger`,className:(0,o.cx)(e),disabled:g||_,onClick:S,"aria-describedby":v,"aria-invalid":y,"aria-required":b,...p}),(0,c.jsx)(w,{...T,children:n})};z.displayName=`FileUpload.Trigger`;var B=Object.assign(O,{Trigger:z,Dropzone:F,Context:M,AcceptedFile:j,RejectedFile:R,PreviewImage:I,ItemDeleteTrigger:A,RejectedFileDeleteTrigger:L});B.displayName=`FileUpload`,z.displayName=`FileUpload.Trigger`,F.displayName=`FileUpload.Dropzone`,M.displayName=`FileUpload.Context`,A.displayName=`FileUpload.ItemDeleteTrigger`,I.displayName=`FileUpload.PreviewImage`,j.displayName=`FileUpload.AcceptedFile`,R.displayName=`FileUpload.RejectedFile`,L.displayName=`FileUpload.RejectedFileDeleteTrigger`,exports.FILE_UPLOAD_ERRORS=_,exports.FileUpload=B;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-C91j1N6u.js`),t=require(`../slot/index.js`),n=require(`../icon-CRPcdgYp.js`),r=require(`../button-pz6WB_vb.js`),i=require(`../icon-button-BKVPOP0K.js`),a=require(`../progress-DBD2FiQ1.js`);let o=require(`class-variance-authority`),s=require(`react`);s=e.t(s);let c=require(`react/jsx-runtime`),l=require(`@spark-ui/components/form-field`),u=require(`@spark-ui/hooks/use-combined-state`),d=require(`@spark-ui/icons/Close`),f=require(`@spark-ui/icons/CvOutline`),p=require(`@spark-ui/icons/FilePdfOutline`),m=require(`@spark-ui/icons/ImageOutline`),h=require(`@spark-ui/icons/PlayOutline`),g=require(`@spark-ui/icons/WarningOutline`);var _={TOO_MANY_FILES:`TOO_MANY_FILES`,FILE_INVALID_TYPE:`FILE_INVALID_TYPE`,FILE_TOO_LARGE:`FILE_TOO_LARGE`,FILE_TOO_SMALL:`FILE_TOO_SMALL`,FILE_INVALID:`FILE_INVALID`,FILE_EXISTS:`FILE_EXISTS`};function v(e,t){return t?t.split(`,`).map(e=>e.trim()).some(t=>{if(t.includes(`/`)){if(t.endsWith(`/*`)){let n=t.slice(0,-2);return e.type.startsWith(n+`/`)}return e.type===t}if(t.startsWith(`.`)){let n=t.toLowerCase();return e.name.toLowerCase().endsWith(n)}let n=`.`+t.toLowerCase();return e.name.toLowerCase().endsWith(n)}):!0}function y(e,t,n,r){let i=r||b();return t!==void 0&&e.size<t?{valid:!1,error:`File "${e.name}" is too small. Minimum size is ${x(t,i)}.`}:n!==void 0&&e.size>n?{valid:!1,error:`File "${e.name}" is too large. Maximum size is ${x(n,i)}.`}:{valid:!0}}function b(){return typeof navigator<`u`&&navigator.language?navigator.language:`en`}function x(e,t){let n=t||b(),r=n;if(n.length===2&&(r=n===`fr`?`fr-FR`:`en-US`),e===0)return new Intl.NumberFormat(r,{style:`unit`,unit:`byte`,unitDisplay:`long`,minimumFractionDigits:0,maximumFractionDigits:0}).format(0);let i=1024,a=Math.floor(Math.log(e)/Math.log(i)),o=[`byte`,`kilobyte`,`megabyte`,`gigabyte`][a]||`byte`,s=e/i**+a,c=a===0?`long`:`short`;return new Intl.NumberFormat(r,{style:`unit`,unit:o,unitDisplay:c,minimumFractionDigits:0,maximumFractionDigits:2}).format(s)}function S(e){let t=e.type.toLowerCase(),n=e.name.toLowerCase();return t.startsWith(`image/`)||/\.(jpg|jpeg|png|gif|bmp|webp|svg|ico)$/i.test(n)?(0,s.createElement)(m.ImageOutline):t===`application/pdf`||n.endsWith(`.pdf`)?(0,s.createElement)(p.FilePdfOutline):t.startsWith(`video/`)||/\.(mp4|avi|mov|wmv|flv|webm|mkv)$/i.test(n)?(0,s.createElement)(h.PlayOutline):(0,s.createElement)(f.CvOutline)}function C(e){if(!e)return!1;if(e.tabIndex>=0)return!0;let t=String(e.contentEditable)===`true`;return e instanceof HTMLInputElement||e instanceof HTMLButtonElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLAnchorElement&&!!e.href||t}function w(e,t){for(let t of e)if(C(t))return t;return t.current?t.current:null}function T({defaultValue:e=[],value:t,onFileAccept:n,onFileReject:r,onFileChange:i,multiple:a=!0,accept:o,maxFiles:c,maxFileSize:l,minFileSize:d,disabled:f=!1,readOnly:p=!1,locale:m}){let h=m||(typeof navigator<`u`&&navigator.language?navigator.language:`en`),[g,b]=(0,u.useCombinedState)(t,e),x=g??[],S=b,[C,w]=(0,s.useState)([]);return{files:x,rejectedFiles:C,addFiles:e=>{if(f||p)return;w([]);let t=[],s=(e,t)=>t.some(t=>t.name===e.name&&t.size===e.size),u=(e,n)=>{let r=t.find(t=>t.file.name===e.name&&t.file.size===e.size);r?r.errors.includes(n)||r.errors.push(n):t.push({file:e,errors:[n]})};S(f=>{let p=f??[],m=c===void 0?void 0:c-p.length;m!==void 0&&m<=0&&e.forEach(e=>{u(e,_.TOO_MANY_FILES)});let g=e;o&&(e.filter(e=>!v(e,o)).forEach(e=>{u(e,_.FILE_INVALID_TYPE)}),g=e.filter(e=>v(e,o)));let b=g;(d!==void 0||l!==void 0)&&(b=g.filter(e=>y(e,d,l,h).valid?!0:(l!==void 0&&e.size>l?u(e,_.FILE_TOO_LARGE):d!==void 0&&e.size<d?u(e,_.FILE_TOO_SMALL):u(e,_.FILE_INVALID),!1)));let x=new Map,S=b.filter(e=>{let t=`${e.name}-${e.size}`;return s(e,p)||x.has(t)?(u(e,_.FILE_EXISTS),!1):(x.set(t,e),!0)}),C=a?S:S.slice(0,1);m!==void 0&&(m<=0?C=[]:C.length>m&&(C.forEach(e=>{u(e,_.TOO_MANY_FILES)}),C=[]));let T=a?[...p,...C]:C,E=[...t];return w(E),C.length>0&&n&&n({files:C}),E.length>0&&r&&r({files:E}),i&&i({acceptedFiles:T,rejectedFiles:E}),T})},removeFile:e=>{f||p||S(t=>{let n=(t??[]).filter((t,n)=>n!==e),r=C;return c!==void 0&&n.length<c&&(r=C.filter(e=>!e.errors.includes(_.TOO_MANY_FILES)),w(r)),i&&i({acceptedFiles:n,rejectedFiles:r}),n})},removeRejectedFile:e=>{f||p||w(t=>t.filter((t,n)=>n!==e))},clearFiles:()=>{f||p||(S([]),w([]),i&&i({acceptedFiles:[],rejectedFiles:[]}))},clearRejectedFiles:()=>{w([])},maxFilesReached:c!==void 0&&x.length>=c}}var E=(0,s.createContext)(null),D=`:file-upload`,O=({asChild:e=!1,children:t,defaultValue:n=[],value:r,onFileAccept:i,onFileReject:a,onFileChange:o,multiple:u=!0,accept:d,maxFiles:f,maxFileSize:p,minFileSize:m,disabled:h=!1,readOnly:g=!1,locale:_})=>{let v=(0,l.useFormFieldControl)(),y=(0,s.useId)(),b=v.id||`${D}-${y}`,x=v.name,S=(0,s.useRef)(null),C=(0,s.useRef)(null),w=(0,s.useRef)(null),O=(0,s.useRef)([]),k=(0,s.useRef)([]),A=v.disabled??h,j=v.readOnly??g,{files:M,rejectedFiles:N,addFiles:P,removeFile:F,removeRejectedFile:I,clearFiles:L,clearRejectedFiles:R,maxFilesReached:z}=T({defaultValue:n,value:r,onFileAccept:i,onFileReject:a,onFileChange:o,multiple:u,accept:d,maxFiles:f,maxFileSize:p,minFileSize:m,disabled:A,readOnly:j,locale:_});return(0,c.jsx)(E,{value:{inputRef:S,files:M,rejectedFiles:N,addFiles:P,removeFile:F,removeRejectedFile:I,clearFiles:()=>{L(),O.current=[]},clearRejectedFiles:()=>{R(),k.current=[]},triggerRef:C,dropzoneRef:w,deleteButtonRefs:O,rejectedFileDeleteButtonRefs:k,multiple:u,maxFiles:f,maxFilesReached:z,disabled:A,readOnly:j,locale:_||(typeof navigator<`u`&&navigator.language?navigator.language:`en`),description:v.description,isInvalid:v.isInvalid,isRequired:v.isRequired},children:(0,c.jsxs)(`div`,{className:`relative`,children:[t,(0,c.jsx)(`input`,{ref:S,type:`file`,tabIndex:-1,id:b,multiple:u,name:x,accept:d,disabled:A,readOnly:j&&!A,required:v.isRequired,"aria-invalid":v.isInvalid,"aria-describedby":v.description,"aria-label":v.labelId?void 0:`Upload files`,className:`sr-only`,onChange:e=>{if(e.target.files&&!A&&!j){P(Array.from(e.target.files));try{e.target.value=``}catch{}}}})]})})};O.displayName=`FileUpload`;var k=()=>{let e=(0,s.useContext)(E);if(!e)throw Error(`useFileUploadContext must be used within a FileUpload provider`);return e},A=({className:e,file:t,onClick:r,...a})=>{let{removeFile:l,triggerRef:u,dropzoneRef:f,deleteButtonRefs:p,inputRef:m,disabled:h,readOnly:g,files:_}=k(),v=(0,s.useRef)(null),y=_.findIndex(e=>e.name===t.name&&e.size===t.size);return(0,c.jsx)(i.t,{ref:e=>{if(v.current=e,e){for(;p.current.length<=y;)p.current.push(null);p.current[y]=e}else p.current[y]&&(p.current[y]=null)},"data-spark-component":`file-upload-item-delete-trigger`,className:(0,o.cx)(e),onClick:e=>{h||g||(l(y),requestAnimationFrame(()=>{let e=p.current.filter(Boolean);if(e.length>0){let t=e[Math.min(y,e.length-1)];t&&t.focus()}else{let e=w([u.current,f.current],m);e&&e.focus()}}),r?.(e))},disabled:h||g,size:`sm`,design:`contrast`,intent:`surface`,...a,children:(0,c.jsx)(n.t,{size:`sm`,children:(0,c.jsx)(d.Close,{})})})};A.displayName=`FileUpload.ItemDeleteTrigger`;var j=({className:e,file:t,uploadProgress:r,deleteButtonAriaLabel:i,progressAriaLabel:l,...u})=>{let{locale:d}=k(),[f,p]=(0,s.useState)(r!==void 0);(0,s.useEffect)(()=>{p(r!==void 0)},[r]);let m=(0,s.useCallback)(()=>{p(!1)},[]);return(0,c.jsxs)(`li`,{"data-spark-component":`file-upload-accepted-file`,className:(0,o.cx)(`relative`,`default:bg-surface default:border-sm default:border-outline default:p-md default:rounded-md`,`gap-md flex items-center justify-between default:w-full`,e),...u,children:[(0,c.jsx)(`div`,{className:`size-sz-36 bg-support-container flex items-center justify-center rounded-md`,children:(0,c.jsx)(n.t,{size:`md`,children:S(t)})}),(0,c.jsxs)(`div`,{className:`gap-md relative flex min-w-0 flex-1 flex-row items-center justify-between self-stretch`,children:[(0,c.jsx)(`p`,{className:`text-body-2 truncate font-medium`,children:t.name}),(0,c.jsx)(`p`,{className:`text-caption opacity-dim-1`,children:x(t.size,d)}),f&&r!==void 0&&(0,c.jsx)(`div`,{className:`absolute bottom-0 left-0 w-full`,children:(0,c.jsx)(a.t,{value:r,max:100,"aria-label":l,onComplete:m})})]}),(0,c.jsx)(A,{"aria-label":i,file:t})]})};j.displayName=`FileUpload.AcceptedFile`;var M=({children:e})=>{let{files:t=[],rejectedFiles:n=[],locale:r}=k();return(0,c.jsx)(c.Fragment,{children:e({acceptedFiles:t,rejectedFiles:n,formatFileSize:x,locale:r})})};M.displayName=`FileUpload.Context`;var N=(0,s.createContext)(!1),P=()=>(0,s.useContext)(N);function F({children:e,className:t,unstyled:n=!1}){let r=k(),i=(0,s.useRef)(null);if(!r)throw Error(`FileUploadDropzone must be used inside <FileUpload>`);let a=e=>{if(e.preventDefault(),e.stopPropagation(),e.currentTarget.setAttribute(`data-drag-over`,`false`),r.disabled||r.readOnly)return;let t=e.dataTransfer.files,n=[];t&&(n=Array.isArray(t)?[...t]:Array.from(t)),n.length>0&&r.addFiles(n)},l=()=>{!r.disabled&&!r.readOnly&&r.inputRef.current?.click()},u=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),!r.disabled&&!r.readOnly&&r.inputRef.current?.click())},d=r.disabled||r.readOnly;return(0,c.jsx)(N,{value:!0,children:(0,c.jsx)(`div`,{ref:e=>{i.current=e,r.dropzoneRef&&(r.dropzoneRef.current=e)},role:`button`,tabIndex:d?-1:0,"aria-disabled":r.disabled?!0:void 0,"aria-describedby":r.description,"aria-invalid":r.isInvalid,"aria-required":r.isRequired,onClick:l,onKeyDown:u,onDrop:a,onDragOver:e=>{e.preventDefault()},className:n?t:(0,o.cx)(`default:bg-surface default:border-sm default:border-outline default:relative default:rounded-lg default:border-dashed`,`gap-lg flex flex-col items-center justify-center text-center`,`default:p-xl`,`transition-colors duration-200`,!d&&`default:hover:bg-surface-hovered`,`data-[drag-over=true]:border-outline-high data-[drag-over=true]:bg-surface-hovered data-[drag-over=true]:border-solid`,r.disabled&&`cursor-not-allowed opacity-50`,r.readOnly&&!r.disabled&&`cursor-default`,t),onDragEnter:e=>{d||e.currentTarget.setAttribute(`data-drag-over`,`true`)},onDragLeave:e=>{e.currentTarget.setAttribute(`data-drag-over`,`false`)},children:e})})}F.displayName=`FileUploadDropzone`;var I=({className:e,file:t,fallback:n=`📄`,...r})=>{let[i,a]=(0,s.useState)(!1),[l,u]=(0,s.useState)(!1),[d,f]=(0,s.useState)(null),p=t.type.startsWith(`image/`);return(0,s.useEffect)(()=>{if(!p){f(null);return}let e=URL.createObjectURL(t);return f(e),()=>{URL.revokeObjectURL(e)}},[t,p]),!p||i?(0,c.jsx)(`div`,{"data-spark-component":`file-upload-preview-image`,className:(0,o.cx)(`bg-neutral-container flex items-center justify-center rounded-md`,e),...r,children:n}):(0,c.jsxs)(`div`,{"data-spark-component":`file-upload-preview-image`,className:(0,o.cx)(`bg-neutral-container overflow-hidden`,e),...r,children:[(0,c.jsx)(`img`,{src:d,alt:t.name,className:(0,o.cx)(`size-full object-cover`,!l&&`opacity-0`),onLoad:()=>u(!0),onError:()=>a(!0)}),!l&&(0,c.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:n})]})};I.displayName=`FileUpload.PreviewImage`;var L=({className:e,rejectedFile:t,onClick:r,...a})=>{let{removeRejectedFile:l,triggerRef:u,dropzoneRef:f,rejectedFileDeleteButtonRefs:p,inputRef:m,disabled:h,readOnly:g,rejectedFiles:_}=k(),v=(0,s.useRef)(null),y=_.findIndex(e=>e.file.name===t.file.name&&e.file.size===t.file.size);return(0,c.jsx)(i.t,{ref:e=>{if(v.current=e,e){for(;p.current.length<=y;)p.current.push(null);p.current[y]=e}else p.current[y]&&(p.current[y]=null)},"data-spark-component":`file-upload-rejected-file-delete-trigger`,className:(0,o.cx)(e),onClick:e=>{h||g||(l(y),requestAnimationFrame(()=>{let e=p.current.filter(Boolean);if(e.length>0){let t=e[Math.min(y,e.length-1)];t&&t.focus()}else{let e=w([u.current,f.current],m);e&&e.focus()}}),r?.(e))},disabled:h||g,size:`sm`,design:`contrast`,intent:`surface`,...a,children:(0,c.jsx)(n.t,{size:`sm`,children:(0,c.jsx)(d.Close,{})})})};L.displayName=`FileUpload.RejectedFileDeleteTrigger`;var R=({className:e,rejectedFile:t,renderError:r,deleteButtonAriaLabel:i,...a})=>{let{locale:s}=k();return(0,c.jsxs)(`li`,{"data-spark-component":`file-upload-rejected-file`,className:(0,o.cx)(`relative`,`default:bg-surface default:border-sm default:border-outline default:p-md default:rounded-md`,`gap-md flex items-center justify-between default:w-full`,`border-error border-md`,e),...a,children:[(0,c.jsx)(`div`,{className:`size-sz-36 bg-error-container flex items-center justify-center rounded-md`,children:(0,c.jsx)(n.t,{size:`md`,className:`text-error`,children:(0,c.jsx)(g.WarningOutline,{})})}),(0,c.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,c.jsxs)(`div`,{className:`gap-md flex flex-col`,children:[(0,c.jsxs)(`div`,{className:`gap-md flex flex-row items-center justify-between`,children:[(0,c.jsx)(`p`,{className:`text-body-2 truncate font-medium`,children:t.file.name}),(0,c.jsx)(`p`,{className:`text-caption opacity-dim-1`,children:x(t.file.size,s)})]}),(0,c.jsx)(`div`,{className:`gap-xs flex flex-col`,children:t.errors.map((e,t)=>(0,c.jsx)(`div`,{className:`text-caption text-error`,"data-error-code":e,children:r(e)},t))})]})}),(0,c.jsx)(L,{"aria-label":i,rejectedFile:t})]})};R.displayName=`FileUpload.RejectedFile`;var z=({className:e,children:n,asChild:i=!1,unstyled:a=!1,design:s=`filled`,intent:l=`support`,size:u=`md`,shape:d=`rounded`,ref:f,...p})=>{let{inputRef:m,triggerRef:h,disabled:g,readOnly:_,description:v,isInvalid:y,isRequired:b}=k(),x=P(),S=e=>{e.stopPropagation(),e.preventDefault(),!g&&!_&&m.current?.click()},C=e=>{h&&(h.current=e),f&&(typeof f==`function`?f(e):f.current=e)},w,T;return x?(w=`span`,T={ref:C,"data-spark-component":`file-upload-trigger`,className:a?e:r.n({design:s,intent:l,size:u,shape:d,disabled:g||_,className:e})}):(w=i?t.Slot:a?`button`:r.t,T={ref:C,type:`button`,design:s,intent:l,size:u,shape:d,"data-spark-component":`file-upload-trigger`,className:(0,o.cx)(e),disabled:g||_,onClick:S,"aria-describedby":v,"aria-invalid":y,"aria-required":b,...p}),(0,c.jsx)(w,{...T,children:n})};z.displayName=`FileUpload.Trigger`;var B=Object.assign(O,{Trigger:z,Dropzone:F,Context:M,AcceptedFile:j,RejectedFile:R,PreviewImage:I,ItemDeleteTrigger:A,RejectedFileDeleteTrigger:L});B.displayName=`FileUpload`,z.displayName=`FileUpload.Trigger`,F.displayName=`FileUpload.Dropzone`,M.displayName=`FileUpload.Context`,A.displayName=`FileUpload.ItemDeleteTrigger`,I.displayName=`FileUpload.PreviewImage`,j.displayName=`FileUpload.AcceptedFile`,R.displayName=`FileUpload.RejectedFile`,L.displayName=`FileUpload.RejectedFileDeleteTrigger`,exports.FILE_UPLOAD_ERRORS=_,exports.FileUpload=B;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  import { Slot as e } from "../slot/index.mjs";
2
2
  import { t } from "../icon-D05Uqh8_.mjs";
3
- import { n, t as r } from "../button-CNabSkd_.mjs";
4
- import { t as i } from "../icon-button-DVbKK2_a.mjs";
3
+ import { n, t as r } from "../button-D49vse7F.mjs";
4
+ import { t as i } from "../icon-button-Bw0k4nKs.mjs";
5
5
  import { t as a } from "../progress-BfpWgeE1.mjs";
6
6
  import { cx as o } from "class-variance-authority";
7
7
  import { createContext as s, createElement as c, useCallback as l, useContext as u, useEffect as d, useId as f, useRef as p, useState as m } from "react";
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../icon-button-CTe0v0g7.js`);exports.IconButton=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../icon-button-BKVPOP0K.js`);exports.IconButton=e.t;
@@ -1,2 +1,2 @@
1
- import { t as e } from "../icon-button-DVbKK2_a.mjs";
1
+ import { t as e } from "../icon-button-Bw0k4nKs.mjs";
2
2
  export { e as IconButton };
@@ -1,2 +1,2 @@
1
- require(`./chunk-C91j1N6u.js`);const e=require(`./button-Tv2N8_24.js`);let t=require(`class-variance-authority`),n=require(`react/jsx-runtime`),r=require(`@spark-ui/internal-utils`);var i=(0,t.cva)([`pl-0 pr-0`],{variants:{size:(0,r.makeVariants)({sm:[`text-body-1`],md:[`text-body-1`],lg:[`text-display-3`]})}}),a=({design:t=`filled`,disabled:r=!1,intent:a=`main`,shape:o=`rounded`,size:s=`md`,className:c,ref:l,...u})=>(0,n.jsx)(e.t,{"data-spark-component":`icon-button`,ref:l,className:i({size:s,className:c}),design:t,disabled:r,intent:a,shape:o,size:s,...u});a.displayName=`IconButton`,Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
2
- //# sourceMappingURL=icon-button-CTe0v0g7.js.map
1
+ require(`./chunk-C91j1N6u.js`);const e=require(`./button-pz6WB_vb.js`);let t=require(`class-variance-authority`),n=require(`react/jsx-runtime`),r=require(`@spark-ui/internal-utils`);var i=(0,t.cva)([`pl-0 pr-0`],{variants:{size:(0,r.makeVariants)({sm:[`text-body-1`],md:[`text-body-1`],lg:[`text-display-3`]})}}),a=({design:t=`filled`,disabled:r=!1,intent:a=`main`,shape:o=`rounded`,size:s=`md`,className:c,ref:l,...u})=>(0,n.jsx)(e.t,{"data-spark-component":`icon-button`,ref:l,className:i({size:s,className:c}),design:t,disabled:r,intent:a,shape:o,size:s,...u});a.displayName=`IconButton`,Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
2
+ //# sourceMappingURL=icon-button-BKVPOP0K.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"icon-button-CTe0v0g7.js","names":[],"sources":["../src/icon-button/IconButton.styles.tsx","../src/icon-button/IconButton.tsx"],"sourcesContent":["import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\n// override the Button component's px-lg padding by using a more specific class selector (pl-0 pr-0)\nexport const iconButtonStyles = cva(['pl-0 pr-0'], {\n variants: {\n /**\n * Sets the size of the icon.\n */\n size: makeVariants<'size', ['sm', 'md', 'lg']>({\n sm: ['text-body-1'],\n md: ['text-body-1'],\n lg: ['text-display-3'],\n }),\n },\n})\n\nexport type IconButtonStylesProps = VariantProps<typeof iconButtonStyles>\n","import { Ref } from 'react'\n\nimport { Button, ButtonProps } from '../button'\nimport { iconButtonStyles } from './IconButton.styles'\n\nexport interface IconButtonProps extends Omit<ButtonProps, 'loadingText'> {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\n/**\n * A button component that contains only an icon without text label.\n */\nexport const IconButton = ({\n design = 'filled',\n disabled = false,\n intent = 'main',\n shape = 'rounded',\n size = 'md',\n className,\n ref,\n ...others\n}: IconButtonProps) => {\n return (\n <Button\n data-spark-component=\"icon-button\"\n ref={ref}\n className={iconButtonStyles({ size, className })}\n design={design}\n disabled={disabled}\n intent={intent}\n shape={shape}\n size={size}\n {...others}\n />\n )\n}\n\nIconButton.displayName = 'IconButton'\n"],"mappings":"sLAIA,IAAa,GAAA,EAAA,EAAA,KAAuB,CAAC,YAAY,CAAE,CACjD,SAAU,CAIR,MAAA,EAAA,EAAA,cAA+C,CAC7C,GAAI,CAAC,cAAc,CACnB,GAAI,CAAC,cAAc,CACnB,GAAI,CAAC,iBAAiB,CACvB,CAAC,CACH,CACF,CAAC,CCFW,GAAc,CACzB,SAAS,SACT,WAAW,GACX,SAAS,OACT,QAAQ,UACR,OAAO,KACP,YACA,MACA,GAAG,MAGD,EAAA,EAAA,KAAC,EAAA,EAAD,CACE,uBAAqB,cAChB,MACL,UAAW,EAAiB,CAAE,OAAM,YAAW,CAAC,CACxC,SACE,WACF,SACD,QACD,OACN,GAAI,EACJ,CAAA,CAIN,EAAW,YAAc"}
1
+ {"version":3,"file":"icon-button-BKVPOP0K.js","names":[],"sources":["../src/icon-button/IconButton.styles.tsx","../src/icon-button/IconButton.tsx"],"sourcesContent":["import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\n// override the Button component's px-lg padding by using a more specific class selector (pl-0 pr-0)\nexport const iconButtonStyles = cva(['pl-0 pr-0'], {\n variants: {\n /**\n * Sets the size of the icon.\n */\n size: makeVariants<'size', ['sm', 'md', 'lg']>({\n sm: ['text-body-1'],\n md: ['text-body-1'],\n lg: ['text-display-3'],\n }),\n },\n})\n\nexport type IconButtonStylesProps = VariantProps<typeof iconButtonStyles>\n","import { Ref } from 'react'\n\nimport { Button, ButtonProps } from '../button'\nimport { iconButtonStyles } from './IconButton.styles'\n\nexport interface IconButtonProps extends Omit<ButtonProps, 'loadingText'> {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\n/**\n * A button component that contains only an icon without text label.\n */\nexport const IconButton = ({\n design = 'filled',\n disabled = false,\n intent = 'main',\n shape = 'rounded',\n size = 'md',\n className,\n ref,\n ...others\n}: IconButtonProps) => {\n return (\n <Button\n data-spark-component=\"icon-button\"\n ref={ref}\n className={iconButtonStyles({ size, className })}\n design={design}\n disabled={disabled}\n intent={intent}\n shape={shape}\n size={size}\n {...others}\n />\n )\n}\n\nIconButton.displayName = 'IconButton'\n"],"mappings":"sLAIA,IAAa,GAAA,EAAA,EAAA,KAAuB,CAAC,YAAY,CAAE,CACjD,SAAU,CAIR,MAAA,EAAA,EAAA,cAA+C,CAC7C,GAAI,CAAC,cAAc,CACnB,GAAI,CAAC,cAAc,CACnB,GAAI,CAAC,iBAAiB,CACvB,CAAC,CACH,CACF,CAAC,CCFW,GAAc,CACzB,SAAS,SACT,WAAW,GACX,SAAS,OACT,QAAQ,UACR,OAAO,KACP,YACA,MACA,GAAG,MAGD,EAAA,EAAA,KAAC,EAAA,EAAD,CACE,uBAAqB,cAChB,MACL,UAAW,EAAiB,CAAE,OAAM,YAAW,CAAC,CACxC,SACE,WACF,SACD,QACD,OACN,GAAI,EACJ,CAAA,CAIN,EAAW,YAAc"}
@@ -1,4 +1,4 @@
1
- import { t as e } from "./button-CNabSkd_.mjs";
1
+ import { t as e } from "./button-D49vse7F.mjs";
2
2
  import { cva as t } from "class-variance-authority";
3
3
  import { jsx as n } from "react/jsx-runtime";
4
4
  import { makeVariants as r } from "@spark-ui/internal-utils";
@@ -25,4 +25,4 @@ a.displayName = "IconButton";
25
25
  //#endregion
26
26
  export { a as t };
27
27
 
28
- //# sourceMappingURL=icon-button-DVbKK2_a.mjs.map
28
+ //# sourceMappingURL=icon-button-Bw0k4nKs.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"icon-button-DVbKK2_a.mjs","names":[],"sources":["../src/icon-button/IconButton.styles.tsx","../src/icon-button/IconButton.tsx"],"sourcesContent":["import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\n// override the Button component's px-lg padding by using a more specific class selector (pl-0 pr-0)\nexport const iconButtonStyles = cva(['pl-0 pr-0'], {\n variants: {\n /**\n * Sets the size of the icon.\n */\n size: makeVariants<'size', ['sm', 'md', 'lg']>({\n sm: ['text-body-1'],\n md: ['text-body-1'],\n lg: ['text-display-3'],\n }),\n },\n})\n\nexport type IconButtonStylesProps = VariantProps<typeof iconButtonStyles>\n","import { Ref } from 'react'\n\nimport { Button, ButtonProps } from '../button'\nimport { iconButtonStyles } from './IconButton.styles'\n\nexport interface IconButtonProps extends Omit<ButtonProps, 'loadingText'> {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\n/**\n * A button component that contains only an icon without text label.\n */\nexport const IconButton = ({\n design = 'filled',\n disabled = false,\n intent = 'main',\n shape = 'rounded',\n size = 'md',\n className,\n ref,\n ...others\n}: IconButtonProps) => {\n return (\n <Button\n data-spark-component=\"icon-button\"\n ref={ref}\n className={iconButtonStyles({ size, className })}\n design={design}\n disabled={disabled}\n intent={intent}\n shape={shape}\n size={size}\n {...others}\n />\n )\n}\n\nIconButton.displayName = 'IconButton'\n"],"mappings":";;;;;AAIA,IAAa,IAAmB,EAAI,CAAC,YAAY,EAAE,EACjD,UAAU,EAIR,MAAM,EAAyC;CAC7C,IAAI,CAAC,cAAc;CACnB,IAAI,CAAC,cAAc;CACnB,IAAI,CAAC,iBAAiB;CACvB,CAAC,EACH,EACF,CAAC,ECFW,KAAc,EACzB,YAAS,UACT,cAAW,IACX,YAAS,QACT,WAAQ,WACR,UAAO,MACP,cACA,QACA,GAAG,QAGD,kBAAC,GAAD;CACE,wBAAqB;CAChB;CACL,WAAW,EAAiB;EAAE;EAAM;EAAW,CAAC;CACxC;CACE;CACF;CACD;CACD;CACN,GAAI;CACJ,CAAA;AAIN,EAAW,cAAc"}
1
+ {"version":3,"file":"icon-button-Bw0k4nKs.mjs","names":[],"sources":["../src/icon-button/IconButton.styles.tsx","../src/icon-button/IconButton.tsx"],"sourcesContent":["import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\n// override the Button component's px-lg padding by using a more specific class selector (pl-0 pr-0)\nexport const iconButtonStyles = cva(['pl-0 pr-0'], {\n variants: {\n /**\n * Sets the size of the icon.\n */\n size: makeVariants<'size', ['sm', 'md', 'lg']>({\n sm: ['text-body-1'],\n md: ['text-body-1'],\n lg: ['text-display-3'],\n }),\n },\n})\n\nexport type IconButtonStylesProps = VariantProps<typeof iconButtonStyles>\n","import { Ref } from 'react'\n\nimport { Button, ButtonProps } from '../button'\nimport { iconButtonStyles } from './IconButton.styles'\n\nexport interface IconButtonProps extends Omit<ButtonProps, 'loadingText'> {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\n/**\n * A button component that contains only an icon without text label.\n */\nexport const IconButton = ({\n design = 'filled',\n disabled = false,\n intent = 'main',\n shape = 'rounded',\n size = 'md',\n className,\n ref,\n ...others\n}: IconButtonProps) => {\n return (\n <Button\n data-spark-component=\"icon-button\"\n ref={ref}\n className={iconButtonStyles({ size, className })}\n design={design}\n disabled={disabled}\n intent={intent}\n shape={shape}\n size={size}\n {...others}\n />\n )\n}\n\nIconButton.displayName = 'IconButton'\n"],"mappings":";;;;;AAIA,IAAa,IAAmB,EAAI,CAAC,YAAY,EAAE,EACjD,UAAU,EAIR,MAAM,EAAyC;CAC7C,IAAI,CAAC,cAAc;CACnB,IAAI,CAAC,cAAc;CACnB,IAAI,CAAC,iBAAiB;CACvB,CAAC,EACH,EACF,CAAC,ECFW,KAAc,EACzB,YAAS,UACT,cAAW,IACX,YAAS,QACT,WAAQ,WACR,UAAO,MACP,cACA,QACA,GAAG,QAGD,kBAAC,GAAD;CACE,wBAAqB;CAChB;CACL,WAAW,EAAiB;EAAE;EAAM;EAAW,CAAC;CACxC;CACE;CACF;CACD;CACD;CACN,GAAI;CACJ,CAAA;AAIN,EAAW,cAAc"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-C91j1N6u.js`),t=require(`../icon-CRPcdgYp.js`),n=require(`../button-Tv2N8_24.js`),r=require(`../icon-button-CTe0v0g7.js`);let i=require(`class-variance-authority`),a=require(`react`),o=require(`react/jsx-runtime`),s=require(`@spark-ui/icons/ArrowVerticalRight`),c=require(`@spark-ui/icons/ArrowVerticalLeft`),l=require(`@zag-js/pagination`);l=e.t(l);let u=require(`@zag-js/react`),d=require(`@spark-ui/icons/ArrowDoubleLeft`),f=require(`@spark-ui/icons/ArrowDoubleRight`);function p(e,t,n){let r=(n-1)/2,i=Math.max(0,t-r),a=Math.min(e.length,t+r+1);return a-i<n&&(i=Math.max(0,Math.min(i,e.length-n)),a=Math.min(e.length,i+n)),e.slice(i,a)}var m=(0,a.createContext)(null),h=({children:e,count:t,visiblePageItems:n=7,pageSize:r,page:i,onPageChange:s,noEllipsis:c,type:d=`link`})=>{let f=c?1/0:Math.max(0,Math.floor((n-5)/2)),h=(0,a.useId)(),g=(0,u.useMachine)(l.machine,{id:h,count:t,siblingCount:f,pageSize:r,page:i,onPageChange:s,type:d}),_=l.connect(g,u.normalizeProps),v=c?p(_.pages,_.page-1,n):_.pages;return(0,o.jsx)(m,{value:{type:d,pagination:{..._,pages:v,getFirstPageTriggerProps:()=>({..._.getPrevTriggerProps(),id:`${_.getRootProps().id}:first`,"data-part":`first-page-trigger`,onClick:_.goToFirstPage}),getLastPageTriggerProps:()=>({..._.getNextTriggerProps(),id:`${_.getRootProps().id}:last`,"data-part":`last-page-trigger`,onClick:_.goToLastPage})}},children:e})},g=()=>{let e=(0,a.useContext)(m);if(!e)throw Error(`usePagination must be used within a Pagination provider`);return e},_=({children:e,visiblePageItems:t=5,type:n=`link`,noEllipsis:r=!1,className:i,...a})=>(0,o.jsx)(h,{visiblePageItems:t,noEllipsis:r,type:n,...a,children:(0,o.jsx)(v,{className:i,children:e})}),v=({children:e,className:t})=>{let{pagination:n}=g();return(0,o.jsx)(`nav`,{"data-spark-component":`pagination`,...n.getRootProps(),className:t,children:(0,o.jsx)(`ul`,{className:`gap-md flex flex-wrap`,children:e})})};_.displayName=`Pagination`;var y=({children:e,index:t,className:n,ref:r,...a})=>{let{pagination:s}=g();return(0,o.jsx)(`li`,{children:(0,o.jsx)(`span`,{"data-spark-component":`pagination-ellipsis`,ref:r,...(0,u.mergeProps)(s.getEllipsisProps({index:t}),{className:(0,i.cx)(`flex size-sz-44 items-center justify-center`,n),...a}),children:e||`…`})})};y.displayName=`Pagination.Ellipsis`;var b=({children:e,className:n,href:i,ref:a,...s})=>{let{pagination:c,type:l}=g(),f=c.getFirstPageTriggerProps(),p=l===`link`&&f[`data-disabled`]===``,m=(0,u.mergeProps)(f,{"data-spark-component":`pagination-first-page-trigger`,intent:`support`,design:`contrast`,...s,className:n,...p&&{disabled:!0,role:`link`,"aria-disabled":!0}}),h=e||(0,o.jsx)(t.t,{children:(0,o.jsx)(d.ArrowDoubleLeft,{})});return(0,o.jsx)(`li`,{children:i?(0,o.jsx)(r.t,{ref:a,...m,asChild:!0,children:(0,o.jsx)(`a`,{href:p?void 0:i,children:h})}):(0,o.jsx)(r.t,{ref:a,...m,children:h})})};b.displayName=`Pagination.FirstPageTrigger`;function x({children:e,value:t,className:r,href:a,ref:s,...c}){let{pagination:l}=g(),d=l.getItemProps({type:`page`,value:t}),f=(0,u.mergeProps)(d,{"data-spark-component":`pagination-item`,intent:`support`,design:d[`aria-current`]===`page`?`filled`:`contrast`,className:(0,i.cx)(`size-sz-44`,r),...c});return(0,o.jsx)(`li`,{children:a?(0,o.jsx)(n.t,{ref:s,...f,asChild:!0,children:(0,o.jsx)(`a`,{href:a,children:e||t})}):(0,o.jsx)(n.t,{ref:s,...f,children:e||t})})}x.displayName=`Pagination.Item`;var S=({children:e,className:n,href:i,ref:a,...s})=>{let{pagination:c,type:l}=g(),d=c.getLastPageTriggerProps(),p=l===`link`&&d[`data-disabled`]===``,m=(0,u.mergeProps)(d,{"data-spark-component":`pagination-last-page-trigger`,intent:`support`,design:`contrast`,...s,className:n,...p&&{disabled:!0,role:`link`,"aria-disabled":!0}}),h=e||(0,o.jsx)(t.t,{children:(0,o.jsx)(f.ArrowDoubleRight,{})});return(0,o.jsx)(`li`,{children:i?(0,o.jsx)(r.t,{ref:a,...m,asChild:!0,children:(0,o.jsx)(`a`,{href:p?void 0:i,children:h})}):(0,o.jsx)(r.t,{ref:a,...m,children:h})})};S.displayName=`Pagination.LastPageTrigger`;var C=({children:e,className:n,href:i,ref:a,...c})=>{let{pagination:l,type:d}=g(),f=l.getNextTriggerProps(),p=d===`link`&&f[`data-disabled`]===``,m=(0,u.mergeProps)(f,{"data-spark-component":`pagination-next-trigger`,intent:`support`,design:`contrast`,...c,className:n,...p&&{disabled:!0,role:`link`,"aria-disabled":!0}}),h=e||(0,o.jsx)(t.t,{children:(0,o.jsx)(s.ArrowVerticalRight,{})});return(0,o.jsx)(`li`,{children:i?(0,o.jsx)(r.t,{ref:a,...m,asChild:!0,children:(0,o.jsx)(`a`,{href:p?void 0:i,children:h})}):(0,o.jsx)(r.t,{ref:a,...m,children:h})})};C.displayName=`Pagination.NextTrigger`;var w=({children:e})=>{let{pagination:t}=g();return e(t)};w.displayName=`Pagination.Pages`;var T=({children:e,className:n,href:i,ref:a,...s})=>{let{pagination:l,type:d}=g(),f=l.getPrevTriggerProps(),p=d===`link`&&f[`data-disabled`]===``,m=(0,u.mergeProps)(f,{"data-spark-component":`pagination-prev-trigger`,intent:`support`,design:`contrast`,...s,className:n,...p&&{disabled:!0,role:`link`,"aria-disabled":!0}}),h=e||(0,o.jsx)(t.t,{children:(0,o.jsx)(c.ArrowVerticalLeft,{})});return(0,o.jsx)(`li`,{children:i?(0,o.jsx)(r.t,{ref:a,...m,asChild:!0,children:(0,o.jsx)(`a`,{href:p?void 0:i,children:h})}):(0,o.jsx)(r.t,{ref:a,...m,children:h})})};T.displayName=`Pagination.PrevTrigger`;var E=Object.assign(_,{PrevTrigger:T,NextTrigger:C,Pages:w,Item:x,Ellipsis:y,FirstPageTrigger:b,LastPageTrigger:S});E.displayName=`Pagination`,T.displayName=`Pagination.PrevTrigger`,C.displayName=`Pagination.NextTrigger`,w.displayName=`Pagination.Pages`,x.displayName=`Pagination.Item`,y.displayName=`Pagination.Ellipsis`,b.displayName=`Pagination.FirstPageTrigger`,S.displayName=`Pagination.LastPageTrigger`,exports.Pagination=E;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-C91j1N6u.js`),t=require(`../icon-CRPcdgYp.js`),n=require(`../button-pz6WB_vb.js`),r=require(`../icon-button-BKVPOP0K.js`);let i=require(`class-variance-authority`),a=require(`react`),o=require(`react/jsx-runtime`),s=require(`@spark-ui/icons/ArrowVerticalRight`),c=require(`@spark-ui/icons/ArrowVerticalLeft`),l=require(`@zag-js/pagination`);l=e.t(l);let u=require(`@zag-js/react`),d=require(`@spark-ui/icons/ArrowDoubleLeft`),f=require(`@spark-ui/icons/ArrowDoubleRight`);function p(e,t,n){let r=(n-1)/2,i=Math.max(0,t-r),a=Math.min(e.length,t+r+1);return a-i<n&&(i=Math.max(0,Math.min(i,e.length-n)),a=Math.min(e.length,i+n)),e.slice(i,a)}var m=(0,a.createContext)(null),h=({children:e,count:t,visiblePageItems:n=7,pageSize:r,page:i,onPageChange:s,noEllipsis:c,type:d=`link`})=>{let f=c?1/0:Math.max(0,Math.floor((n-5)/2)),h=(0,a.useId)(),g=(0,u.useMachine)(l.machine,{id:h,count:t,siblingCount:f,pageSize:r,page:i,onPageChange:s,type:d}),_=l.connect(g,u.normalizeProps),v=c?p(_.pages,_.page-1,n):_.pages;return(0,o.jsx)(m,{value:{type:d,pagination:{..._,pages:v,getFirstPageTriggerProps:()=>({..._.getPrevTriggerProps(),id:`${_.getRootProps().id}:first`,"data-part":`first-page-trigger`,onClick:_.goToFirstPage}),getLastPageTriggerProps:()=>({..._.getNextTriggerProps(),id:`${_.getRootProps().id}:last`,"data-part":`last-page-trigger`,onClick:_.goToLastPage})}},children:e})},g=()=>{let e=(0,a.useContext)(m);if(!e)throw Error(`usePagination must be used within a Pagination provider`);return e},_=({children:e,visiblePageItems:t=5,type:n=`link`,noEllipsis:r=!1,className:i,...a})=>(0,o.jsx)(h,{visiblePageItems:t,noEllipsis:r,type:n,...a,children:(0,o.jsx)(v,{className:i,children:e})}),v=({children:e,className:t})=>{let{pagination:n}=g();return(0,o.jsx)(`nav`,{"data-spark-component":`pagination`,...n.getRootProps(),className:t,children:(0,o.jsx)(`ul`,{className:`gap-md flex flex-wrap`,children:e})})};_.displayName=`Pagination`;var y=({children:e,index:t,className:n,ref:r,...a})=>{let{pagination:s}=g();return(0,o.jsx)(`li`,{children:(0,o.jsx)(`span`,{"data-spark-component":`pagination-ellipsis`,ref:r,...(0,u.mergeProps)(s.getEllipsisProps({index:t}),{className:(0,i.cx)(`flex size-sz-44 items-center justify-center`,n),...a}),children:e||`…`})})};y.displayName=`Pagination.Ellipsis`;var b=({children:e,className:n,href:i,ref:a,...s})=>{let{pagination:c,type:l}=g(),f=c.getFirstPageTriggerProps(),p=l===`link`&&f[`data-disabled`]===``,m=(0,u.mergeProps)(f,{"data-spark-component":`pagination-first-page-trigger`,intent:`support`,design:`contrast`,...s,className:n,...p&&{disabled:!0,role:`link`,"aria-disabled":!0}}),h=e||(0,o.jsx)(t.t,{children:(0,o.jsx)(d.ArrowDoubleLeft,{})});return(0,o.jsx)(`li`,{children:i?(0,o.jsx)(r.t,{ref:a,...m,asChild:!0,children:(0,o.jsx)(`a`,{href:p?void 0:i,children:h})}):(0,o.jsx)(r.t,{ref:a,...m,children:h})})};b.displayName=`Pagination.FirstPageTrigger`;function x({children:e,value:t,className:r,href:a,ref:s,...c}){let{pagination:l}=g(),d=l.getItemProps({type:`page`,value:t}),f=(0,u.mergeProps)(d,{"data-spark-component":`pagination-item`,intent:`support`,design:d[`aria-current`]===`page`?`filled`:`contrast`,className:(0,i.cx)(`size-sz-44`,r),...c});return(0,o.jsx)(`li`,{children:a?(0,o.jsx)(n.t,{ref:s,...f,asChild:!0,children:(0,o.jsx)(`a`,{href:a,children:e||t})}):(0,o.jsx)(n.t,{ref:s,...f,children:e||t})})}x.displayName=`Pagination.Item`;var S=({children:e,className:n,href:i,ref:a,...s})=>{let{pagination:c,type:l}=g(),d=c.getLastPageTriggerProps(),p=l===`link`&&d[`data-disabled`]===``,m=(0,u.mergeProps)(d,{"data-spark-component":`pagination-last-page-trigger`,intent:`support`,design:`contrast`,...s,className:n,...p&&{disabled:!0,role:`link`,"aria-disabled":!0}}),h=e||(0,o.jsx)(t.t,{children:(0,o.jsx)(f.ArrowDoubleRight,{})});return(0,o.jsx)(`li`,{children:i?(0,o.jsx)(r.t,{ref:a,...m,asChild:!0,children:(0,o.jsx)(`a`,{href:p?void 0:i,children:h})}):(0,o.jsx)(r.t,{ref:a,...m,children:h})})};S.displayName=`Pagination.LastPageTrigger`;var C=({children:e,className:n,href:i,ref:a,...c})=>{let{pagination:l,type:d}=g(),f=l.getNextTriggerProps(),p=d===`link`&&f[`data-disabled`]===``,m=(0,u.mergeProps)(f,{"data-spark-component":`pagination-next-trigger`,intent:`support`,design:`contrast`,...c,className:n,...p&&{disabled:!0,role:`link`,"aria-disabled":!0}}),h=e||(0,o.jsx)(t.t,{children:(0,o.jsx)(s.ArrowVerticalRight,{})});return(0,o.jsx)(`li`,{children:i?(0,o.jsx)(r.t,{ref:a,...m,asChild:!0,children:(0,o.jsx)(`a`,{href:p?void 0:i,children:h})}):(0,o.jsx)(r.t,{ref:a,...m,children:h})})};C.displayName=`Pagination.NextTrigger`;var w=({children:e})=>{let{pagination:t}=g();return e(t)};w.displayName=`Pagination.Pages`;var T=({children:e,className:n,href:i,ref:a,...s})=>{let{pagination:l,type:d}=g(),f=l.getPrevTriggerProps(),p=d===`link`&&f[`data-disabled`]===``,m=(0,u.mergeProps)(f,{"data-spark-component":`pagination-prev-trigger`,intent:`support`,design:`contrast`,...s,className:n,...p&&{disabled:!0,role:`link`,"aria-disabled":!0}}),h=e||(0,o.jsx)(t.t,{children:(0,o.jsx)(c.ArrowVerticalLeft,{})});return(0,o.jsx)(`li`,{children:i?(0,o.jsx)(r.t,{ref:a,...m,asChild:!0,children:(0,o.jsx)(`a`,{href:p?void 0:i,children:h})}):(0,o.jsx)(r.t,{ref:a,...m,children:h})})};T.displayName=`Pagination.PrevTrigger`;var E=Object.assign(_,{PrevTrigger:T,NextTrigger:C,Pages:w,Item:x,Ellipsis:y,FirstPageTrigger:b,LastPageTrigger:S});E.displayName=`Pagination`,T.displayName=`Pagination.PrevTrigger`,C.displayName=`Pagination.NextTrigger`,w.displayName=`Pagination.Pages`,x.displayName=`Pagination.Item`,y.displayName=`Pagination.Ellipsis`,b.displayName=`Pagination.FirstPageTrigger`,S.displayName=`Pagination.LastPageTrigger`,exports.Pagination=E;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "../icon-D05Uqh8_.mjs";
2
- import { t } from "../button-CNabSkd_.mjs";
3
- import { t as n } from "../icon-button-DVbKK2_a.mjs";
2
+ import { t } from "../button-D49vse7F.mjs";
3
+ import { t as n } from "../icon-button-Bw0k4nKs.mjs";
4
4
  import { cx as r } from "class-variance-authority";
5
5
  import { createContext as i, useContext as a, useId as o } from "react";
6
6
  import { jsx as s } from "react/jsx-runtime";
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../popover-Daknmg_Z.js`);exports.Popover=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../popover-CWZCAwhW.js`);exports.Popover=e.t;
@@ -1,2 +1,2 @@
1
- import { t as e } from "../popover-83FABwMs.mjs";
1
+ import { t as e } from "../popover-B11eXklt.mjs";
2
2
  export { e as Popover };
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./icon-D05Uqh8_.mjs";
2
- import { t } from "./icon-button-DVbKK2_a.mjs";
2
+ import { t } from "./icon-button-Bw0k4nKs.mjs";
3
3
  import { cva as n, cx as r } from "class-variance-authority";
4
4
  import { createContext as i, useContext as a, useId as o, useLayoutEffect as s, useState as c } from "react";
5
5
  import { Popover as l } from "radix-ui";
@@ -208,4 +208,4 @@ T.displayName = "Popover", _.displayName = "Popover.Anchor", v.displayName = "Po
208
208
  //#endregion
209
209
  export { T as t };
210
210
 
211
- //# sourceMappingURL=popover-83FABwMs.mjs.map
211
+ //# sourceMappingURL=popover-B11eXklt.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"popover-83FABwMs.mjs","names":[],"sources":["../src/popover/PopoverContext.tsx","../src/popover/Popover.tsx","../src/popover/PopoverAnchor.tsx","../src/popover/PopoverArrow.tsx","../src/popover/PopoverCloseButton.tsx","../src/popover/PopoverContent.styles.ts","../src/popover/PopoverContent.tsx","../src/popover/PopoverHeader.tsx","../src/popover/PopoverPortal.tsx","../src/popover/PopoverTrigger.tsx","../src/popover/index.ts"],"sourcesContent":["import { createContext, type ReactNode, useContext, useState } from 'react'\n\ntype HeaderId = string | null\n\nexport type PopoverIntent =\n | 'surface'\n | 'main'\n | 'support'\n | 'accent'\n | 'success'\n | 'alert'\n | 'danger'\n | 'info'\n | 'neutral'\nexport interface PopoverContextState {\n headerId: HeaderId\n setHeaderId: (id: HeaderId) => void\n intent: PopoverIntent\n}\n\nconst PopoverContext = createContext<PopoverContextState | null>(null)\n\nexport const ID_PREFIX = ':popover'\n\nexport const PopoverProvider = ({\n children,\n intent,\n}: {\n children: ReactNode\n intent: PopoverIntent\n}) => {\n const [headerId, setHeaderId] = useState<HeaderId>(null)\n\n return (\n <PopoverContext\n value={{\n headerId,\n setHeaderId,\n intent,\n }}\n >\n {children}\n </PopoverContext>\n )\n}\n\nexport const usePopover = () => {\n const context = useContext(PopoverContext)\n\n if (!context) {\n throw Error('usePopover must be used within a Popover provider')\n }\n\n return context\n}\n","import { Popover as RadixPopover } from 'radix-ui'\n\nimport { type PopoverIntent, PopoverProvider } from './PopoverContext'\n\nexport type PopoverProps = RadixPopover.PopoverProps & {\n intent?: PopoverIntent\n}\n\nexport const Popover = ({ children, intent = 'surface', modal = false, ...rest }: PopoverProps) => {\n return (\n <PopoverProvider intent={intent}>\n <RadixPopover.Root data-spark-component=\"popover\" modal={modal} {...rest}>\n {children}\n </RadixPopover.Root>\n </PopoverProvider>\n )\n}\n\nPopover.displayName = 'Popover'\n","import { Popover as RadixPopover } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type AnchorProps = RadixPopover.PopoverAnchorProps & {\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * The anchor element for positioning the popover. Renders a <div> element.\n */\n\nexport const Anchor = ({ asChild = false, children, ref, ...rest }: AnchorProps) => (\n <RadixPopover.Anchor data-spark-component=\"popover-anchor\" ref={ref} asChild={asChild} {...rest}>\n {children}\n </RadixPopover.Anchor>\n)\n\nAnchor.displayName = 'Popover.Anchor'\n","import { cva } from 'class-variance-authority'\nimport { Popover as RadixPopover } from 'radix-ui'\nimport { Ref } from 'react'\n\nimport { usePopover } from './PopoverContext'\n\nexport type ArrowProps = RadixPopover.PopoverArrowProps & {\n ref?: Ref<SVGSVGElement>\n}\n\n/**\n * An arrow pointing to the anchor element. Renders an <svg> element.\n */\n\nexport const Arrow = ({\n asChild = false,\n width = 16,\n height = 8,\n className,\n ref,\n ...rest\n}: ArrowProps) => {\n const { intent } = usePopover()\n\n /**\n * This is necessary to override a Radix UI behaviour.\n * Radix hides the arrow when the Popover is too misaligned from its trigger element.\n */\n const styles = cva('visible', {\n variants: {\n intent: {\n surface: 'fill-surface',\n main: 'fill-main-container',\n support: 'fill-support-container',\n accent: 'fill-accent-container',\n success: 'fill-success-container',\n alert: 'fill-alert-container',\n danger: 'fill-error-container',\n info: 'fill-info-container',\n neutral: 'fill-neutral-container',\n },\n },\n defaultVariants: {\n intent: 'surface',\n },\n })\n\n return (\n <RadixPopover.Arrow\n data-spark-component=\"popover-arrow\"\n ref={ref}\n className={styles({ intent, className })}\n asChild={asChild}\n width={width}\n height={height}\n {...rest}\n />\n )\n}\n\nArrow.displayName = 'Popover.Arrow'\n","import { Close as CloseSVG } from '@spark-ui/icons/Close'\nimport { cx } from 'class-variance-authority'\nimport { Popover as RadixPopover } from 'radix-ui'\nimport { Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { IconButton } from '../icon-button'\n\nexport type CloseButtonProps = RadixPopover.PopoverCloseProps & {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\n/**\n * A button that closes the popover. Renders a <button> element.\n */\n\nexport const CloseButton = ({\n 'aria-label': ariaLabel,\n className,\n ref,\n ...rest\n}: CloseButtonProps) => {\n return (\n <RadixPopover.Close\n data-spark-component=\"popover-close-button\"\n ref={ref}\n className={cx('right-lg top-md absolute', className)}\n asChild\n {...rest}\n >\n <IconButton size=\"sm\" intent=\"neutral\" design=\"ghost\" aria-label={ariaLabel}>\n <Icon>\n <CloseSVG />\n </Icon>\n </IconButton>\n </RadixPopover.Close>\n )\n}\n\nCloseButton.displayName = 'Popover.CloseButton'\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const styles = cva(\n [\n 'rounded-md',\n 'shadow-sm',\n 'focus-visible:outline-hidden focus-visible:u-outline',\n 'max-h-(--radix-popper-available-height) overflow-y-auto',\n ],\n {\n variants: {\n intent: {\n surface: 'bg-surface text-on-surface',\n main: 'bg-main-container text-on-main-container',\n support: 'bg-support-container text-on-support-container',\n accent: 'bg-accent-container text-on-accent-container',\n success: 'bg-success-container text-on-success-container',\n alert: 'bg-alert-container text-on-alert-container',\n danger: 'bg-error-container text-on-error-container',\n info: 'bg-info-container text-on-info-container',\n neutral: 'bg-neutral-container text-on-neutral-container',\n },\n matchTriggerWidth: {\n true: 'w-(--radix-popper-anchor-width)',\n },\n enforceBoundaries: {\n true: ['max-w-(--radix-popper-available-width)'],\n },\n\n inset: {\n true: 'overflow-hidden',\n false: 'p-lg',\n },\n elevation: {\n dropdown: 'z-dropdown',\n popover: 'z-popover',\n },\n },\n compoundVariants: [\n {\n inset: false,\n /**\n * When there is a close button, padding to the right side must be adjusted to avoid content overlapping with it.\n */\n class: 'has-data-[spark-component=popover-close-button]:pr-3xl',\n },\n {\n enforceBoundaries: false,\n matchTriggerWidth: false,\n class: 'max-w-[min(var(--spacing-sz-384),100vw)]',\n },\n ],\n defaultVariants: {\n matchTriggerWidth: false,\n enforceBoundaries: false,\n inset: false,\n intent: 'surface',\n elevation: 'popover',\n },\n }\n)\n\nexport type StylesProps = VariantProps<typeof styles>\n","import { Popover as RadixPopover } from 'radix-ui'\nimport { Ref } from 'react'\n\nimport { styles, type StylesProps } from './PopoverContent.styles'\nimport { usePopover } from './PopoverContext'\n\nexport type ContentProps = RadixPopover.PopoverContentProps &\n StylesProps & {\n ref?: Ref<HTMLDivElement>\n }\n\n/**\n * The popup element containing popover content. Renders a <div> element.\n */\n\nexport const Content = ({\n // Spark props\n className,\n children,\n matchTriggerWidth = false,\n // Radix props\n align = 'center',\n arrowPadding = 16, // In order not to overlap the arrow on the rounded corners of the popover.\n asChild = false,\n avoidCollisions = true,\n 'aria-labelledby': ariaLabelledBy,\n collisionBoundary,\n collisionPadding = 0,\n hideWhenDetached = false,\n side = 'bottom',\n sideOffset = 8,\n sticky = 'partial',\n inset = false,\n elevation = 'popover',\n ref,\n ...rest\n}: ContentProps) => {\n const { headerId, intent } = usePopover()\n\n return (\n <RadixPopover.Content\n aria-labelledby={headerId || ariaLabelledBy}\n className={styles({\n enforceBoundaries: !!collisionBoundary,\n matchTriggerWidth,\n inset,\n elevation,\n intent,\n className,\n })}\n data-spark-component=\"popover-content\"\n ref={ref}\n {...{\n align,\n arrowPadding,\n asChild,\n avoidCollisions,\n collisionBoundary,\n collisionPadding,\n hideWhenDetached,\n side,\n sideOffset,\n sticky,\n }}\n {...rest}\n >\n {children}\n </RadixPopover.Content>\n )\n}\n\nContent.displayName = 'Popover.Content'\n","import { cx } from 'class-variance-authority'\nimport { type ReactNode, Ref, useId, useLayoutEffect } from 'react'\n\nimport { ID_PREFIX, usePopover } from './PopoverContext'\n\nexport interface HeaderProps {\n children: ReactNode\n className?: string\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * The header section of the popover. Renders a <header> element.\n */\n\nexport const Header = ({ children, className, ref, ...rest }: HeaderProps) => {\n const id = `${ID_PREFIX}-header-${useId()}`\n const { setHeaderId } = usePopover()\n\n useLayoutEffect(() => {\n setHeaderId(id)\n\n return () => setHeaderId(null)\n }, [id, setHeaderId])\n\n return (\n <header id={id} ref={ref} className={cx('mb-md text-headline-2', className)} {...rest}>\n {children}\n </header>\n )\n}\n\nHeader.displayName = 'Popover.Header'\n","import { Popover as RadixPopover } from 'radix-ui'\nimport { ReactElement } from 'react'\n\nexport type PortalProps = RadixPopover.PopoverPortalProps\n\n/**\n * A portal that renders the popover in a different part of the DOM. Renders a <div> element.\n */\n\nexport const Portal = ({ children, ...rest }: PortalProps): ReactElement => (\n <RadixPopover.Portal {...rest}>{children}</RadixPopover.Portal>\n)\n\nPortal.displayName = 'Popover.Portal'\n","import { Popover as RadixPopover } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type TriggerProps = RadixPopover.PopoverTriggerProps & {\n ref?: Ref<HTMLButtonElement>\n}\n\n/**\n * A button that opens the popover. Renders a <button> element.\n */\n\nexport const Trigger = ({ asChild = false, children, ref, ...rest }: TriggerProps) => (\n <RadixPopover.Trigger\n data-spark-component=\"popover-trigger\"\n ref={ref}\n asChild={asChild}\n {...rest}\n >\n {children}\n </RadixPopover.Trigger>\n)\n\nTrigger.displayName = 'Popover.Trigger'\n","import { Popover as Root } from './Popover'\nimport { Anchor } from './PopoverAnchor'\nimport { Arrow } from './PopoverArrow'\nimport { CloseButton } from './PopoverCloseButton'\nimport { Content } from './PopoverContent'\nimport { Header } from './PopoverHeader'\nimport { Portal } from './PopoverPortal'\nimport { Trigger } from './PopoverTrigger'\n\n/**\n * A floating container that displays additional content when triggered, positioned relative to its trigger element.\n */\nexport const Popover: typeof Root & {\n Anchor: typeof Anchor\n Arrow: typeof Arrow\n CloseButton: typeof CloseButton\n Content: typeof Content\n Header: typeof Header\n Portal: typeof Portal\n Trigger: typeof Trigger\n} = Object.assign(Root, {\n Anchor,\n Arrow,\n CloseButton,\n Content,\n Header,\n Portal,\n Trigger,\n})\n\nPopover.displayName = 'Popover'\nAnchor.displayName = 'Popover.Anchor'\nArrow.displayName = 'Popover.Arrow'\nCloseButton.displayName = 'Popover.CloseButton'\nContent.displayName = 'Popover.Content'\nHeader.displayName = 'Popover.Header'\nPortal.displayName = 'Popover.Portal'\nTrigger.displayName = 'Popover.Trigger'\n"],"mappings":"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"}
1
+ {"version":3,"file":"popover-B11eXklt.mjs","names":[],"sources":["../src/popover/PopoverContext.tsx","../src/popover/Popover.tsx","../src/popover/PopoverAnchor.tsx","../src/popover/PopoverArrow.tsx","../src/popover/PopoverCloseButton.tsx","../src/popover/PopoverContent.styles.ts","../src/popover/PopoverContent.tsx","../src/popover/PopoverHeader.tsx","../src/popover/PopoverPortal.tsx","../src/popover/PopoverTrigger.tsx","../src/popover/index.ts"],"sourcesContent":["import { createContext, type ReactNode, useContext, useState } from 'react'\n\ntype HeaderId = string | null\n\nexport type PopoverIntent =\n | 'surface'\n | 'main'\n | 'support'\n | 'accent'\n | 'success'\n | 'alert'\n | 'danger'\n | 'info'\n | 'neutral'\nexport interface PopoverContextState {\n headerId: HeaderId\n setHeaderId: (id: HeaderId) => void\n intent: PopoverIntent\n}\n\nconst PopoverContext = createContext<PopoverContextState | null>(null)\n\nexport const ID_PREFIX = ':popover'\n\nexport const PopoverProvider = ({\n children,\n intent,\n}: {\n children: ReactNode\n intent: PopoverIntent\n}) => {\n const [headerId, setHeaderId] = useState<HeaderId>(null)\n\n return (\n <PopoverContext\n value={{\n headerId,\n setHeaderId,\n intent,\n }}\n >\n {children}\n </PopoverContext>\n )\n}\n\nexport const usePopover = () => {\n const context = useContext(PopoverContext)\n\n if (!context) {\n throw Error('usePopover must be used within a Popover provider')\n }\n\n return context\n}\n","import { Popover as RadixPopover } from 'radix-ui'\n\nimport { type PopoverIntent, PopoverProvider } from './PopoverContext'\n\nexport type PopoverProps = RadixPopover.PopoverProps & {\n intent?: PopoverIntent\n}\n\nexport const Popover = ({ children, intent = 'surface', modal = false, ...rest }: PopoverProps) => {\n return (\n <PopoverProvider intent={intent}>\n <RadixPopover.Root data-spark-component=\"popover\" modal={modal} {...rest}>\n {children}\n </RadixPopover.Root>\n </PopoverProvider>\n )\n}\n\nPopover.displayName = 'Popover'\n","import { Popover as RadixPopover } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type AnchorProps = RadixPopover.PopoverAnchorProps & {\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * The anchor element for positioning the popover. Renders a <div> element.\n */\n\nexport const Anchor = ({ asChild = false, children, ref, ...rest }: AnchorProps) => (\n <RadixPopover.Anchor data-spark-component=\"popover-anchor\" ref={ref} asChild={asChild} {...rest}>\n {children}\n </RadixPopover.Anchor>\n)\n\nAnchor.displayName = 'Popover.Anchor'\n","import { cva } from 'class-variance-authority'\nimport { Popover as RadixPopover } from 'radix-ui'\nimport { Ref } from 'react'\n\nimport { usePopover } from './PopoverContext'\n\nexport type ArrowProps = RadixPopover.PopoverArrowProps & {\n ref?: Ref<SVGSVGElement>\n}\n\n/**\n * An arrow pointing to the anchor element. Renders an <svg> element.\n */\n\nexport const Arrow = ({\n asChild = false,\n width = 16,\n height = 8,\n className,\n ref,\n ...rest\n}: ArrowProps) => {\n const { intent } = usePopover()\n\n /**\n * This is necessary to override a Radix UI behaviour.\n * Radix hides the arrow when the Popover is too misaligned from its trigger element.\n */\n const styles = cva('visible', {\n variants: {\n intent: {\n surface: 'fill-surface',\n main: 'fill-main-container',\n support: 'fill-support-container',\n accent: 'fill-accent-container',\n success: 'fill-success-container',\n alert: 'fill-alert-container',\n danger: 'fill-error-container',\n info: 'fill-info-container',\n neutral: 'fill-neutral-container',\n },\n },\n defaultVariants: {\n intent: 'surface',\n },\n })\n\n return (\n <RadixPopover.Arrow\n data-spark-component=\"popover-arrow\"\n ref={ref}\n className={styles({ intent, className })}\n asChild={asChild}\n width={width}\n height={height}\n {...rest}\n />\n )\n}\n\nArrow.displayName = 'Popover.Arrow'\n","import { Close as CloseSVG } from '@spark-ui/icons/Close'\nimport { cx } from 'class-variance-authority'\nimport { Popover as RadixPopover } from 'radix-ui'\nimport { Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { IconButton } from '../icon-button'\n\nexport type CloseButtonProps = RadixPopover.PopoverCloseProps & {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\n/**\n * A button that closes the popover. Renders a <button> element.\n */\n\nexport const CloseButton = ({\n 'aria-label': ariaLabel,\n className,\n ref,\n ...rest\n}: CloseButtonProps) => {\n return (\n <RadixPopover.Close\n data-spark-component=\"popover-close-button\"\n ref={ref}\n className={cx('right-lg top-md absolute', className)}\n asChild\n {...rest}\n >\n <IconButton size=\"sm\" intent=\"neutral\" design=\"ghost\" aria-label={ariaLabel}>\n <Icon>\n <CloseSVG />\n </Icon>\n </IconButton>\n </RadixPopover.Close>\n )\n}\n\nCloseButton.displayName = 'Popover.CloseButton'\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const styles = cva(\n [\n 'rounded-md',\n 'shadow-sm',\n 'focus-visible:outline-hidden focus-visible:u-outline',\n 'max-h-(--radix-popper-available-height) overflow-y-auto',\n ],\n {\n variants: {\n intent: {\n surface: 'bg-surface text-on-surface',\n main: 'bg-main-container text-on-main-container',\n support: 'bg-support-container text-on-support-container',\n accent: 'bg-accent-container text-on-accent-container',\n success: 'bg-success-container text-on-success-container',\n alert: 'bg-alert-container text-on-alert-container',\n danger: 'bg-error-container text-on-error-container',\n info: 'bg-info-container text-on-info-container',\n neutral: 'bg-neutral-container text-on-neutral-container',\n },\n matchTriggerWidth: {\n true: 'w-(--radix-popper-anchor-width)',\n },\n enforceBoundaries: {\n true: ['max-w-(--radix-popper-available-width)'],\n },\n\n inset: {\n true: 'overflow-hidden',\n false: 'p-lg',\n },\n elevation: {\n dropdown: 'z-dropdown',\n popover: 'z-popover',\n },\n },\n compoundVariants: [\n {\n inset: false,\n /**\n * When there is a close button, padding to the right side must be adjusted to avoid content overlapping with it.\n */\n class: 'has-data-[spark-component=popover-close-button]:pr-3xl',\n },\n {\n enforceBoundaries: false,\n matchTriggerWidth: false,\n class: 'max-w-[min(var(--spacing-sz-384),100vw)]',\n },\n ],\n defaultVariants: {\n matchTriggerWidth: false,\n enforceBoundaries: false,\n inset: false,\n intent: 'surface',\n elevation: 'popover',\n },\n }\n)\n\nexport type StylesProps = VariantProps<typeof styles>\n","import { Popover as RadixPopover } from 'radix-ui'\nimport { Ref } from 'react'\n\nimport { styles, type StylesProps } from './PopoverContent.styles'\nimport { usePopover } from './PopoverContext'\n\nexport type ContentProps = RadixPopover.PopoverContentProps &\n StylesProps & {\n ref?: Ref<HTMLDivElement>\n }\n\n/**\n * The popup element containing popover content. Renders a <div> element.\n */\n\nexport const Content = ({\n // Spark props\n className,\n children,\n matchTriggerWidth = false,\n // Radix props\n align = 'center',\n arrowPadding = 16, // In order not to overlap the arrow on the rounded corners of the popover.\n asChild = false,\n avoidCollisions = true,\n 'aria-labelledby': ariaLabelledBy,\n collisionBoundary,\n collisionPadding = 0,\n hideWhenDetached = false,\n side = 'bottom',\n sideOffset = 8,\n sticky = 'partial',\n inset = false,\n elevation = 'popover',\n ref,\n ...rest\n}: ContentProps) => {\n const { headerId, intent } = usePopover()\n\n return (\n <RadixPopover.Content\n aria-labelledby={headerId || ariaLabelledBy}\n className={styles({\n enforceBoundaries: !!collisionBoundary,\n matchTriggerWidth,\n inset,\n elevation,\n intent,\n className,\n })}\n data-spark-component=\"popover-content\"\n ref={ref}\n {...{\n align,\n arrowPadding,\n asChild,\n avoidCollisions,\n collisionBoundary,\n collisionPadding,\n hideWhenDetached,\n side,\n sideOffset,\n sticky,\n }}\n {...rest}\n >\n {children}\n </RadixPopover.Content>\n )\n}\n\nContent.displayName = 'Popover.Content'\n","import { cx } from 'class-variance-authority'\nimport { type ReactNode, Ref, useId, useLayoutEffect } from 'react'\n\nimport { ID_PREFIX, usePopover } from './PopoverContext'\n\nexport interface HeaderProps {\n children: ReactNode\n className?: string\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * The header section of the popover. Renders a <header> element.\n */\n\nexport const Header = ({ children, className, ref, ...rest }: HeaderProps) => {\n const id = `${ID_PREFIX}-header-${useId()}`\n const { setHeaderId } = usePopover()\n\n useLayoutEffect(() => {\n setHeaderId(id)\n\n return () => setHeaderId(null)\n }, [id, setHeaderId])\n\n return (\n <header id={id} ref={ref} className={cx('mb-md text-headline-2', className)} {...rest}>\n {children}\n </header>\n )\n}\n\nHeader.displayName = 'Popover.Header'\n","import { Popover as RadixPopover } from 'radix-ui'\nimport { ReactElement } from 'react'\n\nexport type PortalProps = RadixPopover.PopoverPortalProps\n\n/**\n * A portal that renders the popover in a different part of the DOM. Renders a <div> element.\n */\n\nexport const Portal = ({ children, ...rest }: PortalProps): ReactElement => (\n <RadixPopover.Portal {...rest}>{children}</RadixPopover.Portal>\n)\n\nPortal.displayName = 'Popover.Portal'\n","import { Popover as RadixPopover } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type TriggerProps = RadixPopover.PopoverTriggerProps & {\n ref?: Ref<HTMLButtonElement>\n}\n\n/**\n * A button that opens the popover. Renders a <button> element.\n */\n\nexport const Trigger = ({ asChild = false, children, ref, ...rest }: TriggerProps) => (\n <RadixPopover.Trigger\n data-spark-component=\"popover-trigger\"\n ref={ref}\n asChild={asChild}\n {...rest}\n >\n {children}\n </RadixPopover.Trigger>\n)\n\nTrigger.displayName = 'Popover.Trigger'\n","import { Popover as Root } from './Popover'\nimport { Anchor } from './PopoverAnchor'\nimport { Arrow } from './PopoverArrow'\nimport { CloseButton } from './PopoverCloseButton'\nimport { Content } from './PopoverContent'\nimport { Header } from './PopoverHeader'\nimport { Portal } from './PopoverPortal'\nimport { Trigger } from './PopoverTrigger'\n\n/**\n * A floating container that displays additional content when triggered, positioned relative to its trigger element.\n */\nexport const Popover: typeof Root & {\n Anchor: typeof Anchor\n Arrow: typeof Arrow\n CloseButton: typeof CloseButton\n Content: typeof Content\n Header: typeof Header\n Portal: typeof Portal\n Trigger: typeof Trigger\n} = Object.assign(Root, {\n Anchor,\n Arrow,\n CloseButton,\n Content,\n Header,\n Portal,\n Trigger,\n})\n\nPopover.displayName = 'Popover'\nAnchor.displayName = 'Popover.Anchor'\nArrow.displayName = 'Popover.Arrow'\nCloseButton.displayName = 'Popover.CloseButton'\nContent.displayName = 'Popover.Content'\nHeader.displayName = 'Popover.Header'\nPortal.displayName = 'Popover.Portal'\nTrigger.displayName = 'Popover.Trigger'\n"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- require(`./chunk-C91j1N6u.js`);const e=require(`./icon-CRPcdgYp.js`),t=require(`./icon-button-CTe0v0g7.js`);let n=require(`class-variance-authority`),r=require(`react`),i=require(`radix-ui`),a=require(`react/jsx-runtime`),o=require(`@spark-ui/icons/Close`);var s=(0,r.createContext)(null),c=`:popover`,l=({children:e,intent:t})=>{let[n,i]=(0,r.useState)(null);return(0,a.jsx)(s,{value:{headerId:n,setHeaderId:i,intent:t},children:e})},u=()=>{let e=(0,r.useContext)(s);if(!e)throw Error(`usePopover must be used within a Popover provider`);return e},d=({children:e,intent:t=`surface`,modal:n=!1,...r})=>(0,a.jsx)(l,{intent:t,children:(0,a.jsx)(i.Popover.Root,{"data-spark-component":`popover`,modal:n,...r,children:e})});d.displayName=`Popover`;var f=({asChild:e=!1,children:t,ref:n,...r})=>(0,a.jsx)(i.Popover.Anchor,{"data-spark-component":`popover-anchor`,ref:n,asChild:e,...r,children:t});f.displayName=`Popover.Anchor`;var p=({asChild:e=!1,width:t=16,height:r=8,className:o,ref:s,...c})=>{let{intent:l}=u(),d=(0,n.cva)(`visible`,{variants:{intent:{surface:`fill-surface`,main:`fill-main-container`,support:`fill-support-container`,accent:`fill-accent-container`,success:`fill-success-container`,alert:`fill-alert-container`,danger:`fill-error-container`,info:`fill-info-container`,neutral:`fill-neutral-container`}},defaultVariants:{intent:`surface`}});return(0,a.jsx)(i.Popover.Arrow,{"data-spark-component":`popover-arrow`,ref:s,className:d({intent:l,className:o}),asChild:e,width:t,height:r,...c})};p.displayName=`Popover.Arrow`;var m=({"aria-label":r,className:s,ref:c,...l})=>(0,a.jsx)(i.Popover.Close,{"data-spark-component":`popover-close-button`,ref:c,className:(0,n.cx)(`right-lg top-md absolute`,s),asChild:!0,...l,children:(0,a.jsx)(t.t,{size:`sm`,intent:`neutral`,design:`ghost`,"aria-label":r,children:(0,a.jsx)(e.t,{children:(0,a.jsx)(o.Close,{})})})});m.displayName=`Popover.CloseButton`;var h=(0,n.cva)([`rounded-md`,`shadow-sm`,`focus-visible:outline-hidden focus-visible:u-outline`,`max-h-(--radix-popper-available-height) overflow-y-auto`],{variants:{intent:{surface:`bg-surface text-on-surface`,main:`bg-main-container text-on-main-container`,support:`bg-support-container text-on-support-container`,accent:`bg-accent-container text-on-accent-container`,success:`bg-success-container text-on-success-container`,alert:`bg-alert-container text-on-alert-container`,danger:`bg-error-container text-on-error-container`,info:`bg-info-container text-on-info-container`,neutral:`bg-neutral-container text-on-neutral-container`},matchTriggerWidth:{true:`w-(--radix-popper-anchor-width)`},enforceBoundaries:{true:[`max-w-(--radix-popper-available-width)`]},inset:{true:`overflow-hidden`,false:`p-lg`},elevation:{dropdown:`z-dropdown`,popover:`z-popover`}},compoundVariants:[{inset:!1,class:`has-data-[spark-component=popover-close-button]:pr-3xl`},{enforceBoundaries:!1,matchTriggerWidth:!1,class:`max-w-[min(var(--spacing-sz-384),100vw)]`}],defaultVariants:{matchTriggerWidth:!1,enforceBoundaries:!1,inset:!1,intent:`surface`,elevation:`popover`}}),g=({className:e,children:t,matchTriggerWidth:n=!1,align:r=`center`,arrowPadding:o=16,asChild:s=!1,avoidCollisions:c=!0,"aria-labelledby":l,collisionBoundary:d,collisionPadding:f=0,hideWhenDetached:p=!1,side:m=`bottom`,sideOffset:g=8,sticky:_=`partial`,inset:v=!1,elevation:y=`popover`,ref:b,...x})=>{let{headerId:S,intent:C}=u();return(0,a.jsx)(i.Popover.Content,{"aria-labelledby":S||l,className:h({enforceBoundaries:!!d,matchTriggerWidth:n,inset:v,elevation:y,intent:C,className:e}),"data-spark-component":`popover-content`,ref:b,align:r,arrowPadding:o,asChild:s,avoidCollisions:c,collisionBoundary:d,collisionPadding:f,hideWhenDetached:p,side:m,sideOffset:g,sticky:_,...x,children:t})};g.displayName=`Popover.Content`;var _=({children:e,className:t,ref:i,...o})=>{let s=`${c}-header-${(0,r.useId)()}`,{setHeaderId:l}=u();return(0,r.useLayoutEffect)(()=>(l(s),()=>l(null)),[s,l]),(0,a.jsx)(`header`,{id:s,ref:i,className:(0,n.cx)(`mb-md text-headline-2`,t),...o,children:e})};_.displayName=`Popover.Header`;var v=({children:e,...t})=>(0,a.jsx)(i.Popover.Portal,{...t,children:e});v.displayName=`Popover.Portal`;var y=({asChild:e=!1,children:t,ref:n,...r})=>(0,a.jsx)(i.Popover.Trigger,{"data-spark-component":`popover-trigger`,ref:n,asChild:e,...r,children:t});y.displayName=`Popover.Trigger`;var b=Object.assign(d,{Anchor:f,Arrow:p,CloseButton:m,Content:g,Header:_,Portal:v,Trigger:y});b.displayName=`Popover`,f.displayName=`Popover.Anchor`,p.displayName=`Popover.Arrow`,m.displayName=`Popover.CloseButton`,g.displayName=`Popover.Content`,_.displayName=`Popover.Header`,v.displayName=`Popover.Portal`,y.displayName=`Popover.Trigger`,Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return b}});
2
- //# sourceMappingURL=popover-Daknmg_Z.js.map
1
+ require(`./chunk-C91j1N6u.js`);const e=require(`./icon-CRPcdgYp.js`),t=require(`./icon-button-BKVPOP0K.js`);let n=require(`class-variance-authority`),r=require(`react`),i=require(`radix-ui`),a=require(`react/jsx-runtime`),o=require(`@spark-ui/icons/Close`);var s=(0,r.createContext)(null),c=`:popover`,l=({children:e,intent:t})=>{let[n,i]=(0,r.useState)(null);return(0,a.jsx)(s,{value:{headerId:n,setHeaderId:i,intent:t},children:e})},u=()=>{let e=(0,r.useContext)(s);if(!e)throw Error(`usePopover must be used within a Popover provider`);return e},d=({children:e,intent:t=`surface`,modal:n=!1,...r})=>(0,a.jsx)(l,{intent:t,children:(0,a.jsx)(i.Popover.Root,{"data-spark-component":`popover`,modal:n,...r,children:e})});d.displayName=`Popover`;var f=({asChild:e=!1,children:t,ref:n,...r})=>(0,a.jsx)(i.Popover.Anchor,{"data-spark-component":`popover-anchor`,ref:n,asChild:e,...r,children:t});f.displayName=`Popover.Anchor`;var p=({asChild:e=!1,width:t=16,height:r=8,className:o,ref:s,...c})=>{let{intent:l}=u(),d=(0,n.cva)(`visible`,{variants:{intent:{surface:`fill-surface`,main:`fill-main-container`,support:`fill-support-container`,accent:`fill-accent-container`,success:`fill-success-container`,alert:`fill-alert-container`,danger:`fill-error-container`,info:`fill-info-container`,neutral:`fill-neutral-container`}},defaultVariants:{intent:`surface`}});return(0,a.jsx)(i.Popover.Arrow,{"data-spark-component":`popover-arrow`,ref:s,className:d({intent:l,className:o}),asChild:e,width:t,height:r,...c})};p.displayName=`Popover.Arrow`;var m=({"aria-label":r,className:s,ref:c,...l})=>(0,a.jsx)(i.Popover.Close,{"data-spark-component":`popover-close-button`,ref:c,className:(0,n.cx)(`right-lg top-md absolute`,s),asChild:!0,...l,children:(0,a.jsx)(t.t,{size:`sm`,intent:`neutral`,design:`ghost`,"aria-label":r,children:(0,a.jsx)(e.t,{children:(0,a.jsx)(o.Close,{})})})});m.displayName=`Popover.CloseButton`;var h=(0,n.cva)([`rounded-md`,`shadow-sm`,`focus-visible:outline-hidden focus-visible:u-outline`,`max-h-(--radix-popper-available-height) overflow-y-auto`],{variants:{intent:{surface:`bg-surface text-on-surface`,main:`bg-main-container text-on-main-container`,support:`bg-support-container text-on-support-container`,accent:`bg-accent-container text-on-accent-container`,success:`bg-success-container text-on-success-container`,alert:`bg-alert-container text-on-alert-container`,danger:`bg-error-container text-on-error-container`,info:`bg-info-container text-on-info-container`,neutral:`bg-neutral-container text-on-neutral-container`},matchTriggerWidth:{true:`w-(--radix-popper-anchor-width)`},enforceBoundaries:{true:[`max-w-(--radix-popper-available-width)`]},inset:{true:`overflow-hidden`,false:`p-lg`},elevation:{dropdown:`z-dropdown`,popover:`z-popover`}},compoundVariants:[{inset:!1,class:`has-data-[spark-component=popover-close-button]:pr-3xl`},{enforceBoundaries:!1,matchTriggerWidth:!1,class:`max-w-[min(var(--spacing-sz-384),100vw)]`}],defaultVariants:{matchTriggerWidth:!1,enforceBoundaries:!1,inset:!1,intent:`surface`,elevation:`popover`}}),g=({className:e,children:t,matchTriggerWidth:n=!1,align:r=`center`,arrowPadding:o=16,asChild:s=!1,avoidCollisions:c=!0,"aria-labelledby":l,collisionBoundary:d,collisionPadding:f=0,hideWhenDetached:p=!1,side:m=`bottom`,sideOffset:g=8,sticky:_=`partial`,inset:v=!1,elevation:y=`popover`,ref:b,...x})=>{let{headerId:S,intent:C}=u();return(0,a.jsx)(i.Popover.Content,{"aria-labelledby":S||l,className:h({enforceBoundaries:!!d,matchTriggerWidth:n,inset:v,elevation:y,intent:C,className:e}),"data-spark-component":`popover-content`,ref:b,align:r,arrowPadding:o,asChild:s,avoidCollisions:c,collisionBoundary:d,collisionPadding:f,hideWhenDetached:p,side:m,sideOffset:g,sticky:_,...x,children:t})};g.displayName=`Popover.Content`;var _=({children:e,className:t,ref:i,...o})=>{let s=`${c}-header-${(0,r.useId)()}`,{setHeaderId:l}=u();return(0,r.useLayoutEffect)(()=>(l(s),()=>l(null)),[s,l]),(0,a.jsx)(`header`,{id:s,ref:i,className:(0,n.cx)(`mb-md text-headline-2`,t),...o,children:e})};_.displayName=`Popover.Header`;var v=({children:e,...t})=>(0,a.jsx)(i.Popover.Portal,{...t,children:e});v.displayName=`Popover.Portal`;var y=({asChild:e=!1,children:t,ref:n,...r})=>(0,a.jsx)(i.Popover.Trigger,{"data-spark-component":`popover-trigger`,ref:n,asChild:e,...r,children:t});y.displayName=`Popover.Trigger`;var b=Object.assign(d,{Anchor:f,Arrow:p,CloseButton:m,Content:g,Header:_,Portal:v,Trigger:y});b.displayName=`Popover`,f.displayName=`Popover.Anchor`,p.displayName=`Popover.Arrow`,m.displayName=`Popover.CloseButton`,g.displayName=`Popover.Content`,_.displayName=`Popover.Header`,v.displayName=`Popover.Portal`,y.displayName=`Popover.Trigger`,Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return b}});
2
+ //# sourceMappingURL=popover-CWZCAwhW.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"popover-Daknmg_Z.js","names":[],"sources":["../src/popover/PopoverContext.tsx","../src/popover/Popover.tsx","../src/popover/PopoverAnchor.tsx","../src/popover/PopoverArrow.tsx","../src/popover/PopoverCloseButton.tsx","../src/popover/PopoverContent.styles.ts","../src/popover/PopoverContent.tsx","../src/popover/PopoverHeader.tsx","../src/popover/PopoverPortal.tsx","../src/popover/PopoverTrigger.tsx","../src/popover/index.ts"],"sourcesContent":["import { createContext, type ReactNode, useContext, useState } from 'react'\n\ntype HeaderId = string | null\n\nexport type PopoverIntent =\n | 'surface'\n | 'main'\n | 'support'\n | 'accent'\n | 'success'\n | 'alert'\n | 'danger'\n | 'info'\n | 'neutral'\nexport interface PopoverContextState {\n headerId: HeaderId\n setHeaderId: (id: HeaderId) => void\n intent: PopoverIntent\n}\n\nconst PopoverContext = createContext<PopoverContextState | null>(null)\n\nexport const ID_PREFIX = ':popover'\n\nexport const PopoverProvider = ({\n children,\n intent,\n}: {\n children: ReactNode\n intent: PopoverIntent\n}) => {\n const [headerId, setHeaderId] = useState<HeaderId>(null)\n\n return (\n <PopoverContext\n value={{\n headerId,\n setHeaderId,\n intent,\n }}\n >\n {children}\n </PopoverContext>\n )\n}\n\nexport const usePopover = () => {\n const context = useContext(PopoverContext)\n\n if (!context) {\n throw Error('usePopover must be used within a Popover provider')\n }\n\n return context\n}\n","import { Popover as RadixPopover } from 'radix-ui'\n\nimport { type PopoverIntent, PopoverProvider } from './PopoverContext'\n\nexport type PopoverProps = RadixPopover.PopoverProps & {\n intent?: PopoverIntent\n}\n\nexport const Popover = ({ children, intent = 'surface', modal = false, ...rest }: PopoverProps) => {\n return (\n <PopoverProvider intent={intent}>\n <RadixPopover.Root data-spark-component=\"popover\" modal={modal} {...rest}>\n {children}\n </RadixPopover.Root>\n </PopoverProvider>\n )\n}\n\nPopover.displayName = 'Popover'\n","import { Popover as RadixPopover } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type AnchorProps = RadixPopover.PopoverAnchorProps & {\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * The anchor element for positioning the popover. Renders a <div> element.\n */\n\nexport const Anchor = ({ asChild = false, children, ref, ...rest }: AnchorProps) => (\n <RadixPopover.Anchor data-spark-component=\"popover-anchor\" ref={ref} asChild={asChild} {...rest}>\n {children}\n </RadixPopover.Anchor>\n)\n\nAnchor.displayName = 'Popover.Anchor'\n","import { cva } from 'class-variance-authority'\nimport { Popover as RadixPopover } from 'radix-ui'\nimport { Ref } from 'react'\n\nimport { usePopover } from './PopoverContext'\n\nexport type ArrowProps = RadixPopover.PopoverArrowProps & {\n ref?: Ref<SVGSVGElement>\n}\n\n/**\n * An arrow pointing to the anchor element. Renders an <svg> element.\n */\n\nexport const Arrow = ({\n asChild = false,\n width = 16,\n height = 8,\n className,\n ref,\n ...rest\n}: ArrowProps) => {\n const { intent } = usePopover()\n\n /**\n * This is necessary to override a Radix UI behaviour.\n * Radix hides the arrow when the Popover is too misaligned from its trigger element.\n */\n const styles = cva('visible', {\n variants: {\n intent: {\n surface: 'fill-surface',\n main: 'fill-main-container',\n support: 'fill-support-container',\n accent: 'fill-accent-container',\n success: 'fill-success-container',\n alert: 'fill-alert-container',\n danger: 'fill-error-container',\n info: 'fill-info-container',\n neutral: 'fill-neutral-container',\n },\n },\n defaultVariants: {\n intent: 'surface',\n },\n })\n\n return (\n <RadixPopover.Arrow\n data-spark-component=\"popover-arrow\"\n ref={ref}\n className={styles({ intent, className })}\n asChild={asChild}\n width={width}\n height={height}\n {...rest}\n />\n )\n}\n\nArrow.displayName = 'Popover.Arrow'\n","import { Close as CloseSVG } from '@spark-ui/icons/Close'\nimport { cx } from 'class-variance-authority'\nimport { Popover as RadixPopover } from 'radix-ui'\nimport { Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { IconButton } from '../icon-button'\n\nexport type CloseButtonProps = RadixPopover.PopoverCloseProps & {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\n/**\n * A button that closes the popover. Renders a <button> element.\n */\n\nexport const CloseButton = ({\n 'aria-label': ariaLabel,\n className,\n ref,\n ...rest\n}: CloseButtonProps) => {\n return (\n <RadixPopover.Close\n data-spark-component=\"popover-close-button\"\n ref={ref}\n className={cx('right-lg top-md absolute', className)}\n asChild\n {...rest}\n >\n <IconButton size=\"sm\" intent=\"neutral\" design=\"ghost\" aria-label={ariaLabel}>\n <Icon>\n <CloseSVG />\n </Icon>\n </IconButton>\n </RadixPopover.Close>\n )\n}\n\nCloseButton.displayName = 'Popover.CloseButton'\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const styles = cva(\n [\n 'rounded-md',\n 'shadow-sm',\n 'focus-visible:outline-hidden focus-visible:u-outline',\n 'max-h-(--radix-popper-available-height) overflow-y-auto',\n ],\n {\n variants: {\n intent: {\n surface: 'bg-surface text-on-surface',\n main: 'bg-main-container text-on-main-container',\n support: 'bg-support-container text-on-support-container',\n accent: 'bg-accent-container text-on-accent-container',\n success: 'bg-success-container text-on-success-container',\n alert: 'bg-alert-container text-on-alert-container',\n danger: 'bg-error-container text-on-error-container',\n info: 'bg-info-container text-on-info-container',\n neutral: 'bg-neutral-container text-on-neutral-container',\n },\n matchTriggerWidth: {\n true: 'w-(--radix-popper-anchor-width)',\n },\n enforceBoundaries: {\n true: ['max-w-(--radix-popper-available-width)'],\n },\n\n inset: {\n true: 'overflow-hidden',\n false: 'p-lg',\n },\n elevation: {\n dropdown: 'z-dropdown',\n popover: 'z-popover',\n },\n },\n compoundVariants: [\n {\n inset: false,\n /**\n * When there is a close button, padding to the right side must be adjusted to avoid content overlapping with it.\n */\n class: 'has-data-[spark-component=popover-close-button]:pr-3xl',\n },\n {\n enforceBoundaries: false,\n matchTriggerWidth: false,\n class: 'max-w-[min(var(--spacing-sz-384),100vw)]',\n },\n ],\n defaultVariants: {\n matchTriggerWidth: false,\n enforceBoundaries: false,\n inset: false,\n intent: 'surface',\n elevation: 'popover',\n },\n }\n)\n\nexport type StylesProps = VariantProps<typeof styles>\n","import { Popover as RadixPopover } from 'radix-ui'\nimport { Ref } from 'react'\n\nimport { styles, type StylesProps } from './PopoverContent.styles'\nimport { usePopover } from './PopoverContext'\n\nexport type ContentProps = RadixPopover.PopoverContentProps &\n StylesProps & {\n ref?: Ref<HTMLDivElement>\n }\n\n/**\n * The popup element containing popover content. Renders a <div> element.\n */\n\nexport const Content = ({\n // Spark props\n className,\n children,\n matchTriggerWidth = false,\n // Radix props\n align = 'center',\n arrowPadding = 16, // In order not to overlap the arrow on the rounded corners of the popover.\n asChild = false,\n avoidCollisions = true,\n 'aria-labelledby': ariaLabelledBy,\n collisionBoundary,\n collisionPadding = 0,\n hideWhenDetached = false,\n side = 'bottom',\n sideOffset = 8,\n sticky = 'partial',\n inset = false,\n elevation = 'popover',\n ref,\n ...rest\n}: ContentProps) => {\n const { headerId, intent } = usePopover()\n\n return (\n <RadixPopover.Content\n aria-labelledby={headerId || ariaLabelledBy}\n className={styles({\n enforceBoundaries: !!collisionBoundary,\n matchTriggerWidth,\n inset,\n elevation,\n intent,\n className,\n })}\n data-spark-component=\"popover-content\"\n ref={ref}\n {...{\n align,\n arrowPadding,\n asChild,\n avoidCollisions,\n collisionBoundary,\n collisionPadding,\n hideWhenDetached,\n side,\n sideOffset,\n sticky,\n }}\n {...rest}\n >\n {children}\n </RadixPopover.Content>\n )\n}\n\nContent.displayName = 'Popover.Content'\n","import { cx } from 'class-variance-authority'\nimport { type ReactNode, Ref, useId, useLayoutEffect } from 'react'\n\nimport { ID_PREFIX, usePopover } from './PopoverContext'\n\nexport interface HeaderProps {\n children: ReactNode\n className?: string\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * The header section of the popover. Renders a <header> element.\n */\n\nexport const Header = ({ children, className, ref, ...rest }: HeaderProps) => {\n const id = `${ID_PREFIX}-header-${useId()}`\n const { setHeaderId } = usePopover()\n\n useLayoutEffect(() => {\n setHeaderId(id)\n\n return () => setHeaderId(null)\n }, [id, setHeaderId])\n\n return (\n <header id={id} ref={ref} className={cx('mb-md text-headline-2', className)} {...rest}>\n {children}\n </header>\n )\n}\n\nHeader.displayName = 'Popover.Header'\n","import { Popover as RadixPopover } from 'radix-ui'\nimport { ReactElement } from 'react'\n\nexport type PortalProps = RadixPopover.PopoverPortalProps\n\n/**\n * A portal that renders the popover in a different part of the DOM. Renders a <div> element.\n */\n\nexport const Portal = ({ children, ...rest }: PortalProps): ReactElement => (\n <RadixPopover.Portal {...rest}>{children}</RadixPopover.Portal>\n)\n\nPortal.displayName = 'Popover.Portal'\n","import { Popover as RadixPopover } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type TriggerProps = RadixPopover.PopoverTriggerProps & {\n ref?: Ref<HTMLButtonElement>\n}\n\n/**\n * A button that opens the popover. Renders a <button> element.\n */\n\nexport const Trigger = ({ asChild = false, children, ref, ...rest }: TriggerProps) => (\n <RadixPopover.Trigger\n data-spark-component=\"popover-trigger\"\n ref={ref}\n asChild={asChild}\n {...rest}\n >\n {children}\n </RadixPopover.Trigger>\n)\n\nTrigger.displayName = 'Popover.Trigger'\n","import { Popover as Root } from './Popover'\nimport { Anchor } from './PopoverAnchor'\nimport { Arrow } from './PopoverArrow'\nimport { CloseButton } from './PopoverCloseButton'\nimport { Content } from './PopoverContent'\nimport { Header } from './PopoverHeader'\nimport { Portal } from './PopoverPortal'\nimport { Trigger } from './PopoverTrigger'\n\n/**\n * A floating container that displays additional content when triggered, positioned relative to its trigger element.\n */\nexport const Popover: typeof Root & {\n Anchor: typeof Anchor\n Arrow: typeof Arrow\n CloseButton: typeof CloseButton\n Content: typeof Content\n Header: typeof Header\n Portal: typeof Portal\n Trigger: typeof Trigger\n} = Object.assign(Root, {\n Anchor,\n Arrow,\n CloseButton,\n Content,\n Header,\n Portal,\n Trigger,\n})\n\nPopover.displayName = 'Popover'\nAnchor.displayName = 'Popover.Anchor'\nArrow.displayName = 'Popover.Arrow'\nCloseButton.displayName = 'Popover.CloseButton'\nContent.displayName = 'Popover.Content'\nHeader.displayName = 'Popover.Header'\nPortal.displayName = 'Popover.Portal'\nTrigger.displayName = 'Popover.Trigger'\n"],"mappings":"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"}
1
+ {"version":3,"file":"popover-CWZCAwhW.js","names":[],"sources":["../src/popover/PopoverContext.tsx","../src/popover/Popover.tsx","../src/popover/PopoverAnchor.tsx","../src/popover/PopoverArrow.tsx","../src/popover/PopoverCloseButton.tsx","../src/popover/PopoverContent.styles.ts","../src/popover/PopoverContent.tsx","../src/popover/PopoverHeader.tsx","../src/popover/PopoverPortal.tsx","../src/popover/PopoverTrigger.tsx","../src/popover/index.ts"],"sourcesContent":["import { createContext, type ReactNode, useContext, useState } from 'react'\n\ntype HeaderId = string | null\n\nexport type PopoverIntent =\n | 'surface'\n | 'main'\n | 'support'\n | 'accent'\n | 'success'\n | 'alert'\n | 'danger'\n | 'info'\n | 'neutral'\nexport interface PopoverContextState {\n headerId: HeaderId\n setHeaderId: (id: HeaderId) => void\n intent: PopoverIntent\n}\n\nconst PopoverContext = createContext<PopoverContextState | null>(null)\n\nexport const ID_PREFIX = ':popover'\n\nexport const PopoverProvider = ({\n children,\n intent,\n}: {\n children: ReactNode\n intent: PopoverIntent\n}) => {\n const [headerId, setHeaderId] = useState<HeaderId>(null)\n\n return (\n <PopoverContext\n value={{\n headerId,\n setHeaderId,\n intent,\n }}\n >\n {children}\n </PopoverContext>\n )\n}\n\nexport const usePopover = () => {\n const context = useContext(PopoverContext)\n\n if (!context) {\n throw Error('usePopover must be used within a Popover provider')\n }\n\n return context\n}\n","import { Popover as RadixPopover } from 'radix-ui'\n\nimport { type PopoverIntent, PopoverProvider } from './PopoverContext'\n\nexport type PopoverProps = RadixPopover.PopoverProps & {\n intent?: PopoverIntent\n}\n\nexport const Popover = ({ children, intent = 'surface', modal = false, ...rest }: PopoverProps) => {\n return (\n <PopoverProvider intent={intent}>\n <RadixPopover.Root data-spark-component=\"popover\" modal={modal} {...rest}>\n {children}\n </RadixPopover.Root>\n </PopoverProvider>\n )\n}\n\nPopover.displayName = 'Popover'\n","import { Popover as RadixPopover } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type AnchorProps = RadixPopover.PopoverAnchorProps & {\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * The anchor element for positioning the popover. Renders a <div> element.\n */\n\nexport const Anchor = ({ asChild = false, children, ref, ...rest }: AnchorProps) => (\n <RadixPopover.Anchor data-spark-component=\"popover-anchor\" ref={ref} asChild={asChild} {...rest}>\n {children}\n </RadixPopover.Anchor>\n)\n\nAnchor.displayName = 'Popover.Anchor'\n","import { cva } from 'class-variance-authority'\nimport { Popover as RadixPopover } from 'radix-ui'\nimport { Ref } from 'react'\n\nimport { usePopover } from './PopoverContext'\n\nexport type ArrowProps = RadixPopover.PopoverArrowProps & {\n ref?: Ref<SVGSVGElement>\n}\n\n/**\n * An arrow pointing to the anchor element. Renders an <svg> element.\n */\n\nexport const Arrow = ({\n asChild = false,\n width = 16,\n height = 8,\n className,\n ref,\n ...rest\n}: ArrowProps) => {\n const { intent } = usePopover()\n\n /**\n * This is necessary to override a Radix UI behaviour.\n * Radix hides the arrow when the Popover is too misaligned from its trigger element.\n */\n const styles = cva('visible', {\n variants: {\n intent: {\n surface: 'fill-surface',\n main: 'fill-main-container',\n support: 'fill-support-container',\n accent: 'fill-accent-container',\n success: 'fill-success-container',\n alert: 'fill-alert-container',\n danger: 'fill-error-container',\n info: 'fill-info-container',\n neutral: 'fill-neutral-container',\n },\n },\n defaultVariants: {\n intent: 'surface',\n },\n })\n\n return (\n <RadixPopover.Arrow\n data-spark-component=\"popover-arrow\"\n ref={ref}\n className={styles({ intent, className })}\n asChild={asChild}\n width={width}\n height={height}\n {...rest}\n />\n )\n}\n\nArrow.displayName = 'Popover.Arrow'\n","import { Close as CloseSVG } from '@spark-ui/icons/Close'\nimport { cx } from 'class-variance-authority'\nimport { Popover as RadixPopover } from 'radix-ui'\nimport { Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { IconButton } from '../icon-button'\n\nexport type CloseButtonProps = RadixPopover.PopoverCloseProps & {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\n/**\n * A button that closes the popover. Renders a <button> element.\n */\n\nexport const CloseButton = ({\n 'aria-label': ariaLabel,\n className,\n ref,\n ...rest\n}: CloseButtonProps) => {\n return (\n <RadixPopover.Close\n data-spark-component=\"popover-close-button\"\n ref={ref}\n className={cx('right-lg top-md absolute', className)}\n asChild\n {...rest}\n >\n <IconButton size=\"sm\" intent=\"neutral\" design=\"ghost\" aria-label={ariaLabel}>\n <Icon>\n <CloseSVG />\n </Icon>\n </IconButton>\n </RadixPopover.Close>\n )\n}\n\nCloseButton.displayName = 'Popover.CloseButton'\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const styles = cva(\n [\n 'rounded-md',\n 'shadow-sm',\n 'focus-visible:outline-hidden focus-visible:u-outline',\n 'max-h-(--radix-popper-available-height) overflow-y-auto',\n ],\n {\n variants: {\n intent: {\n surface: 'bg-surface text-on-surface',\n main: 'bg-main-container text-on-main-container',\n support: 'bg-support-container text-on-support-container',\n accent: 'bg-accent-container text-on-accent-container',\n success: 'bg-success-container text-on-success-container',\n alert: 'bg-alert-container text-on-alert-container',\n danger: 'bg-error-container text-on-error-container',\n info: 'bg-info-container text-on-info-container',\n neutral: 'bg-neutral-container text-on-neutral-container',\n },\n matchTriggerWidth: {\n true: 'w-(--radix-popper-anchor-width)',\n },\n enforceBoundaries: {\n true: ['max-w-(--radix-popper-available-width)'],\n },\n\n inset: {\n true: 'overflow-hidden',\n false: 'p-lg',\n },\n elevation: {\n dropdown: 'z-dropdown',\n popover: 'z-popover',\n },\n },\n compoundVariants: [\n {\n inset: false,\n /**\n * When there is a close button, padding to the right side must be adjusted to avoid content overlapping with it.\n */\n class: 'has-data-[spark-component=popover-close-button]:pr-3xl',\n },\n {\n enforceBoundaries: false,\n matchTriggerWidth: false,\n class: 'max-w-[min(var(--spacing-sz-384),100vw)]',\n },\n ],\n defaultVariants: {\n matchTriggerWidth: false,\n enforceBoundaries: false,\n inset: false,\n intent: 'surface',\n elevation: 'popover',\n },\n }\n)\n\nexport type StylesProps = VariantProps<typeof styles>\n","import { Popover as RadixPopover } from 'radix-ui'\nimport { Ref } from 'react'\n\nimport { styles, type StylesProps } from './PopoverContent.styles'\nimport { usePopover } from './PopoverContext'\n\nexport type ContentProps = RadixPopover.PopoverContentProps &\n StylesProps & {\n ref?: Ref<HTMLDivElement>\n }\n\n/**\n * The popup element containing popover content. Renders a <div> element.\n */\n\nexport const Content = ({\n // Spark props\n className,\n children,\n matchTriggerWidth = false,\n // Radix props\n align = 'center',\n arrowPadding = 16, // In order not to overlap the arrow on the rounded corners of the popover.\n asChild = false,\n avoidCollisions = true,\n 'aria-labelledby': ariaLabelledBy,\n collisionBoundary,\n collisionPadding = 0,\n hideWhenDetached = false,\n side = 'bottom',\n sideOffset = 8,\n sticky = 'partial',\n inset = false,\n elevation = 'popover',\n ref,\n ...rest\n}: ContentProps) => {\n const { headerId, intent } = usePopover()\n\n return (\n <RadixPopover.Content\n aria-labelledby={headerId || ariaLabelledBy}\n className={styles({\n enforceBoundaries: !!collisionBoundary,\n matchTriggerWidth,\n inset,\n elevation,\n intent,\n className,\n })}\n data-spark-component=\"popover-content\"\n ref={ref}\n {...{\n align,\n arrowPadding,\n asChild,\n avoidCollisions,\n collisionBoundary,\n collisionPadding,\n hideWhenDetached,\n side,\n sideOffset,\n sticky,\n }}\n {...rest}\n >\n {children}\n </RadixPopover.Content>\n )\n}\n\nContent.displayName = 'Popover.Content'\n","import { cx } from 'class-variance-authority'\nimport { type ReactNode, Ref, useId, useLayoutEffect } from 'react'\n\nimport { ID_PREFIX, usePopover } from './PopoverContext'\n\nexport interface HeaderProps {\n children: ReactNode\n className?: string\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * The header section of the popover. Renders a <header> element.\n */\n\nexport const Header = ({ children, className, ref, ...rest }: HeaderProps) => {\n const id = `${ID_PREFIX}-header-${useId()}`\n const { setHeaderId } = usePopover()\n\n useLayoutEffect(() => {\n setHeaderId(id)\n\n return () => setHeaderId(null)\n }, [id, setHeaderId])\n\n return (\n <header id={id} ref={ref} className={cx('mb-md text-headline-2', className)} {...rest}>\n {children}\n </header>\n )\n}\n\nHeader.displayName = 'Popover.Header'\n","import { Popover as RadixPopover } from 'radix-ui'\nimport { ReactElement } from 'react'\n\nexport type PortalProps = RadixPopover.PopoverPortalProps\n\n/**\n * A portal that renders the popover in a different part of the DOM. Renders a <div> element.\n */\n\nexport const Portal = ({ children, ...rest }: PortalProps): ReactElement => (\n <RadixPopover.Portal {...rest}>{children}</RadixPopover.Portal>\n)\n\nPortal.displayName = 'Popover.Portal'\n","import { Popover as RadixPopover } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type TriggerProps = RadixPopover.PopoverTriggerProps & {\n ref?: Ref<HTMLButtonElement>\n}\n\n/**\n * A button that opens the popover. Renders a <button> element.\n */\n\nexport const Trigger = ({ asChild = false, children, ref, ...rest }: TriggerProps) => (\n <RadixPopover.Trigger\n data-spark-component=\"popover-trigger\"\n ref={ref}\n asChild={asChild}\n {...rest}\n >\n {children}\n </RadixPopover.Trigger>\n)\n\nTrigger.displayName = 'Popover.Trigger'\n","import { Popover as Root } from './Popover'\nimport { Anchor } from './PopoverAnchor'\nimport { Arrow } from './PopoverArrow'\nimport { CloseButton } from './PopoverCloseButton'\nimport { Content } from './PopoverContent'\nimport { Header } from './PopoverHeader'\nimport { Portal } from './PopoverPortal'\nimport { Trigger } from './PopoverTrigger'\n\n/**\n * A floating container that displays additional content when triggered, positioned relative to its trigger element.\n */\nexport const Popover: typeof Root & {\n Anchor: typeof Anchor\n Arrow: typeof Arrow\n CloseButton: typeof CloseButton\n Content: typeof Content\n Header: typeof Header\n Portal: typeof Portal\n Trigger: typeof Trigger\n} = Object.assign(Root, {\n Anchor,\n Arrow,\n CloseButton,\n Content,\n Header,\n Portal,\n Trigger,\n})\n\nPopover.displayName = 'Popover'\nAnchor.displayName = 'Popover.Anchor'\nArrow.displayName = 'Popover.Arrow'\nCloseButton.displayName = 'Popover.CloseButton'\nContent.displayName = 'Popover.Content'\nHeader.displayName = 'Popover.Header'\nPortal.displayName = 'Popover.Portal'\nTrigger.displayName = 'Popover.Trigger'\n"],"mappings":"iQAoBA,IAAM,GAAA,EAAA,EAAA,eAA2D,KAAK,CAEzD,EAAY,WAEZ,GAAmB,CAC9B,WACA,YAII,CACJ,GAAM,CAAC,EAAU,IAAA,EAAA,EAAA,UAAkC,KAAK,CAExD,OACE,EAAA,EAAA,KAAC,EAAD,CACE,MAAO,CACL,WACA,cACA,SACD,CAEA,WACc,CAAA,EAIR,MAAmB,CAC9B,IAAM,GAAA,EAAA,EAAA,YAAqB,EAAe,CAE1C,GAAI,CAAC,EACH,MAAM,MAAM,oDAAoD,CAGlE,OAAO,GC7CI,GAAW,CAAE,WAAU,SAAS,UAAW,QAAQ,GAAO,GAAG,MAEtE,EAAA,EAAA,KAAC,EAAD,CAAyB,mBACvB,EAAA,EAAA,KAAC,EAAA,QAAa,KAAd,CAAmB,uBAAqB,UAAiB,QAAO,GAAI,EACjE,WACiB,CAAA,CACJ,CAAA,CAItB,EAAQ,YAAc,UCPtB,IAAa,GAAU,CAAE,UAAU,GAAO,WAAU,MAAK,GAAG,MAC1D,EAAA,EAAA,KAAC,EAAA,QAAa,OAAd,CAAqB,uBAAqB,iBAAsB,MAAc,UAAS,GAAI,EACxF,WACmB,CAAA,CAGxB,EAAO,YAAc,iBCHrB,IAAa,GAAS,CACpB,UAAU,GACV,QAAQ,GACR,SAAS,EACT,YACA,MACA,GAAG,KACa,CAChB,GAAM,CAAE,UAAW,GAAY,CAMzB,GAAA,EAAA,EAAA,KAAa,UAAW,CAC5B,SAAU,CACR,OAAQ,CACN,QAAS,eACT,KAAM,sBACN,QAAS,yBACT,OAAQ,wBACR,QAAS,yBACT,MAAO,uBACP,OAAQ,uBACR,KAAM,sBACN,QAAS,yBACV,CACF,CACD,gBAAiB,CACf,OAAQ,UACT,CACF,CAAC,CAEF,OACE,EAAA,EAAA,KAAC,EAAA,QAAa,MAAd,CACE,uBAAqB,gBAChB,MACL,UAAW,EAAO,CAAE,SAAQ,YAAW,CAAC,CAC/B,UACF,QACC,SACR,GAAI,EACJ,CAAA,EAIN,EAAM,YAAc,gBC3CpB,IAAa,GAAe,CAC1B,aAAc,EACd,YACA,MACA,GAAG,MAGD,EAAA,EAAA,KAAC,EAAA,QAAa,MAAd,CACE,uBAAqB,uBAChB,MACL,WAAA,EAAA,EAAA,IAAc,2BAA4B,EAAU,CACpD,QAAA,GACA,GAAI,YAEJ,EAAA,EAAA,KAAC,EAAA,EAAD,CAAY,KAAK,KAAK,OAAO,UAAU,OAAO,QAAQ,aAAY,YAChE,EAAA,EAAA,KAAC,EAAA,EAAD,CAAA,UACE,EAAA,EAAA,KAAC,EAAA,MAAD,EAAY,CAAA,CACP,CAAA,CACI,CAAA,CACM,CAAA,CAIzB,EAAY,YAAc,sBCtC1B,IAAa,GAAA,EAAA,EAAA,KACX,CACE,aACA,YACA,uDACA,0DACD,CACD,CACE,SAAU,CACR,OAAQ,CACN,QAAS,6BACT,KAAM,2CACN,QAAS,iDACT,OAAQ,+CACR,QAAS,iDACT,MAAO,6CACP,OAAQ,6CACR,KAAM,2CACN,QAAS,iDACV,CACD,kBAAmB,CACjB,KAAM,kCACP,CACD,kBAAmB,CACjB,KAAM,CAAC,yCAAyC,CACjD,CAED,MAAO,CACL,KAAM,kBACN,MAAO,OACR,CACD,UAAW,CACT,SAAU,aACV,QAAS,YACV,CACF,CACD,iBAAkB,CAChB,CACE,MAAO,GAIP,MAAO,yDACR,CACD,CACE,kBAAmB,GACnB,kBAAmB,GACnB,MAAO,2CACR,CACF,CACD,gBAAiB,CACf,kBAAmB,GACnB,kBAAmB,GACnB,MAAO,GACP,OAAQ,UACR,UAAW,UACZ,CACF,CACF,CC7CY,GAAW,CAEtB,YACA,WACA,oBAAoB,GAEpB,QAAQ,SACR,eAAe,GACf,UAAU,GACV,kBAAkB,GAClB,kBAAmB,EACnB,oBACA,mBAAmB,EACnB,mBAAmB,GACnB,OAAO,SACP,aAAa,EACb,SAAS,UACT,QAAQ,GACR,YAAY,UACZ,MACA,GAAG,KACe,CAClB,GAAM,CAAE,WAAU,UAAW,GAAY,CAEzC,OACE,EAAA,EAAA,KAAC,EAAA,QAAa,QAAd,CACE,kBAAiB,GAAY,EAC7B,UAAW,EAAO,CAChB,kBAAmB,CAAC,CAAC,EACrB,oBACA,QACA,YACA,SACA,YACD,CAAC,CACF,uBAAqB,kBAChB,MAEH,QACA,eACA,UACA,kBACA,oBACA,mBACA,mBACA,OACA,aACA,SAEF,GAAI,EAEH,WACoB,CAAA,EAI3B,EAAQ,YAAc,kBCxDtB,IAAa,GAAU,CAAE,WAAU,YAAW,MAAK,GAAG,KAAwB,CAC5E,IAAM,EAAK,GAAG,EAAU,WAAA,EAAA,EAAA,QAAiB,GACnC,CAAE,eAAgB,GAAY,CAQpC,OANA,EAAA,EAAA,sBACE,EAAY,EAAG,KAEF,EAAY,KAAK,EAC7B,CAAC,EAAI,EAAY,CAAC,EAGnB,EAAA,EAAA,KAAC,SAAD,CAAY,KAAS,MAAK,WAAA,EAAA,EAAA,IAAc,wBAAyB,EAAU,CAAE,GAAI,EAC9E,WACM,CAAA,EAIb,EAAO,YAAc,iBCvBrB,IAAa,GAAU,CAAE,WAAU,GAAG,MACpC,EAAA,EAAA,KAAC,EAAA,QAAa,OAAd,CAAqB,GAAI,EAAO,WAA+B,CAAA,CAGjE,EAAO,YAAc,iBCFrB,IAAa,GAAW,CAAE,UAAU,GAAO,WAAU,MAAK,GAAG,MAC3D,EAAA,EAAA,KAAC,EAAA,QAAa,QAAd,CACE,uBAAqB,kBAChB,MACI,UACT,GAAI,EAEH,WACoB,CAAA,CAGzB,EAAQ,YAAc,kBCVtB,IAAa,EAQT,OAAO,OAAO,EAAM,CACtB,SACA,QACA,cACA,UACA,SACA,SACA,UACD,CAAC,CAEF,EAAQ,YAAc,UACtB,EAAO,YAAc,iBACrB,EAAM,YAAc,gBACpB,EAAY,YAAc,sBAC1B,EAAQ,YAAc,kBACtB,EAAO,YAAc,iBACrB,EAAO,YAAc,iBACrB,EAAQ,YAAc"}