@viasat/beam-react 2.12.0 → 2.13.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.
- package/assets/panel.css +1 -1
- package/chunks/FloatingUI.context.B15Tz_4h.js +1 -0
- package/chunks/{FloatingUI.context.DtJA57si.js → FloatingUI.context.Dl4Y1y1z.js} +105 -103
- package/lib/Dialog/Dialog.Header.cjs.js +1 -1
- package/lib/Dialog/Dialog.Header.es.js +1 -1
- package/lib/Dialog/Dialog.Trigger.cjs.js +1 -1
- package/lib/Dialog/Dialog.Trigger.es.js +1 -1
- package/lib/FloatingUI/FloatingUI.content.cjs.js +1 -1
- package/lib/FloatingUI/FloatingUI.content.es.js +1 -1
- package/lib/FloatingUI/FloatingUI.context.cjs.js +1 -1
- package/lib/FloatingUI/FloatingUI.context.d.ts +6 -2
- package/lib/FloatingUI/FloatingUI.context.es.js +1 -1
- package/lib/FloatingUI/FloatingUI.interactions.cjs.js +1 -1
- package/lib/FloatingUI/FloatingUI.interactions.d.ts +3 -2
- package/lib/FloatingUI/FloatingUI.interactions.es.js +16 -15
- package/lib/FloatingUI/FloatingUI.root.cjs.js +1 -1
- package/lib/FloatingUI/FloatingUI.root.es.js +1 -1
- package/lib/FloatingUI/FloatingUI.trigger.cjs.js +1 -1
- package/lib/FloatingUI/FloatingUI.trigger.close.cjs.js +1 -1
- package/lib/FloatingUI/FloatingUI.trigger.close.es.js +1 -1
- package/lib/FloatingUI/FloatingUI.trigger.es.js +1 -1
- package/lib/Menu/ActionListContextWrapper.cjs.js +1 -1
- package/lib/Menu/ActionListContextWrapper.es.js +1 -1
- package/lib/Popover/Popover.content.cjs.js +1 -1
- package/lib/Popover/Popover.content.es.js +1 -1
- package/lib/Popover/Popover.trigger.cjs.js +1 -1
- package/lib/Popover/Popover.trigger.es.js +1 -1
- package/lib/Tooltip/Tooltip.cjs.js +1 -1
- package/lib/Tooltip/Tooltip.es.js +1 -1
- package/lib/wip/Panel/Panel.Inline.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Inline.es.js +1 -1
- package/lib/wip/Panel/Panel.Overlay.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Overlay.d.ts +3 -2
- package/lib/wip/Panel/Panel.Overlay.es.js +33 -30
- package/lib/wip/Panel/Panel.cjs.js +1 -1
- package/lib/wip/Panel/Panel.d.ts +1 -1
- package/lib/wip/Panel/Panel.es.js +57 -52
- package/lib/wip/Panel/Panel.types.d.ts +7 -1
- package/package.json +6 -6
- package/chunks/FloatingUI.context.Du9g2lSg.js +0 -1
package/assets/panel.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root,:host,.bm-light,.bm-dark .bm-inverse,[data-bm-theme~=bm-light]{--bm-comp-panel-size-sm:20rem;--bm-comp-panel-size-md:27.5rem;--bm-comp-panel-size-lg:40rem;--bm-comp-panel-space-x-sm:var(--bm-sem-space-100,1rem);--bm-comp-panel-space-x-md:var(--bm-sem-space-150,1.5rem);--bm-comp-panel-space-header-pad-top:var(--bm-sem-space-125,1.25rem);--bm-comp-panel-space-header-pad-bottom:var(--bm-sem-space-100,1rem);--bm-comp-panel-space-header-gap-y:var(--bm-sem-space-25,.25rem);--bm-comp-panel-space-header-gap-x:var(--bm-sem-space-50,.5rem);--bm-comp-panel-space-footer-pad-top:var(--bm-sem-space-100,1rem);--bm-comp-panel-space-footer-pad-bottom:var(--bm-sem-space-125,1.25rem);--bm-comp-panel-space-footer-gap-actions:var(--bm-sem-space-50,.5rem);--bm-comp-panel-space-footer-gap-actions-stack:var(--bm-sem-space-100,1rem);--bm-comp-panel-radius:var(--bm-sem-radius-lg,1rem);--bm-comp-panel-shadow:var(--bm-sem-shadow-overlay,0 .25rem .75rem .125rem #0000001f);--bm-comp-panel-typo-heading:var(--bm-sem-typo-heading-sm,700 1.125rem/1.5rem "Uni Neue");--bm-comp-panel-typo-description:var(--bm-sem-typo-body-sm,400 .875rem/1.25rem "Source Sans Pro");--bm-comp-panel-color-heading:var(--bm-sem-color-text-primary,#141d24);--bm-comp-panel-color-description:var(--bm-sem-color-text-secondary,#576775)}:host,.bm-dark,.bm-light .bm-inverse,[data-bm-theme~=bm-dark]{--bm-comp-panel-size-sm:20rem;--bm-comp-panel-size-md:27.5rem;--bm-comp-panel-size-lg:40rem;--bm-comp-panel-space-x-sm:var(--bm-sem-space-100,1rem);--bm-comp-panel-space-x-md:var(--bm-sem-space-150,1.5rem);--bm-comp-panel-space-header-pad-top:var(--bm-sem-space-125,1.25rem);--bm-comp-panel-space-header-pad-bottom:var(--bm-sem-space-100,1rem);--bm-comp-panel-space-header-gap-y:var(--bm-sem-space-25,.25rem);--bm-comp-panel-space-header-gap-x:var(--bm-sem-space-50,.5rem);--bm-comp-panel-space-footer-pad-top:var(--bm-sem-space-100,1rem);--bm-comp-panel-space-footer-pad-bottom:var(--bm-sem-space-125,1.25rem);--bm-comp-panel-space-footer-gap-actions:var(--bm-sem-space-50,.5rem);--bm-comp-panel-space-footer-gap-actions-stack:var(--bm-sem-space-100,1rem);--bm-comp-panel-radius:var(--bm-sem-radius-lg,1rem);--bm-comp-panel-shadow:var(--bm-sem-shadow-overlay,0 .25rem .75rem .125rem #0000004d);--bm-comp-panel-typo-heading:var(--bm-sem-typo-heading-sm,700 1.125rem/1.5rem "Uni Neue");--bm-comp-panel-typo-description:var(--bm-sem-typo-body-sm,400 .875rem/1.25rem "Source Sans Pro");--bm-comp-panel-color-heading:var(--bm-sem-color-text-primary,#fff);--bm-comp-panel-color-description:var(--bm-sem-color-text-secondary,#c3cdd5)}.bm-panel{background-color:var(--bm-sem-color-surface-01);flex-direction:column;width:20rem;display:flex}.bm-panel--inline{height:100%;box-shadow:var(--bm-sem-shadow-none);position:relative}.bm-panel--overlay{box-shadow:var(--bm-comp-panel-shadow);position:fixed}.bm-panel--overlay.bm-panel--position-start{top:0;bottom:0;left:0}.bm-panel--overlay.bm-panel--position-end{top:0;bottom:0;right:0}.bm-panel--overlay.bm-panel--position-bottom{height:auto;bottom:0;left:0;right:0}.bm-panel--overlay.bm-panel--position-full{top:0;bottom:0;left:0;right:0}.bm-panel--size-full{width:100%}.bm-panel--padding-sm .bm-panel__header,.bm-panel--padding-sm .bm-panel__body,.bm-panel--padding-sm .bm-panel__footer{padding-left:var(--bm-comp-panel-space-x-sm);padding-right:var(--bm-comp-panel-space-x-sm)}.bm-panel--padding-md .bm-panel__header,.bm-panel--padding-md .bm-panel__body,.bm-panel--padding-md .bm-panel__footer{padding-left:var(--bm-comp-panel-space-x-md);padding-right:var(--bm-comp-panel-space-x-md)}.bm-panel__header{gap:var(--bm-comp-panel-space-header-gap-y);padding-top:var(--bm-comp-panel-space-header-pad-top);padding-bottom:var(--bm-comp-panel-space-header-pad-bottom);flex-direction:column;display:flex}.bm-panel__header__row{gap:var(--bm-comp-panel-space-header-gap-x);align-items:flex-start;display:flex}.bm-panel__header__content-before{gap:var(--bm-comp-panel-space-header-gap-x);flex-direction:row;display:flex}.bm-panel__header__content-after{gap:var(--bm-comp-panel-space-header-gap-x);align-items:flex-start;display:flex}.bm-panel__header__heading{font:var(--bm-comp-panel-typo-heading);color:var(--bm-comp-panel-color-heading);flex:1}.bm-panel__header__description{color:var(--bm-comp-panel-color-description)}.bm-panel__header__close-button{width:var(--bm-sem-size-icon-lg);height:var(--bm-sem-size-icon-lg);justify-content:center;align-items:center;display:flex}.bm-panel__body{font:var(--bm-comp-panel-typo-description);color:var(--bm-comp-panel-color-description);flex:1;overflow:auto}.bm-panel__footer{gap:var(--bm-comp-panel-space-footer-gap-actions);padding-top:var(--bm-comp-panel-space-footer-pad-top);padding-bottom:var(--bm-comp-panel-space-footer-pad-bottom);flex-direction:column;display:flex}.bm-panel__footer__actions{gap:var(--bm-comp-panel-space-footer-gap-actions);flex-wrap:wrap;flex-shrink:0;align-content:center;align-items:center;display:flex}.bm-panel__footer__actions--start{justify-content:flex-start}.bm-panel__footer__actions--end{justify-content:flex-end}.bm-panel__footer__actions--spaceBetween{justify-content:space-between}.bm-panel__footer__actions--stacked{justify-content:center;gap:var(--bm-comp-panel-space-footer-gap-actions-stack);flex-direction:column}.bm-panel__overlay-divider{position:absolute}.bm-panel__overlay-divider--start{top:0;bottom:0;right:0}.bm-panel__overlay-divider--end{top:0;bottom:0;left:0}.bm-panel__overlay-divider--bottom{top:0;left:0;right:0}.bm-panel--overlay[data-position=start]{transform:translate(-100%)}.bm-panel--overlay[data-position=start][data-status=open]{transition:transform .4s ease-out;transform:translate(0)}.bm-panel--overlay[data-position=start][data-status=close]{transition:transform .4s ease-in}.bm-panel--overlay[data-position=end]{transform:translate(100%)}.bm-panel--overlay[data-position=end][data-status=open]{transition:transform .4s ease-out;transform:translate(0)}.bm-panel--overlay[data-position=end][data-status=close]{transition:transform .4s ease-in}.bm-panel--overlay[data-position=bottom]{transform:translateY(100%)}.bm-panel--overlay[data-position=bottom][data-status=open]{transition:transform .4s ease-out;transform:translateY(0)}.bm-panel--overlay[data-position=bottom][data-status=close]{transition:transform .4s ease-in}.bm-panel--overlay[data-position=full]{opacity:0}.bm-panel--overlay[data-position=full][data-status=open]{opacity:1;transition:opacity .4s ease-out}.bm-panel--overlay[data-position=full][data-status=close]{transition:opacity .4s ease-in}.bm-panel__inline-wrapper{flex-shrink:0;overflow:hidden}.bm-panel__inline-wrapper[data-status]{width:0;transition:width .4s ease-in}.bm-panel__inline-wrapper[data-status=open]{width:20rem;transition:width .4s ease-out}.bm-panel__inline-wrapper[data-position=bottom][data-status]{width:100%}.bm-panel__inline-wrapper[data-position=bottom][data-status] .bm-panel__inline-wrapper-content{transition:transform .4s ease-in;transform:translateY(100%)}.bm-panel__inline-wrapper[data-position=bottom][data-status=open] .bm-panel__inline-wrapper-content{transition:transform .4s ease-out;transform:translateY(0)}.bm-panel__inline-wrapper--full[data-status=open]{width:100%}.bm-panel__inline-wrapper-content{height:100%}
|
|
1
|
+
:root,:host,.bm-light,.bm-dark .bm-inverse,[data-bm-theme~=bm-light]{--bm-comp-panel-size-sm:20rem;--bm-comp-panel-size-md:27.5rem;--bm-comp-panel-size-lg:40rem;--bm-comp-panel-space-x-sm:var(--bm-sem-space-100,1rem);--bm-comp-panel-space-x-md:var(--bm-sem-space-150,1.5rem);--bm-comp-panel-space-header-pad-top:var(--bm-sem-space-125,1.25rem);--bm-comp-panel-space-header-pad-bottom:var(--bm-sem-space-100,1rem);--bm-comp-panel-space-header-gap-y:var(--bm-sem-space-25,.25rem);--bm-comp-panel-space-header-gap-x:var(--bm-sem-space-50,.5rem);--bm-comp-panel-space-footer-pad-top:var(--bm-sem-space-100,1rem);--bm-comp-panel-space-footer-pad-bottom:var(--bm-sem-space-125,1.25rem);--bm-comp-panel-space-footer-gap-actions:var(--bm-sem-space-50,.5rem);--bm-comp-panel-space-footer-gap-actions-stack:var(--bm-sem-space-100,1rem);--bm-comp-panel-radius:var(--bm-sem-radius-lg,1rem);--bm-comp-panel-shadow:var(--bm-sem-shadow-overlay,0 .25rem .75rem .125rem #0000001f);--bm-comp-panel-typo-heading:var(--bm-sem-typo-heading-sm,700 1.125rem/1.5rem "Uni Neue");--bm-comp-panel-typo-description:var(--bm-sem-typo-body-sm,400 .875rem/1.25rem "Source Sans Pro");--bm-comp-panel-color-heading:var(--bm-sem-color-text-primary,#141d24);--bm-comp-panel-color-description:var(--bm-sem-color-text-secondary,#576775)}:host,.bm-dark,.bm-light .bm-inverse,[data-bm-theme~=bm-dark]{--bm-comp-panel-size-sm:20rem;--bm-comp-panel-size-md:27.5rem;--bm-comp-panel-size-lg:40rem;--bm-comp-panel-space-x-sm:var(--bm-sem-space-100,1rem);--bm-comp-panel-space-x-md:var(--bm-sem-space-150,1.5rem);--bm-comp-panel-space-header-pad-top:var(--bm-sem-space-125,1.25rem);--bm-comp-panel-space-header-pad-bottom:var(--bm-sem-space-100,1rem);--bm-comp-panel-space-header-gap-y:var(--bm-sem-space-25,.25rem);--bm-comp-panel-space-header-gap-x:var(--bm-sem-space-50,.5rem);--bm-comp-panel-space-footer-pad-top:var(--bm-sem-space-100,1rem);--bm-comp-panel-space-footer-pad-bottom:var(--bm-sem-space-125,1.25rem);--bm-comp-panel-space-footer-gap-actions:var(--bm-sem-space-50,.5rem);--bm-comp-panel-space-footer-gap-actions-stack:var(--bm-sem-space-100,1rem);--bm-comp-panel-radius:var(--bm-sem-radius-lg,1rem);--bm-comp-panel-shadow:var(--bm-sem-shadow-overlay,0 .25rem .75rem .125rem #0000004d);--bm-comp-panel-typo-heading:var(--bm-sem-typo-heading-sm,700 1.125rem/1.5rem "Uni Neue");--bm-comp-panel-typo-description:var(--bm-sem-typo-body-sm,400 .875rem/1.25rem "Source Sans Pro");--bm-comp-panel-color-heading:var(--bm-sem-color-text-primary,#fff);--bm-comp-panel-color-description:var(--bm-sem-color-text-secondary,#c3cdd5)}.bm-panel{background-color:var(--bm-sem-color-surface-01);flex-direction:column;width:20rem;display:flex}.bm-panel--inline{height:100%;box-shadow:var(--bm-sem-shadow-none);position:relative}.bm-panel--overlay{box-shadow:var(--bm-comp-panel-shadow);position:fixed}.bm-panel--overlay.bm-panel--position-start{top:0;bottom:0;left:0}.bm-panel--overlay.bm-panel--position-end{top:0;bottom:0;right:0}.bm-panel--overlay.bm-panel--position-bottom{height:auto;bottom:0;left:0;right:0}.bm-panel--overlay.bm-panel--position-full{top:0;bottom:0;left:0;right:0}.bm-panel--size-full{width:100%}.bm-panel--padding-sm .bm-panel__header,.bm-panel--padding-sm .bm-panel__body,.bm-panel--padding-sm .bm-panel__footer{padding-left:var(--bm-comp-panel-space-x-sm);padding-right:var(--bm-comp-panel-space-x-sm)}.bm-panel--padding-md .bm-panel__header,.bm-panel--padding-md .bm-panel__body,.bm-panel--padding-md .bm-panel__footer{padding-left:var(--bm-comp-panel-space-x-md);padding-right:var(--bm-comp-panel-space-x-md)}.bm-panel__header{gap:var(--bm-comp-panel-space-header-gap-y);padding-top:var(--bm-comp-panel-space-header-pad-top);padding-bottom:var(--bm-comp-panel-space-header-pad-bottom);flex-direction:column;display:flex}.bm-panel__header__row{gap:var(--bm-comp-panel-space-header-gap-x);align-items:flex-start;display:flex}.bm-panel__header__content-before{gap:var(--bm-comp-panel-space-header-gap-x);flex-direction:row;display:flex}.bm-panel__header__content-after{gap:var(--bm-comp-panel-space-header-gap-x);align-items:flex-start;display:flex}.bm-panel__header__heading{font:var(--bm-comp-panel-typo-heading);color:var(--bm-comp-panel-color-heading);flex:1}.bm-panel__header__description{font:var(--bm-comp-panel-typo-description);color:var(--bm-comp-panel-color-description)}.bm-panel__header__close-button{width:var(--bm-sem-size-icon-lg);height:var(--bm-sem-size-icon-lg);justify-content:center;align-items:center;display:flex}.bm-panel__body{font:var(--bm-comp-panel-typo-description);color:var(--bm-comp-panel-color-description);flex:1;overflow:auto}.bm-panel__footer{gap:var(--bm-comp-panel-space-footer-gap-actions);padding-top:var(--bm-comp-panel-space-footer-pad-top);padding-bottom:var(--bm-comp-panel-space-footer-pad-bottom);flex-direction:column;display:flex}.bm-panel__footer__actions{gap:var(--bm-comp-panel-space-footer-gap-actions);flex-wrap:wrap;flex-shrink:0;align-content:center;align-items:center;display:flex}.bm-panel__footer__actions--start{justify-content:flex-start}.bm-panel__footer__actions--end{justify-content:flex-end}.bm-panel__footer__actions--spaceBetween{justify-content:space-between}.bm-panel__footer__actions--stacked{justify-content:center;gap:var(--bm-comp-panel-space-footer-gap-actions-stack);flex-direction:column}.bm-panel__overlay-divider{position:absolute}.bm-panel__overlay-divider--start{top:0;bottom:0;right:0}.bm-panel__overlay-divider--end{top:0;bottom:0;left:0}.bm-panel__overlay-divider--bottom{top:0;left:0;right:0}.bm-panel--overlay[data-position=start]{transform:translate(-100%)}.bm-panel--overlay[data-position=start][data-status=open]{transition:transform .4s ease-out;transform:translate(0)}.bm-panel--overlay[data-position=start][data-status=close]{transition:transform .4s ease-in}.bm-panel--overlay[data-position=end]{transform:translate(100%)}.bm-panel--overlay[data-position=end][data-status=open]{transition:transform .4s ease-out;transform:translate(0)}.bm-panel--overlay[data-position=end][data-status=close]{transition:transform .4s ease-in}.bm-panel--overlay[data-position=bottom]{transform:translateY(100%)}.bm-panel--overlay[data-position=bottom][data-status=open]{transition:transform .4s ease-out;transform:translateY(0)}.bm-panel--overlay[data-position=bottom][data-status=close]{transition:transform .4s ease-in}.bm-panel--overlay[data-position=full]{opacity:0}.bm-panel--overlay[data-position=full][data-status=open]{opacity:1;transition:opacity .4s ease-out}.bm-panel--overlay[data-position=full][data-status=close]{transition:opacity .4s ease-in}.bm-panel__inline-wrapper{flex-shrink:0;overflow:hidden}.bm-panel__inline-wrapper[data-status]{width:0;transition:width .4s ease-in}.bm-panel__inline-wrapper[data-status=open]{width:20rem;transition:width .4s ease-out}.bm-panel__inline-wrapper[data-position=bottom][data-status]{width:100%}.bm-panel__inline-wrapper[data-position=bottom][data-status] .bm-panel__inline-wrapper-content{transition:transform .4s ease-in;transform:translateY(100%)}.bm-panel__inline-wrapper[data-position=bottom][data-status=open] .bm-panel__inline-wrapper-content{transition:transform .4s ease-out;transform:translateY(0)}.bm-panel__inline-wrapper--full[data-status=open]{width:100%}.bm-panel__inline-wrapper-content{height:100%}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const h=require("react"),U=require("@floating-ui/dom"),G=require("@floating-ui/react"),J=require("../lib/FloatingUI/FloatingUI.interactions.cjs.js"),T=Math.min,K=Math.max,Q={left:"right",right:"left",bottom:"top",top:"bottom"};function Z(t,e,i){return K(t,T(e,i))}function w(t,e){return typeof t=="function"?t(e):t}function V(t){return t.split("-")[0]}function tt(t){return t.split("-")[1]}function Y(t){return t==="x"?"y":"x"}function et(t){return t==="y"?"height":"width"}function nt(t){return["top","bottom"].includes(V(t))?"y":"x"}function ot(t){return Y(nt(t))}function st(t){return t.replace(/left|right|bottom|top/g,e=>Q[e])}function it(t){return{top:0,right:0,bottom:0,left:0,...t}}function ct(t){return typeof t!="number"?it(t):{top:t,right:t,bottom:t,left:t}}const lt=16,rt=t=>{var e;return{visibility:(e=t.hide)!=null&&e.referenceHidden?"hidden":"visible"}},ut=t=>({name:"arrowStyles",options:t,async fn(e){var _,W;const{x:i,y:c,placement:r,rects:s,platform:n,elements:d,middlewareData:g}=e,{element:u,padding:f=0}=w(t,e)||{};if(u==null)return{};const P=ct(f),I={x:i,y:c},l=ot(r),C=Y(l),m=et(l),a=await n.getDimensions(u),y=l==="y",v=y?"top":"left",o=y?"bottom":"right",$=y?"clientHeight":"clientWidth",E=s.reference[m]+s.reference[l]-I[l]-s.floating[m],L=I[l]-s.reference[l],A=await((_=n.getOffsetParent)==null?void 0:_.call(n,u));let x=A?A[$]:0;(!x||!await((W=n.isElement)==null?void 0:W.call(n,A)))&&(x=d.floating[$]||s.floating[m]);const N=E/2-L/2,D=x/2-a.width/2-1,z=T(P[v],D),j=T(P[o],D),S=z,B=x-a.width-j,p=x/2-a.width/2+N,b=Z(S,p,B),O=!g.arrow&&tt(r)!=null&&p!==b&&s.reference[m]/2-(p<S?z:j)-a.width/2<0,F=O?p<S?p-S:p-B:0,q=V(r),M=["top","left"].includes(q)?-1:1,X=a.height*M,R=at({placement:q,arrowHeight:a.height,arrowWidth:a.width,[l]:b});return{[l]:I[l]+F,[C]:I[C]+X,data:R,reset:O}}}),H=(t,e,i,c)=>{if(c){const r=c===!0?i():i(c);t[e](r)}},ft=({baseConfig:t,middleware:e,offset:i,arrow:c,placement:r="top"})=>{const s={...t,placement:r};let n=[];if(typeof e.overrides!="object"){n.push(U.offset(i));let d=e.flip??!0;if(e.autoPlacement&&(d=!1),H(n,"unshift",U.autoPlacement,e.autoPlacement),H(n,"unshift",U.flip,d),e.size){const g=e.size===!0?{padding:lt,apply({availableHeight:u,elements:f}){Object.assign(f.floating.style,{maxHeight:`${u}px`})}}:e.size;n.push(U.size(g))}H(n,"push",U.shift,e.shift??!0),H(n,"push",U.hide,e.hide??!0)}else n.push(...e.overrides);return c.hide||n.push(ut(c.options)),typeof e.overrides=="function"&&(n=e.overrides(n)),s.middleware=n,s},at=({placement:t,arrowHeight:e,arrowWidth:i,x:c,y:r})=>{const s=V(t),n=i/2-e,d={top:"rotate(0deg)",bottom:"rotate(180deg)",left:`rotate(-90deg) translateX(${-n}px)`,right:`rotate(90deg) translateX(${n}px)`}[s],g=-i/2-e,u={top:`${-e}px`,bottom:`${-e*2}px`,left:`${g}px`,right:`${g}px`}[s],f={transform:d};f.left=c!=null?`${c}px`:"",f.top=r!=null?`${r}px`:"";const P=st(s);return f[P]=u,f},dt=({defaultOpen:t=!1,open:e,placement:i="top",offset:c,onOpenChange:r,openOnClick:s,openOnHover:n,openOnFocus:d,openOnSelected:g,focusConfiguration:u,listNavigation:f,typeahead:P,dismiss:I,middleware:l,autoPlacement:C,flip:m=!0,shift:a=!0,autoHiding:y,size:v,arrow:o,transitionConfig:$,portalled:E,role:L,rootContext:A})=>{const[x,N]=h.useState(t),[D,z]=h.useState(),[j,S]=h.useState(),[B,p]=h.useState(null),b=e??x,O=r??N,F=G.useFloatingNodeId(),q=h.useMemo(()=>{const _={open:b,onOpenChange:O,whileElementsMounted:G.autoUpdate,nodeId:F,rootContext:A};return{...ft({baseConfig:_,middleware:{overrides:l,autoPlacement:C,flip:m,shift:a,hide:y,size:v},arrow:{hide:(o==null?void 0:o.hide)??!1,options:{element:B||null,padding:o==null?void 0:o.edgePadding}},placement:i,offset:c??0})}},[F,b,O,l,C,m,a,y,v,o==null?void 0:o.hide,o==null?void 0:o.edgePadding,B,i,c,A]),M=G.useFloating(q),X=M.context,R=J.useConfigurableInteractions({context:X,openOnClick:s,openOnHover:n,openOnFocus:d,openOnSelected:g,role:L,listNavigation:f,typeahead:P,dismiss:I});return h.useMemo(()=>({open:b,setOpen:O,...R,...M,portalled:E,focusConfiguration:u,transitionConfig:$,labelId:D,descriptionId:j,arrow:o,setLabelId:z,setDescriptionId:S,setArrowEl:p,nodeId:F}),[b,O,R,M,E,u,$,D,j,o,F])},k=h.createContext(null),gt=()=>{const t=h.useContext(k);if(t==null)throw new Error("FloatingUI components must be wrapped in <FloatingUI />");return t};exports.BmFloatingUIContext=k;exports.useBmFloatingUI=dt;exports.useBmFloatingUIContext=gt;exports.visibilityHandler=rt;
|
|
@@ -2,19 +2,19 @@ import h from "react";
|
|
|
2
2
|
import { offset as Y, size as k, autoPlacement as q, flip as J, shift as K, hide as Q } from "@floating-ui/dom";
|
|
3
3
|
import { useFloatingNodeId as Z, useFloating as w, autoUpdate as tt } from "@floating-ui/react";
|
|
4
4
|
import { useConfigurableInteractions as et } from "../lib/FloatingUI/FloatingUI.interactions.es.js";
|
|
5
|
-
const
|
|
5
|
+
const H = Math.min, nt = Math.max, ot = {
|
|
6
6
|
left: "right",
|
|
7
7
|
right: "left",
|
|
8
8
|
bottom: "top",
|
|
9
9
|
top: "bottom"
|
|
10
10
|
};
|
|
11
11
|
function st(t, e, i) {
|
|
12
|
-
return nt(t,
|
|
12
|
+
return nt(t, H(e, i));
|
|
13
13
|
}
|
|
14
14
|
function it(t, e) {
|
|
15
15
|
return typeof t == "function" ? t(e) : t;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function T(t) {
|
|
18
18
|
return t.split("-")[0];
|
|
19
19
|
}
|
|
20
20
|
function ct(t) {
|
|
@@ -27,7 +27,7 @@ function rt(t) {
|
|
|
27
27
|
return t === "y" ? "height" : "width";
|
|
28
28
|
}
|
|
29
29
|
function lt(t) {
|
|
30
|
-
return ["top", "bottom"].includes(
|
|
30
|
+
return ["top", "bottom"].includes(T(t)) ? "y" : "x";
|
|
31
31
|
}
|
|
32
32
|
function ft(t) {
|
|
33
33
|
return W(lt(t));
|
|
@@ -61,31 +61,31 @@ const dt = 16, At = (t) => {
|
|
|
61
61
|
name: "arrowStyles",
|
|
62
62
|
options: t,
|
|
63
63
|
async fn(e) {
|
|
64
|
-
var
|
|
65
|
-
const { x: i, y: c, placement: l, rects: s, platform: n, elements:
|
|
66
|
-
if (
|
|
64
|
+
var G, V;
|
|
65
|
+
const { x: i, y: c, placement: l, rects: s, platform: n, elements: p, middlewareData: d } = e, { element: f, padding: u = 0 } = it(t, e) || {};
|
|
66
|
+
if (f == null)
|
|
67
67
|
return {};
|
|
68
|
-
const
|
|
69
|
-
let
|
|
70
|
-
(!
|
|
71
|
-
const
|
|
72
|
-
placement:
|
|
73
|
-
arrowHeight:
|
|
74
|
-
arrowWidth:
|
|
68
|
+
const P = pt(u), y = { x: i, y: c }, r = ft(l), $ = W(r), m = rt(r), a = await n.getDimensions(f), A = r === "y", v = A ? "top" : "left", o = A ? "bottom" : "right", D = A ? "clientHeight" : "clientWidth", E = s.reference[m] + s.reference[r] - y[r] - s.floating[m], N = y[r] - s.reference[r], I = await ((G = n.getOffsetParent) == null ? void 0 : G.call(n, f));
|
|
69
|
+
let x = I ? I[D] : 0;
|
|
70
|
+
(!x || !await ((V = n.isElement) == null ? void 0 : V.call(n, I))) && (x = p.floating[D] || s.floating[m]);
|
|
71
|
+
const X = E / 2 - N / 2, F = x / 2 - a.width / 2 - 1, z = H(P[v], F), U = H(P[o], F), S = z, j = x - a.width - U, g = x / 2 - a.width / 2 + X, b = st(S, g, j), O = !d.arrow && ct(l) != null && g !== b && s.reference[m] / 2 - (g < S ? z : U) - a.width / 2 < 0, C = O ? g < S ? g - S : g - j : 0, B = T(l), M = ["top", "left"].includes(B) ? -1 : 1, _ = a.height * M, R = mt({
|
|
72
|
+
placement: B,
|
|
73
|
+
arrowHeight: a.height,
|
|
74
|
+
arrowWidth: a.width,
|
|
75
75
|
// pass arrow middleware
|
|
76
|
-
[r]:
|
|
76
|
+
[r]: b
|
|
77
77
|
// for posterity, this is what the floating-ui arrow middleware returns
|
|
78
78
|
// centerOffset: center - offset - alignmentOffset,
|
|
79
79
|
// ...(shouldAddOffset && { alignmentOffset }),
|
|
80
80
|
});
|
|
81
81
|
return {
|
|
82
|
-
[r]:
|
|
83
|
-
[
|
|
84
|
-
data:
|
|
85
|
-
reset:
|
|
82
|
+
[r]: y[r] + C,
|
|
83
|
+
[$]: y[$] + _,
|
|
84
|
+
data: R,
|
|
85
|
+
reset: O
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
|
-
}),
|
|
88
|
+
}), L = (t, e, i, c) => {
|
|
89
89
|
if (c) {
|
|
90
90
|
const l = c === !0 ? i() : i(c);
|
|
91
91
|
t[e](l);
|
|
@@ -101,24 +101,24 @@ const dt = 16, At = (t) => {
|
|
|
101
101
|
let n = [];
|
|
102
102
|
if (typeof e.overrides != "object") {
|
|
103
103
|
n.push(Y(i));
|
|
104
|
-
let
|
|
105
|
-
if (e.autoPlacement && (
|
|
104
|
+
let p = e.flip ?? !0;
|
|
105
|
+
if (e.autoPlacement && (p = !1), L(
|
|
106
106
|
n,
|
|
107
107
|
"unshift",
|
|
108
108
|
q,
|
|
109
109
|
e.autoPlacement
|
|
110
|
-
),
|
|
111
|
-
const
|
|
110
|
+
), L(n, "unshift", J, p), e.size) {
|
|
111
|
+
const d = e.size === !0 ? {
|
|
112
112
|
padding: dt,
|
|
113
|
-
apply({ availableHeight:
|
|
114
|
-
Object.assign(
|
|
115
|
-
maxHeight: `${
|
|
113
|
+
apply({ availableHeight: f, elements: u }) {
|
|
114
|
+
Object.assign(u.floating.style, {
|
|
115
|
+
maxHeight: `${f}px`
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
118
|
} : e.size;
|
|
119
|
-
n.push(k(
|
|
119
|
+
n.push(k(d));
|
|
120
120
|
}
|
|
121
|
-
|
|
121
|
+
L(n, "push", K, e.shift ?? !0), L(n, "push", Q, e.hide ?? !0);
|
|
122
122
|
} else
|
|
123
123
|
n.push(...e.overrides);
|
|
124
124
|
return c.hide || n.push(gt(c.options)), typeof e.overrides == "function" && (n = e.overrides(n)), s.middleware = n, s;
|
|
@@ -129,7 +129,7 @@ const dt = 16, At = (t) => {
|
|
|
129
129
|
x: c,
|
|
130
130
|
y: l
|
|
131
131
|
}) => {
|
|
132
|
-
const s =
|
|
132
|
+
const s = T(t), n = i / 2 - e, p = {
|
|
133
133
|
/* since the default orientation is pointing down, we don't need to rotate the arrow
|
|
134
134
|
if the tooltip is on top of the reference element
|
|
135
135
|
*/
|
|
@@ -157,7 +157,7 @@ const dt = 16, At = (t) => {
|
|
|
157
157
|
*/
|
|
158
158
|
left: `rotate(-90deg) translateX(${-n}px)`,
|
|
159
159
|
right: `rotate(90deg) translateX(${n}px)`
|
|
160
|
-
}[s],
|
|
160
|
+
}[s], d = -i / 2 - e, f = {
|
|
161
161
|
/*
|
|
162
162
|
* If the tooltip is at the top of the anchor, place the arrow at the bottom of
|
|
163
163
|
* the tooltip with bottom: 0. The bottom of the arrow will be flush with the bottom
|
|
@@ -199,15 +199,15 @@ const dt = 16, At = (t) => {
|
|
|
199
199
|
* | .. | | *
|
|
200
200
|
* | | |/
|
|
201
201
|
*/
|
|
202
|
-
left: `${
|
|
202
|
+
left: `${d}px`,
|
|
203
203
|
// similarly for the right side
|
|
204
|
-
right: `${
|
|
205
|
-
}[s],
|
|
206
|
-
transform:
|
|
204
|
+
right: `${d}px`
|
|
205
|
+
}[s], u = {
|
|
206
|
+
transform: p
|
|
207
207
|
};
|
|
208
|
-
|
|
209
|
-
const
|
|
210
|
-
return
|
|
208
|
+
u.left = c != null ? `${c}px` : "", u.top = l != null ? `${l}px` : "";
|
|
209
|
+
const P = ut(s);
|
|
210
|
+
return u[P] = f, u;
|
|
211
211
|
}, It = ({
|
|
212
212
|
defaultOpen: t = !1,
|
|
213
213
|
open: e,
|
|
@@ -217,46 +217,47 @@ const dt = 16, At = (t) => {
|
|
|
217
217
|
onOpenChange: l,
|
|
218
218
|
openOnClick: s,
|
|
219
219
|
openOnHover: n,
|
|
220
|
-
openOnFocus:
|
|
221
|
-
openOnSelected:
|
|
222
|
-
focusConfiguration:
|
|
223
|
-
listNavigation:
|
|
224
|
-
typeahead:
|
|
220
|
+
openOnFocus: p,
|
|
221
|
+
openOnSelected: d,
|
|
222
|
+
focusConfiguration: f,
|
|
223
|
+
listNavigation: u,
|
|
224
|
+
typeahead: P,
|
|
225
|
+
dismiss: y,
|
|
225
226
|
// Floating UI Middlewares
|
|
226
|
-
middleware:
|
|
227
|
-
autoPlacement:
|
|
228
|
-
flip:
|
|
229
|
-
shift:
|
|
230
|
-
autoHiding:
|
|
231
|
-
size:
|
|
227
|
+
middleware: r,
|
|
228
|
+
autoPlacement: $,
|
|
229
|
+
flip: m = !0,
|
|
230
|
+
shift: a = !0,
|
|
231
|
+
autoHiding: A,
|
|
232
|
+
size: v,
|
|
232
233
|
// Floating UI Arrow
|
|
233
234
|
arrow: o,
|
|
234
|
-
transitionConfig:
|
|
235
|
-
portalled:
|
|
236
|
-
role:
|
|
237
|
-
rootContext:
|
|
235
|
+
transitionConfig: D,
|
|
236
|
+
portalled: E,
|
|
237
|
+
role: N,
|
|
238
|
+
rootContext: I
|
|
238
239
|
}) => {
|
|
239
|
-
const [
|
|
240
|
+
const [x, X] = h.useState(t), [F, z] = h.useState(), [U, S] = h.useState(), [j, g] = h.useState(null), b = e ?? x, O = l ?? X, C = Z(), B = h.useMemo(() => ({
|
|
240
241
|
...ht({
|
|
241
242
|
baseConfig: {
|
|
242
|
-
open:
|
|
243
|
-
onOpenChange:
|
|
243
|
+
open: b,
|
|
244
|
+
onOpenChange: O,
|
|
244
245
|
whileElementsMounted: tt,
|
|
245
|
-
nodeId:
|
|
246
|
-
rootContext:
|
|
246
|
+
nodeId: C,
|
|
247
|
+
rootContext: I
|
|
247
248
|
},
|
|
248
249
|
middleware: {
|
|
249
|
-
overrides:
|
|
250
|
-
autoPlacement:
|
|
251
|
-
flip:
|
|
252
|
-
shift:
|
|
253
|
-
hide:
|
|
254
|
-
size:
|
|
250
|
+
overrides: r,
|
|
251
|
+
autoPlacement: $,
|
|
252
|
+
flip: m,
|
|
253
|
+
shift: a,
|
|
254
|
+
hide: A,
|
|
255
|
+
size: v
|
|
255
256
|
},
|
|
256
257
|
arrow: {
|
|
257
258
|
hide: (o == null ? void 0 : o.hide) ?? !1,
|
|
258
259
|
options: {
|
|
259
|
-
element:
|
|
260
|
+
element: j || null,
|
|
260
261
|
padding: o == null ? void 0 : o.edgePadding
|
|
261
262
|
}
|
|
262
263
|
},
|
|
@@ -264,60 +265,61 @@ const dt = 16, At = (t) => {
|
|
|
264
265
|
offset: c ?? 0
|
|
265
266
|
})
|
|
266
267
|
}), [
|
|
267
|
-
y,
|
|
268
|
-
f,
|
|
269
|
-
P,
|
|
270
|
-
m,
|
|
271
|
-
r,
|
|
272
268
|
C,
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
269
|
+
b,
|
|
270
|
+
O,
|
|
271
|
+
r,
|
|
272
|
+
$,
|
|
273
|
+
m,
|
|
274
|
+
a,
|
|
275
|
+
A,
|
|
276
|
+
v,
|
|
276
277
|
o == null ? void 0 : o.hide,
|
|
277
278
|
o == null ? void 0 : o.edgePadding,
|
|
278
|
-
|
|
279
|
+
j,
|
|
279
280
|
i,
|
|
280
281
|
c,
|
|
281
|
-
|
|
282
|
-
]),
|
|
283
|
-
context:
|
|
282
|
+
I
|
|
283
|
+
]), M = w(B), _ = M.context, R = et({
|
|
284
|
+
context: _,
|
|
284
285
|
openOnClick: s,
|
|
285
286
|
openOnHover: n,
|
|
286
|
-
openOnFocus:
|
|
287
|
-
openOnSelected:
|
|
288
|
-
role:
|
|
289
|
-
listNavigation:
|
|
290
|
-
typeahead:
|
|
287
|
+
openOnFocus: p,
|
|
288
|
+
openOnSelected: d,
|
|
289
|
+
role: N,
|
|
290
|
+
listNavigation: u,
|
|
291
|
+
typeahead: P,
|
|
292
|
+
dismiss: y
|
|
291
293
|
});
|
|
292
294
|
return h.useMemo(
|
|
293
295
|
() => ({
|
|
294
|
-
open:
|
|
295
|
-
setOpen:
|
|
296
|
-
...
|
|
297
|
-
...
|
|
298
|
-
portalled:
|
|
299
|
-
focusConfiguration:
|
|
300
|
-
transitionConfig:
|
|
301
|
-
labelId:
|
|
302
|
-
descriptionId:
|
|
296
|
+
open: b,
|
|
297
|
+
setOpen: O,
|
|
298
|
+
...R,
|
|
299
|
+
...M,
|
|
300
|
+
portalled: E,
|
|
301
|
+
focusConfiguration: f,
|
|
302
|
+
transitionConfig: D,
|
|
303
|
+
labelId: F,
|
|
304
|
+
descriptionId: U,
|
|
303
305
|
arrow: o,
|
|
304
|
-
setLabelId:
|
|
305
|
-
setDescriptionId:
|
|
306
|
-
setArrowEl:
|
|
307
|
-
nodeId:
|
|
306
|
+
setLabelId: z,
|
|
307
|
+
setDescriptionId: S,
|
|
308
|
+
setArrowEl: g,
|
|
309
|
+
nodeId: C
|
|
308
310
|
}),
|
|
309
311
|
[
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
S,
|
|
314
|
-
$,
|
|
315
|
-
u,
|
|
316
|
-
U,
|
|
312
|
+
b,
|
|
313
|
+
O,
|
|
314
|
+
R,
|
|
317
315
|
M,
|
|
316
|
+
E,
|
|
317
|
+
f,
|
|
318
|
+
D,
|
|
318
319
|
F,
|
|
320
|
+
U,
|
|
319
321
|
o,
|
|
320
|
-
|
|
322
|
+
C
|
|
321
323
|
]
|
|
322
324
|
);
|
|
323
325
|
}, xt = h.createContext(null), St = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("clsx"),x=require("react"),q=require("../../chunks/CheckCircleOutline.iRHrT_Eb.js"),y=require("../../chunks/ErrorOutline.Cb78OesH.js"),E=require("../../chunks/InfoOutline.Gr8gkm5N.js"),I=require("../../chunks/WarningOutlined.BPePPeyt.js"),u=require("../../chunks/classNames.DAeKwerT.js");require("../../chunks/constants.hwjHOsvT.js");const i=require("../../chunks/dialog.module.COfowyPc.js"),$=require("../Tooltip/Tooltip.cjs.js"),B=require("../CloseButton/CloseButton.cjs.js"),O=require("../../chunks/FloatingUI.context.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("clsx"),x=require("react"),q=require("../../chunks/CheckCircleOutline.iRHrT_Eb.js"),y=require("../../chunks/ErrorOutline.Cb78OesH.js"),E=require("../../chunks/InfoOutline.Gr8gkm5N.js"),I=require("../../chunks/WarningOutlined.BPePPeyt.js"),u=require("../../chunks/classNames.DAeKwerT.js");require("../../chunks/constants.hwjHOsvT.js");const i=require("../../chunks/dialog.module.COfowyPc.js"),$=require("../Tooltip/Tooltip.cjs.js"),B=require("../CloseButton/CloseButton.cjs.js"),O=require("../../chunks/FloatingUI.context.B15Tz_4h.js"),S=require("./Dialog.context.cjs.js"),c={positive:"Success",warning:"Warning",negative:"Error",information:"Information"},k=({icon:t,appearance:l,iconAriaLabel:s})=>{const o=x.useMemo(()=>({positive:e.jsx(q.SvgCheckCircleOutline,{role:"img","aria-label":s||c.positive}),warning:e.jsx(I.SvgWarningOutlined,{role:"img","aria-label":s||c.warning}),negative:e.jsx(y.SvgErrorOutline,{role:"img","aria-label":s||c.negative}),information:e.jsx(E.SvgInfoOutline,{role:"img","aria-label":s||c.information})}),[s]),{subElementClassPrefix:r}=u.getBEMClassNames("dialog__header"),a=m(i.styles[`${r}icon`],l&&i.styles[`${r}icon--${l}`]);return!t&&!l?null:e.jsx("div",{className:a,children:t||(l?o[l]:null)})},w=({ariaLabel:t="Close dialog"})=>{const{subElementClassPrefix:l}=u.getBEMClassNames("dialog__header"),{setOpen:s}=O.useBmFloatingUIContext(),o=x.useCallback(r=>{s==null||s(!1,r,"click")},[s]);return e.jsx("div",{className:i.styles[`${l}close-trigger`],children:e.jsx($.Tooltip,{text:t,children:e.jsx(B.CloseButton,{"aria-label":t,size:"lg",onClick:o})})})},C=({children:t,className:l,dismissible:s=!0,appearance:o,closeButtonAriaLabel:r="Close dialog",heading:a,description:g,icon:f,iconAriaLabel:h,divider:d=!0,disableDividerOnOverflow:j=!1,...v})=>{const{baseClassNamePrefix:_,subElementClassPrefix:n}=u.getBEMClassNames("dialog__header"),{overflowing:N}=S.useDialogContext(),b=d===!0||d===!1&&!j&&N;return e.jsxs("div",{className:m(i.styles[_],l),...v,children:[e.jsxs("div",{className:i.styles[`${n}row`],children:[e.jsx(k,{icon:f,appearance:o,iconAriaLabel:h}),a&&e.jsx("h2",{className:i.styles[`${n}heading`],children:a}),s&&e.jsx(w,{ariaLabel:r})]}),g&&e.jsx("p",{className:i.styles[`${n}description`],children:g}),t&&e.jsx("div",{className:i.styles[`${n}children`],children:t}),b&&e.jsx("hr",{"aria-hidden":"true",className:i.styles[`${n}divider`]})]})};C.displayName="Dialog.Header";exports.Header=C;
|
|
@@ -10,7 +10,7 @@ import "../../chunks/constants.CKKGf1-i.js";
|
|
|
10
10
|
import { s as r } from "../../chunks/dialog.module.D6BI3ubv.js";
|
|
11
11
|
import { Tooltip as k } from "../Tooltip/Tooltip.es.js";
|
|
12
12
|
import { CloseButton as B } from "../CloseButton/CloseButton.es.js";
|
|
13
|
-
import { a as P } from "../../chunks/FloatingUI.context.
|
|
13
|
+
import { a as P } from "../../chunks/FloatingUI.context.Dl4Y1y1z.js";
|
|
14
14
|
import { useDialogContext as D } from "./Dialog.context.es.js";
|
|
15
15
|
const m = {
|
|
16
16
|
positive: "Success",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime");require("../../chunks/FloatingUI.context.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime");require("../../chunks/FloatingUI.context.B15Tz_4h.js");const l=require("../FloatingUI/FloatingUI.trigger.cjs.js"),t=require("../FloatingUI/FloatingUI.trigger.close.cjs.js");require("../FloatingUI/FloatingUI.content.cjs.js");require("react");const g=({children:e,...r})=>i.jsx(l.Trigger,{...r,children:e});g.displayName="Dialog.Trigger";const o=({children:e,...r})=>i.jsx(t.CloseTrigger,{...r,children:e});o.displayName="Dialog.CloseTrigger";exports.CloseTrigger=o;exports.Trigger=g;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import "../../chunks/FloatingUI.context.
|
|
2
|
+
import "../../chunks/FloatingUI.context.Dl4Y1y1z.js";
|
|
3
3
|
import { Trigger as o } from "../FloatingUI/FloatingUI.trigger.es.js";
|
|
4
4
|
import { CloseTrigger as e } from "../FloatingUI/FloatingUI.trigger.close.es.js";
|
|
5
5
|
import "../FloatingUI/FloatingUI.content.es.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),x=require("../../chunks/FloatingUI.context.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),x=require("../../chunks/FloatingUI.context.B15Tz_4h.js"),f=require("react"),i=require("@floating-ui/react"),m=require("../../chunks/classNames.DAeKwerT.js");require("../../chunks/constants.hwjHOsvT.js");const b=require("clsx"),d=require("../../chunks/floatingui.module.D3Aw_aYe.js"),w=require("../Box/Box.cjs.js"),N=require("./FloatingUI.arrow.cjs.js");function S({children:o,props:e}){if(!e)return o;const t=typeof e=="boolean"?{}:e;return a.jsx(i.FloatingPortal,{...t,children:o})}function v({children:o,props:e}){if(!e)return o;const t=typeof e=="boolean",r=e==="transparent",{baseClassNamePrefix:l,classModifierPrefix:c}=m.getBEMClassNames("floatingui__overlay"),u={className:b(d.floatinguiStyles[l],r&&d.floatinguiStyles[`${c}transparent`]),lockScroll:!0},s=t||r?u:{...u,...e};return a.jsx(i.FloatingOverlay,{...s,children:o})}function B({children:o,context:e,props:t}){const r=f.useMemo(()=>({context:e,...typeof t=="boolean"?{}:t}),[e,t]);return t?a.jsx(i.FloatingFocusManager,{...r,children:o}):o}const y=f.forwardRef(({children:o,className:e,style:t,overlay:r,skipFloatingStyles:l=!1,...c},u)=>{const{context:s,nodeId:C,arrow:g,...n}=x.useBmFloatingUIContext(),P=i.useMergeRefs([n.refs.setFloating,u]),{isMounted:_,status:j}=i.useTransitionStatus(s,n.transitionConfig),{baseClassNamePrefix:F}=m.getBEMClassNames("floatingui"),q=l?e:b(d.floatinguiStyles[F],e),I=f.useMemo(()=>({...l?{}:s.floatingStyles,...x.visibilityHandler(s.middlewareData),...t}),[s.floatingStyles,s.middlewareData,l,t]);return _?a.jsx(i.FloatingNode,{id:C,children:a.jsx(S,{props:n.portalled,children:a.jsx(v,{props:r,children:a.jsx(B,{context:s,props:n.focusConfiguration,children:a.jsxs(w.Box,{"data-status":j,ref:P,style:I,className:q,"aria-labelledby":n.labelId,"aria-describedby":n.descriptionId,...n.getFloatingProps(c),children:[o,g&&a.jsx(N.Arrow,{options:g,middleware:n.middlewareData,ref:M=>n.setArrowEl(M)})]})})})})}):null});exports.Content=y;exports.default=y;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as n, jsxs as M } from "react/jsx-runtime";
|
|
2
|
-
import { a as v, v as I } from "../../chunks/FloatingUI.context.
|
|
2
|
+
import { a as v, v as I } from "../../chunks/FloatingUI.context.Dl4Y1y1z.js";
|
|
3
3
|
import c, { useMemo as N } from "react";
|
|
4
4
|
import { useMergeRefs as B, useTransitionStatus as R, FloatingNode as S, FloatingPortal as D, FloatingOverlay as O, FloatingFocusManager as U } from "@floating-ui/react";
|
|
5
5
|
import { g as u } from "../../chunks/classNames.BTJmrO_L.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react");const t=require("../../chunks/FloatingUI.context.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react");const t=require("../../chunks/FloatingUI.context.B15Tz_4h.js");require("@floating-ui/react");require("./FloatingUI.interactions.cjs.js");exports.BmFloatingUIContext=t.BmFloatingUIContext;exports.useBmFloatingUI=t.useBmFloatingUI;exports.useBmFloatingUIContext=t.useBmFloatingUIContext;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { MiddlewareModifier } from '@viasat/beam-shared/components/floatingui';
|
|
3
|
-
import { Placement, AutoPlacementOptions, FlipOptions, ShiftOptions, HideOptions, OffsetOptions, UseHoverProps, UseClickProps, UseFocusProps, FloatingPortalProps, UseTransitionStylesProps, UseFloatingOptions, UseRoleProps, FloatingRootContext, UseListNavigationProps, UseTypeaheadProps, SizeOptions } from '@floating-ui/react';
|
|
3
|
+
import { Placement, AutoPlacementOptions, FlipOptions, ShiftOptions, HideOptions, OffsetOptions, UseHoverProps, UseClickProps, UseDismissProps, UseFocusProps, FloatingPortalProps, UseTransitionStylesProps, UseFloatingOptions, UseRoleProps, FloatingRootContext, UseListNavigationProps, UseTypeaheadProps, SizeOptions } from '@floating-ui/react';
|
|
4
4
|
import { FocusManagerProps } from '../FloatingUI/FloatingUI.content';
|
|
5
5
|
import { ArrowOptions } from '../FloatingUI/FloatingUI.arrow';
|
|
6
6
|
import { UseSelectedProps } from './useSelected';
|
|
@@ -120,8 +120,12 @@ export interface FloatingUIProps {
|
|
|
120
120
|
* Adds typeahead support to the floating list, if any
|
|
121
121
|
*/
|
|
122
122
|
typeahead?: UseTypeaheadProps;
|
|
123
|
+
/**
|
|
124
|
+
* Configure dismiss behaviour (escape key, outside press, etc.)
|
|
125
|
+
*/
|
|
126
|
+
dismiss?: UseDismissProps;
|
|
123
127
|
}
|
|
124
|
-
export declare const useBmFloatingUI: ({ defaultOpen, open: controlledOpen, placement, offset: _offset, onOpenChange: setControlledOpen, openOnClick, openOnHover, openOnFocus, openOnSelected, focusConfiguration, listNavigation, typeahead, middleware, autoPlacement, flip, shift, autoHiding, size, arrow, transitionConfig, portalled, role, rootContext, }: FloatingUIProps) => {
|
|
128
|
+
export declare const useBmFloatingUI: ({ defaultOpen, open: controlledOpen, placement, offset: _offset, onOpenChange: setControlledOpen, openOnClick, openOnHover, openOnFocus, openOnSelected, focusConfiguration, listNavigation, typeahead, dismiss, middleware, autoPlacement, flip, shift, autoHiding, size, arrow, transitionConfig, portalled, role, rootContext, }: FloatingUIProps) => {
|
|
125
129
|
portalled: boolean | FloatingPortalProps | undefined;
|
|
126
130
|
focusConfiguration: boolean | FocusManagerProps | undefined;
|
|
127
131
|
transitionConfig: UseTransitionStylesProps | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "react";
|
|
2
|
-
import { B as e, u as n, a as r } from "../../chunks/FloatingUI.context.
|
|
2
|
+
import { B as e, u as n, a as r } from "../../chunks/FloatingUI.context.Dl4Y1y1z.js";
|
|
3
3
|
import "@floating-ui/react";
|
|
4
4
|
import "./FloatingUI.interactions.es.js";
|
|
5
5
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@floating-ui/react"),r=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@floating-ui/react"),r=require("react"),T=require("./useSelected.cjs.js"),j=({context:s,openOnClick:t,openOnHover:n,openOnFocus:u,openOnSelected:a,role:l,listNavigation:o,typeahead:i,dismiss:f})=>{const c=r.useMemo(()=>n?n===!0?{enabled:!0,handleClose:e.safePolygon()}:{enabled:!0,handleClose:e.safePolygon(),...n}:{enabled:!1},[n]),d=r.useMemo(()=>typeof t=="boolean"?{enabled:t}:t??{enabled:!1},[t]),b=r.useMemo(()=>typeof u=="boolean"?{enabled:u}:u??{enabled:!1},[u]),g=r.useMemo(()=>typeof a=="boolean"?{enabled:a}:a??{enabled:!1},[a]),m=r.useMemo(()=>typeof l=="boolean"?{enabled:l}:l??{enabled:!1},[l]),y=r.useMemo(()=>o||{activeIndex:null,listRef:{current:[]},enabled:!1},[o]),C=r.useMemo(()=>i||{activeIndex:null,listRef:{current:[]},enabled:!1},[i]),M=e.useHover(s,c),h=e.useClick(s,d),I=e.useDismiss(s,f),v=e.useFocus(s,b),R=T.useSelected(s,g),q=e.useRole(s,m),P=e.useListNavigation(s,y),N=e.useTypeahead(s,C);return e.useInteractions([M,h,I,v,R,q,P,N])};exports.useConfigurableInteractions=j;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FloatingContext, UseClickProps, UseFocusProps, UseHoverProps, UseListNavigationProps, UseRoleProps, UseTypeaheadProps } from '@floating-ui/react';
|
|
1
|
+
import { FloatingContext, UseClickProps, UseDismissProps, UseFocusProps, UseHoverProps, UseListNavigationProps, UseRoleProps, UseTypeaheadProps } from '@floating-ui/react';
|
|
2
2
|
import { UseSelectedProps } from './useSelected';
|
|
3
3
|
interface InteractionsWrapperArg {
|
|
4
4
|
context: FloatingContext;
|
|
@@ -9,11 +9,12 @@ interface InteractionsWrapperArg {
|
|
|
9
9
|
role?: boolean | UseRoleProps;
|
|
10
10
|
listNavigation?: UseListNavigationProps;
|
|
11
11
|
typeahead?: UseTypeaheadProps;
|
|
12
|
+
dismiss?: UseDismissProps;
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
15
|
* Allows boolean or object configuration for interactions
|
|
15
16
|
*
|
|
16
17
|
* @param arg
|
|
17
18
|
*/
|
|
18
|
-
export declare const useConfigurableInteractions: ({ context, openOnClick, openOnHover, openOnFocus, openOnSelected, role: _role, listNavigation: _listNavigation, typeahead: _typeahead, }: InteractionsWrapperArg) => import('@floating-ui/react').UseInteractionsReturn;
|
|
19
|
+
export declare const useConfigurableInteractions: ({ context, openOnClick, openOnHover, openOnFocus, openOnSelected, role: _role, listNavigation: _listNavigation, typeahead: _typeahead, dismiss: _dismiss, }: InteractionsWrapperArg) => import('@floating-ui/react').UseInteractionsReturn;
|
|
19
20
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { safePolygon as
|
|
1
|
+
import { safePolygon as i, useHover as P, useClick as T, useDismiss as j, useFocus as k, useRole as q, useListNavigation as w, useTypeahead as z, useInteractions as A } from "@floating-ui/react";
|
|
2
2
|
import s from "react";
|
|
3
|
-
import { useSelected as
|
|
4
|
-
const
|
|
3
|
+
import { useSelected as B } from "./useSelected.es.js";
|
|
4
|
+
const K = ({
|
|
5
5
|
context: e,
|
|
6
6
|
openOnClick: r,
|
|
7
7
|
openOnHover: t,
|
|
@@ -9,39 +9,40 @@ const J = ({
|
|
|
9
9
|
openOnSelected: u,
|
|
10
10
|
role: n,
|
|
11
11
|
listNavigation: o,
|
|
12
|
-
typeahead: l
|
|
12
|
+
typeahead: l,
|
|
13
|
+
dismiss: f
|
|
13
14
|
}) => {
|
|
14
|
-
const
|
|
15
|
+
const d = s.useMemo(() => t ? t === !0 ? {
|
|
15
16
|
enabled: !0,
|
|
16
|
-
handleClose:
|
|
17
|
+
handleClose: i()
|
|
17
18
|
} : {
|
|
18
19
|
enabled: !0,
|
|
19
|
-
handleClose:
|
|
20
|
+
handleClose: i(),
|
|
20
21
|
...t
|
|
21
22
|
} : {
|
|
22
23
|
enabled: !1
|
|
23
|
-
}, [t]),
|
|
24
|
+
}, [t]), b = s.useMemo(() => typeof r == "boolean" ? {
|
|
24
25
|
enabled: r
|
|
25
|
-
} : r ?? { enabled: !1 }, [r]),
|
|
26
|
+
} : r ?? { enabled: !1 }, [r]), c = s.useMemo(() => typeof a == "boolean" ? { enabled: a } : a ?? { enabled: !1 }, [a]), m = s.useMemo(() => typeof u == "boolean" ? { enabled: u } : u ?? { enabled: !1 }, [u]), g = s.useMemo(() => typeof n == "boolean" ? { enabled: n } : n ?? { enabled: !1 }, [n]), C = s.useMemo(() => o || {
|
|
26
27
|
activeIndex: null,
|
|
27
28
|
listRef: { current: [] },
|
|
28
29
|
enabled: !1
|
|
29
|
-
}, [o]),
|
|
30
|
+
}, [o]), y = s.useMemo(() => l || {
|
|
30
31
|
activeIndex: null,
|
|
31
32
|
listRef: { current: [] },
|
|
32
33
|
enabled: !1
|
|
33
|
-
}, [l]),
|
|
34
|
-
return
|
|
35
|
-
y,
|
|
34
|
+
}, [l]), M = P(e, d), h = T(e, b), v = j(e, f), I = k(e, c), R = B(e, m), N = q(e, g), D = w(e, C), L = z(e, y);
|
|
35
|
+
return A([
|
|
36
36
|
M,
|
|
37
37
|
h,
|
|
38
38
|
v,
|
|
39
39
|
I,
|
|
40
40
|
R,
|
|
41
41
|
N,
|
|
42
|
-
D
|
|
42
|
+
D,
|
|
43
|
+
L
|
|
43
44
|
]);
|
|
44
45
|
};
|
|
45
46
|
export {
|
|
46
|
-
|
|
47
|
+
K as useConfigurableInteractions
|
|
47
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),t=require("../../chunks/FloatingUI.context.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),t=require("../../chunks/FloatingUI.context.B15Tz_4h.js");function e({children:o,...i}){const n=t.useBmFloatingUI({...i});return l.jsx(t.BmFloatingUIContext.Provider,{value:n,children:o})}exports.FloatingUIRoot=e;exports.default=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react"),u=require("../../chunks/FloatingUI.context.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react"),u=require("../../chunks/FloatingUI.context.B15Tz_4h.js"),l=require("@floating-ui/react"),g=require("../../utils/functions.cjs.js"),n=({children:t,...s})=>{try{const r=u.useBmFloatingUIContext(),e=o.useMemo(()=>g.ensureSingularRef(t),[t]),c=l.useMergeRefs([r.refs.setReference,e.props.ref??e.ref]),i=r.getReferenceProps({...s,...e.props,ref:c});return o.cloneElement(e,i)}catch{throw new Error("Expected a single child element with a ref for the FloatingUI trigger")}};exports.Trigger=n;exports.default=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),o=require("react"),d=require("../../utils/functions.cjs.js"),m=require("../../chunks/FloatingUI.context.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),o=require("react"),d=require("../../utils/functions.cjs.js"),m=require("../../chunks/FloatingUI.context.B15Tz_4h.js"),g=({children:l,...n})=>{const{setOpen:s}=m.useBmFloatingUIContext(),e=o.useMemo(()=>d.ensureSingularRef(l),[l]),r=o.useCallback(t=>{s==null||s(!1,t,"click")},[s]),c=o.useCallback(t=>{var i,u;r(t),(u=(i=e.props).onClick)==null||u.call(i,t)},[r,e.props]),C=o.useMemo(()=>({...n,...e.props,onClick:c}),[c,n,e.props]);return a.jsx(a.Fragment,{children:o.cloneElement(e,C)})};exports.CloseTrigger=g;exports.default=g;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as f, Fragment as u } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as a, useCallback as m, cloneElement as C } from "react";
|
|
3
3
|
import { ensureSingularRef as d } from "../../utils/functions.es.js";
|
|
4
|
-
import { a as g } from "../../chunks/FloatingUI.context.
|
|
4
|
+
import { a as g } from "../../chunks/FloatingUI.context.Dl4Y1y1z.js";
|
|
5
5
|
const b = ({ children: e, ...l }) => {
|
|
6
6
|
const { setOpen: r } = g(), o = a(() => d(e), [e]), n = m(
|
|
7
7
|
(s) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import f, { useMemo as c } from "react";
|
|
2
|
-
import { a } from "../../chunks/FloatingUI.context.
|
|
2
|
+
import { a } from "../../chunks/FloatingUI.context.Dl4Y1y1z.js";
|
|
3
3
|
import { useMergeRefs as i } from "@floating-ui/react";
|
|
4
4
|
import { ensureSingularRef as m } from "../../utils/functions.es.js";
|
|
5
5
|
const h = ({ children: r, ...o }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),n=require("../ActionList/ActionList.context.cjs.js"),r=require("../../chunks/FloatingUI.context.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),n=require("../ActionList/ActionList.context.cjs.js"),r=require("../../chunks/FloatingUI.context.B15Tz_4h.js"),s=({children:t,...e})=>{const{getItemProps:o}=r.useBmFloatingUIContext();return i.jsx(n.ActionListContextProvider,{getItemProps:o,...e,children:t})};exports.ActionListContextWrapper=s;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { ActionListContextProvider as i } from "../ActionList/ActionList.context.es.js";
|
|
3
|
-
import { a as n } from "../../chunks/FloatingUI.context.
|
|
3
|
+
import { a as n } from "../../chunks/FloatingUI.context.Dl4Y1y1z.js";
|
|
4
4
|
const x = ({
|
|
5
5
|
children: t,
|
|
6
6
|
...o
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),u=require("clsx"),l=require("../../chunks/popover.module.Dum8SaSU.js"),p=require("../../chunks/classNames.DAeKwerT.js"),t=require("../../chunks/constants.hwjHOsvT.js");require("../../chunks/FloatingUI.context.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),u=require("clsx"),l=require("../../chunks/popover.module.Dum8SaSU.js"),p=require("../../chunks/classNames.DAeKwerT.js"),t=require("../../chunks/constants.hwjHOsvT.js");require("../../chunks/FloatingUI.context.B15Tz_4h.js");require("react");require("@floating-ui/react");const m=require("../FloatingUI/FloatingUI.content.cjs.js"),q=require("./Popover.context.cjs.js");function o({children:r,className:n,...s}){const{theme:e,appearance:i}=q.usePopoverContext(),{baseClassNamePrefix:a}=p.getBEMClassNames("popover");return c.jsx(m.Content,{className:u(e&&t.themeClassName(e),l.popoverStyles[a],i==="inverse"&&t.BEAM_INVERSE,n),...s,children:r})}o.displayName="Popover.Content";exports.Content=o;
|
|
@@ -3,7 +3,7 @@ import a from "clsx";
|
|
|
3
3
|
import { p as n } from "../../chunks/popover.module.C6KFea25.js";
|
|
4
4
|
import { g as i } from "../../chunks/classNames.BTJmrO_L.js";
|
|
5
5
|
import { t as f, c as C } from "../../chunks/constants.CKKGf1-i.js";
|
|
6
|
-
import "../../chunks/FloatingUI.context.
|
|
6
|
+
import "../../chunks/FloatingUI.context.Dl4Y1y1z.js";
|
|
7
7
|
import "react";
|
|
8
8
|
import "@floating-ui/react";
|
|
9
9
|
import { Content as c } from "../FloatingUI/FloatingUI.content.es.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime");require("../../chunks/FloatingUI.context.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime");require("../../chunks/FloatingUI.context.B15Tz_4h.js");const t=require("../FloatingUI/FloatingUI.trigger.cjs.js"),s=require("../FloatingUI/FloatingUI.trigger.close.cjs.js");require("../FloatingUI/FloatingUI.content.cjs.js");require("react");const g=({children:e,...r})=>i.jsx(t.Trigger,{...r,children:e});g.displayName="Popover.Trigger";const o=({children:e,...r})=>i.jsx(s.CloseTrigger,{...r,children:e});o.displayName="Popover.CloseTrigger";exports.CloseTrigger=o;exports.Trigger=g;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import "../../chunks/FloatingUI.context.
|
|
2
|
+
import "../../chunks/FloatingUI.context.Dl4Y1y1z.js";
|
|
3
3
|
import { Trigger as g } from "../FloatingUI/FloatingUI.trigger.es.js";
|
|
4
4
|
import { CloseTrigger as i } from "../FloatingUI/FloatingUI.trigger.close.es.js";
|
|
5
5
|
import "../FloatingUI/FloatingUI.content.es.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var N=require("../../assets/Tooltip.css");Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),g=require("react"),h=require("../FloatingUI/FloatingUI.root.cjs.js"),d=require("../FloatingUI/FloatingUI.trigger.cjs.js");require("../../chunks/FloatingUI.context.
|
|
1
|
+
var N=require("../../assets/Tooltip.css");Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),g=require("react"),h=require("../FloatingUI/FloatingUI.root.cjs.js"),d=require("../FloatingUI/FloatingUI.trigger.cjs.js");require("../../chunks/FloatingUI.context.B15Tz_4h.js");const w=require("../FloatingUI/FloatingUI.content.cjs.js"),p=require("../../chunks/tokens.Bc11gmpN.js"),j=require("../../chunks/classNames.DAeKwerT.js");require("../../chunks/constants.hwjHOsvT.js");const u=require("../../utils/hooks/index.cjs.js"),x=require("clsx"),b=require("../../chunks/CSSLookup.DESAWWRT.js"),l={"bm-light":"bm-light","bm-dark":"bm-dark","bm-inverse":"bm-inverse","bm-tooltip__icon-trigger":"bm-tooltip__icon-trigger","bm-tooltip":"bm-tooltip","bm-tooltip__arrow":"bm-tooltip__arrow","bm-tooltip__icon-trigger--disabled":"bm-tooltip__icon-trigger--disabled","bm-tooltip__icon-trigger--xs":"bm-tooltip__icon-trigger--xs","bm-tooltip__icon-trigger--sm":"bm-tooltip__icon-trigger--sm","bm-tooltip__icon-trigger--md":"bm-tooltip__icon-trigger--md","bm-tooltip__icon-trigger--lg":"bm-tooltip__icon-trigger--lg","bm-tooltip__icon-trigger--xl":"bm-tooltip__icon-trigger--xl"},{baseClassNamePrefix:I,subElementClassPrefix:_}=j.getBEMClassNames("tooltip");function f({children:e,portalled:r=!1,text:i,disabled:t,showDelay:a,role:c,...n}){const s=u.useCSSLookup(p.bmCompTooltipSpaceArrow),m=u.useCSSLookup(p.bmCompTooltipSpaceOffset),C=g.useMemo(()=>({edgePadding:b.parseSizeString(s),className:l[`${_}arrow`],hide:!1}),[s]),T=t?{}:{openOnHover:{restMs:a},openOnFocus:!0,openOnSelected:!0},q=c||{enabled:!0,role:"tooltip"};return o.jsxs(h.FloatingUIRoot,{...T,arrow:C,offset:b.parseSizeString(m),portalled:r,transitionConfig:{duration:{open:0,close:200}},role:q,...n,children:[o.jsx(S.Provider,{value:{disabled:t},children:o.jsx(d.Trigger,{children:e})}),o.jsx(F,{theme:n.theme,children:i})]})}const S=g.createContext({disabled:!1}),k=g.forwardRef(({children:e,size:r="md",type:i="button",className:t,...a},c)=>{const{disabled:n}=g.useContext(S),s=`${_}icon-trigger`,m=x(l[`${s}--${r}`],l[s],n&&l[`${_}icon-trigger--disabled`],t);return o.jsx(d.Trigger,{children:o.jsx("button",{ref:c,type:i,disabled:n,className:m,...a,"aria-label":"tooltip trigger",children:e})})});function F({children:e,theme:r,className:i,...t}){return o.jsx(w.Content,{className:x(r,l[I],i),...t,children:e})}exports.Tooltip=f;exports.TooltipIconTrigger=k;exports.default=f;
|
|
@@ -3,7 +3,7 @@ import { jsx as t, jsxs as w } from "react/jsx-runtime";
|
|
|
3
3
|
import { createContext as h, forwardRef as T, useContext as S, useMemo as N } from "react";
|
|
4
4
|
import { FloatingUIRoot as P } from "../FloatingUI/FloatingUI.root.es.js";
|
|
5
5
|
import { Trigger as _ } from "../FloatingUI/FloatingUI.trigger.es.js";
|
|
6
|
-
import "../../chunks/FloatingUI.context.
|
|
6
|
+
import "../../chunks/FloatingUI.context.Dl4Y1y1z.js";
|
|
7
7
|
import { Content as k } from "../FloatingUI/FloatingUI.content.es.js";
|
|
8
8
|
import { j as v, k as O } from "../../chunks/tokens.BD_71qmL.js";
|
|
9
9
|
import { g as $ } from "../../chunks/classNames.BTJmrO_L.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("@floating-ui/react"),I=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const b=require("./Panel.context.cjs.js"),q=require("../../FloatingUI/FloatingUI.root.cjs.js"),v=require("../../../chunks/FloatingUI.context.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("@floating-ui/react"),I=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const b=require("./Panel.context.cjs.js"),q=require("../../FloatingUI/FloatingUI.root.cjs.js"),v=require("../../../chunks/FloatingUI.context.B15Tz_4h.js"),f=require("../../Divider/Divider.cjs.js"),C=require("../../../chunks/panel.module.BX1x4FlX.js"),{baseClassNamePrefix:F}=I.getBEMClassNames("panel"),a=({position:n,className:i})=>e.jsx(f.Divider,{borderColor:"01",orientation:n==="bottom"?"horizontal":"vertical",className:i}),U=({children:n,panelClassName:i,inlineWrapperClassName:o,resolvedPosition:t,dividerBefore:r,dividerInner:l,dividerAfter:c,alwaysVisible:s,...u})=>{const{context:d,transitionConfig:x,refs:g}=v.useBmFloatingUIContext(),{isMounted:j,status:_}=p.useTransitionStatus(d,x),m=s&&_==="initial"?"open":_;return j?e.jsxs(e.Fragment,{children:[r&&e.jsx(a,{position:t}),e.jsx("div",{ref:g.setFloating,className:o,"data-position":t,"data-status":m,children:e.jsxs("div",{className:C.styles[`${F}__inline-wrapper-content`],children:[l&&e.jsx(a,{position:t}),e.jsx("aside",{...u,className:i,children:n})]})}),c&&e.jsx(a,{position:t})]}):null},h=({contextValue:n,panelClassName:i,inlineWrapperClassName:o,resolvedPosition:t,dividerBefore:r,dividerInner:l,dividerAfter:c,open:s,transitionConfig:u,children:d,...x})=>e.jsx(b.PanelContext.Provider,{value:n,children:e.jsx(q.FloatingUIRoot,{open:s??!0,portalled:!1,transitionConfig:u,children:e.jsx(U,{panelClassName:i,inlineWrapperClassName:o,resolvedPosition:t,dividerBefore:r,dividerInner:l,dividerAfter:c,alwaysVisible:s===void 0,...x,children:d})})});exports.InlineDivider=a;exports.InlinePanel=h;
|
|
@@ -4,7 +4,7 @@ import { g as v } from "../../../chunks/classNames.BTJmrO_L.js";
|
|
|
4
4
|
import "../../../chunks/constants.CKKGf1-i.js";
|
|
5
5
|
import { PanelContext as N } from "./Panel.context.es.js";
|
|
6
6
|
import { FloatingUIRoot as b } from "../../FloatingUI/FloatingUI.root.es.js";
|
|
7
|
-
import { a as F } from "../../../chunks/FloatingUI.context.
|
|
7
|
+
import { a as F } from "../../../chunks/FloatingUI.context.Dl4Y1y1z.js";
|
|
8
8
|
import { Divider as w } from "../../Divider/Divider.es.js";
|
|
9
9
|
import { s as U } from "../../../chunks/panel.module.BVm3KvDs.js";
|
|
10
10
|
const { baseClassNamePrefix: j } = v("panel"), f = ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),y=require("clsx"),m=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const p=require("./Panel.context.cjs.js"),q=require("../../FloatingUI/FloatingUI.root.cjs.js"),x=require("../../FloatingUI/FloatingUI.content.cjs.js"),P=require("./Panel.Inline.cjs.js"),i=require("../../../chunks/panel.module.BX1x4FlX.js"),{baseClassNamePrefix:t}=m.getBEMClassNames("panel"),b=({contextValue:r,panelClassName:a,resolvedPosition:l,showDivider:n,modalType:s,open:o,onOpenChange:c,transitionConfig:u,children:_,...d})=>{const g=s==="alert"?{escapeKey:!1,outsidePress:!1}:void 0,v=y(i.styles[`${t}__overlay-divider`],i.styles[`${t}__overlay-divider--${l}`]);return e.jsx(p.PanelContext.Provider,{value:r,children:e.jsx(q.FloatingUIRoot,{open:o,onOpenChange:c,portalled:!0,transitionConfig:u,dismiss:g,children:e.jsxs(x.Content,{className:a,skipFloatingStyles:!0,overlay:!0,...d,role:s==="alert"?"alertdialog":"dialog","data-position":l,children:[_,n&&e.jsx(P.InlineDivider,{position:l,className:v})]})})})};exports.OverlayPanel=b;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UseTransitionStylesProps } from '@floating-ui/react';
|
|
2
|
-
import { PanelPosition } from './Panel.types';
|
|
2
|
+
import { PanelModalType, PanelPosition } from './Panel.types';
|
|
3
3
|
import { PanelContextValue } from './Panel.context';
|
|
4
4
|
import { FloatingUIProps } from '../../FloatingUI/FloatingUI.context';
|
|
5
5
|
type OverlayPanelProps = {
|
|
@@ -7,10 +7,11 @@ type OverlayPanelProps = {
|
|
|
7
7
|
panelClassName: string;
|
|
8
8
|
resolvedPosition: PanelPosition;
|
|
9
9
|
showDivider: boolean;
|
|
10
|
+
modalType?: PanelModalType;
|
|
10
11
|
open?: boolean;
|
|
11
12
|
onOpenChange?: FloatingUIProps['onOpenChange'];
|
|
12
13
|
transitionConfig: UseTransitionStylesProps;
|
|
13
14
|
children: React.ReactNode;
|
|
14
15
|
} & React.ComponentPropsWithoutRef<'aside'>;
|
|
15
|
-
export declare const OverlayPanel: ({ contextValue, panelClassName, resolvedPosition, showDivider, open, onOpenChange, transitionConfig, children, ...props }: OverlayPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const OverlayPanel: ({ contextValue, panelClassName, resolvedPosition, showDivider, modalType, open, onOpenChange, transitionConfig, children, ...props }: OverlayPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
export {};
|
|
@@ -1,45 +1,48 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { g as
|
|
1
|
+
import { jsx as r, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import y from "clsx";
|
|
3
|
+
import { g as u } from "../../../chunks/classNames.BTJmrO_L.js";
|
|
4
4
|
import "../../../chunks/constants.CKKGf1-i.js";
|
|
5
5
|
import { PanelContext as x } from "./Panel.context.es.js";
|
|
6
|
-
import { FloatingUIRoot as
|
|
7
|
-
import { Content as
|
|
8
|
-
import { InlineDivider as
|
|
9
|
-
import { s
|
|
10
|
-
const { baseClassNamePrefix:
|
|
6
|
+
import { FloatingUIRoot as C } from "../../FloatingUI/FloatingUI.root.es.js";
|
|
7
|
+
import { Content as N } from "../../FloatingUI/FloatingUI.content.es.js";
|
|
8
|
+
import { InlineDivider as _ } from "./Panel.Inline.es.js";
|
|
9
|
+
import { s } from "../../../chunks/panel.module.BVm3KvDs.js";
|
|
10
|
+
const { baseClassNamePrefix: i } = u("panel"), B = ({
|
|
11
11
|
contextValue: a,
|
|
12
|
-
panelClassName:
|
|
13
|
-
resolvedPosition:
|
|
14
|
-
showDivider:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
panelClassName: t,
|
|
13
|
+
resolvedPosition: e,
|
|
14
|
+
showDivider: l,
|
|
15
|
+
modalType: o,
|
|
16
|
+
open: m,
|
|
17
|
+
onOpenChange: n,
|
|
18
|
+
transitionConfig: d,
|
|
18
19
|
children: p,
|
|
19
|
-
...
|
|
20
|
+
...f
|
|
20
21
|
}) => {
|
|
21
|
-
const c = v(
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
const c = o === "alert" ? { escapeKey: !1, outsidePress: !1 } : void 0, v = y(
|
|
23
|
+
s[`${i}__overlay-divider`],
|
|
24
|
+
s[`${i}__overlay-divider--${e}`]
|
|
24
25
|
);
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
|
|
26
|
+
return /* @__PURE__ */ r(x.Provider, { value: a, children: /* @__PURE__ */ r(
|
|
27
|
+
C,
|
|
27
28
|
{
|
|
28
|
-
open:
|
|
29
|
-
onOpenChange:
|
|
29
|
+
open: m,
|
|
30
|
+
onOpenChange: n,
|
|
30
31
|
portalled: !0,
|
|
31
|
-
transitionConfig:
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
transitionConfig: d,
|
|
33
|
+
dismiss: c,
|
|
34
|
+
children: /* @__PURE__ */ g(
|
|
35
|
+
N,
|
|
34
36
|
{
|
|
35
|
-
className:
|
|
37
|
+
className: t,
|
|
36
38
|
skipFloatingStyles: !0,
|
|
37
39
|
overlay: !0,
|
|
38
|
-
...
|
|
39
|
-
"
|
|
40
|
+
...f,
|
|
41
|
+
role: o === "alert" ? "alertdialog" : "dialog",
|
|
42
|
+
"data-position": e,
|
|
40
43
|
children: [
|
|
41
44
|
p,
|
|
42
|
-
|
|
45
|
+
l && /* @__PURE__ */ r(_, { position: e, className: v })
|
|
43
46
|
]
|
|
44
47
|
}
|
|
45
48
|
)
|
|
@@ -47,5 +50,5 @@ const { baseClassNamePrefix: t } = y("panel"), b = ({
|
|
|
47
50
|
) });
|
|
48
51
|
};
|
|
49
52
|
export {
|
|
50
|
-
|
|
53
|
+
B as OverlayPanel
|
|
51
54
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react/jsx-runtime"),b=require("clsx"),C=require("react"),j=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const B=require("./Panel.Header.cjs.js"),E=require("./Panel.Body.cjs.js"),T=require("./Panel.Footer.cjs.js"),r=require("./Panel.helpers.cjs.js"),F=require("./Panel.Inline.cjs.js"),H=require("./Panel.Overlay.cjs.js"),e=require("../../../chunks/panel.module.BX1x4FlX.js"),{baseClassNamePrefix:s}=j.getBEMClassNames("panel"),n=({children:o,className:f,padding:g="md",onOpenChange:$,open:_,size:a,dismissible:c=!0,closeButtonAriaLabel:u="Close panel",kind:d="inline",position:i,divider:O=!0,isAnimated:P=!0,onBeforeClose:h,modalType:t,...p})=>{process.env.NODE_ENV!=="production"&&t==="alert"&&c&&console.warn('Panel: `dismissible` is ignored when `modalType="alert"`. The close button is always hidden.');const y=t==="alert"?!1:c,l=r.getResolvedPanelPosition(i),m=b(e.styles[s],e.styles[`${s}--${d}`],a&&e.styles[`${s}--size-${a}`],e.styles[`${s}--padding-${g}`],e.styles[`${s}--position-${l}`],f),x=b(e.styles[`${s}__inline-wrapper`],a==="full"&&e.styles[`${s}__inline-wrapper--full`]),{requestClose:N,handleOverlayOpenChange:I}=r.usePanelClose(h,$),q=C.useMemo(()=>({dismissible:y,closeButtonAriaLabel:u,position:i,requestClose:N}),[y,u,i,N]),{showDivider:D,dividerBefore:M,dividerInner:R,dividerAfter:S}=r.getPanelDividerState(O,l),v=C.useMemo(()=>({duration:P?r.PANEL_TRANSITION_DURATION_MS:0}),[P]);return d==="inline"?w.jsx(F.InlinePanel,{contextValue:q,panelClassName:m,inlineWrapperClassName:x,resolvedPosition:l,dividerBefore:M,dividerInner:R,dividerAfter:S,open:_,transitionConfig:v,...p,children:o}):w.jsx(H.OverlayPanel,{contextValue:q,panelClassName:m,resolvedPosition:l,showDivider:D,modalType:t,open:_,onOpenChange:I,transitionConfig:v,...p,children:o})};n.displayName="Panel";n.Header=B.Header;n.Body=E.Body;n.Footer=T.Footer;exports.Panel=n;
|
package/lib/wip/Panel/Panel.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PanelProps } from './Panel.types';
|
|
2
2
|
export declare const Panel: {
|
|
3
|
-
({ children, className: _className, padding, onOpenChange, open, size, dismissible, closeButtonAriaLabel, kind, position, divider, isAnimated, onBeforeClose, ...
|
|
3
|
+
({ children, className: _className, padding, onOpenChange, open, size, dismissible, closeButtonAriaLabel, kind, position, divider, isAnimated, onBeforeClose, modalType, ...panelProps }: PanelProps): JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
Header: {
|
|
6
6
|
({ children, className: _className, divider, ...props }: import('./Panel.Header').PanelHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,85 +1,90 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { useMemo as
|
|
1
|
+
import { jsx as $ } from "react/jsx-runtime";
|
|
2
|
+
import g from "clsx";
|
|
3
|
+
import { useMemo as _ } from "react";
|
|
4
4
|
import { g as R } from "../../../chunks/classNames.BTJmrO_L.js";
|
|
5
5
|
import "../../../chunks/constants.CKKGf1-i.js";
|
|
6
6
|
import { Header as S } from "./Panel.Header.es.js";
|
|
7
7
|
import { Body as T } from "./Panel.Body.es.js";
|
|
8
8
|
import { Footer as A } from "./Panel.Footer.es.js";
|
|
9
|
-
import { usePanelClose as
|
|
9
|
+
import { usePanelClose as F, getPanelDividerState as H, PANEL_TRANSITION_DURATION_MS as V, getResolvedPanelPosition as j } from "./Panel.helpers.es.js";
|
|
10
10
|
import { InlinePanel as q } from "./Panel.Inline.es.js";
|
|
11
11
|
import { OverlayPanel as U } from "./Panel.Overlay.es.js";
|
|
12
12
|
import { s as e } from "../../../chunks/panel.module.BVm3KvDs.js";
|
|
13
|
-
const { baseClassNamePrefix: r } = R("panel"),
|
|
14
|
-
children:
|
|
15
|
-
className:
|
|
16
|
-
padding:
|
|
17
|
-
onOpenChange:
|
|
13
|
+
const { baseClassNamePrefix: r } = R("panel"), s = ({
|
|
14
|
+
children: t,
|
|
15
|
+
className: O,
|
|
16
|
+
padding: h = "md",
|
|
17
|
+
onOpenChange: w,
|
|
18
18
|
open: l,
|
|
19
|
-
size:
|
|
20
|
-
dismissible:
|
|
21
|
-
closeButtonAriaLabel:
|
|
22
|
-
kind:
|
|
23
|
-
position:
|
|
24
|
-
divider:
|
|
19
|
+
size: n,
|
|
20
|
+
dismissible: m = !0,
|
|
21
|
+
closeButtonAriaLabel: p = "Close panel",
|
|
22
|
+
kind: d = "inline",
|
|
23
|
+
position: i,
|
|
24
|
+
divider: y = !0,
|
|
25
25
|
isAnimated: f = !0,
|
|
26
26
|
onBeforeClose: x,
|
|
27
|
-
|
|
27
|
+
modalType: a,
|
|
28
|
+
...c
|
|
28
29
|
}) => {
|
|
29
|
-
|
|
30
|
+
process.env.NODE_ENV !== "production" && a === "alert" && m && console.warn(
|
|
31
|
+
'Panel: `dismissible` is ignored when `modalType="alert"`. The close button is always hidden.'
|
|
32
|
+
);
|
|
33
|
+
const N = a === "alert" ? !1 : m, o = j(i), u = g(
|
|
30
34
|
e[r],
|
|
31
|
-
e[`${r}--${
|
|
32
|
-
|
|
33
|
-
e[`${r}--padding-${
|
|
35
|
+
e[`${r}--${d}`],
|
|
36
|
+
n && e[`${r}--size-${n}`],
|
|
37
|
+
e[`${r}--padding-${h}`],
|
|
34
38
|
e[`${r}--position-${o}`],
|
|
35
|
-
|
|
36
|
-
),
|
|
39
|
+
O
|
|
40
|
+
), D = g(
|
|
37
41
|
e[`${r}__inline-wrapper`],
|
|
38
|
-
|
|
39
|
-
), { requestClose:
|
|
42
|
+
n === "full" && e[`${r}__inline-wrapper--full`]
|
|
43
|
+
), { requestClose: v, handleOverlayOpenChange: I } = F(
|
|
40
44
|
x,
|
|
41
|
-
|
|
42
|
-
),
|
|
43
|
-
() => ({ dismissible:
|
|
44
|
-
[
|
|
45
|
-
), { showDivider:
|
|
46
|
-
() => ({ duration: f ?
|
|
45
|
+
w
|
|
46
|
+
), C = _(
|
|
47
|
+
() => ({ dismissible: N, closeButtonAriaLabel: p, position: i, requestClose: v }),
|
|
48
|
+
[N, p, i, v]
|
|
49
|
+
), { showDivider: E, dividerBefore: b, dividerInner: B, dividerAfter: M } = H(y, o), P = _(
|
|
50
|
+
() => ({ duration: f ? V : 0 }),
|
|
47
51
|
[f]
|
|
48
52
|
);
|
|
49
|
-
return
|
|
53
|
+
return d === "inline" ? /* @__PURE__ */ $(
|
|
50
54
|
q,
|
|
51
55
|
{
|
|
52
|
-
contextValue:
|
|
53
|
-
panelClassName:
|
|
54
|
-
inlineWrapperClassName:
|
|
56
|
+
contextValue: C,
|
|
57
|
+
panelClassName: u,
|
|
58
|
+
inlineWrapperClassName: D,
|
|
55
59
|
resolvedPosition: o,
|
|
56
|
-
dividerBefore:
|
|
57
|
-
dividerInner:
|
|
60
|
+
dividerBefore: b,
|
|
61
|
+
dividerInner: B,
|
|
58
62
|
dividerAfter: M,
|
|
59
63
|
open: l,
|
|
60
|
-
transitionConfig:
|
|
61
|
-
...
|
|
62
|
-
children:
|
|
64
|
+
transitionConfig: P,
|
|
65
|
+
...c,
|
|
66
|
+
children: t
|
|
63
67
|
}
|
|
64
|
-
) : /* @__PURE__ */
|
|
68
|
+
) : /* @__PURE__ */ $(
|
|
65
69
|
U,
|
|
66
70
|
{
|
|
67
|
-
contextValue:
|
|
68
|
-
panelClassName:
|
|
71
|
+
contextValue: C,
|
|
72
|
+
panelClassName: u,
|
|
69
73
|
resolvedPosition: o,
|
|
70
|
-
showDivider:
|
|
74
|
+
showDivider: E,
|
|
75
|
+
modalType: a,
|
|
71
76
|
open: l,
|
|
72
|
-
onOpenChange:
|
|
73
|
-
transitionConfig:
|
|
74
|
-
...
|
|
75
|
-
children:
|
|
77
|
+
onOpenChange: I,
|
|
78
|
+
transitionConfig: P,
|
|
79
|
+
...c,
|
|
80
|
+
children: t
|
|
76
81
|
}
|
|
77
82
|
);
|
|
78
83
|
};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
84
|
+
s.displayName = "Panel";
|
|
85
|
+
s.Header = S;
|
|
86
|
+
s.Body = T;
|
|
87
|
+
s.Footer = A;
|
|
83
88
|
export {
|
|
84
|
-
|
|
89
|
+
s as Panel
|
|
85
90
|
};
|
|
@@ -73,6 +73,9 @@ interface BasePanelProps extends ComponentPropsWithoutRef<'aside'> {
|
|
|
73
73
|
* by the parent; it only fires for UI-triggered close events (close button, Escape
|
|
74
74
|
* key, or outside press).
|
|
75
75
|
*
|
|
76
|
+
* When `modalType="alert"`, `'escapeKey'` and `'outsidePress'` reasons are
|
|
77
|
+
* suppressed entirely — this callback will not be invoked for those reasons.
|
|
78
|
+
*
|
|
76
79
|
* @example
|
|
77
80
|
* ```tsx
|
|
78
81
|
* // Use a stateful confirmation dialog — avoid window.confirm (blocking, breaks iframes).
|
|
@@ -95,6 +98,7 @@ export interface InlinePanelProps extends BasePanelProps {
|
|
|
95
98
|
* Specify the Panel as inline
|
|
96
99
|
*/
|
|
97
100
|
kind?: 'inline';
|
|
101
|
+
modalType?: never;
|
|
98
102
|
}
|
|
99
103
|
export interface OverlayPanelProps extends BasePanelProps {
|
|
100
104
|
/**
|
|
@@ -102,7 +106,9 @@ export interface OverlayPanelProps extends BasePanelProps {
|
|
|
102
106
|
*/
|
|
103
107
|
kind: 'overlay';
|
|
104
108
|
/**
|
|
105
|
-
* Specify the modal type (overlay only)
|
|
109
|
+
* Specify the modal type (overlay only).
|
|
110
|
+
* When set to `'alert'`, the close button is always hidden regardless of the
|
|
111
|
+
* `dismissible` prop, and ESC / backdrop clicks are suppressed.
|
|
106
112
|
* @default 'nonModal'
|
|
107
113
|
*/
|
|
108
114
|
modalType?: PanelModalType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viasat/beam-react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.13.0",
|
|
4
4
|
"description": "React component library for the Beam design system",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Viasat",
|
|
@@ -59,11 +59,11 @@
|
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@viasat/beam-fonts": "2.
|
|
63
|
-
"@viasat/beam-shared": "2.
|
|
64
|
-
"@viasat/beam-styles": "2.
|
|
65
|
-
"@viasat/beam-tokens": "2.
|
|
66
|
-
"@viasat/beam-icons": "2.
|
|
62
|
+
"@viasat/beam-fonts": "2.13.0",
|
|
63
|
+
"@viasat/beam-shared": "2.13.0",
|
|
64
|
+
"@viasat/beam-styles": "2.13.0",
|
|
65
|
+
"@viasat/beam-tokens": "2.13.0",
|
|
66
|
+
"@viasat/beam-icons": "2.13.0",
|
|
67
67
|
"clsx": "^1.2.1",
|
|
68
68
|
"@floating-ui/react": "^0.26.18",
|
|
69
69
|
"@stepperize/react": "^5.1.5",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const h=require("react"),F=require("@floating-ui/dom"),X=require("@floating-ui/react"),J=require("../lib/FloatingUI/FloatingUI.interactions.cjs.js"),G=Math.min,K=Math.max,Q={left:"right",right:"left",bottom:"top",top:"bottom"};function Z(t,e,i){return K(t,G(e,i))}function w(t,e){return typeof t=="function"?t(e):t}function T(t){return t.split("-")[0]}function tt(t){return t.split("-")[1]}function Y(t){return t==="x"?"y":"x"}function et(t){return t==="y"?"height":"width"}function nt(t){return["top","bottom"].includes(T(t))?"y":"x"}function ot(t){return Y(nt(t))}function st(t){return t.replace(/left|right|bottom|top/g,e=>Q[e])}function it(t){return{top:0,right:0,bottom:0,left:0,...t}}function ct(t){return typeof t!="number"?it(t):{top:t,right:t,bottom:t,left:t}}const lt=16,rt=t=>{var e;return{visibility:(e=t.hide)!=null&&e.referenceHidden?"hidden":"visible"}},ut=t=>({name:"arrowStyles",options:t,async fn(e){var V,W;const{x:i,y:c,placement:r,rects:s,platform:n,elements:g,middlewareData:p}=e,{element:f,padding:a=0}=w(t,e)||{};if(f==null)return{};const y=ct(a),m={x:i,y:c},l=ot(r),U=Y(l),x=et(l),d=await n.getDimensions(f),A=l==="y",o=A?"top":"left",j=A?"bottom":"right",C=A?"clientHeight":"clientWidth",_=s.reference[x]+s.reference[l]-m[l]-s.floating[x],B=m[l]-s.reference[l],$=await((V=n.getOffsetParent)==null?void 0:V.call(n,f));let b=$?$[C]:0;(!b||!await((W=n.isElement)==null?void 0:W.call(n,$)))&&(b=g.floating[C]||s.floating[x]);const M=_/2-B/2,v=b/2-d.width/2-1,D=G(y[o],v),E=G(y[j],v),O=D,z=b-d.width-E,u=b/2-d.width/2+M,P=Z(O,u,z),I=!p.arrow&&tt(r)!=null&&u!==P&&s.reference[x]/2-(u<O?D:E)-d.width/2<0,H=I?u<O?u-O:u-z:0,S=T(r),L=["top","left"].includes(S)?-1:1,q=d.height*L,N=at({placement:S,arrowHeight:d.height,arrowWidth:d.width,[l]:P});return{[l]:m[l]+H,[U]:m[U]+q,data:N,reset:I}}}),R=(t,e,i,c)=>{if(c){const r=c===!0?i():i(c);t[e](r)}},ft=({baseConfig:t,middleware:e,offset:i,arrow:c,placement:r="top"})=>{const s={...t,placement:r};let n=[];if(typeof e.overrides!="object"){n.push(F.offset(i));let g=e.flip??!0;if(e.autoPlacement&&(g=!1),R(n,"unshift",F.autoPlacement,e.autoPlacement),R(n,"unshift",F.flip,g),e.size){const p=e.size===!0?{padding:lt,apply({availableHeight:f,elements:a}){Object.assign(a.floating.style,{maxHeight:`${f}px`})}}:e.size;n.push(F.size(p))}R(n,"push",F.shift,e.shift??!0),R(n,"push",F.hide,e.hide??!0)}else n.push(...e.overrides);return c.hide||n.push(ut(c.options)),typeof e.overrides=="function"&&(n=e.overrides(n)),s.middleware=n,s},at=({placement:t,arrowHeight:e,arrowWidth:i,x:c,y:r})=>{const s=T(t),n=i/2-e,g={top:"rotate(0deg)",bottom:"rotate(180deg)",left:`rotate(-90deg) translateX(${-n}px)`,right:`rotate(90deg) translateX(${n}px)`}[s],p=-i/2-e,f={top:`${-e}px`,bottom:`${-e*2}px`,left:`${p}px`,right:`${p}px`}[s],a={transform:g};a.left=c!=null?`${c}px`:"",a.top=r!=null?`${r}px`:"";const y=st(s);return a[y]=f,a},dt=({defaultOpen:t=!1,open:e,placement:i="top",offset:c,onOpenChange:r,openOnClick:s,openOnHover:n,openOnFocus:g,openOnSelected:p,focusConfiguration:f,listNavigation:a,typeahead:y,middleware:m,autoPlacement:l,flip:U=!0,shift:x=!0,autoHiding:d,size:A,arrow:o,transitionConfig:j,portalled:C,role:_,rootContext:B})=>{const[$,b]=h.useState(t),[M,v]=h.useState(),[D,E]=h.useState(),[O,z]=h.useState(null),u=e??$,P=r??b,I=X.useFloatingNodeId(),H=h.useMemo(()=>{const N={open:u,onOpenChange:P,whileElementsMounted:X.autoUpdate,nodeId:I,rootContext:B};return{...ft({baseConfig:N,middleware:{overrides:m,autoPlacement:l,flip:U,shift:x,hide:d,size:A},arrow:{hide:(o==null?void 0:o.hide)??!1,options:{element:O||null,padding:o==null?void 0:o.edgePadding}},placement:i,offset:c??0})}},[I,u,P,m,l,U,x,d,A,o==null?void 0:o.hide,o==null?void 0:o.edgePadding,O,i,c,B]),S=X.useFloating(H),L=S.context,q=J.useConfigurableInteractions({context:L,openOnClick:s,openOnHover:n,openOnFocus:g,openOnSelected:p,role:_,listNavigation:a,typeahead:y});return h.useMemo(()=>({open:u,setOpen:P,...q,...S,portalled:C,focusConfiguration:f,transitionConfig:j,labelId:M,descriptionId:D,arrow:o,setLabelId:v,setDescriptionId:E,setArrowEl:z,nodeId:I}),[u,P,q,S,C,f,j,M,D,o,I])},k=h.createContext(null),gt=()=>{const t=h.useContext(k);if(t==null)throw new Error("FloatingUI components must be wrapped in <FloatingUI />");return t};exports.BmFloatingUIContext=k;exports.useBmFloatingUI=dt;exports.useBmFloatingUIContext=gt;exports.visibilityHandler=rt;
|