@theroutingcompany/components 0.0.46-alpha.0 → 0.0.46
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.
|
@@ -75,7 +75,7 @@ object-assign
|
|
|
75
75
|
// accordion header uses h3
|
|
76
76
|
all: unset;
|
|
77
77
|
}
|
|
78
|
-
`,
|
|
78
|
+
`,mP=A.default(DE)`
|
|
79
79
|
overflow: hidden;
|
|
80
80
|
margin-top: ${p.spacing_200} !important;
|
|
81
81
|
|
|
@@ -89,7 +89,7 @@ object-assign
|
|
|
89
89
|
position: relative;
|
|
90
90
|
z-index: 1;
|
|
91
91
|
}
|
|
92
|
-
`,
|
|
92
|
+
`,hP=A.default(SE)`
|
|
93
93
|
cursor: pointer;
|
|
94
94
|
display: flex !important;
|
|
95
95
|
align-items: center;
|
|
@@ -109,13 +109,13 @@ object-assign
|
|
|
109
109
|
}
|
|
110
110
|
&[data-state='closed'] {
|
|
111
111
|
}
|
|
112
|
-
`,
|
|
112
|
+
`,bP=A.default(_e.ExpandMore)`
|
|
113
113
|
cursor: pointer;
|
|
114
114
|
font-size: 1rem !important;
|
|
115
115
|
margin-left: auto;
|
|
116
116
|
transition: transform 150ms ease-in-out !important;
|
|
117
117
|
transform: rotate(var(--chevron-rotation, 0));
|
|
118
|
-
`,
|
|
118
|
+
`,gP=A.default(Se).attrs(()=>({as:"span"}))`
|
|
119
119
|
cursor: pointer;
|
|
120
120
|
display: flex;
|
|
121
121
|
align-items: center;
|
|
@@ -134,7 +134,7 @@ object-assign
|
|
|
134
134
|
margin: 0;
|
|
135
135
|
line-height: 1;
|
|
136
136
|
}
|
|
137
|
-
`,
|
|
137
|
+
`,cp=A.default.span`
|
|
138
138
|
height: 36px;
|
|
139
139
|
display: flex;
|
|
140
140
|
align-items: center;
|
|
@@ -143,7 +143,7 @@ object-assign
|
|
|
143
143
|
color: ${p.color_gray_6};
|
|
144
144
|
cursor: pointer;
|
|
145
145
|
width: calc(100% - ${p.spacing_400});
|
|
146
|
-
`;function
|
|
146
|
+
`;function dp({children:e,icon:t,bold:r=!0,...n}){return w(EE,{asChild:!0,children:Q(hP,{...n,children:[t?w(gP,{mr:p.spacing_200,children:t}):null,w(cp,{style:{"--font-weight":r?p.font_weight_500:p.font_weight_300},children:e}),w(gt,{flex:"1",alignItems:"center",cursor:"pointer",className:"chev",width:p.spacing_400,children:w(bP,{})})]})})}function up({children:e,includeBottomDivider:t=!0,...r}){return w(mP,{...r,style:{"--border-bottom":t?`1px solid ${p.color_gray_88}`:"none"},children:e})}const vP=A.default(PE)`
|
|
147
147
|
overflow: hidden;
|
|
148
148
|
padding-bottom: ${p.spacing_200};
|
|
149
149
|
|
|
@@ -155,7 +155,7 @@ object-assign
|
|
|
155
155
|
animation: ${fP} 300ms cubic-bezier(0.87, 0, 0.13, 1); // todo: use tokens
|
|
156
156
|
transform: translateZ(0);
|
|
157
157
|
}
|
|
158
|
-
`,bo=({children:e,type:t,...r})=>w(pP,{type:t,...r,children:e});bo.displayName="Accordion",bo.Item=cp,bo.Header=up,bo.Content=vP;const yP=bo;function $P(e,t=globalThis==null?void 0:globalThis.document){const r=Le(e);c.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n),()=>t.removeEventListener("keydown",n)},[r,t])}const bs="dismissableLayer.update",_P="dismissableLayer.pointerDownOutside",xP="dismissableLayer.focusOutside";let fp;const pp=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),sn=c.forwardRef((e,t)=>{var r;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:s,...d}=e,u=c.useContext(pp),[f,m]=c.useState(null),h=(r=f==null?void 0:f.ownerDocument)!==null&&r!==void 0?r:globalThis==null?void 0:globalThis.document,[,b]=c.useState({}),g=he(t,x=>m(x)),v=Array.from(u.layers),[$]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v.indexOf($),_=f?v.indexOf(f):-1,D=u.layersWithOutsidePointerEventsDisabled.size>0,P=_>=y,L=DP(x=>{const C=x.target,z=[...u.branches].some(S=>S.contains(C));!P||z||(a==null||a(x),l==null||l(x),x.defaultPrevented||s==null||s())},h),T=SP(x=>{const C=x.target;[...u.branches].some(S=>S.contains(C))||(i==null||i(x),l==null||l(x),x.defaultPrevented||s==null||s())},h);return $P(x=>{_===u.layers.size-1&&(o==null||o(x),!x.defaultPrevented&&s&&(x.preventDefault(),s()))},h),c.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(fp=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),mp(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=fp)}},[f,h,n,u]),c.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),mp())},[f,u]),c.useEffect(()=>{const x=()=>b({});return document.addEventListener(bs,x),()=>document.removeEventListener(bs,x)},[]),c.createElement(de.div,M({},d,{ref:g,style:{pointerEvents:D?P?"auto":"none":void 0,...e.style},onFocusCapture:J(e.onFocusCapture,T.onFocusCapture),onBlurCapture:J(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:J(e.onPointerDownCapture,L.onPointerDownCapture)}))}),wP=c.forwardRef((e,t)=>{const r=c.useContext(pp),n=c.useRef(null),o=he(t,n);return c.useEffect(()=>{const a=n.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),c.createElement(de.div,M({},e,{ref:o}))});function DP(e,t=globalThis==null?void 0:globalThis.document){const r=Le(e),n=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const a=l=>{if(l.target&&!n.current){let d=function(){hp(_P,r,s,{discrete:!0})};const s={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function SP(e,t=globalThis==null?void 0:globalThis.document){const r=Le(e),n=c.useRef(!1);return c.useEffect(()=>{const o=a=>{a.target&&!n.current&&hp(xP,r,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function mp(){const e=new CustomEvent(bs);document.dispatchEvent(e)}function hp(e,t,r,{discrete:n}){const o=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?Ql(o,a):o.dispatchEvent(a)}const EP=sn,PP=wP,gs="focusScope.autoFocusOnMount",vs="focusScope.autoFocusOnUnmount",bp={bubbles:!1,cancelable:!0},Ca=c.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...i}=e,[l,s]=c.useState(null),d=Le(o),u=Le(a),f=c.useRef(null),m=he(t,g=>s(g)),h=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(n){let g=function(_){if(h.paused||!l)return;const D=_.target;l.contains(D)?f.current=D:dr(f.current,{select:!0})},v=function(_){if(h.paused||!l)return;const D=_.relatedTarget;D!==null&&(l.contains(D)||dr(f.current,{select:!0}))},$=function(_){const D=document.activeElement;for(const P of _)P.removedNodes.length>0&&(l!=null&&l.contains(D)||dr(l))};document.addEventListener("focusin",g),document.addEventListener("focusout",v);const y=new MutationObserver($);return l&&y.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",v),y.disconnect()}}},[n,l,h.paused]),c.useEffect(()=>{if(l){yp.add(h);const g=document.activeElement;if(!l.contains(g)){const $=new CustomEvent(gs,bp);l.addEventListener(gs,d),l.dispatchEvent($),$.defaultPrevented||(kP(OP(gp(l)),{select:!0}),document.activeElement===g&&dr(l))}return()=>{l.removeEventListener(gs,d),setTimeout(()=>{const $=new CustomEvent(vs,bp);l.addEventListener(vs,u),l.dispatchEvent($),$.defaultPrevented||dr(g??document.body,{select:!0}),l.removeEventListener(vs,u),yp.remove(h)},0)}}},[l,d,u,h]);const b=c.useCallback(g=>{if(!r&&!n||h.paused)return;const v=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,$=document.activeElement;if(v&&$){const y=g.currentTarget,[_,D]=TP(y);_&&D?!g.shiftKey&&$===D?(g.preventDefault(),r&&dr(_,{select:!0})):g.shiftKey&&$===_&&(g.preventDefault(),r&&dr(D,{select:!0})):$===y&&g.preventDefault()}},[r,n,h.paused]);return c.createElement(de.div,M({tabIndex:-1},i,{ref:m,onKeyDown:b}))});function kP(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(dr(n,{select:t}),document.activeElement!==r)return}function TP(e){const t=gp(e),r=vp(t,e),n=vp(t.reverse(),e);return[r,n]}function gp(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function vp(e,t){for(const r of e)if(!CP(r,{upTo:t}))return r}function CP(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function AP(e){return e instanceof HTMLInputElement&&"select"in e}function dr(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&AP(e)&&t&&e.select()}}const yp=IP();function IP(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=$p(e,t),e.unshift(t)},remove(t){var r;e=$p(e,t),(r=e[0])===null||r===void 0||r.resume()}}}function $p(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function OP(e){return e.filter(t=>t.tagName!=="A")}const cn=c.forwardRef((e,t)=>{var r;const{container:n=globalThis==null||(r=globalThis.document)===null||r===void 0?void 0:r.body,...o}=e;return n?zt.default.createPortal(c.createElement(de.div,M({},o,{ref:t})),n):null});let ys=0;function Aa(){c.useEffect(()=>{var e,t;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=r[0])!==null&&e!==void 0?e:_p()),document.body.insertAdjacentElement("beforeend",(t=r[1])!==null&&t!==void 0?t:_p()),ys++,()=>{ys===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),ys--}},[])}function _p(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var Tt=function(){return Tt=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Tt.apply(this,arguments)};function xp(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function MP(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n<o;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Ia="right-scroll-bar-position",Oa="width-before-scroll-bar",NP="with-scroll-bars-hidden",FP="--removed-body-scroll-bar-size";function LP(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function zP(e,t){var r=c.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}function wp(e,t){return zP(t||null,function(r){return e.forEach(function(n){return LP(n,r)})})}function Dp(e){return e}function Sp(e,t){t===void 0&&(t=Dp);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(a){var i=t(a,n);return r.push(i),function(){r=r.filter(function(l){return l!==i})}},assignSyncMedium:function(a){for(n=!0;r.length;){var i=r;r=[],i.forEach(a)}r={push:function(l){return a(l)},filter:function(){return r}}},assignMedium:function(a){n=!0;var i=[];if(r.length){var l=r;r=[],l.forEach(a),i=r}var s=function(){var u=i;i=[],u.forEach(a)},d=function(){return Promise.resolve().then(s)};d(),r={push:function(u){i.push(u),d()},filter:function(u){return i=i.filter(u),r}}}};return o}function $s(e,t){return t===void 0&&(t=Dp),Sp(e,t)}function Ep(e){e===void 0&&(e={});var t=Sp(null);return t.options=Tt({async:!0,ssr:!1},e),t}var Pp=function(e){var t=e.sideCar,r=xp(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return E.createElement(n,Tt({},r))};Pp.isSideCarExport=!0;function RP(e,t){return e.useMedium(t),Pp}var kp=Ep(),_s=function(){},Ma=E.forwardRef(function(e,t){var r=E.useRef(null),n=E.useState({onScrollCapture:_s,onWheelCapture:_s,onTouchMoveCapture:_s}),o=n[0],a=n[1],i=e.forwardProps,l=e.children,s=e.className,d=e.removeScrollBar,u=e.enabled,f=e.shards,m=e.sideCar,h=e.noIsolation,b=e.inert,g=e.allowPinchZoom,v=e.as,$=v===void 0?"div":v,y=xp(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),_=m,D=wp([r,t]),P=Tt(Tt({},y),o);return E.createElement(E.Fragment,null,u&&E.createElement(_,{sideCar:kp,removeScrollBar:d,shards:f,noIsolation:h,inert:b,setCallbacks:a,allowPinchZoom:!!g,lockRef:r}),i?E.cloneElement(E.Children.only(l),Tt(Tt({},P),{ref:D})):E.createElement($,Tt({},P,{className:s,ref:D}),l))});Ma.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ma.classNames={fullWidth:Oa,zeroRight:Ia};var Tp,KP=function(){if(Tp)return Tp;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function VP(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=KP();return t&&e.setAttribute("nonce",t),e}function BP(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function jP(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var UP=function(){var e=0,t=null;return{add:function(r){e==0&&(t=VP())&&(BP(t,r),jP(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},WP=function(){var e=UP();return function(t,r){E.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Cp=function(){var e=WP(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},HP={left:0,top:0,right:0,gap:0},xs=function(e){return parseInt(e||"",10)||0},GP=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[xs(r),xs(n),xs(o)]},YP=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return HP;var t=GP(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},qP=Cp(),ZP=function(e,t,r,n){var o=e.left,a=e.top,i=e.right,l=e.gap;return r===void 0&&(r="margin"),`
|
|
158
|
+
`,bo=({children:e,type:t,...r})=>w(pP,{type:t,...r,children:e});bo.displayName="Accordion",bo.Item=up,bo.Header=dp,bo.Content=vP;const yP=bo;function $P(e,t=globalThis==null?void 0:globalThis.document){const r=Le(e);c.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n),()=>t.removeEventListener("keydown",n)},[r,t])}const bs="dismissableLayer.update",_P="dismissableLayer.pointerDownOutside",xP="dismissableLayer.focusOutside";let fp;const pp=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),sn=c.forwardRef((e,t)=>{var r;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:s,...d}=e,u=c.useContext(pp),[f,m]=c.useState(null),h=(r=f==null?void 0:f.ownerDocument)!==null&&r!==void 0?r:globalThis==null?void 0:globalThis.document,[,b]=c.useState({}),g=he(t,x=>m(x)),v=Array.from(u.layers),[$]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v.indexOf($),_=f?v.indexOf(f):-1,D=u.layersWithOutsidePointerEventsDisabled.size>0,P=_>=y,L=DP(x=>{const C=x.target,z=[...u.branches].some(S=>S.contains(C));!P||z||(a==null||a(x),l==null||l(x),x.defaultPrevented||s==null||s())},h),T=SP(x=>{const C=x.target;[...u.branches].some(S=>S.contains(C))||(i==null||i(x),l==null||l(x),x.defaultPrevented||s==null||s())},h);return $P(x=>{_===u.layers.size-1&&(o==null||o(x),!x.defaultPrevented&&s&&(x.preventDefault(),s()))},h),c.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(fp=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),mp(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=fp)}},[f,h,n,u]),c.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),mp())},[f,u]),c.useEffect(()=>{const x=()=>b({});return document.addEventListener(bs,x),()=>document.removeEventListener(bs,x)},[]),c.createElement(de.div,M({},d,{ref:g,style:{pointerEvents:D?P?"auto":"none":void 0,...e.style},onFocusCapture:J(e.onFocusCapture,T.onFocusCapture),onBlurCapture:J(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:J(e.onPointerDownCapture,L.onPointerDownCapture)}))}),wP=c.forwardRef((e,t)=>{const r=c.useContext(pp),n=c.useRef(null),o=he(t,n);return c.useEffect(()=>{const a=n.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),c.createElement(de.div,M({},e,{ref:o}))});function DP(e,t=globalThis==null?void 0:globalThis.document){const r=Le(e),n=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const a=l=>{if(l.target&&!n.current){let d=function(){hp(_P,r,s,{discrete:!0})};const s={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function SP(e,t=globalThis==null?void 0:globalThis.document){const r=Le(e),n=c.useRef(!1);return c.useEffect(()=>{const o=a=>{a.target&&!n.current&&hp(xP,r,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function mp(){const e=new CustomEvent(bs);document.dispatchEvent(e)}function hp(e,t,r,{discrete:n}){const o=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?Ql(o,a):o.dispatchEvent(a)}const EP=sn,PP=wP,gs="focusScope.autoFocusOnMount",vs="focusScope.autoFocusOnUnmount",bp={bubbles:!1,cancelable:!0},Ca=c.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...i}=e,[l,s]=c.useState(null),d=Le(o),u=Le(a),f=c.useRef(null),m=he(t,g=>s(g)),h=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(n){let g=function(_){if(h.paused||!l)return;const D=_.target;l.contains(D)?f.current=D:dr(f.current,{select:!0})},v=function(_){if(h.paused||!l)return;const D=_.relatedTarget;D!==null&&(l.contains(D)||dr(f.current,{select:!0}))},$=function(_){const D=document.activeElement;for(const P of _)P.removedNodes.length>0&&(l!=null&&l.contains(D)||dr(l))};document.addEventListener("focusin",g),document.addEventListener("focusout",v);const y=new MutationObserver($);return l&&y.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",v),y.disconnect()}}},[n,l,h.paused]),c.useEffect(()=>{if(l){yp.add(h);const g=document.activeElement;if(!l.contains(g)){const $=new CustomEvent(gs,bp);l.addEventListener(gs,d),l.dispatchEvent($),$.defaultPrevented||(kP(OP(gp(l)),{select:!0}),document.activeElement===g&&dr(l))}return()=>{l.removeEventListener(gs,d),setTimeout(()=>{const $=new CustomEvent(vs,bp);l.addEventListener(vs,u),l.dispatchEvent($),$.defaultPrevented||dr(g??document.body,{select:!0}),l.removeEventListener(vs,u),yp.remove(h)},0)}}},[l,d,u,h]);const b=c.useCallback(g=>{if(!r&&!n||h.paused)return;const v=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,$=document.activeElement;if(v&&$){const y=g.currentTarget,[_,D]=TP(y);_&&D?!g.shiftKey&&$===D?(g.preventDefault(),r&&dr(_,{select:!0})):g.shiftKey&&$===_&&(g.preventDefault(),r&&dr(D,{select:!0})):$===y&&g.preventDefault()}},[r,n,h.paused]);return c.createElement(de.div,M({tabIndex:-1},i,{ref:m,onKeyDown:b}))});function kP(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(dr(n,{select:t}),document.activeElement!==r)return}function TP(e){const t=gp(e),r=vp(t,e),n=vp(t.reverse(),e);return[r,n]}function gp(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function vp(e,t){for(const r of e)if(!CP(r,{upTo:t}))return r}function CP(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function AP(e){return e instanceof HTMLInputElement&&"select"in e}function dr(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&AP(e)&&t&&e.select()}}const yp=IP();function IP(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=$p(e,t),e.unshift(t)},remove(t){var r;e=$p(e,t),(r=e[0])===null||r===void 0||r.resume()}}}function $p(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function OP(e){return e.filter(t=>t.tagName!=="A")}const cn=c.forwardRef((e,t)=>{var r;const{container:n=globalThis==null||(r=globalThis.document)===null||r===void 0?void 0:r.body,...o}=e;return n?zt.default.createPortal(c.createElement(de.div,M({},o,{ref:t})),n):null});let ys=0;function Aa(){c.useEffect(()=>{var e,t;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=r[0])!==null&&e!==void 0?e:_p()),document.body.insertAdjacentElement("beforeend",(t=r[1])!==null&&t!==void 0?t:_p()),ys++,()=>{ys===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),ys--}},[])}function _p(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var Tt=function(){return Tt=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Tt.apply(this,arguments)};function xp(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function MP(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n<o;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Ia="right-scroll-bar-position",Oa="width-before-scroll-bar",NP="with-scroll-bars-hidden",FP="--removed-body-scroll-bar-size";function LP(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function zP(e,t){var r=c.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}function wp(e,t){return zP(t||null,function(r){return e.forEach(function(n){return LP(n,r)})})}function Dp(e){return e}function Sp(e,t){t===void 0&&(t=Dp);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(a){var i=t(a,n);return r.push(i),function(){r=r.filter(function(l){return l!==i})}},assignSyncMedium:function(a){for(n=!0;r.length;){var i=r;r=[],i.forEach(a)}r={push:function(l){return a(l)},filter:function(){return r}}},assignMedium:function(a){n=!0;var i=[];if(r.length){var l=r;r=[],l.forEach(a),i=r}var s=function(){var u=i;i=[],u.forEach(a)},d=function(){return Promise.resolve().then(s)};d(),r={push:function(u){i.push(u),d()},filter:function(u){return i=i.filter(u),r}}}};return o}function $s(e,t){return t===void 0&&(t=Dp),Sp(e,t)}function Ep(e){e===void 0&&(e={});var t=Sp(null);return t.options=Tt({async:!0,ssr:!1},e),t}var Pp=function(e){var t=e.sideCar,r=xp(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return E.createElement(n,Tt({},r))};Pp.isSideCarExport=!0;function RP(e,t){return e.useMedium(t),Pp}var kp=Ep(),_s=function(){},Ma=E.forwardRef(function(e,t){var r=E.useRef(null),n=E.useState({onScrollCapture:_s,onWheelCapture:_s,onTouchMoveCapture:_s}),o=n[0],a=n[1],i=e.forwardProps,l=e.children,s=e.className,d=e.removeScrollBar,u=e.enabled,f=e.shards,m=e.sideCar,h=e.noIsolation,b=e.inert,g=e.allowPinchZoom,v=e.as,$=v===void 0?"div":v,y=xp(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),_=m,D=wp([r,t]),P=Tt(Tt({},y),o);return E.createElement(E.Fragment,null,u&&E.createElement(_,{sideCar:kp,removeScrollBar:d,shards:f,noIsolation:h,inert:b,setCallbacks:a,allowPinchZoom:!!g,lockRef:r}),i?E.cloneElement(E.Children.only(l),Tt(Tt({},P),{ref:D})):E.createElement($,Tt({},P,{className:s,ref:D}),l))});Ma.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ma.classNames={fullWidth:Oa,zeroRight:Ia};var Tp,KP=function(){if(Tp)return Tp;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function VP(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=KP();return t&&e.setAttribute("nonce",t),e}function BP(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function jP(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var UP=function(){var e=0,t=null;return{add:function(r){e==0&&(t=VP())&&(BP(t,r),jP(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},WP=function(){var e=UP();return function(t,r){E.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Cp=function(){var e=WP(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},HP={left:0,top:0,right:0,gap:0},xs=function(e){return parseInt(e||"",10)||0},GP=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[xs(r),xs(n),xs(o)]},YP=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return HP;var t=GP(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},qP=Cp(),ZP=function(e,t,r,n){var o=e.left,a=e.top,i=e.right,l=e.gap;return r===void 0&&(r="margin"),`
|
|
159
159
|
.`.concat(NP,` {
|
|
160
160
|
overflow: hidden `).concat(n,`;
|
|
161
161
|
padding-right: `).concat(l,"px ").concat(n,`;
|
|
@@ -3092,5 +3092,5 @@ Defaulting to \`${Sf}\`.`}function m5(e){return lV.includes(e)}const cV=p5,h5="T
|
|
|
3092
3092
|
&[data-swipe='move'] {
|
|
3093
3093
|
transform: translateX(var(--radix-toast-swipe-move-x));
|
|
3094
3094
|
}
|
|
3095
|
-
`;function GV({children:e,...t}){return w(AV,{...t,children:e})}function Af({title:e,children:t,variant:r="primary",onDismiss:n,...o}){const a=BV[r],i=jV[r],l=UV[r];return Q(HV,{style:{"--color-background-notification":a,"--color-notification":i},variant:r,...o,children:[r==="negative"?w(_e.Warning,{height:18}):null,w(VV,{children:e}),w(E5,{style:{"--color-separator":l}}),t,w(S5,{onClick:n,children:w(uo,{label:"Dismiss notification",children:w(_e.Close,{width:18,height:18})})})]})}Af.Action=KV,Af.Close=S5,K.AccessibleIcon=uo,K.Accordion=yP,K.AlertDialog=L3,K.AlertDialogAction=R3,K.AlertDialogCancel=K3,K.AlertDialogCancelButton=B3,K.AlertDialogContent=O3,K.AlertDialogDescription=N3,K.AlertDialogFooter=F3,K.AlertDialogTitle=M3,K.AlertDialogTrigger=z3,K.Badge=Qa,K.Banner=Sc,K.Box=Se,K.BreadcrumbItem=u0,K.BreadcrumbLink=s0,K.BreadcrumbListItem=vd,K.Breadcrumbs=d0,K.Button=Rn,K.ButtonBase=wt,K.ButtonV2=So,K.CalendarCell=Z0,K.CalendarGrid=rl,K.CalendarHeader=J0,K.Checkbox=vl,K.ComboBox=lu,K.Dialog=k3,K.DialogClose=C3,K.DialogCloseButton=P3,K.DialogContent=w3,K.DialogDescription=S3,K.DialogFooter=nh,K.DialogTitle=D3,K.DialogTrigger=T3,K.Direction=Vw,K.Divider=nO,K.Drawer=wx,K.DropdownMenu=fN,K.DropdownMenuArrow=_N,K.DropdownMenuCheckboxItem=yN,K.DropdownMenuContent=Wx,K.DropdownMenuGroup=mN,K.DropdownMenuItem=gN,K.DropdownMenuItemIndicator=$N,K.DropdownMenuLabel=xN,K.DropdownMenuPortal=pN,K.DropdownMenuRadioGroup=bN,K.DropdownMenuRadioItem=vN,K.DropdownMenuSeparator=wN,K.DropdownMenuSub=DN,K.DropdownMenuSubContent=EN,K.DropdownMenuSubTrigger=SN,K.DropdownMenuTrigger=hN,K.EditButtonRight=zw,K.Fieldset=K8,K.FileUpload=Fw,K.Flex=gt,K.FormControl=oI,K.IconButton=Wo,K.IconTooltip=wr,K.InlineEdit=Rw,K.Item=ku,K.Label=We,K.LabeledText=rF,K.Modal=v3,K.MultiSelect=Kw,K.MultiSelectComponent=Su,K.MultiSelectItem=aa,K.MultiSelectSection=wl,K.NavigationMenu=fF,K.NavigationMenuPortal=pF,K.NumberFormControl=K$,K.NumberInput=Fd,K.Page=Ww,K.PageContent=hF,K.PageGrid=mF,K.PageHeader=Hw,K.PageHeaderContent=vF,K.Pagination=w9,K.PaginatorButton=Go,K.PaginatorNumber=ol,K.Panel=yF,K.Popover=a0,K.PopoverClose=bd,K.PopoverCloseCross=M8,K.PopoverContent=o0,K.PopoverTrigger=i0,K.Radio=RF,K.RadioGroup=zF,K.RadioGroupIndicator=eD,K.RadioGroupRadio=Qw,K.RangeCalendar=$9,K.Search=ZS,K.SectionHeader=
|
|
3095
|
+
`;function GV({children:e,...t}){return w(AV,{...t,children:e})}function Af({title:e,children:t,variant:r="primary",onDismiss:n,...o}){const a=BV[r],i=jV[r],l=UV[r];return Q(HV,{style:{"--color-background-notification":a,"--color-notification":i},variant:r,...o,children:[r==="negative"?w(_e.Warning,{height:18}):null,w(VV,{children:e}),w(E5,{style:{"--color-separator":l}}),t,w(S5,{onClick:n,children:w(uo,{label:"Dismiss notification",children:w(_e.Close,{width:18,height:18})})})]})}Af.Action=KV,Af.Close=S5,K.AccessibleIcon=uo,K.Accordion=yP,K.AlertDialog=L3,K.AlertDialogAction=R3,K.AlertDialogCancel=K3,K.AlertDialogCancelButton=B3,K.AlertDialogContent=O3,K.AlertDialogDescription=N3,K.AlertDialogFooter=F3,K.AlertDialogTitle=M3,K.AlertDialogTrigger=z3,K.Badge=Qa,K.Banner=Sc,K.Box=Se,K.BreadcrumbItem=u0,K.BreadcrumbLink=s0,K.BreadcrumbListItem=vd,K.Breadcrumbs=d0,K.Button=Rn,K.ButtonBase=wt,K.ButtonV2=So,K.CalendarCell=Z0,K.CalendarGrid=rl,K.CalendarHeader=J0,K.Checkbox=vl,K.ComboBox=lu,K.Dialog=k3,K.DialogClose=C3,K.DialogCloseButton=P3,K.DialogContent=w3,K.DialogDescription=S3,K.DialogFooter=nh,K.DialogTitle=D3,K.DialogTrigger=T3,K.Direction=Vw,K.Divider=nO,K.Drawer=wx,K.DropdownMenu=fN,K.DropdownMenuArrow=_N,K.DropdownMenuCheckboxItem=yN,K.DropdownMenuContent=Wx,K.DropdownMenuGroup=mN,K.DropdownMenuItem=gN,K.DropdownMenuItemIndicator=$N,K.DropdownMenuLabel=xN,K.DropdownMenuPortal=pN,K.DropdownMenuRadioGroup=bN,K.DropdownMenuRadioItem=vN,K.DropdownMenuSeparator=wN,K.DropdownMenuSub=DN,K.DropdownMenuSubContent=EN,K.DropdownMenuSubTrigger=SN,K.DropdownMenuTrigger=hN,K.EditButtonRight=zw,K.Fieldset=K8,K.FileUpload=Fw,K.Flex=gt,K.FormControl=oI,K.IconButton=Wo,K.IconTooltip=wr,K.InlineEdit=Rw,K.Item=ku,K.Label=We,K.LabeledText=rF,K.Modal=v3,K.MultiSelect=Kw,K.MultiSelectComponent=Su,K.MultiSelectItem=aa,K.MultiSelectSection=wl,K.NavigationMenu=fF,K.NavigationMenuPortal=pF,K.NumberFormControl=K$,K.NumberInput=Fd,K.Page=Ww,K.PageContent=hF,K.PageGrid=mF,K.PageHeader=Hw,K.PageHeaderContent=vF,K.Pagination=w9,K.PaginatorButton=Go,K.PaginatorNumber=ol,K.Panel=yF,K.Popover=a0,K.PopoverClose=bd,K.PopoverCloseCross=M8,K.PopoverContent=o0,K.PopoverTrigger=i0,K.Radio=RF,K.RadioGroup=zF,K.RadioGroupIndicator=eD,K.RadioGroupRadio=Qw,K.RangeCalendar=$9,K.Search=ZS,K.SectionHeader=dp,K.SectionItem=up,K.SectionTitle=cp,K.Separator=Tu,K.SingleSelect=NK,K.SingleSelectItem=aa,K.SingleSelectSection=wl,K.Stack=vi,K.StickyPageHeader=gF,K.StyledButtonBox=Dc,K.StyledFieldSet=f0,K.Switch=QS,K.TabList=no,K.Tabs=Bl,K.Text=Mt,K.TextAreaFormControl=R$,K.TextFormControl=z$,K.TextInput=Rd,K.Time=Mn,K.TimeDateSelect=Vy,K.TimeDateSelectItem=By,K.TimeInput=Ky,K.Title=Fr,K.TitleBase=pr,K.Toast=Af,K.ToastProvider=GV,K.ToastSeparator=E5,K.ToastViewport=WV,K.Tooltip=F$,K.TooltipContent=L$,K.TooltipProvider=N$,K.TooltipTrigger=jd,K.Wrapper=bx,K.boxSystem=Vt,K.buttonPadding=$d,K.buttonV2System=yi,K.dialogCloseButtonStyles=ic,K.dialogContentStyles=nc,K.dialogDescriptionStyles=ac,K.dialogTitleStyles=oc,K.dialogWidths=Ja,K.getTruncate=hs,K.overlayStyles=rc,K.pageMinMaxWidth=Uw,K.useDrawer=mO,K.useFieldProps=gl,K.useFieldset=Ot,Object.defineProperty(K,Symbol.toStringTag,{value:"Module"})});
|
|
3096
3096
|
//# sourceMappingURL=trc-components.umd.js.map
|