@shtabapp/ui-kit 1.65.0 → 1.67.0

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 (89) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/SButton-CLTNdnCK.cjs +1 -0
  3. package/dist/{SButton-DQTSlo61.js → SButton-LAOBxpd4.js} +5 -0
  4. package/dist/{SChip-B6vcMlZD.cjs → SChip-Dcvk3JI8.cjs} +1 -1
  5. package/dist/{SChip-DBlJ-4jv.js → SChip-NDTK29yq.js} +1 -1
  6. package/dist/{SColorPicker-B8x6qO8A.js → SColorPicker-BmaA5Xnp.js} +4 -4
  7. package/dist/{SColorPicker-Z6lSlByI.cjs → SColorPicker-D7mTRL7K.cjs} +1 -1
  8. package/dist/{SDropdown-LNVnMol3.cjs → SDropdown-BdgpPzfl.cjs} +1 -1
  9. package/dist/SDropdown-xNcC6JDy.js +362 -0
  10. package/dist/{SInput-Be10IJ_E.cjs → SInput-B4So5LGW.cjs} +1 -1
  11. package/dist/{SInput-CqC-jrCC.js → SInput-D8NftspL.js} +1 -1
  12. package/dist/{SList-Bxet9twB.js → SList-BuXrkB03.js} +1 -1
  13. package/dist/{SList-3YwWEhUU.cjs → SList-CvP0U6U1.cjs} +1 -1
  14. package/dist/{SListItem-Chd81xY0.js → SListItem-BOSQGRWA.js} +1 -1
  15. package/dist/{SListItem-Rb59ZhEw.cjs → SListItem-BeaflFVf.cjs} +1 -1
  16. package/dist/{SPhotoEdit-0grpjqZQ.cjs → SPhotoEdit-CShhPLJt.cjs} +1 -1
  17. package/dist/{SPhotoEdit-COkIQFxd.js → SPhotoEdit-r63G2NZI.js} +1 -1
  18. package/dist/{SSelect-LaTTGKd1.cjs → SSelect-Coyrc99Y.cjs} +1 -1
  19. package/dist/{SSelect-BLc_92_w.js → SSelect-DUtNtnqM.js} +5 -5
  20. package/dist/{STable-CfRGPFmm.js → STable-CJBdcrD2.js} +106 -100
  21. package/dist/STable-PkWtyYaP.cjs +1 -0
  22. package/dist/{STabs-BbABxzdN.js → STabs-BARXqgoB.js} +1 -1
  23. package/dist/{STabs-a337ikYi.cjs → STabs-n5hMERTK.cjs} +1 -1
  24. package/dist/{STag-BJV5gtD6.js → STag-C5KhPWjQ.js} +1 -1
  25. package/dist/{STag-B68ch31f.cjs → STag-ZPrc5q4N.cjs} +1 -1
  26. package/dist/{STagGroup-DnNdOCrX.js → STagGroup-BGwvunuu.js} +1 -1
  27. package/dist/{STagGroup-B4ktVLZ5.cjs → STagGroup-ccEvIkK7.cjs} +1 -1
  28. package/dist/components/SButton/SButton.types.d.ts +2 -0
  29. package/dist/components/SButton/SButton.types.d.ts.map +1 -1
  30. package/dist/components/SButton/SButton.vue.d.ts.map +1 -1
  31. package/dist/components/SDropdown/SDropdown.types.d.ts +10 -2
  32. package/dist/components/SDropdown/SDropdown.types.d.ts.map +1 -1
  33. package/dist/components/SDropdown/SDropdown.vue.d.ts.map +1 -1
  34. package/dist/components/SDropdown/index.d.ts +1 -1
  35. package/dist/components/SDropdown/index.d.ts.map +1 -1
  36. package/dist/components/STable/STable.vue.d.ts.map +1 -1
  37. package/dist/components/STable/constants/tableSizes.d.ts +17 -4
  38. package/dist/components/STable/constants/tableSizes.d.ts.map +1 -1
  39. package/dist/components/STable/utils/useTableScrollScale.d.ts +2 -1
  40. package/dist/components/STable/utils/useTableScrollScale.d.ts.map +1 -1
  41. package/dist/components/STable/utils/useTableVirtualRows.d.ts +3 -1
  42. package/dist/components/STable/utils/useTableVirtualRows.d.ts.map +1 -1
  43. package/dist/composables/connectedPosition/getOverflow.d.ts.map +1 -1
  44. package/dist/composables/connectedPosition/index.d.ts +1 -1
  45. package/dist/composables/connectedPosition/index.d.ts.map +1 -1
  46. package/dist/composables/connectedPosition/types.d.ts +4 -0
  47. package/dist/composables/connectedPosition/types.d.ts.map +1 -1
  48. package/dist/composables/useFloatingOverlay.d.ts +2 -1
  49. package/dist/composables/useFloatingOverlay.d.ts.map +1 -1
  50. package/dist/entries/button.cjs +1 -1
  51. package/dist/entries/button.js +1 -1
  52. package/dist/entries/chip.cjs +1 -1
  53. package/dist/entries/chip.js +1 -1
  54. package/dist/entries/color-picker.cjs +1 -1
  55. package/dist/entries/color-picker.js +1 -1
  56. package/dist/entries/composables.cjs +1 -1
  57. package/dist/entries/composables.js +1 -1
  58. package/dist/entries/dropdown.cjs +1 -1
  59. package/dist/entries/dropdown.js +2 -2
  60. package/dist/entries/input.cjs +1 -1
  61. package/dist/entries/input.js +1 -1
  62. package/dist/entries/list-item.cjs +1 -1
  63. package/dist/entries/list-item.js +1 -1
  64. package/dist/entries/list.cjs +1 -1
  65. package/dist/entries/list.js +1 -1
  66. package/dist/entries/photo-edit.cjs +1 -1
  67. package/dist/entries/photo-edit.js +1 -1
  68. package/dist/entries/select.cjs +1 -1
  69. package/dist/entries/select.js +1 -1
  70. package/dist/entries/table.cjs +1 -1
  71. package/dist/entries/table.js +1 -1
  72. package/dist/entries/tabs.cjs +1 -1
  73. package/dist/entries/tabs.js +1 -1
  74. package/dist/entries/tag-group.cjs +1 -1
  75. package/dist/entries/tag-group.js +2 -2
  76. package/dist/entries/tag.cjs +1 -1
  77. package/dist/entries/tag.js +1 -1
  78. package/dist/index.cjs +1 -1
  79. package/dist/index.d.ts +1 -1
  80. package/dist/index.d.ts.map +1 -1
  81. package/dist/index.js +141 -141
  82. package/dist/uikit-components.css +1 -1
  83. package/dist/useFloatingOverlay-Dp44TxvN.cjs +1 -0
  84. package/dist/{useFloatingOverlay-QcumEYEq.js → useFloatingOverlay-b9_eDGNE.js} +136 -133
  85. package/package.json +1 -1
  86. package/dist/SButton-BN-PppY7.cjs +0 -1
  87. package/dist/SDropdown-LOTCtlCX.js +0 -356
  88. package/dist/STable-xMxOF84K.cjs +0 -1
  89. package/dist/useFloatingOverlay-B1UCUYQQ.cjs +0 -1
