@yahoo/uds 3.64.1 → 3.64.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.
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,2 @@
1
+ /*! © 2025 Yahoo, Inc. UDS v0.0.0-development */
2
+ var d={none:{default:null,0:null,px:null,.5:null,1:null,1.5:null,2:null,2.5:null,3:null,3.5:null,4:null},xs:{default:"uds-nested-border-radius-children-edges/xs",0:"uds-nested-border-radius-children-edges/xs",px:"uds-nested-border-radius-children-edges/xs/px",.5:"uds-nested-border-radius-children-edges/xs/0_5",1:"uds-nested-border-radius-children-edges/xs/1",1.5:"uds-nested-border-radius-children-edges/xs/1_5",2:"uds-nested-border-radius-children-edges/xs/2",2.5:"uds-nested-border-radius-children-edges/xs/2_5",3:"uds-nested-border-radius-children-edges/xs/3",3.5:"uds-nested-border-radius-children-edges/xs/3_5",4:"uds-nested-border-radius-children-edges/xs/4"},sm:{default:"uds-nested-border-radius-children-edges/sm",0:"uds-nested-border-radius-children-edges/sm",px:"uds-nested-border-radius-children-edges/sm/px",.5:"uds-nested-border-radius-children-edges/sm/0_5",1:"uds-nested-border-radius-children-edges/sm/1",1.5:"uds-nested-border-radius-children-edges/sm/1_5",2:"uds-nested-border-radius-children-edges/sm/2",2.5:"uds-nested-border-radius-children-edges/sm/2_5",3:"uds-nested-border-radius-children-edges/sm/3",3.5:"uds-nested-border-radius-children-edges/sm/3_5",4:"uds-nested-border-radius-children-edges/sm/4"},md:{default:"uds-nested-border-radius-children-edges/md",0:"uds-nested-border-radius-children-edges/md",px:"uds-nested-border-radius-children-edges/md/px",.5:"uds-nested-border-radius-children-edges/md/0_5",1:"uds-nested-border-radius-children-edges/md/1",1.5:"uds-nested-border-radius-children-edges/md/1_5",2:"uds-nested-border-radius-children-edges/md/2",2.5:"uds-nested-border-radius-children-edges/md/2_5",3:"uds-nested-border-radius-children-edges/md/3",3.5:"uds-nested-border-radius-children-edges/md/3_5",4:"uds-nested-border-radius-children-edges/md/4"},lg:{default:"uds-nested-border-radius-children-edges/lg",0:"uds-nested-border-radius-children-edges/lg",px:"uds-nested-border-radius-children-edges/lg/px",.5:"uds-nested-border-radius-children-edges/lg/0_5",1:"uds-nested-border-radius-children-edges/lg/1",1.5:"uds-nested-border-radius-children-edges/lg/1_5",2:"uds-nested-border-radius-children-edges/lg/2",2.5:"uds-nested-border-radius-children-edges/lg/2_5",3:"uds-nested-border-radius-children-edges/lg/3",3.5:"uds-nested-border-radius-children-edges/lg/3_5",4:"uds-nested-border-radius-children-edges/lg/4"},xl:{default:"uds-nested-border-radius-children-edges/xl",0:"uds-nested-border-radius-children-edges/xl",px:"uds-nested-border-radius-children-edges/xl/px",.5:"uds-nested-border-radius-children-edges/xl/0_5",1:"uds-nested-border-radius-children-edges/xl/1",1.5:"uds-nested-border-radius-children-edges/xl/1_5",2:"uds-nested-border-radius-children-edges/xl/2",2.5:"uds-nested-border-radius-children-edges/xl/2_5",3:"uds-nested-border-radius-children-edges/xl/3",3.5:"uds-nested-border-radius-children-edges/xl/3_5",4:"uds-nested-border-radius-children-edges/xl/4"},full:{default:null,0:null,px:null,.5:null,1:null,1.5:null,2:null,2.5:null,3:null,3.5:null,4:null}},e=(e,s)=>d[e][s&&"0"!==s?s:"default"],s=()=>{const d=["xs","sm","md","lg","xl"],e={},s={0:{subtract:"2px",min:{xs:"0px",sm:"0px",md:"0px",lg:"0px",xl:"0px"}},.5:{subtract:"2px",min:{xs:"1px",sm:"2px",md:"2px",lg:"2px",xl:"2px"}},px:{subtract:"2px",min:{xs:"1px",sm:"2px",md:"2px",lg:"2px",xl:"2px"}},1:{subtract:"4px",min:{xs:"1px",sm:"2px",md:"2px",lg:"2px",xl:"0px"}},1.5:{subtract:"4px",min:{xs:"1px",sm:"2px",md:"2px",lg:"2px",xl:"0px"}},2:{subtract:"8px",min:{xs:"1px",sm:"2px",md:"4px",lg:"4px",xl:"0px"}},2.5:{subtract:"8px",min:{xs:"1px",sm:"2px",md:"4px",lg:"4px",xl:"0px"}},3:{subtract:"6px",min:{xs:"2px",sm:"4px",md:"6px",lg:"6px",xl:"20px"}},3.5:{subtract:"6px",min:{xs:"2px",sm:"4px",md:"6px",lg:"6px",xl:"20px"}},4:{subtract:"16px",min:{xs:"1px",sm:"2px",md:"4px",lg:"6px",xl:"6px"}}},r=(d,e)=>{const s=e.min[d];return"xl"===d&&"6px"===e.subtract&&"20px"===s?`min(${s}, calc(var(--uds-border-radius-${d}) - ${e.subtract}))`:"xl"===d&&"4px"===e.subtract&&"0px"===s||"xl"===d&&"8px"===e.subtract&&"0px"===s||"var(--uds-border-width-thin)"===e.subtract?`calc(var(--uds-border-radius-${d}) - ${e.subtract})`:`max(${s}, calc(var(--uds-border-radius-${d}) - ${e.subtract}))`},u=(d,e)=>({"border-top-left-radius":r(d,e),"border-top-right-radius":r(d,e)}),l=(d,e)=>({"border-bottom-left-radius":r(d,e),"border-bottom-right-radius":r(d,e)}),n=(d,e)=>({"border-top-left-radius":r(d,e),"border-top-right-radius":r(d,e),"border-bottom-left-radius":r(d,e),"border-bottom-right-radius":r(d,e)});for(const[r,i]of Object.entries(s)){const s="0"===r?"":`/${r.replace(".","_")}`;for(const r of d){e[`.uds-nested-border-radius-children-edges\\/${r}${s.replace("/","\\/")}`]={"& > *:first-child":u(r,i),"& > *:last-child":l(r,i)};e[`.uds-nested-border-radius-children\\/${r}${s.replace("/","\\/")}`]={"& > *":n(r,i)};e[`.uds-nested-border-radius-t\\/${r}${s.replace("/","\\/")}`]=u(r,i);e[`.uds-nested-border-radius-b\\/${r}${s.replace("/","\\/")}`]=l(r,i)}}return e};export{e as getNestedBorderRadiusClass,s as getNestedBorderRadiusUtilities};
@@ -0,0 +1 @@
1
+ "use strict";/*! © 2025 Yahoo, Inc. UDS v0.0.0-development */var d={none:{default:null,0:null,px:null,.5:null,1:null,1.5:null,2:null,2.5:null,3:null,3.5:null,4:null},xs:{default:"uds-nested-border-radius-children-edges/xs",0:"uds-nested-border-radius-children-edges/xs",px:"uds-nested-border-radius-children-edges/xs/px",.5:"uds-nested-border-radius-children-edges/xs/0_5",1:"uds-nested-border-radius-children-edges/xs/1",1.5:"uds-nested-border-radius-children-edges/xs/1_5",2:"uds-nested-border-radius-children-edges/xs/2",2.5:"uds-nested-border-radius-children-edges/xs/2_5",3:"uds-nested-border-radius-children-edges/xs/3",3.5:"uds-nested-border-radius-children-edges/xs/3_5",4:"uds-nested-border-radius-children-edges/xs/4"},sm:{default:"uds-nested-border-radius-children-edges/sm",0:"uds-nested-border-radius-children-edges/sm",px:"uds-nested-border-radius-children-edges/sm/px",.5:"uds-nested-border-radius-children-edges/sm/0_5",1:"uds-nested-border-radius-children-edges/sm/1",1.5:"uds-nested-border-radius-children-edges/sm/1_5",2:"uds-nested-border-radius-children-edges/sm/2",2.5:"uds-nested-border-radius-children-edges/sm/2_5",3:"uds-nested-border-radius-children-edges/sm/3",3.5:"uds-nested-border-radius-children-edges/sm/3_5",4:"uds-nested-border-radius-children-edges/sm/4"},md:{default:"uds-nested-border-radius-children-edges/md",0:"uds-nested-border-radius-children-edges/md",px:"uds-nested-border-radius-children-edges/md/px",.5:"uds-nested-border-radius-children-edges/md/0_5",1:"uds-nested-border-radius-children-edges/md/1",1.5:"uds-nested-border-radius-children-edges/md/1_5",2:"uds-nested-border-radius-children-edges/md/2",2.5:"uds-nested-border-radius-children-edges/md/2_5",3:"uds-nested-border-radius-children-edges/md/3",3.5:"uds-nested-border-radius-children-edges/md/3_5",4:"uds-nested-border-radius-children-edges/md/4"},lg:{default:"uds-nested-border-radius-children-edges/lg",0:"uds-nested-border-radius-children-edges/lg",px:"uds-nested-border-radius-children-edges/lg/px",.5:"uds-nested-border-radius-children-edges/lg/0_5",1:"uds-nested-border-radius-children-edges/lg/1",1.5:"uds-nested-border-radius-children-edges/lg/1_5",2:"uds-nested-border-radius-children-edges/lg/2",2.5:"uds-nested-border-radius-children-edges/lg/2_5",3:"uds-nested-border-radius-children-edges/lg/3",3.5:"uds-nested-border-radius-children-edges/lg/3_5",4:"uds-nested-border-radius-children-edges/lg/4"},xl:{default:"uds-nested-border-radius-children-edges/xl",0:"uds-nested-border-radius-children-edges/xl",px:"uds-nested-border-radius-children-edges/xl/px",.5:"uds-nested-border-radius-children-edges/xl/0_5",1:"uds-nested-border-radius-children-edges/xl/1",1.5:"uds-nested-border-radius-children-edges/xl/1_5",2:"uds-nested-border-radius-children-edges/xl/2",2.5:"uds-nested-border-radius-children-edges/xl/2_5",3:"uds-nested-border-radius-children-edges/xl/3",3.5:"uds-nested-border-radius-children-edges/xl/3_5",4:"uds-nested-border-radius-children-edges/xl/4"},full:{default:null,0:null,px:null,.5:null,1:null,1.5:null,2:null,2.5:null,3:null,3.5:null,4:null}};exports.getNestedBorderRadiusClass=(e,s)=>d[e][s&&"0"!==s?s:"default"],exports.getNestedBorderRadiusUtilities=()=>{const d=["xs","sm","md","lg","xl"],e={},s={0:{subtract:"2px",min:{xs:"0px",sm:"0px",md:"0px",lg:"0px",xl:"0px"}},.5:{subtract:"2px",min:{xs:"1px",sm:"2px",md:"2px",lg:"2px",xl:"2px"}},px:{subtract:"2px",min:{xs:"1px",sm:"2px",md:"2px",lg:"2px",xl:"2px"}},1:{subtract:"4px",min:{xs:"1px",sm:"2px",md:"2px",lg:"2px",xl:"0px"}},1.5:{subtract:"4px",min:{xs:"1px",sm:"2px",md:"2px",lg:"2px",xl:"0px"}},2:{subtract:"8px",min:{xs:"1px",sm:"2px",md:"4px",lg:"4px",xl:"0px"}},2.5:{subtract:"8px",min:{xs:"1px",sm:"2px",md:"4px",lg:"4px",xl:"0px"}},3:{subtract:"6px",min:{xs:"2px",sm:"4px",md:"6px",lg:"6px",xl:"20px"}},3.5:{subtract:"6px",min:{xs:"2px",sm:"4px",md:"6px",lg:"6px",xl:"20px"}},4:{subtract:"16px",min:{xs:"1px",sm:"2px",md:"4px",lg:"6px",xl:"6px"}}},r=(d,e)=>{const s=e.min[d];return"xl"===d&&"6px"===e.subtract&&"20px"===s?`min(${s}, calc(var(--uds-border-radius-${d}) - ${e.subtract}))`:"xl"===d&&"4px"===e.subtract&&"0px"===s||"xl"===d&&"8px"===e.subtract&&"0px"===s||"var(--uds-border-width-thin)"===e.subtract?`calc(var(--uds-border-radius-${d}) - ${e.subtract})`:`max(${s}, calc(var(--uds-border-radius-${d}) - ${e.subtract}))`},u=(d,e)=>({"border-top-left-radius":r(d,e),"border-top-right-radius":r(d,e)}),l=(d,e)=>({"border-bottom-left-radius":r(d,e),"border-bottom-right-radius":r(d,e)}),n=(d,e)=>({"border-top-left-radius":r(d,e),"border-top-right-radius":r(d,e),"border-bottom-left-radius":r(d,e),"border-bottom-right-radius":r(d,e)});for(const[r,i]of Object.entries(s)){const s="0"===r?"":`/${r.replace(".","_")}`;for(const r of d){e[`.uds-nested-border-radius-children-edges\\/${r}${s.replace("/","\\/")}`]={"& > *:first-child":u(r,i),"& > *:last-child":l(r,i)};e[`.uds-nested-border-radius-children\\/${r}${s.replace("/","\\/")}`]={"& > *":n(r,i)};e[`.uds-nested-border-radius-t\\/${r}${s.replace("/","\\/")}`]=u(r,i);e[`.uds-nested-border-radius-b\\/${r}${s.replace("/","\\/")}`]=l(r,i)}}return e};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";var e=require("../chunk-KQYW7REL.cjs"),r=require("../chunk-CGHQHGYY.cjs"),a=require("../chunk-EUBXXJNQ.cjs"),t=require("../chunk-O7H45A6H.cjs"),d=require("../chunk-BMP5TZVZ.cjs"),s=require("../chunk-QLXJH36U.cjs"),n=require("@ariakit/react/menu"),i=require("react"),c=require("use-sync-external-store/shim/index.js"),o=require("@yahoo/uds/fixtures"),u=require("motion/react"),l=require("react/jsx-runtime"),x=require("@ariakit/react");function m(e){return e&&e.__esModule?e:{default:e}}function p(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach(function(a){if("default"!==a){var t=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,t.get?t:{enumerable:!0,get:function(){return e[a]}})}}),r.default=e,Object.freeze(r)}var f=p(i),b=m(c),h={};function _(e){return e}function v(e,r){const a=e.__unstableInternals;return function(e,r){if(!e)throw new Error(r)}(a,"Invalid store"),a[r]}s.__export(h,{Content:()=>j,Divider:()=>N,Item:()=>R,ItemCheckbox:()=>P,Provider:()=>z,Trigger:()=>A,useMenuContext:()=>n.useMenuContext,useMenuStore:()=>n.useMenuStore,useStoreState:()=>x.useStoreState});var{useSyncExternalStore:g}=b.default;function y(e,r=_){const a=f.useCallback(r=>e?function(e,...r){if(e)return v(e,"subscribe")(...r)}(e,null,r):()=>{},[e]),t=()=>{const a="string"==typeof r?r:null,t="function"==typeof r?r:null,d=null==e?void 0:e.getState();if(t)return t(d);var s,n;if(d&&(a&&(s=d,n=a,"function"==typeof Object.hasOwn?Object.hasOwn(s,n):Object.prototype.hasOwnProperty.call(s,n))))return d[a]};return g(a,t,t)}var I=u.m.create(a.VStack),C=5,S=.97,w={top:{x:0,y:C},bottom:{x:0,y:-5},left:{x:C,y:0},right:{x:-5,y:0}},k=e=>i.useMemo(()=>((e="bottom")=>{const[r="top"]=e?.split("-");return{closed:{...w[r],opacity:0,scale:S},open:{y:0,x:0,opacity:1,scale:1}}})(e),[e]),j=i.forwardRef(function({gap:e,spacing:r,spacingBottom:a,spacingEnd:t,spacingStart:s,spacingTop:c,gutter:x="1",backgroundColor:m="primary",borderRadius:p="md",borderColor:f,borderWidth:b="thin",overflow:h,dropShadow:_="lg",className:v,sameWidth:g,focusable:C,children:S,portalElement:w,portal:j=!0,disableAutoBorderRadius:N,...M},V){const E=n.useMenuContext(),R=y(E,"open"),P=y(E,"mounted"),O=y(E,"currentPlacement"),q=y(E,"placement"),[z,A]=i.useState(O),[T,H]=i.useState(O);i.useEffect(()=>{q!==T&&H(q)},[q]),i.useEffect(()=>{O!==T&&H(O)},[O]),i.useEffect(()=>{P&&T!==z&&A(T)},[P,T,z]);const B=i.useMemo(()=>R&&P?"open":"closed",[R,P]),D=i.useMemo(()=>R?_:"none",[R,_]),G=k(T),L=(({borderRadius:e,spacing:r})=>{if(void 0===r||"0"===r)switch(e){case"xs":return"[&>*:first-child]:rounded-t-[calc(var(--uds-border-radius-xs)_-_var(--uds-border-width-thin))] [&>*:last-child]:rounded-b-[calc(var(--uds-border-radius-xs)_-_var(--uds-border-width-thin))]";case"sm":return"[&>*:first-child]:rounded-t-[calc(var(--uds-border-radius-sm)_-_var(--uds-border-width-thin))] [&>*:last-child]:rounded-b-[calc(var(--uds-border-radius-sm)_-_var(--uds-border-width-thin))]";case"md":return"[&>*:first-child]:rounded-t-[calc(var(--uds-border-radius-md)_-_var(--uds-border-width-thin))] [&>*:last-child]:rounded-b-[calc(var(--uds-border-radius-md)_-_var(--uds-border-width-thin))]";case"lg":return"[&>*:first-child]:rounded-t-[calc(var(--uds-border-radius-lg)_-_var(--uds-border-width-thin))] [&>*:last-child]:rounded-b-[calc(var(--uds-border-radius-lg)_-_var(--uds-border-width-thin))]";case"xl":return"[&>*:first-child]:rounded-t-[calc(var(--uds-border-radius-xl)_-_var(--uds-border-width-thin))] [&>*:last-child]:rounded-b-[calc(var(--uds-border-radius-xl)_-_var(--uds-border-width-thin))]"}if("px"===r||"0.5"===r)switch(e){case"xs":return"[&>*:first-child]:rounded-t-[max(1px,calc(var(--uds-border-radius-xs)_-_2px))] [&>*:last-child]:rounded-b-[max(1px,calc(var(--uds-border-radius-xs)_-_2px))]";case"sm":return"[&>*:first-child]:rounded-t-[max(2px,calc(var(--uds-border-radius-sm)_-_2px))] [&>*:last-child]:rounded-b-[max(2px,calc(var(--uds-border-radius-sm)_-_2px))]";case"md":return"[&>*:first-child]:rounded-t-[max(2px,calc(var(--uds-border-radius-md)_-_2px))] [&>*:last-child]:rounded-b-[max(2px,calc(var(--uds-border-radius-md)_-_2px))]";case"lg":return"[&>*:first-child]:rounded-t-[max(2px,calc(var(--uds-border-radius-lg)_-_2px))] [&>*:last-child]:rounded-b-[max(2px,calc(var(--uds-border-radius-lg)_-_2px))]";case"xl":return"[&>*:first-child]:rounded-t-[max(2px,calc(var(--uds-border-radius-xl)_-_2px))] [&>*:last-child]:rounded-b-[max(2px,calc(var(--uds-border-radius-xl)_-_2px))]"}if("1"===r||"1.5"===r)switch(e){case"xs":return"[&>*:first-child]:rounded-t-[max(1px,calc(var(--uds-border-radius-xs)_-_4px))] [&>*:last-child]:rounded-b-[max(1px,calc(var(--uds-border-radius-xs)_-_4px))]";case"sm":return"[&>*:first-child]:rounded-t-[max(2px,calc(var(--uds-border-radius-sm)_-_4px))] [&>*:last-child]:rounded-b-[max(2px,calc(var(--uds-border-radius-sm)_-_4px))]";case"md":return"[&>*:first-child]:rounded-t-[max(2px,calc(var(--uds-border-radius-md)_-_4px))] [&>*:last-child]:rounded-b-[max(2px,calc(var(--uds-border-radius-md)_-_4px))]";case"lg":return"[&>*:first-child]:rounded-t-[max(2px,calc(var(--uds-border-radius-lg)_-_4px))] [&>*:last-child]:rounded-b-[max(2px,calc(var(--uds-border-radius-lg)_-_4px))]";case"xl":return"[&>*:first-child]:rounded-t-[calc(var(--uds-border-radius-xl)_-_4px)] [&>*:last-child]:rounded-b-[calc(var(--uds-border-radius-xl)_-_4px)]"}if("2"===r||"2.5"===r)switch(e){case"xs":return"[&>*:first-child]:rounded-t-[max(1px,calc(var(--uds-border-radius-xs)_-_8px))] [&>*:last-child]:rounded-b-[max(1px,calc(var(--uds-border-radius-xs)_-_8px))]";case"sm":return"[&>*:first-child]:rounded-t-[max(2px,calc(var(--uds-border-radius-sm)_-_8px))] [&>*:last-child]:rounded-b-[max(2px,calc(var(--uds-border-radius-sm)_-_8px))]";case"md":return"[&>*:first-child]:rounded-t-[max(4px,calc(var(--uds-border-radius-md)_-_8px))] [&>*:last-child]:rounded-b-[max(4px,calc(var(--uds-border-radius-md)_-_8px))]";case"lg":return"[&>*:first-child]:rounded-t-[max(4px,calc(var(--uds-border-radius-lg)_-_8px))] [&>*:last-child]:rounded-b-[max(4px,calc(var(--uds-border-radius-lg)_-_8px))]";case"xl":return"[&>*:first-child]:rounded-t-[calc(var(--uds-border-radius-xl)_-_8px)] [&>*:last-child]:rounded-b-[calc(var(--uds-border-radius-xl)_-_8px)]"}if("3"===r||"3.5"===r)switch(e){case"xs":return"[&>*:first-child]:rounded-t-[max(2px,calc(var(--uds-border-radius-xs)_-_6px))] [&>*:last-child]:rounded-b-[max(2px,calc(var(--uds-border-radius-xs)_-_6px))]";case"sm":return"[&>*:first-child]:rounded-t-[max(4px,calc(var(--uds-border-radius-sm)_-_6px))] [&>*:last-child]:rounded-b-[max(4px,calc(var(--uds-border-radius-sm)_-_6px))]";case"md":return"[&>*:first-child]:rounded-t-[max(6px,calc(var(--uds-border-radius-md)_-_6px))] [&>*:last-child]:rounded-b-[max(6px,calc(var(--uds-border-radius-md)_-_6px))]";case"lg":return"[&>*:first-child]:rounded-t-[max(6px,calc(var(--uds-border-radius-lg)_-_6px))] [&>*:last-child]:rounded-b-[max(6px,calc(var(--uds-border-radius-lg)_-_6px))]";case"xl":return"[&>*:first-child]:rounded-t-[min(20px,calc(var(--uds-border-radius-xl)_-_6px))] [&>*:last-child]:rounded-b-[min(20px,calc(var(--uds-border-radius-xl)_-_6px))]"}if("4"===r)switch(e){case"xs":return"[&>*:first-child]:rounded-t-[max(1px,calc(var(--uds-border-radius-xs)_-_16px))] [&>*:last-child]:rounded-b-[max(1px,calc(var(--uds-border-radius-xs)_-_16px))]";case"sm":return"[&>*:first-child]:rounded-t-[max(2px,calc(var(--uds-border-radius-sm)_-_16px))] [&>*:last-child]:rounded-b-[max(2px,calc(var(--uds-border-radius-sm)_-_16px))]";case"md":return"[&>*:first-child]:rounded-t-[max(4px,calc(var(--uds-border-radius-md)_-_16px))] [&>*:last-child]:rounded-b-[max(4px,calc(var(--uds-border-radius-md)_-_16px))]";case"lg":return"[&>*:first-child]:rounded-t-[max(6px,calc(var(--uds-border-radius-lg)_-_16px))] [&>*:last-child]:rounded-b-[max(6px,calc(var(--uds-border-radius-lg)_-_16px))]";case"xl":return"[&>*:first-child]:rounded-t-[max(6px,calc(var(--uds-border-radius-xl)_-_16px))] [&>*:last-child]:rounded-b-[max(6px,calc(var(--uds-border-radius-xl)_-_16px))]"}switch(e){case"xs":return"[&>*:first-child]:rounded-t-[max(1px,calc(var(--uds-border-radius-xs)_-_4px))] [&>*:last-child]:rounded-b-[max(1px,calc(var(--uds-border-radius-xs)_-_4px))]";case"sm":return"[&>*:first-child]:rounded-t-[max(2px,calc(var(--uds-border-radius-sm)_-_4px))] [&>*:last-child]:rounded-b-[max(2px,calc(var(--uds-border-radius-sm)_-_4px))]";case"md":return"[&>*:first-child]:rounded-t-[max(2px,calc(var(--uds-border-radius-md)_-_4px))] [&>*:last-child]:rounded-b-[max(2px,calc(var(--uds-border-radius-md)_-_4px))]";case"lg":return"[&>*:first-child]:rounded-t-[max(2px,calc(var(--uds-border-radius-lg)_-_4px))] [&>*:last-child]:rounded-b-[max(2px,calc(var(--uds-border-radius-lg)_-_4px))]";case"xl":return"[&>*:first-child]:rounded-t-[min(18px,calc(var(--uds-border-radius-xl)_-_4px))] [&>*:last-child]:rounded-b-[min(18px,calc(var(--uds-border-radius-xl)_-_4px))]"}})({borderRadius:p,spacing:r}),W=i.useMemo(()=>o.spacingMap[x],[x]);return l.jsx(u.AnimatePresence,{initial:!1,children:l.jsx(n.Menu,{gutter:W,sameWidth:g,focusable:C,store:E,ref:V,portalElement:w,portal:j,...M,render:l.jsx(I,{backgroundColor:m,gap:e,spacing:r,spacingBottom:a,spacingEnd:t,spacingStart:s,spacingTop:c,borderRadius:p,borderColor:f,borderWidth:b,overflow:h,animate:B,variants:G,dropShadow:D,className:d.cx("uds-menu-content","transition-shadow","duration-200","ease-in-out","min-w-60","max-w-lg","max-h-96","overflow-auto","uds-ring","z-10","group",!N&&L,v),children:S})})})});j.displayName="MenuContent";var N=i.forwardRef(function({role:r="separator",contentPosition:a="start",gap:t="4",children:s,spacingVertical:n=(s?"2":"0"),spacingHorizontal:i=(s?"4":"0"),className:c,...o},u){const x={root:d.getStyles({menuDividerVariantRoot:"default",className:c}),text:d.getStyles({menuDividerVariantText:"default"}),line:d.getStyles({menuDividerVariantLine:"default"})};return l.jsx(e.DividerInternal,{ref:u,role:r,variant:"inherit",contentPosition:a,gap:t,spacingVertical:n,spacingHorizontal:i,className:x.root,layerClassNames:x,...o,children:s})});N.displayName="MenuDivider";var M="uds-menu-item",V={visible:{scale:1,opacity:1},hidden:{scale:.7,opacity:0}},E=i.forwardRef(function({spacing:e="0",spacingBottom:t,spacingEnd:s,spacingHorizontal:n="4",spacingStart:c,spacingTop:o,spacingVertical:x="3.5",columnGap:m="2",className:p,children:f,endIcon:b,startIcon:h,hideEndIcon:_,active:v,disabled:g,as:y,name:I,alignItems:C="center",justifyContent:S="space-between",layerClassNames:w,slots:k,rootProps:j,...N},E){const R=i.Children.count(f)>1,P=(({active:e,disabled:r,className:a})=>d.cx(M,"flex","focus-visible:text-brand","focus-visible:bg-brand-secondary","focus-visible:z-10","uds-ring","!-outline-offset-2",e&&["[&:not([aria-checked])]:cursor-default"],r&&"opacity-25 cursor-not-allowed","duration-20 transition-[font-variation-settings] ease-in-out","z-0",a))({active:v,disabled:g,className:p}),O=d.getStyles({className:d.cx(`${M}-content truncate`,w?.text),textAlign:"start",...R&&{columnGap:m,display:"flex",alignItems:"center",width:"full",justifyContent:"space-between"}}),q=i.useMemo(()=>({root:d.getStyles({menuSizeRoot:"default",flexDirection:"row",spacing:e,spacingBottom:t,spacingEnd:s,spacingHorizontal:n,spacingStart:c,spacingTop:o,spacingVertical:x,columnGap:m,alignItems:C,justifyContent:S,className:d.cx(P,w?.root)}),startIcon:d.getStyles({menuSizeStartIcon:"default",className:w?.startIcon}),endIcon:d.getStyles({menuSizeEndIcon:"default",className:w?.endIcon})}),[C,m,S,w?.endIcon,w?.root,w?.startIcon,P,e,t,s,n,c,o,x]),z=k?.root??(e=>l.jsx(r.Pressable,{...e,...N,onClick:r=>{e.onClick?.(r),N.onClick?.(r)}}));return l.jsxs(y,{ref:E,name:I??"",...j,render:z,disabled:g,className:q.root,children:[l.jsxs(a.HStack,{gap:m,alignItems:"center",width:"full",children:[l.jsx(u.AnimatePresence,{initial:!1,children:h&&l.jsx(u.m.span,{variants:V,initial:"hidden",animate:"visible",exit:"hidden",className:"uds-start-icon",children:l.jsx(d.IconSlot,{icon:h,className:q.startIcon,iconProps:{size:"sm",variant:v?"fill":"outline",color:"current"}})})}),l.jsx("span",{className:O,children:f})]}),l.jsx(u.AnimatePresence,{initial:!1,mode:"popLayout",children:!_&&b&&l.jsx(u.m.span,{variants:V,initial:"hidden",animate:"visible",exit:"hidden",className:"uds-end-icon",children:l.jsx(d.IconSlot,{icon:b,className:q.endIcon,iconProps:{size:"sm",variant:v?"fill":"outline",color:"current"}})})})]})});E.displayName="MenuItemBase";var R=i.forwardRef(function({active:e,hideOnClick:r,...a},t){const s={root:d.getStyles({menuItemVariantRoot:"default",menuItemVariantActiveRoot:e?"on":"off"}),text:d.getStyles({menuItemVariantText:"default",menuItemVariantActiveText:e?"on":"off"}),startIcon:d.getStyles({menuItemVariantIcon:"default",menuItemVariantActiveIcon:e?"on":"off"})};return l.jsx(E,{ref:t,as:n.MenuItem,active:e,layerClassNames:s,rootProps:{hideOnClick:r},...a})});R.displayName="MenuItem";var P=i.forwardRef(function({name:e,endIcon:a=r.e,checked:t,defaultChecked:s,hideOnClick:c,className:o,...u},m){const p=e,f=i.useRef(!1),b=n.useMenuContext(),h=x.useStoreState(b);i.useEffect(()=>{!f.current&&void 0!==s&&b&&(b.setValues(e=>({...e,[p]:s})),f.current=!0)},[b,s,p]);const _=i.useMemo(()=>{if(void 0!==t)return t;if(h?.items?.length){const e=h?.items.find(e=>e.element?.name===p);if(e?.element)return e.element.checked}const e=h?.values[p];return"boolean"==typeof e?e:s??!1},[h?.items,h?.values,p,t,s]),v=i.useCallback(e=>{void 0===t&&b?.setValues(r=>({...r,[p]:e.target.checked}))},[p,b,t]),g={root:d.getStyles({menuItemCheckboxVariantRoot:"default",menuItemCheckboxVariantActiveRoot:_?"on":"off"}),text:d.getStyles({menuItemCheckboxVariantText:"default",menuItemCheckboxVariantActiveText:_?"on":"off"}),startIcon:d.getStyles({menuItemCheckboxVariantStartIcon:"default",menuItemCheckboxVariantActiveStartIcon:_?"on":"off"}),endIcon:d.getStyles({menuItemCheckboxVariantEndIcon:"default",menuItemCheckboxVariantActiveEndIcon:_?"on":"off"})};return l.jsx(E,{ref:m,as:n.MenuItemCheckbox,hideEndIcon:!_,endIcon:a,active:_,className:d.cx("uds-menu-item-checkbox",o),layerClassNames:g,name:e,rootProps:{onChange:v,defaultChecked:s,checked:void 0!==t?t:void 0,hideOnClick:c},...u})});P.displayName="MenuItemCheckbox";var O=()=>{if("undefined"==typeof document)return!1;return"rtl"===getComputedStyle(document.documentElement).direction},q=e=>{const[r,a]=i.useState(O);return i.useEffect(()=>{if(e?.explicit)return void a(e.explicit);const r=(e=>{const r=new MutationObserver(r=>{r.some(e=>"attributes"===e.type&&"dir"===e.attributeName)&&e()});return r.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]}),r})(()=>{a(O())});return()=>r.disconnect()},[e?.explicit]),r},z=function({placement:e="bottom",rtl:r,...a}){const d=q({explicit:r}),s=((e,r)=>{const a=r?.rtl;if("start"===e)return a?"right":"left";if("end"===e)return a?"left":"right";if(e?.includes("-")){const[r,t]=e.split("-");if(!("start"!==r&&"end"!==r||"top"!==t&&"bottom"!==t))return`${"start"===r?a?"right":"left":a?"left":"right"}-${"bottom"===t?"end":"start"}`;if("top"===r||"bottom"===r)return`${r}-${"start"===t?a?"end":"start":a?"start":"end"}`}return e})(e,{rtl:d});return l.jsx(t.SpringMotionConfig,{children:l.jsx(n.MenuProvider,{placement:s,rtl:d,...a})})};z.displayName="MenuProvider";var A=i.forwardRef(function({asChild:e,children:r,className:a,...t},s){const c=i.useRef(null),o=e?{render:l.jsx(d.Box,{asChild:!0,ref:c,className:"uds-ring h-fit w-fit",children:r})}:{children:r},u=i.useCallback(()=>{const e=c.current?.firstChild;e instanceof HTMLElement&&"function"==typeof e.focus&&e.focus()},[c]);return l.jsx(n.MenuButton,{onFocus:u,onFocusVisible:u,ref:s,className:d.cx("uds-menu-trigger",a),...o,...t})});A.displayName="MenuTrigger",exports.Menu=h;
2
+ "use strict";var e=require("../chunk-E3IMFFEG.cjs"),t=require("../chunk-KQYW7REL.cjs"),n=require("../chunk-CGHQHGYY.cjs"),r=require("../chunk-EUBXXJNQ.cjs"),a=require("../chunk-O7H45A6H.cjs"),o=require("../chunk-BMP5TZVZ.cjs"),i=require("../chunk-QLXJH36U.cjs"),s=require("@ariakit/react/menu"),c=require("react"),u=require("use-sync-external-store/shim/index.js"),l=require("@yahoo/uds/fixtures"),d=require("motion/react"),m=require("react/jsx-runtime"),f=require("@ariakit/react");function p(e){return e&&e.__esModule?e:{default:e}}function g(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var h=g(c),x=p(u),b={};function v(e){return e}function y(e,t){const n=e.__unstableInternals;return function(e,t){if(!e)throw new Error(t)}(n,"Invalid store"),n[t]}i.__export(b,{Content:()=>w,Divider:()=>E,Item:()=>O,ItemCheckbox:()=>q,Provider:()=>T,Trigger:()=>B,useMenuContext:()=>s.useMenuContext,useMenuStore:()=>s.useMenuStore,useStoreState:()=>f.useStoreState});var{useSyncExternalStore:I}=x.default;function C(e,t=v){const n=h.useCallback(t=>e?function(e,...t){if(e)return y(e,"subscribe")(...t)}(e,null,t):()=>{},[e]),r=()=>{const n="string"==typeof t?t:null,r="function"==typeof t?t:null,a=null==e?void 0:e.getState();if(r)return r(a);var o,i;if(a&&(n&&(o=a,i=n,"function"==typeof Object.hasOwn?Object.hasOwn(o,i):Object.prototype.hasOwnProperty.call(o,i))))return a[n]};return I(n,r,r)}var S=d.m.create(r.VStack),k=5,j=.97,N={top:{x:0,y:k},bottom:{x:0,y:-5},left:{x:k,y:0},right:{x:-5,y:0}},M=e=>c.useMemo(()=>((e="bottom")=>{const[t="top"]=e?.split("-");return{closed:{...N[t],opacity:0,scale:j},open:{y:0,x:0,opacity:1,scale:1}}})(e),[e]),w=c.forwardRef(function({gap:t,spacing:n,spacingBottom:r,spacingEnd:a,spacingStart:i,spacingTop:u,gutter:f="1",backgroundColor:p="primary",borderRadius:g="md",borderColor:h,borderWidth:x="thin",overflow:b,dropShadow:v="lg",className:y,sameWidth:I,focusable:k,children:j,portalElement:N,portal:w=!0,disableAutoBorderRadius:E,...V},P){const R=s.useMenuContext(),O=C(R,"open"),q=C(R,"mounted"),z=C(R,"currentPlacement"),A=C(R,"placement"),[T,B]=c.useState(z),[H,D]=c.useState(z);c.useEffect(()=>{A!==H&&D(A)},[A]),c.useEffect(()=>{z!==H&&D(z)},[z]),c.useEffect(()=>{q&&H!==T&&B(H)},[q,H,T]);const _=c.useMemo(()=>O&&q?"open":"closed",[O,q]),G=c.useMemo(()=>O?v:"none",[O,v]),F=M(H),L=c.useMemo(()=>l.spacingMap[f],[f]);return m.jsx(d.AnimatePresence,{initial:!1,children:m.jsx(s.Menu,{gutter:L,sameWidth:I,focusable:k,store:R,ref:P,portalElement:N,portal:w,...V,render:m.jsx(S,{backgroundColor:p,gap:t,spacing:n,spacingBottom:r,spacingEnd:a,spacingStart:i,spacingTop:u,borderRadius:g,borderColor:h,borderWidth:x,overflow:b,animate:_,variants:F,dropShadow:G,className:o.cx("uds-menu-content","transition-shadow","duration-200","ease-in-out","min-w-60","max-w-lg","max-h-96","overflow-auto","uds-ring","z-10","group",!E&&e.getNestedBorderRadiusClass(g,n),y),children:j})})})});w.displayName="MenuContent";var E=c.forwardRef(function({role:e="separator",contentPosition:n="start",gap:r="4",children:a,spacingVertical:i=(a?"2":"0"),spacingHorizontal:s=(a?"4":"0"),className:c,...u},l){const d={root:o.getStyles({menuDividerVariantRoot:"default",className:c}),text:o.getStyles({menuDividerVariantText:"default"}),line:o.getStyles({menuDividerVariantLine:"default"})};return m.jsx(t.DividerInternal,{ref:l,role:e,variant:"inherit",contentPosition:n,gap:r,spacingVertical:i,spacingHorizontal:s,className:d.root,layerClassNames:d,...u,children:a})});E.displayName="MenuDivider";var V="uds-menu-item",P={visible:{scale:1,opacity:1},hidden:{scale:.7,opacity:0}},R=c.forwardRef(function({spacing:e="0",spacingBottom:t,spacingEnd:a,spacingHorizontal:i="4",spacingStart:s,spacingTop:u,spacingVertical:l="3.5",columnGap:f="2",className:p,children:g,endIcon:h,startIcon:x,hideEndIcon:b,active:v,disabled:y,as:I,name:C,alignItems:S="center",justifyContent:k="space-between",layerClassNames:j,slots:N,rootProps:M,...w},E){const R=c.Children.count(g)>1,O=(({active:e,disabled:t,className:n})=>o.cx(V,"flex","focus-visible:text-brand","focus-visible:bg-brand-secondary","focus-visible:z-10","uds-ring","!-outline-offset-2",e&&["[&:not([aria-checked])]:cursor-default"],t&&"opacity-25 cursor-not-allowed","duration-20 transition-[font-variation-settings] ease-in-out","z-0",n))({active:v,disabled:y,className:p}),q=o.getStyles({className:o.cx(`${V}-content truncate`,j?.text),textAlign:"start",...R&&{columnGap:f,display:"flex",alignItems:"center",width:"full",justifyContent:"space-between"}}),z=c.useMemo(()=>({root:o.getStyles({menuSizeRoot:"default",flexDirection:"row",spacing:e,spacingBottom:t,spacingEnd:a,spacingHorizontal:i,spacingStart:s,spacingTop:u,spacingVertical:l,columnGap:f,alignItems:S,justifyContent:k,className:o.cx(O,j?.root)}),startIcon:o.getStyles({menuSizeStartIcon:"default",className:j?.startIcon}),endIcon:o.getStyles({menuSizeEndIcon:"default",className:j?.endIcon})}),[S,f,k,j?.endIcon,j?.root,j?.startIcon,O,e,t,a,i,s,u,l]),A=N?.root??(e=>m.jsx(n.Pressable,{...e,...w,onClick:t=>{e.onClick?.(t),w.onClick?.(t)}}));return m.jsxs(I,{ref:E,name:C??"",...M,render:A,disabled:y,className:z.root,children:[m.jsxs(r.HStack,{gap:f,alignItems:"center",width:"full",children:[m.jsx(d.AnimatePresence,{initial:!1,children:x&&m.jsx(d.m.span,{variants:P,initial:"hidden",animate:"visible",exit:"hidden",className:"uds-start-icon",children:m.jsx(o.IconSlot,{icon:x,className:z.startIcon,iconProps:{size:"sm",variant:v?"fill":"outline",color:"current"}})})}),m.jsx("span",{className:q,children:g})]}),m.jsx(d.AnimatePresence,{initial:!1,mode:"popLayout",children:!b&&h&&m.jsx(d.m.span,{variants:P,initial:"hidden",animate:"visible",exit:"hidden",className:"uds-end-icon",children:m.jsx(o.IconSlot,{icon:h,className:z.endIcon,iconProps:{size:"sm",variant:v?"fill":"outline",color:"current"}})})})]})});R.displayName="MenuItemBase";var O=c.forwardRef(function({active:e,hideOnClick:t,...n},r){const a={root:o.getStyles({menuItemVariantRoot:"default",menuItemVariantActiveRoot:e?"on":"off"}),text:o.getStyles({menuItemVariantText:"default",menuItemVariantActiveText:e?"on":"off"}),startIcon:o.getStyles({menuItemVariantIcon:"default",menuItemVariantActiveIcon:e?"on":"off"})};return m.jsx(R,{ref:r,as:s.MenuItem,active:e,layerClassNames:a,rootProps:{hideOnClick:t},...n})});O.displayName="MenuItem";var q=c.forwardRef(function({name:e,endIcon:t=n.e,checked:r,defaultChecked:a,hideOnClick:i,className:u,...l},d){const p=e,g=c.useRef(!1),h=s.useMenuContext(),x=f.useStoreState(h);c.useEffect(()=>{!g.current&&void 0!==a&&h&&(h.setValues(e=>({...e,[p]:a})),g.current=!0)},[h,a,p]);const b=c.useMemo(()=>{if(void 0!==r)return r;if(x?.items?.length){const e=x?.items.find(e=>e.element?.name===p);if(e?.element)return e.element.checked}const e=x?.values[p];return"boolean"==typeof e?e:a??!1},[x?.items,x?.values,p,r,a]),v=c.useCallback(e=>{void 0===r&&h?.setValues(t=>({...t,[p]:e.target.checked}))},[p,h,r]),y={root:o.getStyles({menuItemCheckboxVariantRoot:"default",menuItemCheckboxVariantActiveRoot:b?"on":"off"}),text:o.getStyles({menuItemCheckboxVariantText:"default",menuItemCheckboxVariantActiveText:b?"on":"off"}),startIcon:o.getStyles({menuItemCheckboxVariantStartIcon:"default",menuItemCheckboxVariantActiveStartIcon:b?"on":"off"}),endIcon:o.getStyles({menuItemCheckboxVariantEndIcon:"default",menuItemCheckboxVariantActiveEndIcon:b?"on":"off"})};return m.jsx(R,{ref:d,as:s.MenuItemCheckbox,hideEndIcon:!b,endIcon:t,active:b,className:o.cx("uds-menu-item-checkbox",u),layerClassNames:y,name:e,rootProps:{onChange:v,defaultChecked:a,checked:void 0!==r?r:void 0,hideOnClick:i},...l})});q.displayName="MenuItemCheckbox";var z=()=>{if("undefined"==typeof document)return!1;return"rtl"===getComputedStyle(document.documentElement).direction},A=e=>{const[t,n]=c.useState(z);return c.useEffect(()=>{if(e?.explicit)return void n(e.explicit);const t=(e=>{const t=new MutationObserver(t=>{t.some(e=>"attributes"===e.type&&"dir"===e.attributeName)&&e()});return t.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]}),t})(()=>{n(z())});return()=>t.disconnect()},[e?.explicit]),t},T=function({placement:e="bottom",rtl:t,...n}){const r=A({explicit:t}),o=((e,t)=>{const n=t?.rtl;if("start"===e)return n?"right":"left";if("end"===e)return n?"left":"right";if(e?.includes("-")){const[t,r]=e.split("-");if(!("start"!==t&&"end"!==t||"top"!==r&&"bottom"!==r))return`${"start"===t?n?"right":"left":n?"left":"right"}-${"bottom"===r?"end":"start"}`;if("top"===t||"bottom"===t)return`${t}-${"start"===r?n?"end":"start":n?"start":"end"}`}return e})(e,{rtl:r});return m.jsx(a.SpringMotionConfig,{children:m.jsx(s.MenuProvider,{placement:o,rtl:r,...n})})};T.displayName="MenuProvider";var B=c.forwardRef(function({asChild:e,children:t,className:n,...r},a){const i=c.useRef(null),u=e?{render:m.jsx(o.Box,{asChild:!0,ref:i,className:"uds-ring h-fit w-fit",children:t})}:{children:t},l=c.useCallback(()=>{const e=i.current?.firstChild;e instanceof HTMLElement&&"function"==typeof e.focus&&e.focus()},[i]);return m.jsx(s.MenuButton,{onFocus:l,onFocusVisible:l,ref:a,className:o.cx("uds-menu-trigger",n),...u,...r})});B.displayName="MenuTrigger",exports.Menu=b;
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{DividerInternal as r}from"../chunk-XOHE32Q2.js";import{e,Pressable as a}from"../chunk-WEIHOHSB.js";import{VStack as d,HStack as t}from"../chunk-WTCFWBEP.js";import{SpringMotionConfig as s}from"../chunk-7ODTLDW2.js";import{cx as i,getStyles as n,IconSlot as c,Box as o}from"../chunk-FEHICJMH.js";import{__export as u}from"../chunk-GF4A6TFM.js";import{useMenuStore as l,useMenuContext as m,Menu as x,MenuItem as p,MenuItemCheckbox as h,MenuProvider as b,MenuButton as f}from"@ariakit/react/menu";import*as _ from"react";import{forwardRef as v,useState as g,useEffect as I,useMemo as C,Children as y,useRef as w,useCallback as k}from"react";import N from"use-sync-external-store/shim/index.js";import{spacingMap as V}from"@yahoo/uds/fixtures";import{m as S,AnimatePresence as E}from"motion/react";import{jsx as M,jsxs as T}from"react/jsx-runtime";import{useStoreState as j}from"@ariakit/react";/*! © 2025 Yahoo, Inc. UDS v0.0.0-development */
3
- var O={};function P(r){return r}function z(r,e){const a=r.__unstableInternals;return function(r,e){if(!r)throw new Error(e)}(a,"Invalid store"),a[e]}u(O,{Content:()=>$,Divider:()=>G,Item:()=>X,ItemCheckbox:()=>q,Provider:()=>Y,Trigger:()=>Z,useMenuContext:()=>m,useMenuStore:()=>l,useStoreState:()=>j});var{useSyncExternalStore:R}=N;function A(r,e=P){const a=_.useCallback(e=>r?function(r,...e){if(r)return z(r,"subscribe")(...e)}(r,null,e):()=>{},[r]),d=()=>{const a="string"==typeof e?e:null,d="function"==typeof e?e:null,t=null==r?void 0:r.getState();if(d)return d(t);var s,i;if(t&&(a&&(s=t,i=a,"function"==typeof Object.hasOwn?Object.hasOwn(s,i):Object.prototype.hasOwnProperty.call(s,i))))return t[a]};return R(a,d,d)}var H=S.create(d),B=5,D=.97,W={top:{x:0,y:B},bottom:{x:0,y:-5},left:{x:B,y:0},right:{x:-5,y:0}},F=r=>C(()=>((r="bottom")=>{const[e="top"]=r?.split("-");return{closed:{...W[e],opacity:0,scale:D},open:{y:0,x:0,opacity:1,scale:1}}})(r),[r]),$=v(function({gap:r,spacing:e,spacingBottom:a,spacingEnd:d,spacingStart:t,spacingTop:s,gutter:n="1",backgroundColor:c="primary",borderRadius:o="md",borderColor:u,borderWidth:l="thin",overflow:p,dropShadow:h="lg",className:b,sameWidth:f,focusable:_,children:v,portalElement:y,portal:w=!0,disableAutoBorderRadius:k,...N},S){const T=m(),j=A(T,"open"),O=A(T,"mounted"),P=A(T,"currentPlacement"),z=A(T,"placement"),[R,B]=g(P),[D,W]=g(P);I(()=>{z!==D&&W(z)},[z]),I(()=>{P!==D&&W(P)},[P]),I(()=>{O&&D!==R&&B(D)},[O,D,R]);const $=C(()=>j&&O?"open":"closed",[j,O]),G=C(()=>j?h:"none",[j,h]),L=F(D),J=(({borderRadius:r,spacing:e})=>{if(void 0===e||"0"===e)switch(r){case"xs":return"[&>*:first-child]:rounded-t-[calc(var(--uds-border-radius-xs)_-_var(--uds-border-width-thin))] [&>*:last-child]:rounded-b-[calc(var(--uds-border-radius-xs)_-_var(--uds-border-width-thin))]";case"sm":return"[&>*:first-child]:rounded-t-[calc(var(--uds-border-radius-sm)_-_var(--uds-border-width-thin))] [&>*:last-child]:rounded-b-[calc(var(--uds-border-radius-sm)_-_var(--uds-border-width-thin))]";case"md":return"[&>*:first-child]:rounded-t-[calc(var(--uds-border-radius-md)_-_var(--uds-border-width-thin))] [&>*:last-child]:rounded-b-[calc(var(--uds-border-radius-md)_-_var(--uds-border-width-thin))]";case"lg":return"[&>*:first-child]:rounded-t-[calc(var(--uds-border-radius-lg)_-_var(--uds-border-width-thin))] [&>*:last-child]:rounded-b-[calc(var(--uds-border-radius-lg)_-_var(--uds-border-width-thin))]";case"xl":return"[&>*:first-child]:rounded-t-[calc(var(--uds-border-radius-xl)_-_var(--uds-border-width-thin))] [&>*:last-child]:rounded-b-[calc(var(--uds-border-radius-xl)_-_var(--uds-border-width-thin))]"}if("px"===e||"0.5"===e)switch(r){case"xs":return"[&>*:first-child]:rounded-t-[max(1px,calc(var(--uds-border-radius-xs)_-_2px))] [&>*:last-child]:rounded-b-[max(1px,calc(var(--uds-border-radius-xs)_-_2px))]";case"sm":return"[&>*:first-child]:rounded-t-[max(2px,calc(var(--uds-border-radius-sm)_-_2px))] [&>*:last-child]:rounded-b-[max(2px,calc(var(--uds-border-radius-sm)_-_2px))]";case"md":return"[&>*:first-child]:rounded-t-[max(2px,calc(var(--uds-border-radius-md)_-_2px))] [&>*:last-child]:rounded-b-[max(2px,calc(var(--uds-border-radius-md)_-_2px))]";case"lg":return"[&>*:first-child]:rounded-t-[max(2px,calc(var(--uds-border-radius-lg)_-_2px))] [&>*:last-child]:rounded-b-[max(2px,calc(var(--uds-border-radius-lg)_-_2px))]";case"xl":return"[&>*:first-child]:rounded-t-[max(2px,calc(var(--uds-border-radius-xl)_-_2px))] [&>*:last-child]:rounded-b-[max(2px,calc(var(--uds-border-radius-xl)_-_2px))]"}if("1"===e||"1.5"===e)switch(r){case"xs":return"[&>*:first-child]:rounded-t-[max(1px,calc(var(--uds-border-radius-xs)_-_4px))] [&>*:last-child]:rounded-b-[max(1px,calc(var(--uds-border-radius-xs)_-_4px))]";case"sm":return"[&>*:first-child]:rounded-t-[max(2px,calc(var(--uds-border-radius-sm)_-_4px))] [&>*:last-child]:rounded-b-[max(2px,calc(var(--uds-border-radius-sm)_-_4px))]";case"md":return"[&>*:first-child]:rounded-t-[max(2px,calc(var(--uds-border-radius-md)_-_4px))] [&>*:last-child]:rounded-b-[max(2px,calc(var(--uds-border-radius-md)_-_4px))]";case"lg":return"[&>*:first-child]:rounded-t-[max(2px,calc(var(--uds-border-radius-lg)_-_4px))] [&>*:last-child]:rounded-b-[max(2px,calc(var(--uds-border-radius-lg)_-_4px))]";case"xl":return"[&>*:first-child]:rounded-t-[calc(var(--uds-border-radius-xl)_-_4px)] [&>*:last-child]:rounded-b-[calc(var(--uds-border-radius-xl)_-_4px)]"}if("2"===e||"2.5"===e)switch(r){case"xs":return"[&>*:first-child]:rounded-t-[max(1px,calc(var(--uds-border-radius-xs)_-_8px))] [&>*:last-child]:rounded-b-[max(1px,calc(var(--uds-border-radius-xs)_-_8px))]";case"sm":return"[&>*:first-child]:rounded-t-[max(2px,calc(var(--uds-border-radius-sm)_-_8px))] [&>*:last-child]:rounded-b-[max(2px,calc(var(--uds-border-radius-sm)_-_8px))]";case"md":return"[&>*:first-child]:rounded-t-[max(4px,calc(var(--uds-border-radius-md)_-_8px))] [&>*:last-child]:rounded-b-[max(4px,calc(var(--uds-border-radius-md)_-_8px))]";case"lg":return"[&>*:first-child]:rounded-t-[max(4px,calc(var(--uds-border-radius-lg)_-_8px))] [&>*:last-child]:rounded-b-[max(4px,calc(var(--uds-border-radius-lg)_-_8px))]";case"xl":return"[&>*:first-child]:rounded-t-[calc(var(--uds-border-radius-xl)_-_8px)] [&>*:last-child]:rounded-b-[calc(var(--uds-border-radius-xl)_-_8px)]"}if("3"===e||"3.5"===e)switch(r){case"xs":return"[&>*:first-child]:rounded-t-[max(2px,calc(var(--uds-border-radius-xs)_-_6px))] [&>*:last-child]:rounded-b-[max(2px,calc(var(--uds-border-radius-xs)_-_6px))]";case"sm":return"[&>*:first-child]:rounded-t-[max(4px,calc(var(--uds-border-radius-sm)_-_6px))] [&>*:last-child]:rounded-b-[max(4px,calc(var(--uds-border-radius-sm)_-_6px))]";case"md":return"[&>*:first-child]:rounded-t-[max(6px,calc(var(--uds-border-radius-md)_-_6px))] [&>*:last-child]:rounded-b-[max(6px,calc(var(--uds-border-radius-md)_-_6px))]";case"lg":return"[&>*:first-child]:rounded-t-[max(6px,calc(var(--uds-border-radius-lg)_-_6px))] [&>*:last-child]:rounded-b-[max(6px,calc(var(--uds-border-radius-lg)_-_6px))]";case"xl":return"[&>*:first-child]:rounded-t-[min(20px,calc(var(--uds-border-radius-xl)_-_6px))] [&>*:last-child]:rounded-b-[min(20px,calc(var(--uds-border-radius-xl)_-_6px))]"}if("4"===e)switch(r){case"xs":return"[&>*:first-child]:rounded-t-[max(1px,calc(var(--uds-border-radius-xs)_-_16px))] [&>*:last-child]:rounded-b-[max(1px,calc(var(--uds-border-radius-xs)_-_16px))]";case"sm":return"[&>*:first-child]:rounded-t-[max(2px,calc(var(--uds-border-radius-sm)_-_16px))] [&>*:last-child]:rounded-b-[max(2px,calc(var(--uds-border-radius-sm)_-_16px))]";case"md":return"[&>*:first-child]:rounded-t-[max(4px,calc(var(--uds-border-radius-md)_-_16px))] [&>*:last-child]:rounded-b-[max(4px,calc(var(--uds-border-radius-md)_-_16px))]";case"lg":return"[&>*:first-child]:rounded-t-[max(6px,calc(var(--uds-border-radius-lg)_-_16px))] [&>*:last-child]:rounded-b-[max(6px,calc(var(--uds-border-radius-lg)_-_16px))]";case"xl":return"[&>*:first-child]:rounded-t-[max(6px,calc(var(--uds-border-radius-xl)_-_16px))] [&>*:last-child]:rounded-b-[max(6px,calc(var(--uds-border-radius-xl)_-_16px))]"}switch(r){case"xs":return"[&>*:first-child]:rounded-t-[max(1px,calc(var(--uds-border-radius-xs)_-_4px))] [&>*:last-child]:rounded-b-[max(1px,calc(var(--uds-border-radius-xs)_-_4px))]";case"sm":return"[&>*:first-child]:rounded-t-[max(2px,calc(var(--uds-border-radius-sm)_-_4px))] [&>*:last-child]:rounded-b-[max(2px,calc(var(--uds-border-radius-sm)_-_4px))]";case"md":return"[&>*:first-child]:rounded-t-[max(2px,calc(var(--uds-border-radius-md)_-_4px))] [&>*:last-child]:rounded-b-[max(2px,calc(var(--uds-border-radius-md)_-_4px))]";case"lg":return"[&>*:first-child]:rounded-t-[max(2px,calc(var(--uds-border-radius-lg)_-_4px))] [&>*:last-child]:rounded-b-[max(2px,calc(var(--uds-border-radius-lg)_-_4px))]";case"xl":return"[&>*:first-child]:rounded-t-[min(18px,calc(var(--uds-border-radius-xl)_-_4px))] [&>*:last-child]:rounded-b-[min(18px,calc(var(--uds-border-radius-xl)_-_4px))]"}})({borderRadius:o,spacing:e}),Q=C(()=>V[n],[n]);return M(E,{initial:!1,children:M(x,{gutter:Q,sameWidth:f,focusable:_,store:T,ref:S,portalElement:y,portal:w,...N,render:M(H,{backgroundColor:c,gap:r,spacing:e,spacingBottom:a,spacingEnd:d,spacingStart:t,spacingTop:s,borderRadius:o,borderColor:u,borderWidth:l,overflow:p,animate:$,variants:L,dropShadow:G,className:i("uds-menu-content","transition-shadow","duration-200","ease-in-out","min-w-60","max-w-lg","max-h-96","overflow-auto","uds-ring","z-10","group",!k&&J,b),children:v})})})});$.displayName="MenuContent";var G=v(function({role:e="separator",contentPosition:a="start",gap:d="4",children:t,spacingVertical:s=(t?"2":"0"),spacingHorizontal:i=(t?"4":"0"),className:c,...o},u){const l={root:n({menuDividerVariantRoot:"default",className:c}),text:n({menuDividerVariantText:"default"}),line:n({menuDividerVariantLine:"default"})};return M(r,{ref:u,role:e,variant:"inherit",contentPosition:a,gap:d,spacingVertical:s,spacingHorizontal:i,className:l.root,layerClassNames:l,...o,children:t})});G.displayName="MenuDivider";var L="uds-menu-item",J={visible:{scale:1,opacity:1},hidden:{scale:.7,opacity:0}},Q=v(function({spacing:r="0",spacingBottom:e,spacingEnd:d,spacingHorizontal:s="4",spacingStart:o,spacingTop:u,spacingVertical:l="3.5",columnGap:m="2",className:x,children:p,endIcon:h,startIcon:b,hideEndIcon:f,active:_,disabled:v,as:g,name:I,alignItems:w="center",justifyContent:k="space-between",layerClassNames:N,slots:V,rootProps:j,...O},P){const z=y.count(p)>1,R=(({active:r,disabled:e,className:a})=>i(L,"flex","focus-visible:text-brand","focus-visible:bg-brand-secondary","focus-visible:z-10","uds-ring","!-outline-offset-2",r&&["[&:not([aria-checked])]:cursor-default"],e&&"opacity-25 cursor-not-allowed","duration-20 transition-[font-variation-settings] ease-in-out","z-0",a))({active:_,disabled:v,className:x}),A=n({className:i(`${L}-content truncate`,N?.text),textAlign:"start",...z&&{columnGap:m,display:"flex",alignItems:"center",width:"full",justifyContent:"space-between"}}),H=C(()=>({root:n({menuSizeRoot:"default",flexDirection:"row",spacing:r,spacingBottom:e,spacingEnd:d,spacingHorizontal:s,spacingStart:o,spacingTop:u,spacingVertical:l,columnGap:m,alignItems:w,justifyContent:k,className:i(R,N?.root)}),startIcon:n({menuSizeStartIcon:"default",className:N?.startIcon}),endIcon:n({menuSizeEndIcon:"default",className:N?.endIcon})}),[w,m,k,N?.endIcon,N?.root,N?.startIcon,R,r,e,d,s,o,u,l]);return T(g,{ref:P,name:I??"",...j,render:V?.root??(r=>M(a,{...r,...O,onClick:e=>{r.onClick?.(e),O.onClick?.(e)}})),disabled:v,className:H.root,children:[T(t,{gap:m,alignItems:"center",width:"full",children:[M(E,{initial:!1,children:b&&M(S.span,{variants:J,initial:"hidden",animate:"visible",exit:"hidden",className:"uds-start-icon",children:M(c,{icon:b,className:H.startIcon,iconProps:{size:"sm",variant:_?"fill":"outline",color:"current"}})})}),M("span",{className:A,children:p})]}),M(E,{initial:!1,mode:"popLayout",children:!f&&h&&M(S.span,{variants:J,initial:"hidden",animate:"visible",exit:"hidden",className:"uds-end-icon",children:M(c,{icon:h,className:H.endIcon,iconProps:{size:"sm",variant:_?"fill":"outline",color:"current"}})})})]})});Q.displayName="MenuItemBase";var X=v(function({active:r,hideOnClick:e,...a},d){const t={root:n({menuItemVariantRoot:"default",menuItemVariantActiveRoot:r?"on":"off"}),text:n({menuItemVariantText:"default",menuItemVariantActiveText:r?"on":"off"}),startIcon:n({menuItemVariantIcon:"default",menuItemVariantActiveIcon:r?"on":"off"})};return M(Q,{ref:d,as:p,active:r,layerClassNames:t,rootProps:{hideOnClick:e},...a})});X.displayName="MenuItem";var q=v(function({name:r,endIcon:a=e,checked:d,defaultChecked:t,hideOnClick:s,className:c,...o},u){const l=r,x=w(!1),p=m(),b=j(p);I(()=>{!x.current&&void 0!==t&&p&&(p.setValues(r=>({...r,[l]:t})),x.current=!0)},[p,t,l]);const f=C(()=>{if(void 0!==d)return d;if(b?.items?.length){const r=b?.items.find(r=>r.element?.name===l);if(r?.element)return r.element.checked}const r=b?.values[l];return"boolean"==typeof r?r:t??!1},[b?.items,b?.values,l,d,t]),_=k(r=>{void 0===d&&p?.setValues(e=>({...e,[l]:r.target.checked}))},[l,p,d]),v={root:n({menuItemCheckboxVariantRoot:"default",menuItemCheckboxVariantActiveRoot:f?"on":"off"}),text:n({menuItemCheckboxVariantText:"default",menuItemCheckboxVariantActiveText:f?"on":"off"}),startIcon:n({menuItemCheckboxVariantStartIcon:"default",menuItemCheckboxVariantActiveStartIcon:f?"on":"off"}),endIcon:n({menuItemCheckboxVariantEndIcon:"default",menuItemCheckboxVariantActiveEndIcon:f?"on":"off"})};return M(Q,{ref:u,as:h,hideEndIcon:!f,endIcon:a,active:f,className:i("uds-menu-item-checkbox",c),layerClassNames:v,name:r,rootProps:{onChange:_,defaultChecked:t,checked:void 0!==d?d:void 0,hideOnClick:s},...o})});q.displayName="MenuItemCheckbox";var K=()=>{if("undefined"==typeof document)return!1;return"rtl"===getComputedStyle(document.documentElement).direction},U=r=>{const[e,a]=g(K);return I(()=>{if(r?.explicit)return void a(r.explicit);const e=(r=>{const e=new MutationObserver(e=>{e.some(r=>"attributes"===r.type&&"dir"===r.attributeName)&&r()});return e.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]}),e})(()=>{a(K())});return()=>e.disconnect()},[r?.explicit]),e},Y=function({placement:r="bottom",rtl:e,...a}){const d=U({explicit:e}),t=((r,e)=>{const a=e?.rtl;if("start"===r)return a?"right":"left";if("end"===r)return a?"left":"right";if(r?.includes("-")){const[e,d]=r.split("-");if(!("start"!==e&&"end"!==e||"top"!==d&&"bottom"!==d))return`${"start"===e?a?"right":"left":a?"left":"right"}-${"bottom"===d?"end":"start"}`;if("top"===e||"bottom"===e)return`${e}-${"start"===d?a?"end":"start":a?"start":"end"}`}return r})(r,{rtl:d});return M(s,{children:M(b,{placement:t,rtl:d,...a})})};Y.displayName="MenuProvider";var Z=v(function({asChild:r,children:e,className:a,...d},t){const s=w(null),n=r?{render:M(o,{asChild:!0,ref:s,className:"uds-ring h-fit w-fit",children:e})}:{children:e},c=k(()=>{const r=s.current?.firstChild;r instanceof HTMLElement&&"function"==typeof r.focus&&r.focus()},[s]);return M(f,{onFocus:c,onFocusVisible:c,ref:t,className:i("uds-menu-trigger",a),...n,...d})});Z.displayName="MenuTrigger";export{O as Menu};
2
+ import{getNestedBorderRadiusClass as e}from"../chunk-4GZB6XX6.js";import{DividerInternal as t}from"../chunk-XOHE32Q2.js";import{e as n,Pressable as o}from"../chunk-WEIHOHSB.js";import{VStack as a,HStack as r}from"../chunk-WTCFWBEP.js";import{SpringMotionConfig as i}from"../chunk-7ODTLDW2.js";import{cx as s,getStyles as c,IconSlot as l,Box as u}from"../chunk-FEHICJMH.js";import{__export as d}from"../chunk-GF4A6TFM.js";import{useMenuStore as m,useMenuContext as f,Menu as p,MenuItem as h,MenuItemCheckbox as g,MenuProvider as b,MenuButton as v}from"@ariakit/react/menu";import*as I from"react";import{forwardRef as x,useState as C,useEffect as y,useMemo as k,Children as N,useRef as V,useCallback as S}from"react";import w from"use-sync-external-store/shim/index.js";import{spacingMap as E}from"@yahoo/uds/fixtures";import{m as M,AnimatePresence as j}from"motion/react";import{jsx as T,jsxs as O}from"react/jsx-runtime";import{useStoreState as P}from"@ariakit/react";/*! © 2025 Yahoo, Inc. UDS v0.0.0-development */
3
+ var z={};function A(e){return e}function H(e,t){const n=e.__unstableInternals;return function(e,t){if(!e)throw new Error(t)}(n,"Invalid store"),n[t]}d(z,{Content:()=>L,Divider:()=>X,Item:()=>Z,ItemCheckbox:()=>q,Provider:()=>Y,Trigger:()=>ee,useMenuContext:()=>f,useMenuStore:()=>m,useStoreState:()=>P});var{useSyncExternalStore:B}=w;function R(e,t=A){const n=I.useCallback(t=>e?function(e,...t){if(e)return H(e,"subscribe")(...t)}(e,null,t):()=>{},[e]),o=()=>{const n="string"==typeof t?t:null,o="function"==typeof t?t:null,a=null==e?void 0:e.getState();if(o)return o(a);var r,i;if(a&&(n&&(r=a,i=n,"function"==typeof Object.hasOwn?Object.hasOwn(r,i):Object.prototype.hasOwnProperty.call(r,i))))return a[n]};return B(n,o,o)}var D=M.create(a),W=5,F=.97,G={top:{x:0,y:W},bottom:{x:0,y:-5},left:{x:W,y:0},right:{x:-5,y:0}},$=e=>k(()=>((e="bottom")=>{const[t="top"]=e?.split("-");return{closed:{...G[t],opacity:0,scale:F},open:{y:0,x:0,opacity:1,scale:1}}})(e),[e]),L=x(function({gap:t,spacing:n,spacingBottom:o,spacingEnd:a,spacingStart:r,spacingTop:i,gutter:c="1",backgroundColor:l="primary",borderRadius:u="md",borderColor:d,borderWidth:m="thin",overflow:h,dropShadow:g="lg",className:b,sameWidth:v,focusable:I,children:x,portalElement:N,portal:V=!0,disableAutoBorderRadius:S,...w},M){const O=f(),P=R(O,"open"),z=R(O,"mounted"),A=R(O,"currentPlacement"),H=R(O,"placement"),[B,W]=C(A),[F,G]=C(A);y(()=>{H!==F&&G(H)},[H]),y(()=>{A!==F&&G(A)},[A]),y(()=>{z&&F!==B&&W(F)},[z,F,B]);const L=k(()=>P&&z?"open":"closed",[P,z]),X=k(()=>P?g:"none",[P,g]),_=$(F),J=k(()=>E[c],[c]);return T(j,{initial:!1,children:T(p,{gutter:J,sameWidth:v,focusable:I,store:O,ref:M,portalElement:N,portal:V,...w,render:T(D,{backgroundColor:l,gap:t,spacing:n,spacingBottom:o,spacingEnd:a,spacingStart:r,spacingTop:i,borderRadius:u,borderColor:d,borderWidth:m,overflow:h,animate:L,variants:_,dropShadow:X,className:s("uds-menu-content","transition-shadow","duration-200","ease-in-out","min-w-60","max-w-lg","max-h-96","overflow-auto","uds-ring","z-10","group",!S&&e(u,n),b),children:x})})})});L.displayName="MenuContent";var X=x(function({role:e="separator",contentPosition:n="start",gap:o="4",children:a,spacingVertical:r=(a?"2":"0"),spacingHorizontal:i=(a?"4":"0"),className:s,...l},u){const d={root:c({menuDividerVariantRoot:"default",className:s}),text:c({menuDividerVariantText:"default"}),line:c({menuDividerVariantLine:"default"})};return T(t,{ref:u,role:e,variant:"inherit",contentPosition:n,gap:o,spacingVertical:r,spacingHorizontal:i,className:d.root,layerClassNames:d,...l,children:a})});X.displayName="MenuDivider";var _="uds-menu-item",J={visible:{scale:1,opacity:1},hidden:{scale:.7,opacity:0}},Q=x(function({spacing:e="0",spacingBottom:t,spacingEnd:n,spacingHorizontal:a="4",spacingStart:i,spacingTop:u,spacingVertical:d="3.5",columnGap:m="2",className:f,children:p,endIcon:h,startIcon:g,hideEndIcon:b,active:v,disabled:I,as:x,name:C,alignItems:y="center",justifyContent:V="space-between",layerClassNames:S,slots:w,rootProps:E,...P},z){const A=N.count(p)>1,H=(({active:e,disabled:t,className:n})=>s(_,"flex","focus-visible:text-brand","focus-visible:bg-brand-secondary","focus-visible:z-10","uds-ring","!-outline-offset-2",e&&["[&:not([aria-checked])]:cursor-default"],t&&"opacity-25 cursor-not-allowed","duration-20 transition-[font-variation-settings] ease-in-out","z-0",n))({active:v,disabled:I,className:f}),B=c({className:s(`${_}-content truncate`,S?.text),textAlign:"start",...A&&{columnGap:m,display:"flex",alignItems:"center",width:"full",justifyContent:"space-between"}}),R=k(()=>({root:c({menuSizeRoot:"default",flexDirection:"row",spacing:e,spacingBottom:t,spacingEnd:n,spacingHorizontal:a,spacingStart:i,spacingTop:u,spacingVertical:d,columnGap:m,alignItems:y,justifyContent:V,className:s(H,S?.root)}),startIcon:c({menuSizeStartIcon:"default",className:S?.startIcon}),endIcon:c({menuSizeEndIcon:"default",className:S?.endIcon})}),[y,m,V,S?.endIcon,S?.root,S?.startIcon,H,e,t,n,a,i,u,d]);return O(x,{ref:z,name:C??"",...E,render:w?.root??(e=>T(o,{...e,...P,onClick:t=>{e.onClick?.(t),P.onClick?.(t)}})),disabled:I,className:R.root,children:[O(r,{gap:m,alignItems:"center",width:"full",children:[T(j,{initial:!1,children:g&&T(M.span,{variants:J,initial:"hidden",animate:"visible",exit:"hidden",className:"uds-start-icon",children:T(l,{icon:g,className:R.startIcon,iconProps:{size:"sm",variant:v?"fill":"outline",color:"current"}})})}),T("span",{className:B,children:p})]}),T(j,{initial:!1,mode:"popLayout",children:!b&&h&&T(M.span,{variants:J,initial:"hidden",animate:"visible",exit:"hidden",className:"uds-end-icon",children:T(l,{icon:h,className:R.endIcon,iconProps:{size:"sm",variant:v?"fill":"outline",color:"current"}})})})]})});Q.displayName="MenuItemBase";var Z=x(function({active:e,hideOnClick:t,...n},o){const a={root:c({menuItemVariantRoot:"default",menuItemVariantActiveRoot:e?"on":"off"}),text:c({menuItemVariantText:"default",menuItemVariantActiveText:e?"on":"off"}),startIcon:c({menuItemVariantIcon:"default",menuItemVariantActiveIcon:e?"on":"off"})};return T(Q,{ref:o,as:h,active:e,layerClassNames:a,rootProps:{hideOnClick:t},...n})});Z.displayName="MenuItem";var q=x(function({name:e,endIcon:t=n,checked:o,defaultChecked:a,hideOnClick:r,className:i,...l},u){const d=e,m=V(!1),p=f(),h=P(p);y(()=>{!m.current&&void 0!==a&&p&&(p.setValues(e=>({...e,[d]:a})),m.current=!0)},[p,a,d]);const b=k(()=>{if(void 0!==o)return o;if(h?.items?.length){const e=h?.items.find(e=>e.element?.name===d);if(e?.element)return e.element.checked}const e=h?.values[d];return"boolean"==typeof e?e:a??!1},[h?.items,h?.values,d,o,a]),v=S(e=>{void 0===o&&p?.setValues(t=>({...t,[d]:e.target.checked}))},[d,p,o]),I={root:c({menuItemCheckboxVariantRoot:"default",menuItemCheckboxVariantActiveRoot:b?"on":"off"}),text:c({menuItemCheckboxVariantText:"default",menuItemCheckboxVariantActiveText:b?"on":"off"}),startIcon:c({menuItemCheckboxVariantStartIcon:"default",menuItemCheckboxVariantActiveStartIcon:b?"on":"off"}),endIcon:c({menuItemCheckboxVariantEndIcon:"default",menuItemCheckboxVariantActiveEndIcon:b?"on":"off"})};return T(Q,{ref:u,as:g,hideEndIcon:!b,endIcon:t,active:b,className:s("uds-menu-item-checkbox",i),layerClassNames:I,name:e,rootProps:{onChange:v,defaultChecked:a,checked:void 0!==o?o:void 0,hideOnClick:r},...l})});q.displayName="MenuItemCheckbox";var K=()=>{if("undefined"==typeof document)return!1;return"rtl"===getComputedStyle(document.documentElement).direction},U=e=>{const[t,n]=C(K);return y(()=>{if(e?.explicit)return void n(e.explicit);const t=(e=>{const t=new MutationObserver(t=>{t.some(e=>"attributes"===e.type&&"dir"===e.attributeName)&&e()});return t.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]}),t})(()=>{n(K())});return()=>t.disconnect()},[e?.explicit]),t},Y=function({placement:e="bottom",rtl:t,...n}){const o=U({explicit:t}),a=((e,t)=>{const n=t?.rtl;if("start"===e)return n?"right":"left";if("end"===e)return n?"left":"right";if(e?.includes("-")){const[t,o]=e.split("-");if(!("start"!==t&&"end"!==t||"top"!==o&&"bottom"!==o))return`${"start"===t?n?"right":"left":n?"left":"right"}-${"bottom"===o?"end":"start"}`;if("top"===t||"bottom"===t)return`${t}-${"start"===o?n?"end":"start":n?"start":"end"}`}return e})(e,{rtl:o});return T(i,{children:T(b,{placement:a,rtl:o,...n})})};Y.displayName="MenuProvider";var ee=x(function({asChild:e,children:t,className:n,...o},a){const r=V(null),i=e?{render:T(u,{asChild:!0,ref:r,className:"uds-ring h-fit w-fit",children:t})}:{children:t},c=S(()=>{const e=r.current?.firstChild;e instanceof HTMLElement&&"function"==typeof e.focus&&e.focus()},[r]);return T(v,{onFocus:c,onFocusVisible:c,ref:a,className:s("uds-menu-trigger",n),...i,...o})});ee.displayName="MenuTrigger";export{z as Menu};
@@ -1,2 +1 @@
1
- "use client";
2
1
  import{FormLabel as t}from"../../chunk-DFLTCYEQ.js";import{SpringMotionConfig as e,AvoidMotionLibraryProvider as a}from"../../chunk-7ODTLDW2.js";import{Box as o,cx as i,getStyles as n,IconSlot as r}from"../../chunk-FEHICJMH.js";import*as l from"motion/react-m";import{forwardRef as c,useId as s,useRef as d,useState as h,useCallback as u,useEffect as m}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";/*! © 2025 Yahoo, Inc. UDS v0.0.0-development */var w=()=>import("../../domMax-XRPNJ6D3.js").then(({domMax:t})=>t),y=l.create(o),b=c(function({id:a,isOn:l,defaultIsOn:c,onChange:b,label:v,labelPosition:N="start",size:x="md",onIcon:C,offIcon:g,reduceMotion:I,disabled:k,required:V,onFocus:S,onBlur:H,className:z,layerClassNames:j,...D},F){const M=s(),A=a??`uds-input-${M}`,P=d(null),R=void 0!==l,[q,O]=h(R?l:c),B=u(t=>{b?.(t),R||O(t.target.checked)},[R,b]),E=u(t=>{S?.(t)},[S]),J=u(t=>{H?.(t)},[H]),L=I?"always":"user",T=I?"duration-0":"duration-120 motion-reduce:duration-0";m(()=>{R&&O(l)},[l,R]);const Q={root:n({switchSizeRoot:x,switchVariantRoot:"default",switchVariantActiveRoot:q?"on":"off",className:i("group","flex","items-center","start"===N?"flex-row":"flex-row-reverse",...k?["cursor-default","opacity-50"]:["cursor-pointer"],j?.root,z)}),switch:n({switchVariantSwitch:"default",switchSizeSwitch:x,switchVariantActiveSwitch:q?"on":"off",className:i("uds-ring","uds-ring-within","relative","rounded-full","items-center",T,"transition-[background-color,box-shadow]",j?.switch)}),handleContainer:i("pointer-events-none","relative","w-full","h-full"),handle:n({switchSizeHandle:x,className:i("absolute","top-0","bottom-0",q?"right-0":"left-0",j?.handle)}),handleContents:i("relative","w-full","h-full","rounded-full","overflow-hidden",!k&&"group-hover:scale-105","opacity-95",!k&&"group-hover:opacity-100",T,"transition-[transform,opacity]"),handleCircle:n({switchVariantActiveHandle:q?"on":"off",switchVariantHandle:"default",className:i("absolute","top-0","left-0","right-0","bottom-0")}),handleIcon:n({switchSizeHandleIcon:x,switchVariantHandleIcon:"default",switchVariantActiveHandleIcon:q?"on":"off",className:i("absolute","opacity-0","top-1/2","left-1/2","transform","translate-x-[-50%]","translate-y-[-50%]",T,"transition-opacity")}),htmlCheckbox:i("cursor-[inherit]","absolute","opacity-0","top-1/2","left-1/2","w-[calc(100%+2px)]","h-[calc(100%+2px)]","transform","translate-x-[-50%]","translate-y-[-50%]"),label:i("start"===N?"text-start":"text-end",j?.label)};return f(e,{reducedMotion:L,loadFeatures:w,layoutVariant:"bouncy",layoutSpeed:"4",children:p(v?"label":"div",{className:Q.root,"data-testid":"switch-root",tabIndex:-1,children:[p(o,{className:Q.switch,children:[f("input",{type:"checkbox",...D,ref:t=>{P.current=t,"function"==typeof F?F(t):null!==F&&(F.current=t)},onFocus:E,onBlur:J,id:A,disabled:k,required:V,checked:R?q:void 0,defaultChecked:R?void 0:c,onChange:B,className:Q.htmlCheckbox,style:{}}),f(o,{className:Q.handleContainer,children:f(y,{className:Q.handle,layout:"position",layoutDependency:q,children:p(o,{className:Q.handleContents,children:[f(o,{className:Q.handleCircle}),C&&f(r,{icon:C,iconProps:{variant:"fill",size:"sm"},"data-testid":"on-icon",className:i(Q.handleIcon,q?"opacity-100":"opacity-0")}),g&&f(r,{icon:g,iconProps:{variant:"fill",size:"sm"},"data-testid":"off-icon",className:i(Q.handleIcon,q?"opacity-0":"opacity-100")})]})})})]}),v&&f(t,{as:"div",variant:"inherit",color:"inherit",required:V,label:v,className:Q.label})]})})});b.displayName="SwitchV2";var v=a;export{b as SwitchV2,v as SwitchV2AvoidMotionLibraryProvider};