@@ -0,0 +1 @@
1
+ let e=require("vue"),t=require("@vueuse/core");var n=function(e){return e.TOP=`top`,e.BOTTOM=`bottom`,e.LEFT=`left`,e.RIGHT=`right`,e}({}),r=function(e){return e.START=`start`,e.END=`end`,e.CENTER=`center`,e}({}),i=function(e){return e.TOP=`top`,e.TOP_START=`top-start`,e.TOP_END=`top-end`,e.BOTTOM=`bottom`,e.BOTTOM_START=`bottom-start`,e.BOTTOM_END=`bottom-end`,e.LEFT=`left`,e.LEFT_START=`left-start`,e.LEFT_END=`left-end`,e.RIGHT=`right`,e.RIGHT_START=`right-start`,e.RIGHT_END=`right-end`,e}({}),a=function(e){return e.CLIPPING_ANCESTORS=`clipping-ancestors`,e.VIEWPORT=`viewport`,e}({}),o=function(e){return e.PREFERRED=`preferred`,e.FLIP=`flip`,e.SHIFT=`shift`,e.SIZE=`size`,e}({}),s=e=>{switch(e){case i.TOP:return{side:n.TOP,align:r.CENTER};case i.TOP_START:return{side:n.TOP,align:r.START};case i.TOP_END:return{side:n.TOP,align:r.END};case i.BOTTOM:return{side:n.BOTTOM,align:r.CENTER};case i.BOTTOM_START:return{side:n.BOTTOM,align:r.START};case i.BOTTOM_END:return{side:n.BOTTOM,align:r.END};case i.LEFT:return{side:n.LEFT,align:r.CENTER};case i.LEFT_START:return{side:n.LEFT,align:r.START};case i.LEFT_END:return{side:n.LEFT,align:r.END};case i.RIGHT:return{side:n.RIGHT,align:r.CENTER};case i.RIGHT_START:return{side:n.RIGHT,align:r.START};case i.RIGHT_END:return{side:n.RIGHT,align:r.END};default:return e}},c=e=>e.side===n.TOP?e.align===r.START?i.TOP_START:e.align===r.END?i.TOP_END:i.TOP:e.side===n.BOTTOM?e.align===r.START?i.BOTTOM_START:e.align===r.END?i.BOTTOM_END:i.BOTTOM:e.side===n.LEFT?e.align===r.START?i.LEFT_START:e.align===r.END?i.LEFT_END:i.LEFT:e.align===r.START?i.RIGHT_START:e.align===r.END?i.RIGHT_END:i.RIGHT,l=(e,t,n)=>Math.min(Math.max(t,e),n),u=e=>e===n.TOP?`bottom`:e===n.BOTTOM?`top`:e===n.LEFT?`right`:`left`,d=({referenceCenter:e,floatingStart:t,floatingLength:n,crossAxisProperty:r,staticSide:i,staticOffset:a,arrowSize:o,arrowPadding:s})=>{let c=e-t-o/2,u=l(s,c,n-o-s),d=c-u;return{crossAxisPosition:u,crossAxisProperty:r,staticSide:i,staticOffset:a,centerOffset:d,isOverflow:Math.abs(d)>o/2}},f=e=>{let{referenceRect:t,floatingCoordinates:r,floatingSize:i,arrowSize:a,arrowPadding:o}=e,c=s(e.resolvedPlacement),l=u(c.side),f=-(a/2);return c.side===n.TOP||c.side===n.BOTTOM?d({referenceCenter:t.left+t.width/2,floatingStart:r.x,floatingLength:i.width,crossAxisProperty:`left`,staticSide:l,staticOffset:f,arrowSize:a,arrowPadding:o}):d({referenceCenter:t.top+t.height/2,floatingStart:r.y,floatingLength:i.height,crossAxisProperty:`top`,staticSide:l,staticOffset:f,arrowSize:a,arrowPadding:o})},p=.5,m=e=>e>p,h=(e,t,n)=>{let r=t.top+n,i=t.left+n,a=t.right-n,o=t.bottom-n;return{top:r-e.top,bottom:e.bottom-o,left:i-e.left,right:e.right-a}},g=(e,t)=>m(t===`top`?e.top:t===`bottom`?e.bottom:t===`left`?e.left:e.right),_=e=>m(e.top)||m(e.bottom)||m(e.left)||m(e.right),v=(e,t)=>t===n.TOP||t===n.BOTTOM?m(e.left)||m(e.right):m(e.top)||m(e.bottom),y=(e,t)=>e.bottom>t.top&&e.top<t.bottom&&e.right>t.left&&e.left<t.right,b=(e,t)=>{let n=e.top+t,r=e.left+t,i=e.right-t,a=e.bottom-t;return{top:n,left:r,right:i,bottom:a,width:Math.max(0,i-r),height:Math.max(0,a-n)}},x=e=>e.side===n.TOP?{...e,side:n.BOTTOM}:e.side===n.BOTTOM?{...e,side:n.TOP}:e.side===n.LEFT?{...e,side:n.RIGHT}:{...e,side:n.LEFT},S=(e,t,n)=>Math.min(Math.max(t,e),n),C=(e,t,n)=>e===`y`?{x:t.x,y:S(t.y+n.top,t.y,t.y-n.bottom)}:{x:S(t.x+n.left,t.x,t.x-n.right),y:t.y},w=e=>e===n.TOP||e===n.BOTTOM?{mainAxis:`x`,crossAxis:`y`}:{mainAxis:`y`,crossAxis:`x`},T=(e,t,n,i)=>i===r.START?e:i===r.END?e+t-n:e+(t-n)/2,E=(e,t,r,i)=>r.side===n.BOTTOM?{x:T(e.left,e.width,t.width,r.align),y:e.bottom+i}:r.side===n.TOP?{x:T(e.left,e.width,t.width,r.align),y:e.top-i-t.height}:r.side===n.LEFT?{x:e.left-i-t.width,y:T(e.top,e.height,t.height,r.align)}:{x:e.right+i,y:T(e.top,e.height,t.height,r.align)},D=(e,t)=>({top:e.y,left:e.x,right:e.x+t.width,bottom:e.y+t.height,width:t.width,height:t.height}),O=(e,t,n,r)=>e===`x`?{min:t.left+n,max:t.right-n-r.width}:{min:t.top+n,max:t.bottom-n-r.height},k=(e,t,n,r,i)=>t<=n?S(t,e,n):S(r,e,i),A=(e,t,n,r,i,a)=>{let{mainAxis:o}=w(t),{x:s,y:c}=e,l=O(o,i,a,r);if(o===`y`){let e=n.top-r.height,t=n.bottom,i=Math.max(l.min,e),a=Math.min(l.max,t);c=k(c,i,a,l.min,l.max)}else{let e=n.left-r.width,t=n.right,i=Math.max(l.min,e),a=Math.min(l.max,t);s=k(s,i,a,l.min,l.max)}return{x:s,y:c}},j=(e,t,n)=>{let{anchorSide:r,referenceRect:i,viewportRect:a,viewportPadding:o,mainAxis:s=!0,crossAxis:c=!1}=n,l=h(D(e,t),a,o),{mainAxis:u,crossAxis:d}=w(r),f={x:e.x,y:e.y};return s&&(f=C(u,f,l)),c&&(f=C(d,f,l)),A(f,r,i,t,a,o)},M=e=>e===n.TOP?`top`:e===n.BOTTOM?`bottom`:e===n.LEFT?`left`:`right`,N=(e,t,n)=>{let r=t.bottom-n;return Math.max(0,Math.floor(r-e.y))},P=e=>{let t=s(e.placement),n=e.flip?[t,x(t)]:[t],r={anchor:t,coordinates:E(e.referenceRect,e.floatingSize,t,e.offset),strategy:o.PREFERRED};for(let i of n){let n=E(e.referenceRect,e.floatingSize,i,e.offset);if(!g(h(D(n,e.floatingSize),e.viewportRect,e.viewportPadding),M(i.side)))return{anchor:i,coordinates:n,strategy:i===t?o.PREFERRED:o.FLIP};r={anchor:i,coordinates:n,strategy:o.FLIP}}return r},F=(e,t)=>!e.shift||!_(h(D(t.coordinates,e.floatingSize),e.viewportRect,e.viewportPadding))?t:{...t,coordinates:j(t.coordinates,e.floatingSize,{anchorSide:t.anchor.side,referenceRect:e.referenceRect,viewportRect:e.viewportRect,viewportPadding:e.viewportPadding}),strategy:o.SHIFT},I=(e,t)=>{if(!e.fitViewport)return{coordinates:t.coordinates,strategy:t.strategy,maxHeight:void 0};let r=N(t.coordinates,e.viewportRect,e.viewportPadding),i=e.referenceRect.top-e.offset;if(t.anchor.side===n.TOP){let t=e.viewportRect.top+e.viewportPadding,n=Math.max(0,Math.floor(i-t));r=Math.min(r,n)}return r>=e.floatingSize.height?{coordinates:t.coordinates,strategy:t.strategy,maxHeight:void 0}:{coordinates:t.anchor.side===n.TOP?{...t.coordinates,y:i-r}:t.coordinates,strategy:o.SIZE,maxHeight:r}},L=e=>{let t=F(e,P(e)),n=I(e,t);return{x:n.coordinates.x,y:n.coordinates.y,resolvedPlacement:c(t.anchor),strategy:n.strategy,maxHeight:n.maxHeight}},R=()=>{let e=window.visualViewport;return e?{top:e.offsetTop,left:e.offsetLeft,right:e.offsetLeft+e.width,bottom:e.offsetTop+e.height,width:e.width,height:e.height}:{top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}},z=e=>({top:e.top,left:e.left,right:e.right,bottom:e.bottom,width:e.width,height:e.height}),B=/auto|scroll|overlay|hidden|clip/,V=e=>{let t=window.getComputedStyle(e);return[t.overflow,t.overflowX,t.overflowY].some(e=>B.test(e))},H=(e,t)=>{let n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),i=Math.min(e.right,t.right),a=Math.min(e.bottom,t.bottom);return{top:n,left:r,right:i,bottom:a,width:Math.max(0,i-r),height:Math.max(0,a-n)}},U=e=>{let t=R();if(!e)return t;let n=e.parentElement;for(;n;)V(n)&&(t=H(t,n.getBoundingClientRect())),n=n.parentElement;return t},W=/auto|scroll|overlay/,G=e=>{let t=window.getComputedStyle(e);return[t.overflow,t.overflowX,t.overflowY].some(e=>W.test(e))},K=e=>{let t=[],n=e?.parentElement??null;for(;n;)G(n)&&t.push(n),n=n.parentElement;return t},q=e=>e?e instanceof HTMLElement?e:e.$el instanceof HTMLElement?e.$el:null:null,J=e=>{let t=e.trim();if(!t)return;let n=parseFloat(t);if(!Number.isNaN(n))return n},Y=e=>{let t=getComputedStyle(e);return{arrowSize:J(t.getPropertyValue(`--s-ui-dropdown-arrow-size`))??12,arrowPadding:J(t.getPropertyValue(`--s-ui-dropdown-arrow-padding`))??8}},X=(e,t,n)=>{if(!n)return t;let r=e.firstElementChild;if(!(r instanceof HTMLElement))return Math.max(e.scrollHeight,t);let i=Math.max(0,t-r.clientHeight);return r.scrollHeight+i},Z=(t,n)=>(0,e.toValue)(t??n),Q=(e,t)=>e&&t instanceof HTMLElement?Y(t):{arrowSize:12,arrowPadding:8},$=(e,t,n,r,i,a,o,c)=>{let l=b(i,o),u=h(D(t,r),a,o),d=y(n,l),f=s(e.resolvedPlacement).side,p=c?!v(u,f):!_(u);return d&&p},ee=n=>{let r=(0,e.shallowRef)(null),o=(0,e.shallowRef)(void 0),s=(0,e.shallowRef)(i.BOTTOM_START),c=(0,e.shallowRef)(!1),l=(0,e.shallowRef)(0),u=(0,e.shallowRef)(null),d=(0,e.shallowRef)(!1),p=[],m=()=>{(0,e.toValue)(n.open)&&b()},h=()=>{for(let e of p)e();p=[]},g=()=>{h();let t=q((0,e.toValue)(n.reference));for(let e of K(t))e.addEventListener(`scroll`,m,{capture:!0,passive:!0}),p.push(()=>{e.removeEventListener(`scroll`,m,{capture:!0})})};(0,t.useEventListener)(window,`scroll`,m,{capture:!0}),(0,t.useEventListener)(document,`scroll`,m,{capture:!0}),(0,t.useEventListener)(()=>document.documentElement,`scroll`,m,{capture:!0}),(0,t.useEventListener)(()=>window.visualViewport??null,`scroll`,m,{passive:!0});let _=()=>({matchReferenceWidth:Z(n.matchReferenceWidth,!1),fitViewport:Z(n.fitViewport,!1),shift:Z(n.shift,!1),baseOffset:Z(n.offset,8),viewportPadding:Z(n.viewportPadding,8),hasArrow:Z(n.arrow,!1),placement:Z(n.placement,i.BOTTOM_START),flip:Z(n.flip,!0),boundary:Z(n.boundary,a.CLIPPING_ANCESTORS)}),v=(e,t)=>{if(!e){u.value=null,d.value=!1;return}let n=f({referenceRect:t.referenceRect,floatingCoordinates:{x:t.result.x,y:t.result.y},floatingSize:t.renderedFloatingSize,resolvedPlacement:t.result.resolvedPlacement,arrowSize:t.arrowSize,arrowPadding:t.arrowPadding});u.value=n,d.value=n.isOverflow},y=()=>{if(!(0,e.toValue)(n.open))return;let t=q((0,e.toValue)(n.reference)),i=(0,e.toValue)(n.panel);if(!t||!i)return;let u=_(),d=z(t.getBoundingClientRect()),f=z(i.getBoundingClientRect());l.value=Math.round(d.width);let p=i.firstElementChild,{arrowSize:m,arrowPadding:h}=Q(u.hasArrow,p),g=u.hasArrow?u.baseOffset+m/2:u.baseOffset,y={width:u.matchReferenceWidth&&d.width>0?d.width:f.width,height:X(i,f.height,u.fitViewport)},b=U(t),x=u.boundary===a.VIEWPORT?R():b,S=L({referenceRect:d,floatingSize:y,placement:u.placement,offset:g,flip:u.flip,shift:u.shift,fitViewport:u.fitViewport,viewportRect:x,viewportPadding:u.viewportPadding});r.value={x:Math.round(S.x),y:Math.round(S.y)},o.value=S.maxHeight===void 0?void 0:Math.floor(S.maxHeight),s.value=S.resolvedPlacement;let C={width:y.width,height:o.value??y.height};c.value=$(S,r.value,d,C,b,x,u.viewportPadding,u.shift),v(u.hasArrow,{referenceRect:d,result:S,renderedFloatingSize:C,arrowSize:m,arrowPadding:h})},b=()=>{y()},x=(0,e.computed)(()=>{let t=(0,e.toValue)(n.matchReferenceWidth??!1);if(!(0,e.toValue)(n.open)||!r.value)return{position:`fixed`,top:`0`,left:`0`,visibility:`hidden`,pointerEvents:`none`};let i={position:`fixed`,top:`0`,left:`0`,transform:`translate(${r.value.x}px, ${r.value.y}px)`,visibility:c.value?`visible`:`hidden`,pointerEvents:c.value?`auto`:`none`};if(t&&l.value>0){let e=`${Math.round(l.value)}px`;i.width=e,i.minWidth=e,i.maxWidth=e}return i}),S=(0,e.computed)(()=>{if(!(0,e.toValue)(n.open)||!(0,e.toValue)(n.arrow??!1)||!u.value)return;let t=u.value;return{[t.crossAxisProperty]:`${t.crossAxisPosition}px`}}),C=()=>{n.onOpenChange?.(!1)};return(0,e.watch)(()=>(0,e.toValue)(n.open),async t=>{if(t){c.value=!1,await(0,e.nextTick)(),g(),b();return}c.value=!1,r.value=null,o.value=void 0,u.value=null,d.value=!1,h()}),(0,e.watch)([()=>(0,e.toValue)(n.placement??i.BOTTOM_START),()=>(0,e.toValue)(n.offset??8),()=>(0,e.toValue)(n.flip??!0),()=>(0,e.toValue)(n.shift??!1),()=>(0,e.toValue)(n.matchReferenceWidth??!1),()=>(0,e.toValue)(n.fitViewport??!1),()=>(0,e.toValue)(n.viewportPadding??8),()=>(0,e.toValue)(n.arrow??!1),()=>(0,e.toValue)(n.boundary??a.CLIPPING_ANCESTORS)],async()=>{(0,e.toValue)(n.open)&&(c.value=!1,await(0,e.nextTick)(),b())}),(0,t.useResizeObserver)(()=>q((0,e.toValue)(n.reference)),()=>{(0,e.toValue)(n.open)&&b()}),(0,t.useResizeObserver)(()=>(0,e.toValue)(n.panel),()=>{(0,e.toValue)(n.open)&&b()}),(0,t.useEventListener)(window,`resize`,()=>{(0,e.toValue)(n.open)&&b()}),(0,t.useEventListener)(()=>window.visualViewport??null,`resize`,()=>{(0,e.toValue)(n.open)&&b()}),(0,t.onClickOutside)(()=>(0,e.toValue)(n.panel),()=>{!(0,e.toValue)(n.open)||!(0,e.toValue)(n.dismissOnClickOutside??!0)||C()},{ignore:[(0,e.computed)(()=>q((0,e.toValue)(n.reference))),`.s-ui-dropdown`,`.s-ui-dropdown__panel`]}),(0,t.useEventListener)(window,`keydown`,t=>{!(0,e.toValue)(n.open)||!(0,e.toValue)(n.dismissOnEscape??!0)||t.key===`Escape`&&C()}),(0,e.onScopeDispose)(()=>{h()}),{panelStyles:x,panelMaxHeight:o,resolvedPlacement:s,isPositionReady:c,referenceWidth:l,arrowStyles:S,isArrowOverflow:d,updatePosition:b}};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return ee}});
@@ -8,8 +8,10 @@ var l = /* @__PURE__ */ function(e) {
8
8
  }({}), d = /* @__PURE__ */ function(e) {
9
9
  return e.TOP = "top", e.TOP_START = "top-start", e.TOP_END = "top-end", e.BOTTOM = "bottom", e.BOTTOM_START = "bottom-start", e.BOTTOM_END = "bottom-end", e.LEFT = "left", e.LEFT_START = "left-start", e.LEFT_END = "left-end", e.RIGHT = "right", e.RIGHT_START = "right-start", e.RIGHT_END = "right-end", e;
10
10
  }({}), f = /* @__PURE__ */ function(e) {
11
+ return e.CLIPPING_ANCESTORS = "clipping-ancestors", e.VIEWPORT = "viewport", e;
12
+ }({}), p = /* @__PURE__ */ function(e) {
11
13
  return e.PREFERRED = "preferred", e.FLIP = "flip", e.SHIFT = "shift", e.SIZE = "size", e;
12
- }({}), p = (e) => {
14
+ }({}), m = (e) => {
13
15
  switch (e) {
14
16
  case d.TOP: return {
15
17
  side: l.TOP,
@@ -61,8 +63,8 @@ var l = /* @__PURE__ */ function(e) {
61
63
  };
62
64
  default: return e;
63
65
  }
64
- }, m = (e) => e.side === l.TOP ? e.align === u.START ? d.TOP_START : e.align === u.END ? d.TOP_END : d.TOP : e.side === l.BOTTOM ? e.align === u.START ? d.BOTTOM_START : e.align === u.END ? d.BOTTOM_END : d.BOTTOM : e.side === l.LEFT ? e.align === u.START ? d.LEFT_START : e.align === u.END ? d.LEFT_END : d.LEFT : e.align === u.START ? d.RIGHT_START : e.align === u.END ? d.RIGHT_END : d.RIGHT, h = (e, t, n) => Math.min(Math.max(t, e), n), g = (e) => e === l.TOP ? "bottom" : e === l.BOTTOM ? "top" : e === l.LEFT ? "right" : "left", _ = ({ referenceCenter: e, floatingStart: t, floatingLength: n, crossAxisProperty: r, staticSide: i, staticOffset: a, arrowSize: o, arrowPadding: s }) => {
65
- let c = e - t - o / 2, l = h(s, c, n - o - s), u = c - l;
66
+ }, h = (e) => e.side === l.TOP ? e.align === u.START ? d.TOP_START : e.align === u.END ? d.TOP_END : d.TOP : e.side === l.BOTTOM ? e.align === u.START ? d.BOTTOM_START : e.align === u.END ? d.BOTTOM_END : d.BOTTOM : e.side === l.LEFT ? e.align === u.START ? d.LEFT_START : e.align === u.END ? d.LEFT_END : d.LEFT : e.align === u.START ? d.RIGHT_START : e.align === u.END ? d.RIGHT_END : d.RIGHT, g = (e, t, n) => Math.min(Math.max(t, e), n), _ = (e) => e === l.TOP ? "bottom" : e === l.BOTTOM ? "top" : e === l.LEFT ? "right" : "left", v = ({ referenceCenter: e, floatingStart: t, floatingLength: n, crossAxisProperty: r, staticSide: i, staticOffset: a, arrowSize: o, arrowPadding: s }) => {
67
+ let c = e - t - o / 2, l = g(s, c, n - o - s), u = c - l;
66
68
  return {
67
69
  crossAxisPosition: l,
68
70
  crossAxisProperty: r,
@@ -71,9 +73,9 @@ var l = /* @__PURE__ */ function(e) {
71
73
  centerOffset: u,
72
74
  isOverflow: Math.abs(u) > o / 2
73
75
  };
74
- }, v = (e) => {
75
- let { referenceRect: t, floatingCoordinates: n, floatingSize: r, arrowSize: i, arrowPadding: a } = e, o = p(e.resolvedPlacement), s = g(o.side), c = -(i / 2);
76
- return o.side === l.TOP || o.side === l.BOTTOM ? _({
76
+ }, y = (e) => {
77
+ let { referenceRect: t, floatingCoordinates: n, floatingSize: r, arrowSize: i, arrowPadding: a } = e, o = m(e.resolvedPlacement), s = _(o.side), c = -(i / 2);
78
+ return o.side === l.TOP || o.side === l.BOTTOM ? v({
77
79
  referenceCenter: t.left + t.width / 2,
78
80
  floatingStart: n.x,
79
81
  floatingLength: r.width,
@@ -82,7 +84,7 @@ var l = /* @__PURE__ */ function(e) {
82
84
  staticOffset: c,
83
85
  arrowSize: i,
84
86
  arrowPadding: a
85
- }) : _({
87
+ }) : v({
86
88
  referenceCenter: t.top + t.height / 2,
87
89
  floatingStart: n.y,
88
90
  floatingLength: r.height,
@@ -92,7 +94,7 @@ var l = /* @__PURE__ */ function(e) {
92
94
  arrowSize: i,
93
95
  arrowPadding: a
94
96
  });
95
- }, y = (e, t, n) => {
97
+ }, b = .5, x = (e) => e > b, S = (e, t, n) => {
96
98
  let r = t.top + n, i = t.left + n, a = t.right - n, o = t.bottom - n;
97
99
  return {
98
100
  top: r - e.top,
@@ -100,7 +102,7 @@ var l = /* @__PURE__ */ function(e) {
100
102
  left: i - e.left,
101
103
  right: e.right - a
102
104
  };
103
- }, b = (e, t) => t === "top" ? e.top > 0 : t === "bottom" ? e.bottom > 0 : t === "left" ? e.left > 0 : e.right > 0, x = (e) => e.top > 0 || e.bottom > 0 || e.left > 0 || e.right > 0, S = (e, t) => t === l.TOP || t === l.BOTTOM ? e.left > 0 || e.right > 0 : e.top > 0 || e.bottom > 0, C = (e, t) => e.bottom > t.top && e.top < t.bottom && e.right > t.left && e.left < t.right, w = (e, t) => {
105
+ }, C = (e, t) => x(t === "top" ? e.top : t === "bottom" ? e.bottom : t === "left" ? e.left : e.right), w = (e) => x(e.top) || x(e.bottom) || x(e.left) || x(e.right), T = (e, t) => t === l.TOP || t === l.BOTTOM ? x(e.left) || x(e.right) : x(e.top) || x(e.bottom), E = (e, t) => e.bottom > t.top && e.top < t.bottom && e.right > t.left && e.left < t.right, D = (e, t) => {
104
106
  let n = e.top + t, r = e.left + t, i = e.right - t, a = e.bottom - t;
105
107
  return {
106
108
  top: n,
@@ -110,7 +112,7 @@ var l = /* @__PURE__ */ function(e) {
110
112
  width: Math.max(0, i - r),
111
113
  height: Math.max(0, a - n)
112
114
  };
113
- }, T = (e) => e.side === l.TOP ? {
115
+ }, O = (e) => e.side === l.TOP ? {
114
116
  ...e,
115
117
  side: l.BOTTOM
116
118
  } : e.side === l.BOTTOM ? {
@@ -122,101 +124,101 @@ var l = /* @__PURE__ */ function(e) {
122
124
  } : {
123
125
  ...e,
124
126
  side: l.LEFT
125
- }, E = (e, t, n) => Math.min(Math.max(t, e), n), D = (e, t, n) => e === "y" ? {
127
+ }, k = (e, t, n) => Math.min(Math.max(t, e), n), A = (e, t, n) => e === "y" ? {
126
128
  x: t.x,
127
- y: E(t.y + n.top, t.y, t.y - n.bottom)
129
+ y: k(t.y + n.top, t.y, t.y - n.bottom)
128
130
  } : {
129
- x: E(t.x + n.left, t.x, t.x - n.right),
131
+ x: k(t.x + n.left, t.x, t.x - n.right),
130
132
  y: t.y
131
- }, O = (e) => e === l.TOP || e === l.BOTTOM ? {
133
+ }, j = (e) => e === l.TOP || e === l.BOTTOM ? {
132
134
  mainAxis: "x",
133
135
  crossAxis: "y"
134
136
  } : {
135
137
  mainAxis: "y",
136
138
  crossAxis: "x"
137
- }, k = (e, t, n, r) => r === u.START ? e : r === u.END ? e + t - n : e + (t - n) / 2, A = (e, t, n, r) => n.side === l.BOTTOM ? {
138
- x: k(e.left, e.width, t.width, n.align),
139
+ }, M = (e, t, n, r) => r === u.START ? e : r === u.END ? e + t - n : e + (t - n) / 2, N = (e, t, n, r) => n.side === l.BOTTOM ? {
140
+ x: M(e.left, e.width, t.width, n.align),
139
141
  y: e.bottom + r
140
142
  } : n.side === l.TOP ? {
141
- x: k(e.left, e.width, t.width, n.align),
143
+ x: M(e.left, e.width, t.width, n.align),
142
144
  y: e.top - r - t.height
143
145
  } : n.side === l.LEFT ? {
144
146
  x: e.left - r - t.width,
145
- y: k(e.top, e.height, t.height, n.align)
147
+ y: M(e.top, e.height, t.height, n.align)
146
148
  } : {
147
149
  x: e.right + r,
148
- y: k(e.top, e.height, t.height, n.align)
149
- }, j = (e, t) => ({
150
+ y: M(e.top, e.height, t.height, n.align)
151
+ }, P = (e, t) => ({
150
152
  top: e.y,
151
153
  left: e.x,
152
154
  right: e.x + t.width,
153
155
  bottom: e.y + t.height,
154
156
  width: t.width,
155
157
  height: t.height
156
- }), M = (e, t, n, r) => e === "x" ? {
158
+ }), F = (e, t, n, r) => e === "x" ? {
157
159
  min: t.left + n,
158
160
  max: t.right - n - r.width
159
161
  } : {
160
162
  min: t.top + n,
161
163
  max: t.bottom - n - r.height
162
- }, N = (e, t, n, r, i) => t <= n ? E(t, e, n) : E(r, e, i), P = (e, t, n, r, i, a) => {
163
- let { mainAxis: o } = O(t), { x: s, y: c } = e, l = M(o, i, a, r);
164
+ }, I = (e, t, n, r, i) => t <= n ? k(t, e, n) : k(r, e, i), L = (e, t, n, r, i, a) => {
165
+ let { mainAxis: o } = j(t), { x: s, y: c } = e, l = F(o, i, a, r);
164
166
  if (o === "y") {
165
167
  let e = n.top - r.height, t = n.bottom, i = Math.max(l.min, e), a = Math.min(l.max, t);
166
- c = N(c, i, a, l.min, l.max);
168
+ c = I(c, i, a, l.min, l.max);
167
169
  } else {
168
170
  let e = n.left - r.width, t = n.right, i = Math.max(l.min, e), a = Math.min(l.max, t);
169
- s = N(s, i, a, l.min, l.max);
171
+ s = I(s, i, a, l.min, l.max);
170
172
  }
171
173
  return {
172
174
  x: s,
173
175
  y: c
174
176
  };
175
- }, F = (e, t, n) => {
176
- let { anchorSide: r, referenceRect: i, viewportRect: a, viewportPadding: o, mainAxis: s = !0, crossAxis: c = !1 } = n, l = y(j(e, t), a, o), { mainAxis: u, crossAxis: d } = O(r), f = {
177
+ }, R = (e, t, n) => {
178
+ let { anchorSide: r, referenceRect: i, viewportRect: a, viewportPadding: o, mainAxis: s = !0, crossAxis: c = !1 } = n, l = S(P(e, t), a, o), { mainAxis: u, crossAxis: d } = j(r), f = {
177
179
  x: e.x,
178
180
  y: e.y
179
181
  };
180
- return s && (f = D(u, f, l)), c && (f = D(d, f, l)), P(f, r, i, t, a, o);
181
- }, I = (e) => e === l.TOP ? "top" : e === l.BOTTOM ? "bottom" : e === l.LEFT ? "left" : "right", L = (e, t, n) => {
182
+ return s && (f = A(u, f, l)), c && (f = A(d, f, l)), L(f, r, i, t, a, o);
183
+ }, z = (e) => e === l.TOP ? "top" : e === l.BOTTOM ? "bottom" : e === l.LEFT ? "left" : "right", B = (e, t, n) => {
182
184
  let r = t.bottom - n;
183
185
  return Math.max(0, Math.floor(r - e.y));
184
- }, R = (e) => {
185
- let t = p(e.placement), n = e.flip ? [t, T(t)] : [t], r = {
186
+ }, V = (e) => {
187
+ let t = m(e.placement), n = e.flip ? [t, O(t)] : [t], r = {
186
188
  anchor: t,
187
- coordinates: A(e.referenceRect, e.floatingSize, t, e.offset),
188
- strategy: f.PREFERRED
189
+ coordinates: N(e.referenceRect, e.floatingSize, t, e.offset),
190
+ strategy: p.PREFERRED
189
191
  };
190
192
  for (let i of n) {
191
- let n = A(e.referenceRect, e.floatingSize, i, e.offset);
192
- if (!b(y(j(n, e.floatingSize), e.viewportRect, e.viewportPadding), I(i.side))) return {
193
+ let n = N(e.referenceRect, e.floatingSize, i, e.offset);
194
+ if (!C(S(P(n, e.floatingSize), e.viewportRect, e.viewportPadding), z(i.side))) return {
193
195
  anchor: i,
194
196
  coordinates: n,
195
- strategy: i === t ? f.PREFERRED : f.FLIP
197
+ strategy: i === t ? p.PREFERRED : p.FLIP
196
198
  };
197
199
  r = {
198
200
  anchor: i,
199
201
  coordinates: n,
200
- strategy: f.FLIP
202
+ strategy: p.FLIP
201
203
  };
202
204
  }
203
205
  return r;
204
- }, z = (e, t) => !e.shift || !x(y(j(t.coordinates, e.floatingSize), e.viewportRect, e.viewportPadding)) ? t : {
206
+ }, H = (e, t) => !e.shift || !w(S(P(t.coordinates, e.floatingSize), e.viewportRect, e.viewportPadding)) ? t : {
205
207
  ...t,
206
- coordinates: F(t.coordinates, e.floatingSize, {
208
+ coordinates: R(t.coordinates, e.floatingSize, {
207
209
  anchorSide: t.anchor.side,
208
210
  referenceRect: e.referenceRect,
209
211
  viewportRect: e.viewportRect,
210
212
  viewportPadding: e.viewportPadding
211
213
  }),
212
- strategy: f.SHIFT
213
- }, B = (e, t) => {
214
+ strategy: p.SHIFT
215
+ }, U = (e, t) => {
214
216
  if (!e.fitViewport) return {
215
217
  coordinates: t.coordinates,
216
218
  strategy: t.strategy,
217
219
  maxHeight: void 0
218
220
  };
219
- let n = L(t.coordinates, e.viewportRect, e.viewportPadding), r = e.referenceRect.top - e.offset;
221
+ let n = B(t.coordinates, e.viewportRect, e.viewportPadding), r = e.referenceRect.top - e.offset;
220
222
  if (t.anchor.side === l.TOP) {
221
223
  let t = e.viewportRect.top + e.viewportPadding, i = Math.max(0, Math.floor(r - t));
222
224
  n = Math.min(n, i);
@@ -230,19 +232,19 @@ var l = /* @__PURE__ */ function(e) {
230
232
  ...t.coordinates,
231
233
  y: r - n
232
234
  } : t.coordinates,
233
- strategy: f.SIZE,
235
+ strategy: p.SIZE,
234
236
  maxHeight: n
235
237
  };
236
- }, V = (e) => {
237
- let t = z(e, R(e)), n = B(e, t);
238
+ }, W = (e) => {
239
+ let t = H(e, V(e)), n = U(e, t);
238
240
  return {
239
241
  x: n.coordinates.x,
240
242
  y: n.coordinates.y,
241
- resolvedPlacement: m(t.anchor),
243
+ resolvedPlacement: h(t.anchor),
242
244
  strategy: n.strategy,
243
245
  maxHeight: n.maxHeight
244
246
  };
245
- }, H = () => {
247
+ }, G = () => {
246
248
  let e = window.visualViewport;
247
249
  return e ? {
248
250
  top: e.offsetTop,
@@ -259,21 +261,21 @@ var l = /* @__PURE__ */ function(e) {
259
261
  width: window.innerWidth,
260
262
  height: window.innerHeight
261
263
  };
262
- }, U = (e) => ({
264
+ }, K = (e) => ({
263
265
  top: e.top,
264
266
  left: e.left,
265
267
  right: e.right,
266
268
  bottom: e.bottom,
267
269
  width: e.width,
268
270
  height: e.height
269
- }), W = /auto|scroll|overlay|hidden|clip/, G = (e) => {
271
+ }), q = /auto|scroll|overlay|hidden|clip/, J = (e) => {
270
272
  let t = window.getComputedStyle(e);
271
273
  return [
272
274
  t.overflow,
273
275
  t.overflowX,
274
276
  t.overflowY
275
- ].some((e) => W.test(e));
276
- }, K = (e, t) => {
277
+ ].some((e) => q.test(e));
278
+ }, Y = (e, t) => {
277
279
  let n = Math.max(e.top, t.top), r = Math.max(e.left, t.left), i = Math.min(e.right, t.right), a = Math.min(e.bottom, t.bottom);
278
280
  return {
279
281
  top: n,
@@ -283,65 +285,64 @@ var l = /* @__PURE__ */ function(e) {
283
285
  width: Math.max(0, i - r),
284
286
  height: Math.max(0, a - n)
285
287
  };
286
- }, q = (e) => {
287
- let t = H();
288
+ }, X = (e) => {
289
+ let t = G();
288
290
  if (!e) return t;
289
291
  let n = e.parentElement;
290
- for (; n;) G(n) && (t = K(t, n.getBoundingClientRect())), n = n.parentElement;
292
+ for (; n;) J(n) && (t = Y(t, n.getBoundingClientRect())), n = n.parentElement;
291
293
  return t;
292
- }, J = /auto|scroll|overlay/, Y = (e) => {
294
+ }, ee = /auto|scroll|overlay/, te = (e) => {
293
295
  let t = window.getComputedStyle(e);
294
296
  return [
295
297
  t.overflow,
296
298
  t.overflowX,
297
299
  t.overflowY
298
- ].some((e) => J.test(e));
299
- }, X = (e) => {
300
+ ].some((e) => ee.test(e));
301
+ }, ne = (e) => {
300
302
  let t = [], n = e?.parentElement ?? null;
301
- for (; n;) Y(n) && t.push(n), n = n.parentElement;
303
+ for (; n;) te(n) && t.push(n), n = n.parentElement;
302
304
  return t;
303
305
  }, Z = (e) => e ? e instanceof HTMLElement ? e : e.$el instanceof HTMLElement ? e.$el : null : null, Q = (e) => {
304
306
  let t = e.trim();
305
307
  if (!t) return;
306
308
  let n = parseFloat(t);
307
309
  if (!Number.isNaN(n)) return n;
308
- }, ee = (e) => {
310
+ }, re = (e) => {
309
311
  let t = getComputedStyle(e);
310
312
  return {
311
313
  arrowSize: Q(t.getPropertyValue("--s-ui-dropdown-arrow-size")) ?? 12,
312
314
  arrowPadding: Q(t.getPropertyValue("--s-ui-dropdown-arrow-padding")) ?? 8
313
315
  };
314
- }, te = (e, t, n) => {
316
+ }, ie = (e, t, n) => {
315
317
  if (!n) return t;
316
318
  let r = e.firstElementChild;
317
- return r instanceof HTMLElement ? Math.max(r.scrollHeight, t) : Math.max(e.scrollHeight, t);
318
- }, $ = (e, t) => i(e ?? t), ne = (e, t) => e && t instanceof HTMLElement ? ee(t) : {
319
+ if (!(r instanceof HTMLElement)) return Math.max(e.scrollHeight, t);
320
+ let i = Math.max(0, t - r.clientHeight);
321
+ return r.scrollHeight + i;
322
+ }, $ = (e, t) => i(e ?? t), ae = (e, t) => e && t instanceof HTMLElement ? re(t) : {
319
323
  arrowSize: 12,
320
324
  arrowPadding: 8
321
- }, re = (e, t, n, r, i, a) => {
322
- let o = w(r, i), s = y(j({
323
- x: e.x,
324
- y: e.y
325
- }, n), r, i), c = C(t, o), l = p(e.resolvedPlacement).side, u = a ? !S(s, l) : !x(s);
326
- return c && u;
327
- }, ie = (l) => {
328
- let u = r(null), f = r(void 0), p = r(d.BOTTOM_START), m = r(!1), h = r(0), g = r(null), _ = r(!1), y = [], b = () => {
329
- i(l.open) && E();
330
- }, x = () => {
331
- for (let e of y) e();
332
- y = [];
325
+ }, oe = (e, t, n, r, i, a, o, s) => {
326
+ let c = D(i, o), l = S(P(t, r), a, o), u = E(n, c), d = m(e.resolvedPlacement).side, f = s ? !T(l, d) : !w(l);
327
+ return u && f;
328
+ }, se = (l) => {
329
+ let u = r(null), p = r(void 0), m = r(d.BOTTOM_START), h = r(!1), g = r(0), _ = r(null), v = r(!1), b = [], x = () => {
330
+ i(l.open) && D();
333
331
  }, S = () => {
334
- x();
332
+ for (let e of b) e();
333
+ b = [];
334
+ }, C = () => {
335
+ S();
335
336
  let e = Z(i(l.reference));
336
- for (let t of X(e)) t.addEventListener("scroll", b, {
337
+ for (let t of ne(e)) t.addEventListener("scroll", x, {
337
338
  capture: !0,
338
339
  passive: !0
339
- }), y.push(() => {
340
- t.removeEventListener("scroll", b, { capture: !0 });
340
+ }), b.push(() => {
341
+ t.removeEventListener("scroll", x, { capture: !0 });
341
342
  });
342
343
  };
343
- s(window, "scroll", b, { capture: !0 }), s(document, "scroll", b, { capture: !0 }), s(() => document.documentElement, "scroll", b, { capture: !0 }), s(() => window.visualViewport ?? null, "scroll", b, { passive: !0 });
344
- let C = () => ({
344
+ s(window, "scroll", x, { capture: !0 }), s(document, "scroll", x, { capture: !0 }), s(() => document.documentElement, "scroll", x, { capture: !0 }), s(() => window.visualViewport ?? null, "scroll", x, { passive: !0 });
345
+ let w = () => ({
345
346
  matchReferenceWidth: $(l.matchReferenceWidth, !1),
346
347
  fitViewport: $(l.fitViewport, !1),
347
348
  shift: $(l.shift, !1),
@@ -349,13 +350,14 @@ var l = /* @__PURE__ */ function(e) {
349
350
  viewportPadding: $(l.viewportPadding, 8),
350
351
  hasArrow: $(l.arrow, !1),
351
352
  placement: $(l.placement, d.BOTTOM_START),
352
- flip: $(l.flip, !0)
353
- }), w = (e, t) => {
353
+ flip: $(l.flip, !0),
354
+ boundary: $(l.boundary, f.CLIPPING_ANCESTORS)
355
+ }), T = (e, t) => {
354
356
  if (!e) {
355
- g.value = null, _.value = !1;
357
+ _.value = null, v.value = !1;
356
358
  return;
357
359
  }
358
- let n = v({
360
+ let n = y({
359
361
  referenceRect: t.referenceRect,
360
362
  floatingCoordinates: {
361
363
  x: t.result.x,
@@ -366,45 +368,45 @@ var l = /* @__PURE__ */ function(e) {
366
368
  arrowSize: t.arrowSize,
367
369
  arrowPadding: t.arrowPadding
368
370
  });
369
- g.value = n, _.value = n.isOverflow;
370
- }, T = () => {
371
+ _.value = n, v.value = n.isOverflow;
372
+ }, E = () => {
371
373
  if (!i(l.open)) return;
372
374
  let e = Z(i(l.reference)), t = i(l.panel);
373
375
  if (!e || !t) return;
374
- let n = C(), r = U(e.getBoundingClientRect()), a = U(t.getBoundingClientRect());
375
- h.value = Math.round(r.width);
376
- let o = t.firstElementChild, { arrowSize: s, arrowPadding: c } = ne(n.hasArrow, o), d = n.hasArrow ? n.baseOffset + s / 2 : n.baseOffset, g = {
376
+ let n = w(), r = K(e.getBoundingClientRect()), a = K(t.getBoundingClientRect());
377
+ g.value = Math.round(r.width);
378
+ let o = t.firstElementChild, { arrowSize: s, arrowPadding: c } = ae(n.hasArrow, o), d = n.hasArrow ? n.baseOffset + s / 2 : n.baseOffset, _ = {
377
379
  width: n.matchReferenceWidth && r.width > 0 ? r.width : a.width,
378
- height: te(t, a.height, n.fitViewport)
379
- }, _ = q(e), v = V({
380
+ height: ie(t, a.height, n.fitViewport)
381
+ }, v = X(e), y = n.boundary === f.VIEWPORT ? G() : v, b = W({
380
382
  referenceRect: r,
381
- floatingSize: g,
383
+ floatingSize: _,
382
384
  placement: n.placement,
383
385
  offset: d,
384
386
  flip: n.flip,
385
387
  shift: n.shift,
386
388
  fitViewport: n.fitViewport,
387
- viewportRect: _,
389
+ viewportRect: y,
388
390
  viewportPadding: n.viewportPadding
389
391
  });
390
392
  u.value = {
391
- x: v.x,
392
- y: v.y
393
- }, f.value = v.maxHeight, p.value = v.resolvedPlacement;
394
- let y = {
395
- width: g.width,
396
- height: v.maxHeight ?? g.height
393
+ x: Math.round(b.x),
394
+ y: Math.round(b.y)
395
+ }, p.value = b.maxHeight === void 0 ? void 0 : Math.floor(b.maxHeight), m.value = b.resolvedPlacement;
396
+ let x = {
397
+ width: _.width,
398
+ height: p.value ?? _.height
397
399
  };
398
- m.value = re(v, r, y, _, n.viewportPadding, n.shift), w(n.hasArrow, {
400
+ h.value = oe(b, u.value, r, x, v, y, n.viewportPadding, n.shift), T(n.hasArrow, {
399
401
  referenceRect: r,
400
- result: v,
401
- renderedFloatingSize: y,
402
+ result: b,
403
+ renderedFloatingSize: x,
402
404
  arrowSize: s,
403
405
  arrowPadding: c
404
406
  });
405
- }, E = () => {
406
- T();
407
- }, D = e(() => {
407
+ }, D = () => {
408
+ E();
409
+ }, O = e(() => {
408
410
  let e = i(l.matchReferenceWidth ?? !1);
409
411
  if (!i(l.open) || !u.value) return {
410
412
  position: "fixed",
@@ -418,27 +420,27 @@ var l = /* @__PURE__ */ function(e) {
418
420
  top: "0",
419
421
  left: "0",
420
422
  transform: `translate(${u.value.x}px, ${u.value.y}px)`,
421
- visibility: m.value ? "visible" : "hidden",
422
- pointerEvents: m.value ? "auto" : "none"
423
+ visibility: h.value ? "visible" : "hidden",
424
+ pointerEvents: h.value ? "auto" : "none"
423
425
  };
424
- if (e && h.value > 0) {
425
- let e = `${Math.round(h.value)}px`;
426
+ if (e && g.value > 0) {
427
+ let e = `${Math.round(g.value)}px`;
426
428
  t.width = e, t.minWidth = e, t.maxWidth = e;
427
429
  }
428
430
  return t;
429
- }), O = e(() => {
430
- if (!i(l.open) || !i(l.arrow ?? !1) || !g.value) return;
431
- let e = g.value;
431
+ }), k = e(() => {
432
+ if (!i(l.open) || !i(l.arrow ?? !1) || !_.value) return;
433
+ let e = _.value;
432
434
  return { [e.crossAxisProperty]: `${e.crossAxisPosition}px` };
433
- }), k = () => {
435
+ }), A = () => {
434
436
  l.onOpenChange?.(!1);
435
437
  };
436
438
  return a(() => i(l.open), async (e) => {
437
439
  if (e) {
438
- m.value = !1, await t(), S(), E();
440
+ h.value = !1, await t(), C(), D();
439
441
  return;
440
442
  }
441
- m.value = !1, u.value = null, f.value = void 0, g.value = null, _.value = !1, x();
443
+ h.value = !1, u.value = null, p.value = void 0, _.value = null, v.value = !1, S();
442
444
  }), a([
443
445
  () => i(l.placement ?? d.BOTTOM_START),
444
446
  () => i(l.offset ?? 8),
@@ -447,37 +449,38 @@ var l = /* @__PURE__ */ function(e) {
447
449
  () => i(l.matchReferenceWidth ?? !1),
448
450
  () => i(l.fitViewport ?? !1),
449
451
  () => i(l.viewportPadding ?? 8),
450
- () => i(l.arrow ?? !1)
452
+ () => i(l.arrow ?? !1),
453
+ () => i(l.boundary ?? f.CLIPPING_ANCESTORS)
451
454
  ], async () => {
452
- i(l.open) && (m.value = !1, await t(), E());
455
+ i(l.open) && (h.value = !1, await t(), D());
453
456
  }), c(() => Z(i(l.reference)), () => {
454
- i(l.open) && E();
457
+ i(l.open) && D();
455
458
  }), c(() => i(l.panel), () => {
456
- i(l.open) && E();
459
+ i(l.open) && D();
457
460
  }), s(window, "resize", () => {
458
- i(l.open) && E();
461
+ i(l.open) && D();
459
462
  }), s(() => window.visualViewport ?? null, "resize", () => {
460
- i(l.open) && E();
463
+ i(l.open) && D();
461
464
  }), o(() => i(l.panel), () => {
462
- !i(l.open) || !i(l.dismissOnClickOutside ?? !0) || k();
465
+ !i(l.open) || !i(l.dismissOnClickOutside ?? !0) || A();
463
466
  }, { ignore: [
464
467
  e(() => Z(i(l.reference))),
465
468
  ".s-ui-dropdown",
466
469
  ".s-ui-dropdown__panel"
467
470
  ] }), s(window, "keydown", (e) => {
468
- !i(l.open) || !i(l.dismissOnEscape ?? !0) || e.key === "Escape" && k();
471
+ !i(l.open) || !i(l.dismissOnEscape ?? !0) || e.key === "Escape" && A();
469
472
  }), n(() => {
470
- x();
473
+ S();
471
474
  }), {
472
- panelStyles: D,
473
- panelMaxHeight: f,
474
- resolvedPlacement: p,
475
- isPositionReady: m,
476
- referenceWidth: h,
477
- arrowStyles: O,
478
- isArrowOverflow: _,
479
- updatePosition: E
475
+ panelStyles: O,
476
+ panelMaxHeight: p,
477
+ resolvedPlacement: m,
478
+ isPositionReady: h,
479
+ referenceWidth: g,
480
+ arrowStyles: k,
481
+ isArrowOverflow: v,
482
+ updatePosition: D
480
483
  };
481
484
  };
482
485
  //#endregion
483
- export { d as i, V as n, f as r, ie as t };
486
+ export { d as a, f as i, W as n, p as r, se as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shtabapp/ui-kit",
3
- "version": "1.65.0",
3
+ "version": "1.67.0",
4
4
  "description": "Vue 3 component library by Shtab — 30+ typed components, design tokens, light/dark themes",
5
5
  "keywords": [
6
6
  "shtab",
@@ -1 +0,0 @@
1
- const e=require("./SBadge-d1GOPFP-.cjs"),t=require("./context-kCi2xRHY.cjs"),n=require("./useSelectionGroup-NJvi3hNo.cjs"),r=require("./useSelectLink-DZIAhQ2J.cjs"),i=require("./useLink-1LLWpdDZ.cjs");let a=require("vue"),o=require("@shtabapp/ui-kit-primitives");var s=function(e){return e.MAJOR=`major`,e.MINOR=`minor`,e.SURFACE=`surface`,e.OUTLINED=`outlined`,e.BARE=`bare`,e}({}),c=function(e){return e.MAIN=`main`,e.NEUTRAL=`neutral`,e.DANGER=`danger`,e.SUCCESS=`success`,e.BILLING=`billing`,e}({}),l=function(e){return e.SMALL=`small`,e.MEDIUM=`medium`,e.LARGE=`large`,e}({}),u={offsetX:1,offsetY:-1},d={[l.SMALL]:{offsetX:-6,offsetY:6},[l.MEDIUM]:{offsetX:-7,offsetY:7},[l.LARGE]:{offsetX:-8,offsetY:8}},f={[l.SMALL]:e.i.SMALL,[l.MEDIUM]:e.i.SMALL,[l.LARGE]:e.i.MEDIUM},p=({color:t,counterValue:n})=>{if(typeof n==`number`)return{anchored:!0,color:t,offsetX:u.offsetX,offsetY:u.offsetY,placement:e.r.TOP_END,size:e.i.MEDIUM,value:n}},m=({buttonSize:t,color:n,indicator:r})=>{if(!r)return;let i=d[t];return{anchored:!0,color:n,offsetX:i.offsetX,offsetY:i.offsetY,placement:e.r.TOP_END,size:f[t]}},h=({badgeColor:t,counter:n,indicator:r,size:i})=>({buttonBadgeProps:(0,a.computed)(()=>{let o=(0,a.toValue)(t)||e.n.MAIN;return p({color:o,counterValue:(0,a.toValue)(n)})||m({buttonSize:(0,a.toValue)(i),color:o,indicator:(0,a.toValue)(r)})})}),g=[`aria-hidden`],_={key:0,class:`s-ui-button__spinner`,"aria-hidden":`true`},v=(0,a.defineComponent)({inheritAttrs:!1,__name:`SButton`,props:{appearance:{},badgeColor:{},counter:{},disabled:{type:Boolean,default:!1},icon:{},iconLeft:{},iconRight:{},indicator:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{},value:{},variant:{},link:{},exact:{type:Boolean,default:!1},replace:{type:Boolean,default:!1}},setup(u){let d=(0,a.inject)(t.t,null),f=(0,a.useAttrs)(),p=(0,a.computed)(()=>n.a(u.appearance,d?(0,a.toValue)(d.appearance):void 0,s.MAJOR)),m=(0,a.computed)(()=>n.a(u.variant,d?(0,a.toValue)(d.variant):void 0,c.MAIN)),v=(0,a.computed)(()=>n.a(u.size,d?(0,a.toValue)(d.size):void 0,l.MEDIUM)),y=(0,a.computed)(()=>u.disabled||!!(d&&(0,a.toValue)(d.disabled))),b=(0,a.useTemplateRef)(`buttonRootRef`),{buttonBadgeProps:x}=h({badgeColor:()=>u.badgeColor,counter:()=>u.counter,indicator:()=>u.indicator,size:()=>v.value}),S=i.t(()=>u.link,()=>u.exact,()=>u.replace),C=S.linkPresentation;r.t({isRouterLink:S.isRouterLink,isActive:S.isActive,group:()=>d,value:()=>u.value});let w=(0,a.computed)(()=>{let e=C.value;return e.mode===`none`?`button`:e.rootTag}),T=(0,a.computed)(()=>w.value===`button`),E=(0,a.computed)(()=>y.value||u.loading),D=r.n({group:d,value:()=>u.value,el:b,disabled:y,interactive:()=>!E.value}),O=(0,a.computed)(()=>S.isRouterLink.value?S.isActive.value:D.isActive.value),k=(0,a.computed)(()=>[`s-ui-button`,`s-ui-button--tab-focus`,`s-ui-button--appearance-${p.value}`,`s-ui-button--variant-${m.value}`,`s-ui-button--size-${v.value}`,{"s-ui-button--disabled":y.value,"s-ui-button--loading":u.loading,"s-ui-button--icon-only":u.icon,"s-ui-button--active":O.value,"s-ui-button--link":C.value.mode!==`none`}]),A=(0,a.computed)(()=>({disabled:T.value?E.value:void 0,"aria-busy":u.loading?!0:void 0,"aria-pressed":D.ariaPressed.value,"aria-checked":D.ariaChecked.value,tabindex:D.tabIndex.value,...i.n(C.value,{replace:u.replace})})),j=(0,a.computed)(()=>({...A.value,...f})),M={[l.SMALL]:`s-ui-typography-label-12-medium`,[l.MEDIUM]:`s-ui-typography-label-14-medium`,[l.LARGE]:`s-ui-typography-label-16-medium`},N=(0,a.computed)(()=>M[v.value]),P={[l.SMALL]:16,[l.MEDIUM]:20,[l.LARGE]:24},F=(0,a.computed)(()=>P[v.value]),I=(0,a.computed)(()=>y.value||u.loading?!1:m.value===c.BILLING&&p.value!==s.MAJOR),L=(0,a.computed)(()=>m.value===c.BILLING&&p.value!==s.MAJOR),R=e=>{if(!E.value){if(S.isRouterLink.value&&(e.key===`Enter`||e.key===` `||e.key===`Spacebar`)){e.preventDefault(),S.navigate();return}D.handleKeydown(e)}},z=e=>{if(E.value){e.preventDefault(),e.stopPropagation();return}S.isRouterLink.value||D.handleClick()};return(t,n)=>((0,a.openBlock)(),(0,a.createBlock)((0,a.resolveDynamicComponent)(w.value),(0,a.mergeProps)({ref_key:`buttonRootRef`,ref:b,class:k.value},j.value,{onClick:z,onKeydown:R}),{default:(0,a.withCtx)(()=>[(0,a.createElementVNode)(`span`,{class:`s-ui-button__inner`,"aria-hidden":u.loading?!0:void 0},[u.icon?((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(o.SIcon),{key:0,name:u.icon,size:F.value,billing:I.value},null,8,[`name`,`size`,`billing`])):((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:1},[u.iconLeft?((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(o.SIcon),{key:0,name:u.iconLeft,size:F.value,billing:I.value},null,8,[`name`,`size`,`billing`])):(0,a.createCommentVNode)(``,!0),(0,a.createElementVNode)(`span`,{class:(0,a.normalizeClass)([`s-ui-button__label`,N.value])},[(0,a.renderSlot)(t.$slots,`default`)],2),u.iconRight?((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(o.SIcon),{key:1,name:u.iconRight,size:F.value,billing:I.value},null,8,[`name`,`size`,`billing`])):(0,a.createCommentVNode)(``,!0)],64))],8,g),u.loading?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,_,[(0,a.createVNode)((0,a.unref)(o.SSpinner),{billing:L.value,size:F.value},null,8,[`billing`,`size`])])):(0,a.createCommentVNode)(``,!0),(0,a.unref)(x)?((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(e.t),(0,a.normalizeProps)((0,a.mergeProps)({key:1},(0,a.unref)(x))),null,16)):(0,a.createCommentVNode)(``,!0)]),_:3},16,[`class`]))}});Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return v}});