@servicetitan/anvil2 1.3.4 → 1.3.5

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/Page.cjs CHANGED
@@ -1,2 +1,2 @@
1
- var se=require("./index13.css");Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./jsx-runtime-494437bb.cjs"),o=require("react"),_=require("./index-ef2e9d11.cjs"),R=require("./Button.cjs"),O=require("./useSize.cjs"),j=require("./Tooltip.cjs"),k=require("./primitive-898a5f6f.cjs"),T=require("./useTrackingId.cjs"),S=require("./index-40821bc4.cjs");require("./LocalizationProvider.cjs");require("./index-11b6ca91-d30fd1d3.cjs");const E=require("./Dialog.cjs"),b=require("./Popover.cjs"),L=require("./Flex.cjs"),z=require("./Icon.cjs");function W(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(a,s,n.get?n:{enumerable:!0,get:()=>e[s]})}}return a.default=e,Object.freeze(a)}const d=W(o),H="_page_3p54k_7",I="_container_3p54k_16",G="_content_3p54k_32",A="_sidebar_3p54k_41",D="_panel_3p54k_124",K="_collapsed_3p54k_160",J="_open_3p54k_160",F="_small_3p54k_160",U="_medium_3p54k_163",V="_large_3p54k_166",Y="_noPadding_3p54k_256",r={page:H,container:I,content:G,"content-inner":"_content-inner_3p54k_36",sidebar:A,"sidebar-inner":"_sidebar-inner_3p54k_50","toggle-button-wrapper":"_toggle-button-wrapper_3p54k_77","toggle-button-tooltip":"_toggle-button-tooltip_3p54k_85","toggle-button":"_toggle-button_3p54k_77","sidebar-header":"_sidebar-header_3p54k_103","sidebar-adaptive-trigger-container":"_sidebar-adaptive-trigger-container_3p54k_109","sidebar-adaptive-container":"_sidebar-adaptive-container_3p54k_118","sidebar-adaptive":"_sidebar-adaptive_3p54k_109",panel:D,"panel-inner":"_panel-inner_3p54k_131","virtual-scroll-container":"_virtual-scroll-container_3p54k_142",collapsed:K,open:J,small:F,medium:U,large:V,noPadding:Y,"sidebar-adaptive-trigger":"_sidebar-adaptive-trigger_3p54k_109"};function Q(...e){return d.useCallback(a=>{for(let s=0;s<e.length;s++){const n=e[s];typeof n=="function"?n(a):n&&typeof n=="object"&&(n.current=a)}},e)}const X=e=>d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},d.createElement("path",{d:"M9.29 6.71a.996.996 0 0 0 0 1.41L13.17 12l-3.88 3.88a.996.996 0 1 0 1.41 1.41l4.59-4.59a.996.996 0 0 0 0-1.41L10.7 6.7c-.38-.38-1.02-.38-1.41.01z"})),Z=e=>d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},d.createElement("path",{d:"M14.71 6.71a.996.996 0 0 0-1.41 0L8.71 11.3a.996.996 0 0 0 0 1.41l4.59 4.59a.996.996 0 1 0 1.41-1.41L10.83 12l3.88-3.88c.39-.39.38-1.03 0-1.41z"})),$=e=>d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},d.createElement("path",{d:"M10 18h10c.55 0 1-.45 1-1s-.45-1-1-1H10c-.55 0-1 .45-1 1s.45 1 1 1zM3 7c0 .55.45 1 1 1h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1zm7 6h10c.55 0 1-.45 1-1s-.45-1-1-1H10c-.55 0-1 .45-1 1s.45 1 1 1z"})),ee=e=>d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},d.createElement("path",{d:"M8.12 9.29 12 13.17l3.88-3.88a.996.996 0 1 1 1.41 1.41l-4.59 4.59a.996.996 0 0 1-1.41 0L6.7 10.7a.996.996 0 0 1 0-1.41c.39-.38 1.03-.39 1.42 0z"})),te=e=>d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},d.createElement("path",{d:"M8.12 14.71 12 10.83l3.88 3.88a.996.996 0 1 0 1.41-1.41L12.7 8.71a.996.996 0 0 0-1.41 0L6.7 13.3a.996.996 0 0 0 0 1.41c.39.38 1.03.39 1.42 0z"})),ne=o.forwardRef((e,a)=>{const{children:s,...n}=e;return t.jsxRuntimeExports.jsx("div",{className:r.page,ref:a,...n,children:t.jsxRuntimeExports.jsx("div",{className:r.container,children:s})})}),N=o.createContext(null),P=o.forwardRef((e,a)=>{var w;const{children:s,className:n,currentPageTitle:g,localStorageKey:c="sidebar-collapsed",...m}=e,f={localStorageKey:c},{breakpoint:i}=o.useContext(S.M),u=T.useTrackingId({name:"PageSidebarButton",data:f,hasOverride:!!e["data-tracking-id"]}),[l,x]=o.useState(()=>{const p=localStorage.getItem(c);return p?JSON.parse(p):!1}),v=_.G([r.sidebar],n,{[r.collapsed]:l}),h=()=>{x(p=>(localStorage.setItem(c,JSON.stringify(!p)),!p))},B=+(((w=k.BreakpointMd)==null?void 0:w.value.replace("px",""))??0);return((i==null?void 0:i.innerWidth)??0)<B?t.jsxRuntimeExports.jsxs(b.default,{fillAvailableHeight:!0,matchReferenceWidth:!0,noPadding:!0,disableCaret:!0,children:[t.jsxRuntimeExports.jsx(b.default.Trigger,{children:p=>(typeof document<"u"&&(p["data-state"]==="open"?document.body.style.overflow="hidden":document.body.style.overflow="auto"),t.jsxRuntimeExports.jsx("div",{className:r["sidebar-adaptive-trigger-container"],children:t.jsxRuntimeExports.jsxs(R.default,{className:r["sidebar-adaptive-trigger"],icon:$,appearance:"ghost",...p,children:[g||"Menu",t.jsxRuntimeExports.jsx(z.default,{flexGrow:"1",justifyContent:"end",svg:p["data-state"]==="open"?te:ee})]})}))}),t.jsxRuntimeExports.jsx(b.default.Content,{className:r["sidebar-adaptive-container"],children:t.jsxRuntimeExports.jsx(L.default,{direction:"column",className:r["sidebar-adaptive"],ref:a,children:s})})]}):t.jsxRuntimeExports.jsx(N.Provider,{value:{collapsed:l},children:t.jsxRuntimeExports.jsxs("div",{className:v,ref:a,...m,children:[t.jsxRuntimeExports.jsx("div",{className:r["sidebar-inner"],"aria-hidden":l,children:t.jsxRuntimeExports.jsx("div",{children:s})}),t.jsxRuntimeExports.jsx("div",{className:r["toggle-button-wrapper"],children:t.jsxRuntimeExports.jsxs(j.default,{placement:"right",children:[t.jsxRuntimeExports.jsx(j.default.Trigger,{className:r["toggle-button-tooltip"],children:t.jsxRuntimeExports.jsx(R.default,{size:"small",onClick:h,className:r["toggle-button"],"aria-label":l?"Open Sidebar":"Close Sidebar","data-tracking-id":u,icon:l?X:Z})}),t.jsxRuntimeExports.jsx(j.default.Content,{children:l?"Open Sidebar":"Close Sidebar"})]})})]})})}),y=o.forwardRef((e,a)=>{const{children:s,className:n,...g}=e,c=o.useContext(N),m=_.G([r["sidebar-header"]],n);return t.jsxRuntimeExports.jsx("div",{className:m,ref:a,...g,children:t.jsxRuntimeExports.jsx("div",{className:r["header-content"],"aria-hidden":c==null?void 0:c.collapsed,children:s})})}),C=o.forwardRef((e,a)=>{const{children:s,className:n,...g}=e,c=_.G([r.content],n),m=o.useRef(null),f=o.useRef(null),i=O.useSize(m),u=o.useRef(!0);o.useEffect(()=>{if(typeof window>"u"||!u.current)return;function x(){var h;const v=window.scrollY;(h=f.current)==null||h.scrollTo(0,v??0)}return window.addEventListener("scroll",x,{passive:!0}),()=>{window.removeEventListener("scroll",x)}},[]);function l(x){typeof window>"u"||u.current||window.scrollTo(0,x.target.scrollTop)}return t.jsxRuntimeExports.jsxs("main",{className:c,ref:Q(m,a),...g,children:[t.jsxRuntimeExports.jsx("div",{className:r["content-inner"],children:s}),t.jsxRuntimeExports.jsx("div",{className:r["virtual-scroll-container"],ref:f,style:{left:i&&(i==null?void 0:i.left)+(i==null?void 0:i.width)},onScrollCapture:l,onMouseEnter:()=>{u.current=!1},onMouseLeave:()=>{u.current=!0},children:t.jsxRuntimeExports.jsx("div",{style:{width:1,height:i?i.height+i.y*2:0}})})]})}),M=o.forwardRef((e,a)=>{var h;const{children:s,open:n,size:g="medium",noPadding:c,style:m,className:f,...i}=e,u=_.G([r.panel],[r[g]],f,{[r.open]:typeof n>"u"?!0:n,[r.persistent]:typeof n>"u",[r.noPadding]:c}),{breakpoint:l}=o.useContext(S.M),x=+(((h=k.BreakpointMd)==null?void 0:h.value.replace("px",""))??0),v=(l==null?void 0:l.innerWidth)??0;return typeof n<"u"&&v<x?t.jsxRuntimeExports.jsx(E.default,{open:n,children:t.jsxRuntimeExports.jsx(E.default.Content,{children:t.jsxRuntimeExports.jsx("div",{className:u,"aria-hidden":!n,"aria-disabled":!n,ref:a,...i,children:s})})}):t.jsxRuntimeExports.jsx("div",{className:u,"aria-hidden":!n,"aria-disabled":!n,ref:a,...i,children:t.jsxRuntimeExports.jsx("div",{className:r["panel-inner"],tabIndex:typeof n<"u"&&n?0:-1,style:m,children:t.jsxRuntimeExports.jsx("div",{children:s})})})}),q=Object.assign(ne,{Sidebar:P,SidebarHeader:y,Content:C,Panel:M});exports.Page=q;exports.PageContent=C;exports.PagePanel=M;exports.PageSidebar=P;exports.PageSidebarHeader=y;exports.default=q;
1
+ var se=require("./index13.css");Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./jsx-runtime-494437bb.cjs"),o=require("react"),_=require("./index-ef2e9d11.cjs"),R=require("./Button.cjs"),O=require("./useSize.cjs"),j=require("./Tooltip.cjs"),k=require("./primitive-898a5f6f.cjs"),T=require("./useTrackingId.cjs"),S=require("./index-40821bc4.cjs");require("./LocalizationProvider.cjs");require("./PortalProvider.cjs");require("./index-11b6ca91-d30fd1d3.cjs");const E=require("./Dialog.cjs"),b=require("./Popover.cjs"),L=require("./Flex.cjs"),z=require("./Icon.cjs");function W(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(a,s,n.get?n:{enumerable:!0,get:()=>e[s]})}}return a.default=e,Object.freeze(a)}const d=W(o),H="_page_3p54k_7",I="_container_3p54k_16",G="_content_3p54k_32",A="_sidebar_3p54k_41",D="_panel_3p54k_124",K="_collapsed_3p54k_160",J="_open_3p54k_160",F="_small_3p54k_160",U="_medium_3p54k_163",V="_large_3p54k_166",Y="_noPadding_3p54k_256",r={page:H,container:I,content:G,"content-inner":"_content-inner_3p54k_36",sidebar:A,"sidebar-inner":"_sidebar-inner_3p54k_50","toggle-button-wrapper":"_toggle-button-wrapper_3p54k_77","toggle-button-tooltip":"_toggle-button-tooltip_3p54k_85","toggle-button":"_toggle-button_3p54k_77","sidebar-header":"_sidebar-header_3p54k_103","sidebar-adaptive-trigger-container":"_sidebar-adaptive-trigger-container_3p54k_109","sidebar-adaptive-container":"_sidebar-adaptive-container_3p54k_118","sidebar-adaptive":"_sidebar-adaptive_3p54k_109",panel:D,"panel-inner":"_panel-inner_3p54k_131","virtual-scroll-container":"_virtual-scroll-container_3p54k_142",collapsed:K,open:J,small:F,medium:U,large:V,noPadding:Y,"sidebar-adaptive-trigger":"_sidebar-adaptive-trigger_3p54k_109"};function Q(...e){return d.useCallback(a=>{for(let s=0;s<e.length;s++){const n=e[s];typeof n=="function"?n(a):n&&typeof n=="object"&&(n.current=a)}},e)}const X=e=>d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},d.createElement("path",{d:"M9.29 6.71a.996.996 0 0 0 0 1.41L13.17 12l-3.88 3.88a.996.996 0 1 0 1.41 1.41l4.59-4.59a.996.996 0 0 0 0-1.41L10.7 6.7c-.38-.38-1.02-.38-1.41.01z"})),Z=e=>d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},d.createElement("path",{d:"M14.71 6.71a.996.996 0 0 0-1.41 0L8.71 11.3a.996.996 0 0 0 0 1.41l4.59 4.59a.996.996 0 1 0 1.41-1.41L10.83 12l3.88-3.88c.39-.39.38-1.03 0-1.41z"})),$=e=>d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},d.createElement("path",{d:"M10 18h10c.55 0 1-.45 1-1s-.45-1-1-1H10c-.55 0-1 .45-1 1s.45 1 1 1zM3 7c0 .55.45 1 1 1h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1zm7 6h10c.55 0 1-.45 1-1s-.45-1-1-1H10c-.55 0-1 .45-1 1s.45 1 1 1z"})),ee=e=>d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},d.createElement("path",{d:"M8.12 9.29 12 13.17l3.88-3.88a.996.996 0 1 1 1.41 1.41l-4.59 4.59a.996.996 0 0 1-1.41 0L6.7 10.7a.996.996 0 0 1 0-1.41c.39-.38 1.03-.39 1.42 0z"})),te=e=>d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},d.createElement("path",{d:"M8.12 14.71 12 10.83l3.88 3.88a.996.996 0 1 0 1.41-1.41L12.7 8.71a.996.996 0 0 0-1.41 0L6.7 13.3a.996.996 0 0 0 0 1.41c.39.38 1.03.39 1.42 0z"})),ne=o.forwardRef((e,a)=>{const{children:s,...n}=e;return t.jsxRuntimeExports.jsx("div",{className:r.page,ref:a,...n,children:t.jsxRuntimeExports.jsx("div",{className:r.container,children:s})})}),N=o.createContext(null),P=o.forwardRef((e,a)=>{var w;const{children:s,className:n,currentPageTitle:g,localStorageKey:c="sidebar-collapsed",...m}=e,f={localStorageKey:c},{breakpoint:i}=o.useContext(S.M),u=T.useTrackingId({name:"PageSidebarButton",data:f,hasOverride:!!e["data-tracking-id"]}),[l,x]=o.useState(()=>{const p=localStorage.getItem(c);return p?JSON.parse(p):!1}),v=_.G([r.sidebar],n,{[r.collapsed]:l}),h=()=>{x(p=>(localStorage.setItem(c,JSON.stringify(!p)),!p))},B=+(((w=k.BreakpointMd)==null?void 0:w.value.replace("px",""))??0);return((i==null?void 0:i.innerWidth)??0)<B?t.jsxRuntimeExports.jsxs(b.default,{fillAvailableHeight:!0,matchReferenceWidth:!0,noPadding:!0,disableCaret:!0,children:[t.jsxRuntimeExports.jsx(b.default.Trigger,{children:p=>(typeof document<"u"&&(p["data-state"]==="open"?document.body.style.overflow="hidden":document.body.style.overflow="auto"),t.jsxRuntimeExports.jsx("div",{className:r["sidebar-adaptive-trigger-container"],children:t.jsxRuntimeExports.jsxs(R.default,{className:r["sidebar-adaptive-trigger"],icon:$,appearance:"ghost",...p,children:[g||"Menu",t.jsxRuntimeExports.jsx(z.default,{flexGrow:"1",justifyContent:"end",svg:p["data-state"]==="open"?te:ee})]})}))}),t.jsxRuntimeExports.jsx(b.default.Content,{className:r["sidebar-adaptive-container"],children:t.jsxRuntimeExports.jsx(L.default,{direction:"column",className:r["sidebar-adaptive"],ref:a,children:s})})]}):t.jsxRuntimeExports.jsx(N.Provider,{value:{collapsed:l},children:t.jsxRuntimeExports.jsxs("div",{className:v,ref:a,...m,children:[t.jsxRuntimeExports.jsx("div",{className:r["sidebar-inner"],"aria-hidden":l,children:t.jsxRuntimeExports.jsx("div",{children:s})}),t.jsxRuntimeExports.jsx("div",{className:r["toggle-button-wrapper"],children:t.jsxRuntimeExports.jsxs(j.default,{placement:"right",children:[t.jsxRuntimeExports.jsx(j.default.Trigger,{className:r["toggle-button-tooltip"],children:t.jsxRuntimeExports.jsx(R.default,{size:"small",onClick:h,className:r["toggle-button"],"aria-label":l?"Open Sidebar":"Close Sidebar","data-tracking-id":u,icon:l?X:Z})}),t.jsxRuntimeExports.jsx(j.default.Content,{children:l?"Open Sidebar":"Close Sidebar"})]})})]})})}),y=o.forwardRef((e,a)=>{const{children:s,className:n,...g}=e,c=o.useContext(N),m=_.G([r["sidebar-header"]],n);return t.jsxRuntimeExports.jsx("div",{className:m,ref:a,...g,children:t.jsxRuntimeExports.jsx("div",{className:r["header-content"],"aria-hidden":c==null?void 0:c.collapsed,children:s})})}),C=o.forwardRef((e,a)=>{const{children:s,className:n,...g}=e,c=_.G([r.content],n),m=o.useRef(null),f=o.useRef(null),i=O.useSize(m),u=o.useRef(!0);o.useEffect(()=>{if(typeof window>"u"||!u.current)return;function x(){var h;const v=window.scrollY;(h=f.current)==null||h.scrollTo(0,v??0)}return window.addEventListener("scroll",x,{passive:!0}),()=>{window.removeEventListener("scroll",x)}},[]);function l(x){typeof window>"u"||u.current||window.scrollTo(0,x.target.scrollTop)}return t.jsxRuntimeExports.jsxs("main",{className:c,ref:Q(m,a),...g,children:[t.jsxRuntimeExports.jsx("div",{className:r["content-inner"],children:s}),t.jsxRuntimeExports.jsx("div",{className:r["virtual-scroll-container"],ref:f,style:{left:i&&(i==null?void 0:i.left)+(i==null?void 0:i.width)},onScrollCapture:l,onMouseEnter:()=>{u.current=!1},onMouseLeave:()=>{u.current=!0},children:t.jsxRuntimeExports.jsx("div",{style:{width:1,height:i?i.height+i.y*2:0}})})]})}),M=o.forwardRef((e,a)=>{var h;const{children:s,open:n,size:g="medium",noPadding:c,style:m,className:f,...i}=e,u=_.G([r.panel],[r[g]],f,{[r.open]:typeof n>"u"?!0:n,[r.persistent]:typeof n>"u",[r.noPadding]:c}),{breakpoint:l}=o.useContext(S.M),x=+(((h=k.BreakpointMd)==null?void 0:h.value.replace("px",""))??0),v=(l==null?void 0:l.innerWidth)??0;return typeof n<"u"&&v<x?t.jsxRuntimeExports.jsx(E.default,{open:n,children:t.jsxRuntimeExports.jsx(E.default.Content,{children:t.jsxRuntimeExports.jsx("div",{className:u,"aria-hidden":!n,"aria-disabled":!n,ref:a,...i,children:s})})}):t.jsxRuntimeExports.jsx("div",{className:u,"aria-hidden":!n,"aria-disabled":!n,ref:a,...i,children:t.jsxRuntimeExports.jsx("div",{className:r["panel-inner"],tabIndex:typeof n<"u"&&n?0:-1,style:m,children:t.jsxRuntimeExports.jsx("div",{children:s})})})}),q=Object.assign(ne,{Sidebar:P,SidebarHeader:y,Content:C,Panel:M});exports.Page=q;exports.PageContent=C;exports.PagePanel=M;exports.PageSidebar=P;exports.PageSidebarHeader=y;exports.default=q;
2
2
  //# sourceMappingURL=Page.cjs.map
package/Page.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Page.cjs","sources":["../node_modules/@react-hook/merged-ref/dist/module/index.js","../node_modules/@servicetitan/hammer-icon/mdi/round/chevron_right.svg","../node_modules/@servicetitan/hammer-icon/mdi/round/chevron_left.svg","../node_modules/@servicetitan/hammer-icon/mdi/round/segment.svg","../node_modules/@servicetitan/hammer-icon/mdi/round/keyboard_arrow_down.svg","../node_modules/@servicetitan/hammer-icon/mdi/round/keyboard_arrow_up.svg","../src/components/Page/Page.tsx"],"sourcesContent":["import * as React from 'react';\n\nfunction useMergedRef(...refs) {\n return React.useCallback(element => {\n for (let i = 0; i < refs.length; i++) {\n const ref = refs[i];\n if (typeof ref === 'function') ref(element);else if (ref && typeof ref === 'object') ref.current = element;\n }\n }, // eslint-disable-next-line react-hooks/exhaustive-deps\n refs);\n}\n\nexport default useMergedRef;","export default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNOS4yOSA2LjcxYS45OTYuOTk2IDAgMCAwIDAgMS40MUwxMy4xNyAxMmwtMy44OCAzLjg4YS45OTYuOTk2IDAgMSAwIDEuNDEgMS40MWw0LjU5LTQuNTlhLjk5Ni45OTYgMCAwIDAgMC0xLjQxTDEwLjcgNi43Yy0uMzgtLjM4LTEuMDItLjM4LTEuNDEuMDF6Ii8+PC9zdmc+\"","export default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTQuNzEgNi43MWEuOTk2Ljk5NiAwIDAgMC0xLjQxIDBMOC43MSAxMS4zYS45OTYuOTk2IDAgMCAwIDAgMS40MWw0LjU5IDQuNTlhLjk5Ni45OTYgMCAxIDAgMS40MS0xLjQxTDEwLjgzIDEybDMuODgtMy44OGMuMzktLjM5LjM4LTEuMDMgMC0xLjQxeiIvPjwvc3ZnPg==\"","export default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTAgMThoMTBjLjU1IDAgMS0uNDUgMS0xcy0uNDUtMS0xLTFIMTBjLS41NSAwLTEgLjQ1LTEgMXMuNDUgMSAxIDF6TTMgN2MwIC41NS40NSAxIDEgMWgxNmMuNTUgMCAxLS40NSAxLTFzLS40NS0xLTEtMUg0Yy0uNTUgMC0xIC40NS0xIDF6bTcgNmgxMGMuNTUgMCAxLS40NSAxLTFzLS40NS0xLTEtMUgxMGMtLjU1IDAtMSAuNDUtMSAxcy40NSAxIDEgMXoiLz48L3N2Zz4=\"","export default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNOC4xMiA5LjI5IDEyIDEzLjE3bDMuODgtMy44OGEuOTk2Ljk5NiAwIDEgMSAxLjQxIDEuNDFsLTQuNTkgNC41OWEuOTk2Ljk5NiAwIDAgMS0xLjQxIDBMNi43IDEwLjdhLjk5Ni45OTYgMCAwIDEgMC0xLjQxYy4zOS0uMzggMS4wMy0uMzkgMS40MiAweiIvPjwvc3ZnPg==\"","export default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNOC4xMiAxNC43MSAxMiAxMC44M2wzLjg4IDMuODhhLjk5Ni45OTYgMCAxIDAgMS40MS0xLjQxTDEyLjcgOC43MWEuOTk2Ljk5NiAwIDAgMC0xLjQxIDBMNi43IDEzLjNhLjk5Ni45OTYgMCAwIDAgMCAxLjQxYy4zOS4zOCAxLjAzLjM5IDEuNDIgMHoiLz48L3N2Zz4=\"","import {\n ComponentPropsWithoutRef,\n Ref,\n UIEvent,\n createContext,\n forwardRef,\n useContext,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport styles from \"./Page.module.scss\";\nimport cx from \"classnames\";\nimport Button from \"../Button\";\nimport useMergedRef from \"@react-hook/merged-ref\";\nimport useSize from \"../../hooks/useSize\";\nimport OpenSVG from \"@servicetitan/hammer-icon/mdi/round/chevron_right.svg\";\nimport CloseSVG from \"@servicetitan/hammer-icon/mdi/round/chevron_left.svg\";\nimport SegmentSVG from \"@servicetitan/hammer-icon/mdi/round/segment.svg\";\nimport RespOpen from \"@servicetitan/hammer-icon/mdi/round/keyboard_arrow_down.svg\";\nimport RespClose from \"@servicetitan/hammer-icon/mdi/round/keyboard_arrow_up.svg\";\nimport Tooltip from \"../Tooltip\";\nimport { core } from \"@servicetitan/hammer-token\";\nimport { useTrackingId } from \"../../hooks/useTrackingId\";\nimport {\n AnvilProviderContext,\n AnvilProviderContextProps,\n} from \"../../providers\";\nimport Dialog from \"../Dialog\";\nimport Popover from \"../Popover\";\nimport Flex from \"../Flex\";\nimport Icon from \"../Icon\";\n\nexport type PageProps = ComponentPropsWithoutRef<\"div\">;\n\nconst PageElement = forwardRef((props: PageProps, ref: Ref<HTMLDivElement>) => {\n const { children, ...rest } = props;\n\n return (\n <div className={styles[\"page\"]} ref={ref} {...rest}>\n <div className={styles[\"container\"]}>{children}</div>\n </div>\n );\n});\n\ntype PageSideBarContextProps = {\n collapsed: boolean;\n};\nconst PageSideBarContext = createContext<PageSideBarContextProps | null>(null);\n\nexport type PageSidebarProps = ComponentPropsWithoutRef<\"div\"> & {\n localStorageKey?: string;\n [\"data-tracking-id\"]?: string;\n currentPageTitle?: string;\n};\nexport const PageSidebar = forwardRef(\n (props: PageSidebarProps, ref: Ref<HTMLDivElement>) => {\n const {\n children,\n className,\n currentPageTitle,\n localStorageKey = \"sidebar-collapsed\",\n ...rest\n } = props;\n\n const data = {\n localStorageKey,\n };\n\n const { breakpoint } =\n useContext<AnvilProviderContextProps>(AnvilProviderContext);\n\n const trackingId = useTrackingId({\n name: \"PageSidebarButton\",\n data,\n hasOverride: !!props[\"data-tracking-id\"],\n });\n\n const [collapsed, setCollapsed] = useState<boolean>(() => {\n // getting stored value\n const sidebarState = localStorage.getItem(localStorageKey);\n return sidebarState ? JSON.parse(sidebarState) : false;\n });\n const classNames = cx([styles[\"sidebar\"]], className, {\n [styles[\"collapsed\"]]: collapsed,\n });\n const onToggleButtonClick = () => {\n setCollapsed((prev) => {\n localStorage.setItem(localStorageKey, JSON.stringify(!prev));\n return !prev;\n });\n };\n\n const breakpointWidth = +(\n core.primitive?.BreakpointMd?.value.replace(\"px\", \"\") ?? 0\n );\n const innerWidth = breakpoint?.innerWidth ?? 0;\n\n if (innerWidth < breakpointWidth) {\n return (\n <Popover fillAvailableHeight matchReferenceWidth noPadding disableCaret>\n <Popover.Trigger>\n {(props) => {\n if (typeof document !== \"undefined\") {\n props[\"data-state\"] === \"open\"\n ? (document.body.style.overflow = \"hidden\")\n : (document.body.style.overflow = \"auto\");\n }\n return (\n <div className={styles[\"sidebar-adaptive-trigger-container\"]}>\n <Button\n className={styles[\"sidebar-adaptive-trigger\"]}\n icon={SegmentSVG}\n appearance=\"ghost\"\n {...props}\n >\n {!currentPageTitle ? \"Menu\" : currentPageTitle}\n <Icon\n flexGrow=\"1\"\n justifyContent=\"end\"\n svg={\n props[\"data-state\"] === \"open\" ? RespClose : RespOpen\n }\n />\n </Button>\n </div>\n );\n }}\n </Popover.Trigger>\n <Popover.Content className={styles[\"sidebar-adaptive-container\"]}>\n <Flex\n direction=\"column\"\n className={styles[\"sidebar-adaptive\"]}\n ref={ref}\n >\n {children}\n </Flex>\n </Popover.Content>\n </Popover>\n );\n }\n\n return (\n <PageSideBarContext.Provider value={{ collapsed }}>\n <div className={classNames} ref={ref} {...rest}>\n <div className={styles[\"sidebar-inner\"]} aria-hidden={collapsed}>\n <div>{children}</div>\n </div>\n <div className={styles[\"toggle-button-wrapper\"]}>\n <Tooltip placement=\"right\">\n <Tooltip.Trigger className={styles[\"toggle-button-tooltip\"]}>\n <Button\n size=\"small\"\n onClick={onToggleButtonClick}\n className={styles[\"toggle-button\"]}\n aria-label={collapsed ? \"Open Sidebar\" : \"Close Sidebar\"}\n data-tracking-id={trackingId}\n icon={collapsed ? OpenSVG : CloseSVG}\n />\n </Tooltip.Trigger>\n <Tooltip.Content>\n {collapsed ? \"Open Sidebar\" : \"Close Sidebar\"}\n </Tooltip.Content>\n </Tooltip>\n </div>\n </div>\n </PageSideBarContext.Provider>\n );\n }\n);\n\nexport type PageSidebarHeaderProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const PageSidebarHeader = forwardRef(\n (props: PageSidebarHeaderProps, ref: Ref<HTMLDivElement>) => {\n const { children, className, ...rest } = props;\n const context = useContext(PageSideBarContext);\n const classNames = cx([styles[\"sidebar-header\"]], className);\n\n return (\n <div className={classNames} ref={ref} {...rest}>\n <div\n className={styles[\"header-content\"]}\n aria-hidden={context?.collapsed}\n >\n {children}\n </div>\n </div>\n );\n }\n);\n\nexport type PageContentProps = ComponentPropsWithoutRef<\"main\">;\n\nexport const PageContent = forwardRef(\n (props: PageContentProps, ref: Ref<HTMLAreaElement>) => {\n const { children, className, ...rest } = props;\n const classNames = cx([styles[\"content\"]], className);\n const mainRef = useRef<HTMLAreaElement>(null);\n const virtualScrollRef = useRef<HTMLDivElement>(null);\n const size = useSize(mainRef);\n const blocker = useRef(true);\n\n useEffect(() => {\n if (typeof window === \"undefined\") return;\n if (!blocker.current) return;\n function updatePosition() {\n const newValue = window.scrollY;\n\n virtualScrollRef.current?.scrollTo(0, newValue ?? 0);\n }\n window.addEventListener(\"scroll\", updatePosition, { passive: true });\n\n return () => {\n window.removeEventListener(\"scroll\", updatePosition);\n };\n }, []);\n\n function scrollBody(e: UIEvent<HTMLElement>) {\n if (typeof window === \"undefined\") return;\n if (blocker.current) return;\n window.scrollTo(0, (e.target as HTMLDivElement).scrollTop);\n }\n\n return (\n <main className={classNames} ref={useMergedRef(mainRef, ref)} {...rest}>\n <div className={styles[\"content-inner\"]}>{children}</div>\n <div\n className={styles[\"virtual-scroll-container\"]}\n ref={virtualScrollRef}\n style={{ left: size && size?.left + size?.width }}\n onScrollCapture={scrollBody}\n onMouseEnter={() => {\n blocker.current = false;\n }}\n onMouseLeave={() => {\n blocker.current = true;\n }}\n >\n <div\n style={{ width: 1, height: size ? size.height + size.y * 2 : 0 }}\n />\n </div>\n </main>\n );\n }\n);\n\nexport type PagePanelProps = ComponentPropsWithoutRef<\"div\"> & {\n open?: boolean;\n size?: \"small\" | \"medium\" | \"large\";\n noPadding?: boolean;\n};\n\nexport const PagePanel = forwardRef(\n (props: PagePanelProps, ref: Ref<HTMLDivElement>) => {\n const {\n children,\n open,\n size = \"medium\",\n noPadding,\n style,\n className,\n ...rest\n } = props;\n const classNames = cx([styles[\"panel\"]], [styles[size]], className, {\n [styles[\"open\"]]: typeof open === \"undefined\" ? true : open,\n [styles[\"persistent\"]]: typeof open === \"undefined\",\n [styles[\"noPadding\"]]: noPadding,\n });\n\n const { breakpoint } =\n useContext<AnvilProviderContextProps>(AnvilProviderContext);\n\n const breakpointWidth = +(\n core.primitive?.BreakpointMd?.value.replace(\"px\", \"\") ?? 0\n );\n const innerWidth = breakpoint?.innerWidth ?? 0;\n\n if (typeof open !== \"undefined\" && innerWidth < breakpointWidth) {\n return (\n <Dialog open={open}>\n <Dialog.Content>\n <div\n className={classNames}\n aria-hidden={!open}\n aria-disabled={!open}\n ref={ref}\n {...rest}\n >\n {children}\n </div>\n </Dialog.Content>\n </Dialog>\n );\n }\n return (\n <div\n className={classNames}\n aria-hidden={!open}\n aria-disabled={!open}\n ref={ref}\n {...rest}\n >\n <div\n className={styles[\"panel-inner\"]}\n tabIndex={typeof open !== \"undefined\" && open ? 0 : -1}\n style={style}\n >\n <div>{children}</div>\n </div>\n </div>\n );\n }\n);\n\nexport const Page = Object.assign(PageElement, {\n Sidebar: PageSidebar,\n SidebarHeader: PageSidebarHeader,\n Content: PageContent,\n Panel: PagePanel,\n});\n"],"names":["useMergedRef","refs","React__namespace","element","i","ref","SvgChevronRight","props","SvgChevronLeft","SvgSegment","SvgKeyboardArrowDown","SvgKeyboardArrowUp","PageElement","React","children","rest","jsxRuntime","styles","PageSideBarContext","PageSidebar","className","currentPageTitle","localStorageKey","data","breakpoint","AnvilProvider","trackingId","useTrackingId","collapsed","setCollapsed","sidebarState","classNames","index","onToggleButtonClick","prev","breakpointWidth","_a","primitive","Popover","props2","Button","Icon","Flex","Tooltip","PageSidebarHeader","context","PageContent","mainRef","virtualScrollRef","size","useSize","blocker","updatePosition","newValue","scrollBody","e","PagePanel","open","noPadding","style","innerWidth","Dialog","Page"],"mappings":"81DAEA,SAAAA,KAAAC,EAAA,CACA,OAAAC,EAAA,YAAAC,GAAA,CACA,QAAAC,EAAA,EAAAA,EAAAH,EAAA,OAAAG,IAAA,CACA,MAAAC,EAAAJ,EAAAG,CAAA,EACA,OAAAC,GAAA,WAAAA,EAAAF,CAAA,EAAAE,GAAA,OAAAA,GAAA,WAAAA,EAAA,QAAAF,EACA,CACA,EACAF,CAAA,CACA,CCTA,MAAAK,EAAAC,GAAAL,EAAA,cAAA,MAAA,CAAA,MAAA,6BAAA,MAAA,MAAA,OAAA,MAAA,QAAA,YAAA,GAAAK,CAAA,EAAAL,EAAA,cAAA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A,CAAA,SAAA7C,EAAA,kBAAA,IAGM,MAAC,CAAA,UAAAe,EACY,cAAA,CAAA0B,EACG,gBAAA,CAAAA,EACE,IAAApD,EAChB,GAAAU,EACI,SAAAD,CAEH,CAAA,CAAA,CAAA,CAAA,CAAA,EAMXE,EAAA,kBAAA,IACE,MAAC,CAAA,UAAAe,EACY,cAAA,CAAA0B,EACG,gBAAA,CAAAA,EACE,IAAApD,EAChB,GAAAU,EACI,SAAAC,EAAA,kBAAA,IAEJ,MAAC,CAAA,UAAAC,EAAA,aAAA,EACgC,SAAA,OAAAwC,EAAA,KAAAA,EAAA,EAAA,GACqB,MAAAE,EACpD,SAAA3C,EAAA,kBAAA,IAAA,MAAA,CAAA,SAAAF,CAAA,CAAA,CAEe,CAAA,CACjB,CAAA,CACF,CAGN,EAEagD,EAAA,OAAA,OAAAlD,GAAA,CAAkC,QAAAO,EACpC,cAAAyB,EACM,QAAAE,EACN,MAAAU,CAEX,CAAA","x_google_ignoreList":[0,1,2,3,4,5]}
1
+ {"version":3,"file":"Page.cjs","sources":["../node_modules/@react-hook/merged-ref/dist/module/index.js","../node_modules/@servicetitan/hammer-icon/mdi/round/chevron_right.svg","../node_modules/@servicetitan/hammer-icon/mdi/round/chevron_left.svg","../node_modules/@servicetitan/hammer-icon/mdi/round/segment.svg","../node_modules/@servicetitan/hammer-icon/mdi/round/keyboard_arrow_down.svg","../node_modules/@servicetitan/hammer-icon/mdi/round/keyboard_arrow_up.svg","../src/components/Page/Page.tsx"],"sourcesContent":["import * as React from 'react';\n\nfunction useMergedRef(...refs) {\n return React.useCallback(element => {\n for (let i = 0; i < refs.length; i++) {\n const ref = refs[i];\n if (typeof ref === 'function') ref(element);else if (ref && typeof ref === 'object') ref.current = element;\n }\n }, // eslint-disable-next-line react-hooks/exhaustive-deps\n refs);\n}\n\nexport default useMergedRef;","export default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNOS4yOSA2LjcxYS45OTYuOTk2IDAgMCAwIDAgMS40MUwxMy4xNyAxMmwtMy44OCAzLjg4YS45OTYuOTk2IDAgMSAwIDEuNDEgMS40MWw0LjU5LTQuNTlhLjk5Ni45OTYgMCAwIDAgMC0xLjQxTDEwLjcgNi43Yy0uMzgtLjM4LTEuMDItLjM4LTEuNDEuMDF6Ii8+PC9zdmc+\"","export default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTQuNzEgNi43MWEuOTk2Ljk5NiAwIDAgMC0xLjQxIDBMOC43MSAxMS4zYS45OTYuOTk2IDAgMCAwIDAgMS40MWw0LjU5IDQuNTlhLjk5Ni45OTYgMCAxIDAgMS40MS0xLjQxTDEwLjgzIDEybDMuODgtMy44OGMuMzktLjM5LjM4LTEuMDMgMC0xLjQxeiIvPjwvc3ZnPg==\"","export default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTAgMThoMTBjLjU1IDAgMS0uNDUgMS0xcy0uNDUtMS0xLTFIMTBjLS41NSAwLTEgLjQ1LTEgMXMuNDUgMSAxIDF6TTMgN2MwIC41NS40NSAxIDEgMWgxNmMuNTUgMCAxLS40NSAxLTFzLS40NS0xLTEtMUg0Yy0uNTUgMC0xIC40NS0xIDF6bTcgNmgxMGMuNTUgMCAxLS40NSAxLTFzLS40NS0xLTEtMUgxMGMtLjU1IDAtMSAuNDUtMSAxcy40NSAxIDEgMXoiLz48L3N2Zz4=\"","export default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNOC4xMiA5LjI5IDEyIDEzLjE3bDMuODgtMy44OGEuOTk2Ljk5NiAwIDEgMSAxLjQxIDEuNDFsLTQuNTkgNC41OWEuOTk2Ljk5NiAwIDAgMS0xLjQxIDBMNi43IDEwLjdhLjk5Ni45OTYgMCAwIDEgMC0xLjQxYy4zOS0uMzggMS4wMy0uMzkgMS40MiAweiIvPjwvc3ZnPg==\"","export default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNOC4xMiAxNC43MSAxMiAxMC44M2wzLjg4IDMuODhhLjk5Ni45OTYgMCAxIDAgMS40MS0xLjQxTDEyLjcgOC43MWEuOTk2Ljk5NiAwIDAgMC0xLjQxIDBMNi43IDEzLjNhLjk5Ni45OTYgMCAwIDAgMCAxLjQxYy4zOS4zOCAxLjAzLjM5IDEuNDIgMHoiLz48L3N2Zz4=\"","import {\n ComponentPropsWithoutRef,\n Ref,\n UIEvent,\n createContext,\n forwardRef,\n useContext,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport styles from \"./Page.module.scss\";\nimport cx from \"classnames\";\nimport Button from \"../Button\";\nimport useMergedRef from \"@react-hook/merged-ref\";\nimport useSize from \"../../hooks/useSize\";\nimport OpenSVG from \"@servicetitan/hammer-icon/mdi/round/chevron_right.svg\";\nimport CloseSVG from \"@servicetitan/hammer-icon/mdi/round/chevron_left.svg\";\nimport SegmentSVG from \"@servicetitan/hammer-icon/mdi/round/segment.svg\";\nimport RespOpen from \"@servicetitan/hammer-icon/mdi/round/keyboard_arrow_down.svg\";\nimport RespClose from \"@servicetitan/hammer-icon/mdi/round/keyboard_arrow_up.svg\";\nimport Tooltip from \"../Tooltip\";\nimport { core } from \"@servicetitan/hammer-token\";\nimport { useTrackingId } from \"../../hooks/useTrackingId\";\nimport {\n AnvilProviderContext,\n AnvilProviderContextProps,\n} from \"../../providers\";\nimport Dialog from \"../Dialog\";\nimport Popover from \"../Popover\";\nimport Flex from \"../Flex\";\nimport Icon from \"../Icon\";\n\nexport type PageProps = ComponentPropsWithoutRef<\"div\">;\n\nconst PageElement = forwardRef((props: PageProps, ref: Ref<HTMLDivElement>) => {\n const { children, ...rest } = props;\n\n return (\n <div className={styles[\"page\"]} ref={ref} {...rest}>\n <div className={styles[\"container\"]}>{children}</div>\n </div>\n );\n});\n\ntype PageSideBarContextProps = {\n collapsed: boolean;\n};\nconst PageSideBarContext = createContext<PageSideBarContextProps | null>(null);\n\nexport type PageSidebarProps = ComponentPropsWithoutRef<\"div\"> & {\n localStorageKey?: string;\n [\"data-tracking-id\"]?: string;\n currentPageTitle?: string;\n};\nexport const PageSidebar = forwardRef(\n (props: PageSidebarProps, ref: Ref<HTMLDivElement>) => {\n const {\n children,\n className,\n currentPageTitle,\n localStorageKey = \"sidebar-collapsed\",\n ...rest\n } = props;\n\n const data = {\n localStorageKey,\n };\n\n const { breakpoint } =\n useContext<AnvilProviderContextProps>(AnvilProviderContext);\n\n const trackingId = useTrackingId({\n name: \"PageSidebarButton\",\n data,\n hasOverride: !!props[\"data-tracking-id\"],\n });\n\n const [collapsed, setCollapsed] = useState<boolean>(() => {\n // getting stored value\n const sidebarState = localStorage.getItem(localStorageKey);\n return sidebarState ? JSON.parse(sidebarState) : false;\n });\n const classNames = cx([styles[\"sidebar\"]], className, {\n [styles[\"collapsed\"]]: collapsed,\n });\n const onToggleButtonClick = () => {\n setCollapsed((prev) => {\n localStorage.setItem(localStorageKey, JSON.stringify(!prev));\n return !prev;\n });\n };\n\n const breakpointWidth = +(\n core.primitive?.BreakpointMd?.value.replace(\"px\", \"\") ?? 0\n );\n const innerWidth = breakpoint?.innerWidth ?? 0;\n\n if (innerWidth < breakpointWidth) {\n return (\n <Popover fillAvailableHeight matchReferenceWidth noPadding disableCaret>\n <Popover.Trigger>\n {(props) => {\n if (typeof document !== \"undefined\") {\n props[\"data-state\"] === \"open\"\n ? (document.body.style.overflow = \"hidden\")\n : (document.body.style.overflow = \"auto\");\n }\n return (\n <div className={styles[\"sidebar-adaptive-trigger-container\"]}>\n <Button\n className={styles[\"sidebar-adaptive-trigger\"]}\n icon={SegmentSVG}\n appearance=\"ghost\"\n {...props}\n >\n {!currentPageTitle ? \"Menu\" : currentPageTitle}\n <Icon\n flexGrow=\"1\"\n justifyContent=\"end\"\n svg={\n props[\"data-state\"] === \"open\" ? RespClose : RespOpen\n }\n />\n </Button>\n </div>\n );\n }}\n </Popover.Trigger>\n <Popover.Content className={styles[\"sidebar-adaptive-container\"]}>\n <Flex\n direction=\"column\"\n className={styles[\"sidebar-adaptive\"]}\n ref={ref}\n >\n {children}\n </Flex>\n </Popover.Content>\n </Popover>\n );\n }\n\n return (\n <PageSideBarContext.Provider value={{ collapsed }}>\n <div className={classNames} ref={ref} {...rest}>\n <div className={styles[\"sidebar-inner\"]} aria-hidden={collapsed}>\n <div>{children}</div>\n </div>\n <div className={styles[\"toggle-button-wrapper\"]}>\n <Tooltip placement=\"right\">\n <Tooltip.Trigger className={styles[\"toggle-button-tooltip\"]}>\n <Button\n size=\"small\"\n onClick={onToggleButtonClick}\n className={styles[\"toggle-button\"]}\n aria-label={collapsed ? \"Open Sidebar\" : \"Close Sidebar\"}\n data-tracking-id={trackingId}\n icon={collapsed ? OpenSVG : CloseSVG}\n />\n </Tooltip.Trigger>\n <Tooltip.Content>\n {collapsed ? \"Open Sidebar\" : \"Close Sidebar\"}\n </Tooltip.Content>\n </Tooltip>\n </div>\n </div>\n </PageSideBarContext.Provider>\n );\n }\n);\n\nexport type PageSidebarHeaderProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const PageSidebarHeader = forwardRef(\n (props: PageSidebarHeaderProps, ref: Ref<HTMLDivElement>) => {\n const { children, className, ...rest } = props;\n const context = useContext(PageSideBarContext);\n const classNames = cx([styles[\"sidebar-header\"]], className);\n\n return (\n <div className={classNames} ref={ref} {...rest}>\n <div\n className={styles[\"header-content\"]}\n aria-hidden={context?.collapsed}\n >\n {children}\n </div>\n </div>\n );\n }\n);\n\nexport type PageContentProps = ComponentPropsWithoutRef<\"main\">;\n\nexport const PageContent = forwardRef(\n (props: PageContentProps, ref: Ref<HTMLAreaElement>) => {\n const { children, className, ...rest } = props;\n const classNames = cx([styles[\"content\"]], className);\n const mainRef = useRef<HTMLAreaElement>(null);\n const virtualScrollRef = useRef<HTMLDivElement>(null);\n const size = useSize(mainRef);\n const blocker = useRef(true);\n\n useEffect(() => {\n if (typeof window === \"undefined\") return;\n if (!blocker.current) return;\n function updatePosition() {\n const newValue = window.scrollY;\n\n virtualScrollRef.current?.scrollTo(0, newValue ?? 0);\n }\n window.addEventListener(\"scroll\", updatePosition, { passive: true });\n\n return () => {\n window.removeEventListener(\"scroll\", updatePosition);\n };\n }, []);\n\n function scrollBody(e: UIEvent<HTMLElement>) {\n if (typeof window === \"undefined\") return;\n if (blocker.current) return;\n window.scrollTo(0, (e.target as HTMLDivElement).scrollTop);\n }\n\n return (\n <main className={classNames} ref={useMergedRef(mainRef, ref)} {...rest}>\n <div className={styles[\"content-inner\"]}>{children}</div>\n <div\n className={styles[\"virtual-scroll-container\"]}\n ref={virtualScrollRef}\n style={{ left: size && size?.left + size?.width }}\n onScrollCapture={scrollBody}\n onMouseEnter={() => {\n blocker.current = false;\n }}\n onMouseLeave={() => {\n blocker.current = true;\n }}\n >\n <div\n style={{ width: 1, height: size ? size.height + size.y * 2 : 0 }}\n />\n </div>\n </main>\n );\n }\n);\n\nexport type PagePanelProps = ComponentPropsWithoutRef<\"div\"> & {\n open?: boolean;\n size?: \"small\" | \"medium\" | \"large\";\n noPadding?: boolean;\n};\n\nexport const PagePanel = forwardRef(\n (props: PagePanelProps, ref: Ref<HTMLDivElement>) => {\n const {\n children,\n open,\n size = \"medium\",\n noPadding,\n style,\n className,\n ...rest\n } = props;\n const classNames = cx([styles[\"panel\"]], [styles[size]], className, {\n [styles[\"open\"]]: typeof open === \"undefined\" ? true : open,\n [styles[\"persistent\"]]: typeof open === \"undefined\",\n [styles[\"noPadding\"]]: noPadding,\n });\n\n const { breakpoint } =\n useContext<AnvilProviderContextProps>(AnvilProviderContext);\n\n const breakpointWidth = +(\n core.primitive?.BreakpointMd?.value.replace(\"px\", \"\") ?? 0\n );\n const innerWidth = breakpoint?.innerWidth ?? 0;\n\n if (typeof open !== \"undefined\" && innerWidth < breakpointWidth) {\n return (\n <Dialog open={open}>\n <Dialog.Content>\n <div\n className={classNames}\n aria-hidden={!open}\n aria-disabled={!open}\n ref={ref}\n {...rest}\n >\n {children}\n </div>\n </Dialog.Content>\n </Dialog>\n );\n }\n return (\n <div\n className={classNames}\n aria-hidden={!open}\n aria-disabled={!open}\n ref={ref}\n {...rest}\n >\n <div\n className={styles[\"panel-inner\"]}\n tabIndex={typeof open !== \"undefined\" && open ? 0 : -1}\n style={style}\n >\n <div>{children}</div>\n </div>\n </div>\n );\n }\n);\n\nexport const Page = Object.assign(PageElement, {\n Sidebar: PageSidebar,\n SidebarHeader: PageSidebarHeader,\n Content: PageContent,\n Panel: PagePanel,\n});\n"],"names":["useMergedRef","refs","React__namespace","element","i","ref","SvgChevronRight","props","SvgChevronLeft","SvgSegment","SvgKeyboardArrowDown","SvgKeyboardArrowUp","PageElement","React","children","rest","jsxRuntime","styles","PageSideBarContext","PageSidebar","className","currentPageTitle","localStorageKey","data","breakpoint","AnvilProvider","trackingId","useTrackingId","collapsed","setCollapsed","sidebarState","classNames","index","onToggleButtonClick","prev","breakpointWidth","_a","primitive","Popover","props2","Button","Icon","Flex","Tooltip","PageSidebarHeader","context","PageContent","mainRef","virtualScrollRef","size","useSize","blocker","updatePosition","newValue","scrollBody","e","PagePanel","open","noPadding","style","innerWidth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C,EAAA,UAAA,EAAA,OAAAwC,EAAA,IACf,CAAAxC,EAAA,SAAA,EAAAyC,CACjB,CAAA,EAGzB,CAAA,WAAAlC,CAAA,EAAAX,EAAA,WAAAY,EAAA,CAAA,EAGAU,EAAA,IAAAC,EAAAC,EAAA,eAAA,YAAAD,EAAA,MAAA,QAAA,KAAA,MAAA,GAGAwB,GAAApC,GAAA,YAAAA,EAAA,aAAA,EAEA,OAAA,OAAAiC,EAAA,KAAAG,EAAAzB,EACEnB,EAAA,kBAAA,IAAA6C,EAAA,QAAA,CAAA,KAAAJ,EAAA,SAAAzC,EAAA,kBAAA,IAAA6C,EAAA,QAAA,QAAA,CAAA,SAAA7C,EAAA,kBAAA,IAGM,MAAC,CAAA,UAAAe,EACY,cAAA,CAAA0B,EACG,gBAAA,CAAAA,EACE,IAAApD,EAChB,GAAAU,EACI,SAAAD,CAEH,CAAA,CAAA,CAAA,CAAA,CAAA,EAMXE,EAAA,kBAAA,IACE,MAAC,CAAA,UAAAe,EACY,cAAA,CAAA0B,EACG,gBAAA,CAAAA,EACE,IAAApD,EAChB,GAAAU,EACI,SAAAC,EAAA,kBAAA,IAEJ,MAAC,CAAA,UAAAC,EAAA,aAAA,EACgC,SAAA,OAAAwC,EAAA,KAAAA,EAAA,EAAA,GACqB,MAAAE,EACpD,SAAA3C,EAAA,kBAAA,IAAA,MAAA,CAAA,SAAAF,CAAA,CAAA,CAEe,CAAA,CACjB,CAAA,CACF,CAGN,EAEagD,EAAA,OAAA,OAAAlD,GAAA,CAAkC,QAAAO,EACpC,cAAAyB,EACM,QAAAE,EACN,MAAAU,CAEX,CAAA","x_google_ignoreList":[0,1,2,3,4,5]}
package/Page.js CHANGED
@@ -10,6 +10,7 @@ import { B as P } from "./primitive-90e4e69c.js";
10
10
  import { useTrackingId as W } from "./useTrackingId.js";
11
11
  import { M as C } from "./index-49242812.js";
12
12
  import "./LocalizationProvider.js";
13
+ import "./PortalProvider.js";
13
14
  import "./index-11b6ca91-14b4e485.js";
14
15
  import y from "./Dialog.js";
15
16
  import j from "./Popover.js";
@@ -227,18 +228,18 @@ const Q = (n) => /* @__PURE__ */ c.createElement("svg", { xmlns: "http://www.w3.
227
228
  }
228
229
  );
229
230
  }
230
- ), ke = Object.assign(te, {
231
+ ), Ne = Object.assign(te, {
231
232
  Sidebar: ne,
232
233
  SidebarHeader: ae,
233
234
  Content: re,
234
235
  Panel: ie
235
236
  });
236
237
  export {
237
- ke as Page,
238
+ Ne as Page,
238
239
  re as PageContent,
239
240
  ie as PagePanel,
240
241
  ne as PageSidebar,
241
242
  ae as PageSidebarHeader,
242
- ke as default
243
+ Ne as default
243
244
  };
244
245
  //# sourceMappingURL=Page.js.map
package/Page.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Page.js","sources":["../node_modules/@react-hook/merged-ref/dist/module/index.js","../node_modules/@servicetitan/hammer-icon/mdi/round/chevron_right.svg","../node_modules/@servicetitan/hammer-icon/mdi/round/chevron_left.svg","../node_modules/@servicetitan/hammer-icon/mdi/round/segment.svg","../node_modules/@servicetitan/hammer-icon/mdi/round/keyboard_arrow_down.svg","../node_modules/@servicetitan/hammer-icon/mdi/round/keyboard_arrow_up.svg","../src/components/Page/Page.tsx"],"sourcesContent":["import * as React from 'react';\n\nfunction useMergedRef(...refs) {\n return React.useCallback(element => {\n for (let i = 0; i < refs.length; i++) {\n const ref = refs[i];\n if (typeof ref === 'function') ref(element);else if (ref && typeof ref === 'object') ref.current = element;\n }\n }, // eslint-disable-next-line react-hooks/exhaustive-deps\n refs);\n}\n\nexport default useMergedRef;","export default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNOS4yOSA2LjcxYS45OTYuOTk2IDAgMCAwIDAgMS40MUwxMy4xNyAxMmwtMy44OCAzLjg4YS45OTYuOTk2IDAgMSAwIDEuNDEgMS40MWw0LjU5LTQuNTlhLjk5Ni45OTYgMCAwIDAgMC0xLjQxTDEwLjcgNi43Yy0uMzgtLjM4LTEuMDItLjM4LTEuNDEuMDF6Ii8+PC9zdmc+\"","export default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTQuNzEgNi43MWEuOTk2Ljk5NiAwIDAgMC0xLjQxIDBMOC43MSAxMS4zYS45OTYuOTk2IDAgMCAwIDAgMS40MWw0LjU5IDQuNTlhLjk5Ni45OTYgMCAxIDAgMS40MS0xLjQxTDEwLjgzIDEybDMuODgtMy44OGMuMzktLjM5LjM4LTEuMDMgMC0xLjQxeiIvPjwvc3ZnPg==\"","export default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTAgMThoMTBjLjU1IDAgMS0uNDUgMS0xcy0uNDUtMS0xLTFIMTBjLS41NSAwLTEgLjQ1LTEgMXMuNDUgMSAxIDF6TTMgN2MwIC41NS40NSAxIDEgMWgxNmMuNTUgMCAxLS40NSAxLTFzLS40NS0xLTEtMUg0Yy0uNTUgMC0xIC40NS0xIDF6bTcgNmgxMGMuNTUgMCAxLS40NSAxLTFzLS40NS0xLTEtMUgxMGMtLjU1IDAtMSAuNDUtMSAxcy40NSAxIDEgMXoiLz48L3N2Zz4=\"","export default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNOC4xMiA5LjI5IDEyIDEzLjE3bDMuODgtMy44OGEuOTk2Ljk5NiAwIDEgMSAxLjQxIDEuNDFsLTQuNTkgNC41OWEuOTk2Ljk5NiAwIDAgMS0xLjQxIDBMNi43IDEwLjdhLjk5Ni45OTYgMCAwIDEgMC0xLjQxYy4zOS0uMzggMS4wMy0uMzkgMS40MiAweiIvPjwvc3ZnPg==\"","export default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNOC4xMiAxNC43MSAxMiAxMC44M2wzLjg4IDMuODhhLjk5Ni45OTYgMCAxIDAgMS40MS0xLjQxTDEyLjcgOC43MWEuOTk2Ljk5NiAwIDAgMC0xLjQxIDBMNi43IDEzLjNhLjk5Ni45OTYgMCAwIDAgMCAxLjQxYy4zOS4zOCAxLjAzLjM5IDEuNDIgMHoiLz48L3N2Zz4=\"","import {\n ComponentPropsWithoutRef,\n Ref,\n UIEvent,\n createContext,\n forwardRef,\n useContext,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport styles from \"./Page.module.scss\";\nimport cx from \"classnames\";\nimport Button from \"../Button\";\nimport useMergedRef from \"@react-hook/merged-ref\";\nimport useSize from \"../../hooks/useSize\";\nimport OpenSVG from \"@servicetitan/hammer-icon/mdi/round/chevron_right.svg\";\nimport CloseSVG from \"@servicetitan/hammer-icon/mdi/round/chevron_left.svg\";\nimport SegmentSVG from \"@servicetitan/hammer-icon/mdi/round/segment.svg\";\nimport RespOpen from \"@servicetitan/hammer-icon/mdi/round/keyboard_arrow_down.svg\";\nimport RespClose from \"@servicetitan/hammer-icon/mdi/round/keyboard_arrow_up.svg\";\nimport Tooltip from \"../Tooltip\";\nimport { core } from \"@servicetitan/hammer-token\";\nimport { useTrackingId } from \"../../hooks/useTrackingId\";\nimport {\n AnvilProviderContext,\n AnvilProviderContextProps,\n} from \"../../providers\";\nimport Dialog from \"../Dialog\";\nimport Popover from \"../Popover\";\nimport Flex from \"../Flex\";\nimport Icon from \"../Icon\";\n\nexport type PageProps = ComponentPropsWithoutRef<\"div\">;\n\nconst PageElement = forwardRef((props: PageProps, ref: Ref<HTMLDivElement>) => {\n const { children, ...rest } = props;\n\n return (\n <div className={styles[\"page\"]} ref={ref} {...rest}>\n <div className={styles[\"container\"]}>{children}</div>\n </div>\n );\n});\n\ntype PageSideBarContextProps = {\n collapsed: boolean;\n};\nconst PageSideBarContext = createContext<PageSideBarContextProps | null>(null);\n\nexport type PageSidebarProps = ComponentPropsWithoutRef<\"div\"> & {\n localStorageKey?: string;\n [\"data-tracking-id\"]?: string;\n currentPageTitle?: string;\n};\nexport const PageSidebar = forwardRef(\n (props: PageSidebarProps, ref: Ref<HTMLDivElement>) => {\n const {\n children,\n className,\n currentPageTitle,\n localStorageKey = \"sidebar-collapsed\",\n ...rest\n } = props;\n\n const data = {\n localStorageKey,\n };\n\n const { breakpoint } =\n useContext<AnvilProviderContextProps>(AnvilProviderContext);\n\n const trackingId = useTrackingId({\n name: \"PageSidebarButton\",\n data,\n hasOverride: !!props[\"data-tracking-id\"],\n });\n\n const [collapsed, setCollapsed] = useState<boolean>(() => {\n // getting stored value\n const sidebarState = localStorage.getItem(localStorageKey);\n return sidebarState ? JSON.parse(sidebarState) : false;\n });\n const classNames = cx([styles[\"sidebar\"]], className, {\n [styles[\"collapsed\"]]: collapsed,\n });\n const onToggleButtonClick = () => {\n setCollapsed((prev) => {\n localStorage.setItem(localStorageKey, JSON.stringify(!prev));\n return !prev;\n });\n };\n\n const breakpointWidth = +(\n core.primitive?.BreakpointMd?.value.replace(\"px\", \"\") ?? 0\n );\n const innerWidth = breakpoint?.innerWidth ?? 0;\n\n if (innerWidth < breakpointWidth) {\n return (\n <Popover fillAvailableHeight matchReferenceWidth noPadding disableCaret>\n <Popover.Trigger>\n {(props) => {\n if (typeof document !== \"undefined\") {\n props[\"data-state\"] === \"open\"\n ? (document.body.style.overflow = \"hidden\")\n : (document.body.style.overflow = \"auto\");\n }\n return (\n <div className={styles[\"sidebar-adaptive-trigger-container\"]}>\n <Button\n className={styles[\"sidebar-adaptive-trigger\"]}\n icon={SegmentSVG}\n appearance=\"ghost\"\n {...props}\n >\n {!currentPageTitle ? \"Menu\" : currentPageTitle}\n <Icon\n flexGrow=\"1\"\n justifyContent=\"end\"\n svg={\n props[\"data-state\"] === \"open\" ? RespClose : RespOpen\n }\n />\n </Button>\n </div>\n );\n }}\n </Popover.Trigger>\n <Popover.Content className={styles[\"sidebar-adaptive-container\"]}>\n <Flex\n direction=\"column\"\n className={styles[\"sidebar-adaptive\"]}\n ref={ref}\n >\n {children}\n </Flex>\n </Popover.Content>\n </Popover>\n );\n }\n\n return (\n <PageSideBarContext.Provider value={{ collapsed }}>\n <div className={classNames} ref={ref} {...rest}>\n <div className={styles[\"sidebar-inner\"]} aria-hidden={collapsed}>\n <div>{children}</div>\n </div>\n <div className={styles[\"toggle-button-wrapper\"]}>\n <Tooltip placement=\"right\">\n <Tooltip.Trigger className={styles[\"toggle-button-tooltip\"]}>\n <Button\n size=\"small\"\n onClick={onToggleButtonClick}\n className={styles[\"toggle-button\"]}\n aria-label={collapsed ? \"Open Sidebar\" : \"Close Sidebar\"}\n data-tracking-id={trackingId}\n icon={collapsed ? OpenSVG : CloseSVG}\n />\n </Tooltip.Trigger>\n <Tooltip.Content>\n {collapsed ? \"Open Sidebar\" : \"Close Sidebar\"}\n </Tooltip.Content>\n </Tooltip>\n </div>\n </div>\n </PageSideBarContext.Provider>\n );\n }\n);\n\nexport type PageSidebarHeaderProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const PageSidebarHeader = forwardRef(\n (props: PageSidebarHeaderProps, ref: Ref<HTMLDivElement>) => {\n const { children, className, ...rest } = props;\n const context = useContext(PageSideBarContext);\n const classNames = cx([styles[\"sidebar-header\"]], className);\n\n return (\n <div className={classNames} ref={ref} {...rest}>\n <div\n className={styles[\"header-content\"]}\n aria-hidden={context?.collapsed}\n >\n {children}\n </div>\n </div>\n );\n }\n);\n\nexport type PageContentProps = ComponentPropsWithoutRef<\"main\">;\n\nexport const PageContent = forwardRef(\n (props: PageContentProps, ref: Ref<HTMLAreaElement>) => {\n const { children, className, ...rest } = props;\n const classNames = cx([styles[\"content\"]], className);\n const mainRef = useRef<HTMLAreaElement>(null);\n const virtualScrollRef = useRef<HTMLDivElement>(null);\n const size = useSize(mainRef);\n const blocker = useRef(true);\n\n useEffect(() => {\n if (typeof window === \"undefined\") return;\n if (!blocker.current) return;\n function updatePosition() {\n const newValue = window.scrollY;\n\n virtualScrollRef.current?.scrollTo(0, newValue ?? 0);\n }\n window.addEventListener(\"scroll\", updatePosition, { passive: true });\n\n return () => {\n window.removeEventListener(\"scroll\", updatePosition);\n };\n }, []);\n\n function scrollBody(e: UIEvent<HTMLElement>) {\n if (typeof window === \"undefined\") return;\n if (blocker.current) return;\n window.scrollTo(0, (e.target as HTMLDivElement).scrollTop);\n }\n\n return (\n <main className={classNames} ref={useMergedRef(mainRef, ref)} {...rest}>\n <div className={styles[\"content-inner\"]}>{children}</div>\n <div\n className={styles[\"virtual-scroll-container\"]}\n ref={virtualScrollRef}\n style={{ left: size && size?.left + size?.width }}\n onScrollCapture={scrollBody}\n onMouseEnter={() => {\n blocker.current = false;\n }}\n onMouseLeave={() => {\n blocker.current = true;\n }}\n >\n <div\n style={{ width: 1, height: size ? size.height + size.y * 2 : 0 }}\n />\n </div>\n </main>\n );\n }\n);\n\nexport type PagePanelProps = ComponentPropsWithoutRef<\"div\"> & {\n open?: boolean;\n size?: \"small\" | \"medium\" | \"large\";\n noPadding?: boolean;\n};\n\nexport const PagePanel = forwardRef(\n (props: PagePanelProps, ref: Ref<HTMLDivElement>) => {\n const {\n children,\n open,\n size = \"medium\",\n noPadding,\n style,\n className,\n ...rest\n } = props;\n const classNames = cx([styles[\"panel\"]], [styles[size]], className, {\n [styles[\"open\"]]: typeof open === \"undefined\" ? true : open,\n [styles[\"persistent\"]]: typeof open === \"undefined\",\n [styles[\"noPadding\"]]: noPadding,\n });\n\n const { breakpoint } =\n useContext<AnvilProviderContextProps>(AnvilProviderContext);\n\n const breakpointWidth = +(\n core.primitive?.BreakpointMd?.value.replace(\"px\", \"\") ?? 0\n );\n const innerWidth = breakpoint?.innerWidth ?? 0;\n\n if (typeof open !== \"undefined\" && innerWidth < breakpointWidth) {\n return (\n <Dialog open={open}>\n <Dialog.Content>\n <div\n className={classNames}\n aria-hidden={!open}\n aria-disabled={!open}\n ref={ref}\n {...rest}\n >\n {children}\n </div>\n </Dialog.Content>\n </Dialog>\n );\n }\n return (\n <div\n className={classNames}\n aria-hidden={!open}\n aria-disabled={!open}\n ref={ref}\n {...rest}\n >\n <div\n className={styles[\"panel-inner\"]}\n tabIndex={typeof open !== \"undefined\" && open ? 0 : -1}\n style={style}\n >\n <div>{children}</div>\n </div>\n </div>\n );\n }\n);\n\nexport const Page = Object.assign(PageElement, {\n Sidebar: PageSidebar,\n SidebarHeader: PageSidebarHeader,\n Content: PageContent,\n Panel: PagePanel,\n});\n"],"names":["useMergedRef","refs","React","element","ref","SvgChevronRight","props","SvgChevronLeft","SvgSegment","SvgKeyboardArrowDown","SvgKeyboardArrowUp","PageElement","forwardRef","children","rest","jsxRuntimeExports","styles","PageSideBarContext","createContext","PageSidebar","className","currentPageTitle","localStorageKey","data","breakpoint","useContext","M","trackingId","useTrackingId","collapsed","setCollapsed","useState","sidebarState","classNames","G","onToggleButtonClick","prev","breakpointWidth","_a","BreakpointMd","Popover","props2","Button","Icon","Flex","Tooltip","PageSidebarHeader","context","PageContent","mainRef","useRef","virtualScrollRef","size","useSize","blocker","useEffect","updatePosition","newValue","scrollBody","e","PagePanel","open","noPadding","style","innerWidth","Dialog","Page"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAAA,KAAAC,GAAA;AACA,SAAAC,EAAA;AAAA,IAAA,CAAAC,MAAA;AACA,eA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gBAAAE,EAAA;AAAA,MACE;AAAA,MAAC;AAAA,QAAA,WAAAkB;AAAA,QACY,eAAA,CAAA4B;AAAA,QACG,iBAAA,CAAAA;AAAA,QACE,KAAAzD;AAAA,QAChB,GAAAU;AAAA,QACI,UAAA,gBAAAC,EAAA;AAAA,UAEJ;AAAA,UAAC;AAAA,YAAA,WAAAC,EAAA,aAAA;AAAA,YACgC,UAAA,OAAA6C,IAAA,OAAAA,IAAA,IAAA;AAAA,YACqB,OAAAE;AAAA,YACpD,UAAA,gBAAAhD,EAAA,IAAA,OAAA,EAAA,UAAAF,EAAA,CAAA;AAAA,UAEe;AAAA,QAAA;AAAA,MACjB;AAAA,IAAA;AAAA,EACF;AAGN,GAEaqD,KAAA,OAAA,OAAAvD,IAAA;AAAA,EAAkC,SAAAQ;AAAA,EACpC,eAAA2B;AAAA,EACM,SAAAE;AAAA,EACN,OAAAY;AAEX,CAAA;","x_google_ignoreList":[0,1,2,3,4,5]}
1
+ {"version":3,"file":"Page.js","sources":["../node_modules/@react-hook/merged-ref/dist/module/index.js","../node_modules/@servicetitan/hammer-icon/mdi/round/chevron_right.svg","../node_modules/@servicetitan/hammer-icon/mdi/round/chevron_left.svg","../node_modules/@servicetitan/hammer-icon/mdi/round/segment.svg","../node_modules/@servicetitan/hammer-icon/mdi/round/keyboard_arrow_down.svg","../node_modules/@servicetitan/hammer-icon/mdi/round/keyboard_arrow_up.svg","../src/components/Page/Page.tsx"],"sourcesContent":["import * as React from 'react';\n\nfunction useMergedRef(...refs) {\n return React.useCallback(element => {\n for (let i = 0; i < refs.length; i++) {\n const ref = refs[i];\n if (typeof ref === 'function') ref(element);else if (ref && typeof ref === 'object') ref.current = element;\n }\n }, // eslint-disable-next-line react-hooks/exhaustive-deps\n refs);\n}\n\nexport default useMergedRef;","export default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNOS4yOSA2LjcxYS45OTYuOTk2IDAgMCAwIDAgMS40MUwxMy4xNyAxMmwtMy44OCAzLjg4YS45OTYuOTk2IDAgMSAwIDEuNDEgMS40MWw0LjU5LTQuNTlhLjk5Ni45OTYgMCAwIDAgMC0xLjQxTDEwLjcgNi43Yy0uMzgtLjM4LTEuMDItLjM4LTEuNDEuMDF6Ii8+PC9zdmc+\"","export default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTQuNzEgNi43MWEuOTk2Ljk5NiAwIDAgMC0xLjQxIDBMOC43MSAxMS4zYS45OTYuOTk2IDAgMCAwIDAgMS40MWw0LjU5IDQuNTlhLjk5Ni45OTYgMCAxIDAgMS40MS0xLjQxTDEwLjgzIDEybDMuODgtMy44OGMuMzktLjM5LjM4LTEuMDMgMC0xLjQxeiIvPjwvc3ZnPg==\"","export default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTAgMThoMTBjLjU1IDAgMS0uNDUgMS0xcy0uNDUtMS0xLTFIMTBjLS41NSAwLTEgLjQ1LTEgMXMuNDUgMSAxIDF6TTMgN2MwIC41NS40NSAxIDEgMWgxNmMuNTUgMCAxLS40NSAxLTFzLS40NS0xLTEtMUg0Yy0uNTUgMC0xIC40NS0xIDF6bTcgNmgxMGMuNTUgMCAxLS40NSAxLTFzLS40NS0xLTEtMUgxMGMtLjU1IDAtMSAuNDUtMSAxcy40NSAxIDEgMXoiLz48L3N2Zz4=\"","export default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNOC4xMiA5LjI5IDEyIDEzLjE3bDMuODgtMy44OGEuOTk2Ljk5NiAwIDEgMSAxLjQxIDEuNDFsLTQuNTkgNC41OWEuOTk2Ljk5NiAwIDAgMS0xLjQxIDBMNi43IDEwLjdhLjk5Ni45OTYgMCAwIDEgMC0xLjQxYy4zOS0uMzggMS4wMy0uMzkgMS40MiAweiIvPjwvc3ZnPg==\"","export default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNOC4xMiAxNC43MSAxMiAxMC44M2wzLjg4IDMuODhhLjk5Ni45OTYgMCAxIDAgMS40MS0xLjQxTDEyLjcgOC43MWEuOTk2Ljk5NiAwIDAgMC0xLjQxIDBMNi43IDEzLjNhLjk5Ni45OTYgMCAwIDAgMCAxLjQxYy4zOS4zOCAxLjAzLjM5IDEuNDIgMHoiLz48L3N2Zz4=\"","import {\n ComponentPropsWithoutRef,\n Ref,\n UIEvent,\n createContext,\n forwardRef,\n useContext,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport styles from \"./Page.module.scss\";\nimport cx from \"classnames\";\nimport Button from \"../Button\";\nimport useMergedRef from \"@react-hook/merged-ref\";\nimport useSize from \"../../hooks/useSize\";\nimport OpenSVG from \"@servicetitan/hammer-icon/mdi/round/chevron_right.svg\";\nimport CloseSVG from \"@servicetitan/hammer-icon/mdi/round/chevron_left.svg\";\nimport SegmentSVG from \"@servicetitan/hammer-icon/mdi/round/segment.svg\";\nimport RespOpen from \"@servicetitan/hammer-icon/mdi/round/keyboard_arrow_down.svg\";\nimport RespClose from \"@servicetitan/hammer-icon/mdi/round/keyboard_arrow_up.svg\";\nimport Tooltip from \"../Tooltip\";\nimport { core } from \"@servicetitan/hammer-token\";\nimport { useTrackingId } from \"../../hooks/useTrackingId\";\nimport {\n AnvilProviderContext,\n AnvilProviderContextProps,\n} from \"../../providers\";\nimport Dialog from \"../Dialog\";\nimport Popover from \"../Popover\";\nimport Flex from \"../Flex\";\nimport Icon from \"../Icon\";\n\nexport type PageProps = ComponentPropsWithoutRef<\"div\">;\n\nconst PageElement = forwardRef((props: PageProps, ref: Ref<HTMLDivElement>) => {\n const { children, ...rest } = props;\n\n return (\n <div className={styles[\"page\"]} ref={ref} {...rest}>\n <div className={styles[\"container\"]}>{children}</div>\n </div>\n );\n});\n\ntype PageSideBarContextProps = {\n collapsed: boolean;\n};\nconst PageSideBarContext = createContext<PageSideBarContextProps | null>(null);\n\nexport type PageSidebarProps = ComponentPropsWithoutRef<\"div\"> & {\n localStorageKey?: string;\n [\"data-tracking-id\"]?: string;\n currentPageTitle?: string;\n};\nexport const PageSidebar = forwardRef(\n (props: PageSidebarProps, ref: Ref<HTMLDivElement>) => {\n const {\n children,\n className,\n currentPageTitle,\n localStorageKey = \"sidebar-collapsed\",\n ...rest\n } = props;\n\n const data = {\n localStorageKey,\n };\n\n const { breakpoint } =\n useContext<AnvilProviderContextProps>(AnvilProviderContext);\n\n const trackingId = useTrackingId({\n name: \"PageSidebarButton\",\n data,\n hasOverride: !!props[\"data-tracking-id\"],\n });\n\n const [collapsed, setCollapsed] = useState<boolean>(() => {\n // getting stored value\n const sidebarState = localStorage.getItem(localStorageKey);\n return sidebarState ? JSON.parse(sidebarState) : false;\n });\n const classNames = cx([styles[\"sidebar\"]], className, {\n [styles[\"collapsed\"]]: collapsed,\n });\n const onToggleButtonClick = () => {\n setCollapsed((prev) => {\n localStorage.setItem(localStorageKey, JSON.stringify(!prev));\n return !prev;\n });\n };\n\n const breakpointWidth = +(\n core.primitive?.BreakpointMd?.value.replace(\"px\", \"\") ?? 0\n );\n const innerWidth = breakpoint?.innerWidth ?? 0;\n\n if (innerWidth < breakpointWidth) {\n return (\n <Popover fillAvailableHeight matchReferenceWidth noPadding disableCaret>\n <Popover.Trigger>\n {(props) => {\n if (typeof document !== \"undefined\") {\n props[\"data-state\"] === \"open\"\n ? (document.body.style.overflow = \"hidden\")\n : (document.body.style.overflow = \"auto\");\n }\n return (\n <div className={styles[\"sidebar-adaptive-trigger-container\"]}>\n <Button\n className={styles[\"sidebar-adaptive-trigger\"]}\n icon={SegmentSVG}\n appearance=\"ghost\"\n {...props}\n >\n {!currentPageTitle ? \"Menu\" : currentPageTitle}\n <Icon\n flexGrow=\"1\"\n justifyContent=\"end\"\n svg={\n props[\"data-state\"] === \"open\" ? RespClose : RespOpen\n }\n />\n </Button>\n </div>\n );\n }}\n </Popover.Trigger>\n <Popover.Content className={styles[\"sidebar-adaptive-container\"]}>\n <Flex\n direction=\"column\"\n className={styles[\"sidebar-adaptive\"]}\n ref={ref}\n >\n {children}\n </Flex>\n </Popover.Content>\n </Popover>\n );\n }\n\n return (\n <PageSideBarContext.Provider value={{ collapsed }}>\n <div className={classNames} ref={ref} {...rest}>\n <div className={styles[\"sidebar-inner\"]} aria-hidden={collapsed}>\n <div>{children}</div>\n </div>\n <div className={styles[\"toggle-button-wrapper\"]}>\n <Tooltip placement=\"right\">\n <Tooltip.Trigger className={styles[\"toggle-button-tooltip\"]}>\n <Button\n size=\"small\"\n onClick={onToggleButtonClick}\n className={styles[\"toggle-button\"]}\n aria-label={collapsed ? \"Open Sidebar\" : \"Close Sidebar\"}\n data-tracking-id={trackingId}\n icon={collapsed ? OpenSVG : CloseSVG}\n />\n </Tooltip.Trigger>\n <Tooltip.Content>\n {collapsed ? \"Open Sidebar\" : \"Close Sidebar\"}\n </Tooltip.Content>\n </Tooltip>\n </div>\n </div>\n </PageSideBarContext.Provider>\n );\n }\n);\n\nexport type PageSidebarHeaderProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const PageSidebarHeader = forwardRef(\n (props: PageSidebarHeaderProps, ref: Ref<HTMLDivElement>) => {\n const { children, className, ...rest } = props;\n const context = useContext(PageSideBarContext);\n const classNames = cx([styles[\"sidebar-header\"]], className);\n\n return (\n <div className={classNames} ref={ref} {...rest}>\n <div\n className={styles[\"header-content\"]}\n aria-hidden={context?.collapsed}\n >\n {children}\n </div>\n </div>\n );\n }\n);\n\nexport type PageContentProps = ComponentPropsWithoutRef<\"main\">;\n\nexport const PageContent = forwardRef(\n (props: PageContentProps, ref: Ref<HTMLAreaElement>) => {\n const { children, className, ...rest } = props;\n const classNames = cx([styles[\"content\"]], className);\n const mainRef = useRef<HTMLAreaElement>(null);\n const virtualScrollRef = useRef<HTMLDivElement>(null);\n const size = useSize(mainRef);\n const blocker = useRef(true);\n\n useEffect(() => {\n if (typeof window === \"undefined\") return;\n if (!blocker.current) return;\n function updatePosition() {\n const newValue = window.scrollY;\n\n virtualScrollRef.current?.scrollTo(0, newValue ?? 0);\n }\n window.addEventListener(\"scroll\", updatePosition, { passive: true });\n\n return () => {\n window.removeEventListener(\"scroll\", updatePosition);\n };\n }, []);\n\n function scrollBody(e: UIEvent<HTMLElement>) {\n if (typeof window === \"undefined\") return;\n if (blocker.current) return;\n window.scrollTo(0, (e.target as HTMLDivElement).scrollTop);\n }\n\n return (\n <main className={classNames} ref={useMergedRef(mainRef, ref)} {...rest}>\n <div className={styles[\"content-inner\"]}>{children}</div>\n <div\n className={styles[\"virtual-scroll-container\"]}\n ref={virtualScrollRef}\n style={{ left: size && size?.left + size?.width }}\n onScrollCapture={scrollBody}\n onMouseEnter={() => {\n blocker.current = false;\n }}\n onMouseLeave={() => {\n blocker.current = true;\n }}\n >\n <div\n style={{ width: 1, height: size ? size.height + size.y * 2 : 0 }}\n />\n </div>\n </main>\n );\n }\n);\n\nexport type PagePanelProps = ComponentPropsWithoutRef<\"div\"> & {\n open?: boolean;\n size?: \"small\" | \"medium\" | \"large\";\n noPadding?: boolean;\n};\n\nexport const PagePanel = forwardRef(\n (props: PagePanelProps, ref: Ref<HTMLDivElement>) => {\n const {\n children,\n open,\n size = \"medium\",\n noPadding,\n style,\n className,\n ...rest\n } = props;\n const classNames = cx([styles[\"panel\"]], [styles[size]], className, {\n [styles[\"open\"]]: typeof open === \"undefined\" ? true : open,\n [styles[\"persistent\"]]: typeof open === \"undefined\",\n [styles[\"noPadding\"]]: noPadding,\n });\n\n const { breakpoint } =\n useContext<AnvilProviderContextProps>(AnvilProviderContext);\n\n const breakpointWidth = +(\n core.primitive?.BreakpointMd?.value.replace(\"px\", \"\") ?? 0\n );\n const innerWidth = breakpoint?.innerWidth ?? 0;\n\n if (typeof open !== \"undefined\" && innerWidth < breakpointWidth) {\n return (\n <Dialog open={open}>\n <Dialog.Content>\n <div\n className={classNames}\n aria-hidden={!open}\n aria-disabled={!open}\n ref={ref}\n {...rest}\n >\n {children}\n </div>\n </Dialog.Content>\n </Dialog>\n );\n }\n return (\n <div\n className={classNames}\n aria-hidden={!open}\n aria-disabled={!open}\n ref={ref}\n {...rest}\n >\n <div\n className={styles[\"panel-inner\"]}\n tabIndex={typeof open !== \"undefined\" && open ? 0 : -1}\n style={style}\n >\n <div>{children}</div>\n </div>\n </div>\n );\n }\n);\n\nexport const Page = Object.assign(PageElement, {\n Sidebar: PageSidebar,\n SidebarHeader: PageSidebarHeader,\n Content: PageContent,\n Panel: PagePanel,\n});\n"],"names":["useMergedRef","refs","React","element","ref","SvgChevronRight","props","SvgChevronLeft","SvgSegment","SvgKeyboardArrowDown","SvgKeyboardArrowUp","PageElement","forwardRef","children","rest","jsxRuntimeExports","styles","PageSideBarContext","createContext","PageSidebar","className","currentPageTitle","localStorageKey","data","breakpoint","useContext","M","trackingId","useTrackingId","collapsed","setCollapsed","useState","sidebarState","classNames","G","onToggleButtonClick","prev","breakpointWidth","_a","BreakpointMd","Popover","props2","Button","Icon","Flex","Tooltip","PageSidebarHeader","context","PageContent","mainRef","useRef","virtualScrollRef","size","useSize","blocker","useEffect","updatePosition","newValue","scrollBody","e","PagePanel","open","noPadding","style","innerWidth","Dialog","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B;AAAA,QACG,iBAAA,CAAAA;AAAA,QACE,KAAAzD;AAAA,QAChB,GAAAU;AAAA,QACI,UAAAD;AAAA,MAEH;AAAA,IAAA,EAAA,CAAA,EAAA,CAAA,IAMX,gBAAAE,EAAA;AAAA,MACE;AAAA,MAAC;AAAA,QAAA,WAAAkB;AAAA,QACY,eAAA,CAAA4B;AAAA,QACG,iBAAA,CAAAA;AAAA,QACE,KAAAzD;AAAA,QAChB,GAAAU;AAAA,QACI,UAAA,gBAAAC,EAAA;AAAA,UAEJ;AAAA,UAAC;AAAA,YAAA,WAAAC,EAAA,aAAA;AAAA,YACgC,UAAA,OAAA6C,IAAA,OAAAA,IAAA,IAAA;AAAA,YACqB,OAAAE;AAAA,YACpD,UAAA,gBAAAhD,EAAA,IAAA,OAAA,EAAA,UAAAF,EAAA,CAAA;AAAA,UAEe;AAAA,QAAA;AAAA,MACjB;AAAA,IAAA;AAAA,EACF;AAGN,GAEaqD,KAAA,OAAA,OAAAvD,IAAA;AAAA,EAAkC,SAAAQ;AAAA,EACpC,eAAA2B;AAAA,EACM,SAAAE;AAAA,EACN,OAAAY;AAEX,CAAA;","x_google_ignoreList":[0,1,2,3,4,5]}
package/anvil2.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("./Alert.cjs"),T=require("./Announcement.cjs"),f=require("./Avatar.cjs"),D=require("./Badge.cjs"),w=require("./Button.cjs"),B=require("./ButtonCompound.cjs"),h=require("./ButtonLink.cjs"),y=require("./ButtonToggle.cjs"),o=require("./Calendar.cjs"),k=require("./Card.cjs"),S=require("./Checkbox.cjs"),O=require("./Chip.cjs"),e=require("./Combobox.cjs"),s=require("./Details.cjs"),r=require("./Dialog.cjs"),A=require("./Divider.cjs"),a=require("./Drawer.cjs"),N=require("./Flex.cjs"),F=require("./Grid.cjs"),G=require("./Icon.cjs"),d=require("./Layout.cjs"),I=require("./Link.cjs"),c=require("./Listbox.cjs"),p=require("./ListView.cjs"),g=require("./Menu.cjs"),q=require("./Overflow.cjs"),n=require("./Page.cjs"),i=require("./Popover.cjs"),M=require("./ProgressBar.cjs"),m=require("./Radio.cjs"),P=require("./SegmentedControl.cjs"),u=require("./SideNav.cjs"),z=require("./SrOnly.cjs"),t=require("./Stepper.cjs"),R=require("./Switch.cjs"),l=require("./Tab.cjs"),V=require("./Text.cjs"),E=require("./Textarea.cjs"),H=require("./TextField.cjs"),v=require("./Toast.cjs"),C=require("./Tooltip.cjs"),j=require("./useAccessibleColor.cjs"),Y=require("./index-dcf78e3f.cjs"),J=require("./index-69174413.cjs"),K=require("./usePrefersColorScheme.cjs"),Q=require("./useSwipe.cjs"),U=require("./useTrackingId.cjs"),x=require("./index-40821bc4.cjs"),b=require("./LocalizationProvider.cjs"),W=require("./ThemeProvider.cjs");exports.Alert=L.default;exports.Announcement=T.default;exports.Avatar=f.default;exports.AvatarGroup=f.AvatarGroup;exports.Badge=D.default;exports.Button=w.default;exports.ButtonCompound=B.default;exports.ButtonLink=h.default;exports.ButtonToggle=y.default;exports.Calendar=o.default;exports.CalendarMonth=o.CalendarMonth;exports.CalendarNext=o.CalendarNext;exports.CalendarNow=o.CalendarNow;exports.CalendarPrev=o.CalendarPrev;exports.Card=k.default;exports.Checkbox=S.default;exports.CheckboxGroup=S.CheckboxGroup;exports.Chip=O.default;exports.Combobox=e.default;exports.ComboboxContent=e.ComboboxContent;exports.ComboboxElement=e.ComboboxElement;exports.ComboboxEmpty=e.ComboboxEmpty;exports.ComboboxItem=e.ComboboxItem;exports.ComboboxList=e.ComboboxList;exports.ComboboxSearchField=e.ComboboxSearchField;exports.Details=s.default;exports.DetailsContent=s.DetailsContent;exports.DetailsSummary=s.DetailsSummary;exports.Dialog=r.default;exports.DialogCancelButton=r.DialogCancelButton;exports.DialogContent=r.DialogContent;exports.DialogFooter=r.DialogFooter;exports.DialogHeader=r.DialogHeader;exports.Divider=A.default;exports.Drawer=a.default;exports.DrawerCancelButton=a.DrawerCancelButton;exports.DrawerContent=a.DrawerContent;exports.DrawerFooter=a.DrawerFooter;exports.DrawerHeader=a.DrawerHeader;exports.Flex=N.default;exports.Grid=F.default;exports.Icon=G.default;exports.Layout=d.default;exports.LayoutElement=d.LayoutElement;exports.LayoutItem=d.LayoutItem;exports.Link=I.default;exports.Listbox=c.default;exports.ListboxOption=c.ListboxOption;exports.ListboxOptionGroup=c.ListboxOptionGroup;exports.ListView=p.default;exports.ListViewOption=p.ListViewOption;exports.ListViewOptionCell=p.ListViewOptionCell;exports.Menu=g.default;exports.MenuItem=g.MenuItem;exports.Overflow=q.default;exports.OverflowText=q.OverflowText;exports.Page=n.default;exports.PageContent=n.PageContent;exports.PagePanel=n.PagePanel;exports.PageSidebar=n.PageSidebar;exports.PageSidebarHeader=n.PageSidebarHeader;exports.Popover=i.default;exports.PopoverButton=i.PopoverButton;exports.PopoverClose=i.PopoverClose;exports.PopoverContent=i.PopoverContent;exports.PopoverTrigger=i.PopoverTrigger;exports.ProgressBar=M.default;exports.Radio=m.default;exports.RadioGroup=m.RadioGroup;exports.SegmentedControl=P.default;exports.SegmentedControlSegment=P.SegmentedControlSegment;exports.SideNav=u.default;exports.SideNavCollapsible=u.SideNavCollapsible;exports.SideNavGroup=u.SideNavGroup;exports.SideNavLink=u.SideNavLink;exports.SrOnly=z.default;exports.Stepper=t.default;exports.StepperFinalPanel=t.StepperFinalPanel;exports.StepperList=t.StepperList;exports.StepperNextButton=t.StepperNextButton;exports.StepperPanel=t.StepperPanel;exports.StepperPrevButton=t.StepperPrevButton;exports.StepperStep=t.StepperStep;exports.Switch=R.default;exports.Tab=l.default;exports.TabButton=l.TabButton;exports.TabList=l.TabList;exports.TabPanel=l.TabPanel;exports.Text=V.default;exports.Textarea=E.default;exports.TextField=H.default;exports.Toaster=v.Toaster;exports.toast=v.default;exports.Tooltip=C.default;exports.TooltipContent=C.TooltipContent;exports.TooltipTrigger=C.TooltipTrigger;exports.useAccessibleColor=j.useAccessibleColor;exports.useLinkStyles=Y.V;exports.useMergeRefs=J.useMergeRefs;exports.usePrefersColorScheme=K.usePrefersColorScheme;exports.useSwipe=Q.useSwipe;exports.useTrackingId=U.useTrackingId;exports.AnvilProvider=x.Y;exports.AnvilProviderContext=x.M;exports.LocalizationContext=b.LocalizationContext;exports.LocalizationProvider=b.LocalizationProvider;exports.useLocalizationContext=b.useLocalizationContext;exports.ThemeProvider=W.ThemeProvider;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("./Alert.cjs"),D=require("./Announcement.cjs"),P=require("./Avatar.cjs"),w=require("./Badge.cjs"),B=require("./Button.cjs"),h=require("./ButtonCompound.cjs"),y=require("./ButtonLink.cjs"),k=require("./ButtonToggle.cjs"),o=require("./Calendar.cjs"),O=require("./Card.cjs"),f=require("./Checkbox.cjs"),A=require("./Chip.cjs"),e=require("./Combobox.cjs"),s=require("./Details.cjs"),r=require("./Dialog.cjs"),N=require("./Divider.cjs"),a=require("./Drawer.cjs"),F=require("./Flex.cjs"),G=require("./Grid.cjs"),I=require("./Icon.cjs"),d=require("./Layout.cjs"),M=require("./Link.cjs"),c=require("./Listbox.cjs"),p=require("./ListView.cjs"),S=require("./Menu.cjs"),q=require("./Overflow.cjs"),n=require("./Page.cjs"),i=require("./Popover.cjs"),z=require("./ProgressBar.cjs"),g=require("./Radio.cjs"),v=require("./SegmentedControl.cjs"),u=require("./SideNav.cjs"),R=require("./SrOnly.cjs"),t=require("./Stepper.cjs"),V=require("./Switch.cjs"),l=require("./Tab.cjs"),E=require("./Text.cjs"),H=require("./Textarea.cjs"),j=require("./TextField.cjs"),m=require("./Toast.cjs"),C=require("./Tooltip.cjs"),Y=require("./useAccessibleColor.cjs"),J=require("./index-dcf78e3f.cjs"),K=require("./index-69174413.cjs"),Q=require("./usePrefersColorScheme.cjs"),U=require("./useSwipe.cjs"),W=require("./useTrackingId.cjs"),x=require("./index-40821bc4.cjs"),b=require("./LocalizationProvider.cjs"),L=require("./PortalProvider.cjs"),X=require("./ThemeProvider.cjs");exports.Alert=T.default;exports.Announcement=D.default;exports.Avatar=P.default;exports.AvatarGroup=P.AvatarGroup;exports.Badge=w.default;exports.Button=B.default;exports.ButtonCompound=h.default;exports.ButtonLink=y.default;exports.ButtonToggle=k.default;exports.Calendar=o.default;exports.CalendarMonth=o.CalendarMonth;exports.CalendarNext=o.CalendarNext;exports.CalendarNow=o.CalendarNow;exports.CalendarPrev=o.CalendarPrev;exports.Card=O.default;exports.Checkbox=f.default;exports.CheckboxGroup=f.CheckboxGroup;exports.Chip=A.default;exports.Combobox=e.default;exports.ComboboxContent=e.ComboboxContent;exports.ComboboxElement=e.ComboboxElement;exports.ComboboxEmpty=e.ComboboxEmpty;exports.ComboboxItem=e.ComboboxItem;exports.ComboboxList=e.ComboboxList;exports.ComboboxSearchField=e.ComboboxSearchField;exports.Details=s.default;exports.DetailsContent=s.DetailsContent;exports.DetailsSummary=s.DetailsSummary;exports.Dialog=r.default;exports.DialogCancelButton=r.DialogCancelButton;exports.DialogContent=r.DialogContent;exports.DialogFooter=r.DialogFooter;exports.DialogHeader=r.DialogHeader;exports.Divider=N.default;exports.Drawer=a.default;exports.DrawerCancelButton=a.DrawerCancelButton;exports.DrawerContent=a.DrawerContent;exports.DrawerFooter=a.DrawerFooter;exports.DrawerHeader=a.DrawerHeader;exports.Flex=F.default;exports.Grid=G.default;exports.Icon=I.default;exports.Layout=d.default;exports.LayoutElement=d.LayoutElement;exports.LayoutItem=d.LayoutItem;exports.Link=M.default;exports.Listbox=c.default;exports.ListboxOption=c.ListboxOption;exports.ListboxOptionGroup=c.ListboxOptionGroup;exports.ListView=p.default;exports.ListViewOption=p.ListViewOption;exports.ListViewOptionCell=p.ListViewOptionCell;exports.Menu=S.default;exports.MenuItem=S.MenuItem;exports.Overflow=q.default;exports.OverflowText=q.OverflowText;exports.Page=n.default;exports.PageContent=n.PageContent;exports.PagePanel=n.PagePanel;exports.PageSidebar=n.PageSidebar;exports.PageSidebarHeader=n.PageSidebarHeader;exports.Popover=i.default;exports.PopoverButton=i.PopoverButton;exports.PopoverClose=i.PopoverClose;exports.PopoverContent=i.PopoverContent;exports.PopoverTrigger=i.PopoverTrigger;exports.ProgressBar=z.default;exports.Radio=g.default;exports.RadioGroup=g.RadioGroup;exports.SegmentedControl=v.default;exports.SegmentedControlSegment=v.SegmentedControlSegment;exports.SideNav=u.default;exports.SideNavCollapsible=u.SideNavCollapsible;exports.SideNavGroup=u.SideNavGroup;exports.SideNavLink=u.SideNavLink;exports.SrOnly=R.default;exports.Stepper=t.default;exports.StepperFinalPanel=t.StepperFinalPanel;exports.StepperList=t.StepperList;exports.StepperNextButton=t.StepperNextButton;exports.StepperPanel=t.StepperPanel;exports.StepperPrevButton=t.StepperPrevButton;exports.StepperStep=t.StepperStep;exports.Switch=V.default;exports.Tab=l.default;exports.TabButton=l.TabButton;exports.TabList=l.TabList;exports.TabPanel=l.TabPanel;exports.Text=E.default;exports.Textarea=H.default;exports.TextField=j.default;exports.Toaster=m.Toaster;exports.toast=m.default;exports.Tooltip=C.default;exports.TooltipContent=C.TooltipContent;exports.TooltipTrigger=C.TooltipTrigger;exports.useAccessibleColor=Y.useAccessibleColor;exports.useLinkStyles=J.V;exports.useMergeRefs=K.useMergeRefs;exports.usePrefersColorScheme=Q.usePrefersColorScheme;exports.useSwipe=U.useSwipe;exports.useTrackingId=W.useTrackingId;exports.AnvilProvider=x.Y;exports.AnvilProviderContext=x.M;exports.LocalizationContext=b.LocalizationContext;exports.LocalizationProvider=b.LocalizationProvider;exports.useLocalizationContext=b.useLocalizationContext;exports.PortalProvider=L.PortalProvider;exports.PortalProviderContext=L.PortalProviderContext;exports.ThemeProvider=X.ThemeProvider;
2
2
  //# sourceMappingURL=anvil2.cjs.map
package/anvil2.d.ts CHANGED
@@ -103,6 +103,10 @@ import { PopoverContentProps as PopoverContentProps_2 } from '@servicetitan/hamm
103
103
  import { PopoverContextType as PopoverContextType_2 } from '@servicetitan/hammer-react/dist/Popover';
104
104
  import { PopoverProps as PopoverProps_2 } from '@servicetitan/hammer-react/dist/Popover';
105
105
  import { PopoverTriggerProps as PopoverTriggerProps_2 } from '@servicetitan/hammer-react/dist/Popover';
106
+ import { PortalProvider } from '@servicetitan/hammer-react/dist/PortalProvider';
107
+ import { PortalProviderContext } from '@servicetitan/hammer-react/dist/PortalProvider';
108
+ import { PortalProviderContextProps } from '@servicetitan/hammer-react/dist/PortalProvider';
109
+ import { ProtalProviderProps as PortalProviderProps } from '@servicetitan/hammer-react/dist/PortalProvider';
106
110
  import { ProgressBarProps as ProgressBarProps_2 } from '@servicetitan/hammer-react/dist/ProgressBar';
107
111
  import { RadioGroupProps as RadioGroupProps_2 } from '@servicetitan/hammer-react/dist/Radio';
108
112
  import { RadioProps as RadioProps_2 } from '@servicetitan/hammer-react/dist/Radio';
@@ -843,6 +847,14 @@ export declare const PopoverTrigger: (props: PopoverTriggerProps) => JSX_2.Eleme
843
847
 
844
848
  export declare type PopoverTriggerProps = PopoverTriggerProps_2 & DataTrackingId;
845
849
 
850
+ export { PortalProvider }
851
+
852
+ export { PortalProviderContext }
853
+
854
+ export { PortalProviderContextProps }
855
+
856
+ export { PortalProviderProps }
857
+
846
858
  export declare const ProgressBar: ForwardRefExoticComponent<ProgressBarProps_2 & RefAttributes<HTMLDivElement>>;
847
859
 
848
860
  export declare type ProgressBarProps = ProgressBarProps_2;
package/anvil2.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { default as t } from "./Alert.js";
2
2
  import { default as a } from "./Announcement.js";
3
3
  import { default as l, AvatarGroup as p } from "./Avatar.js";
4
- import { default as m } from "./Badge.js";
5
- import { default as x } from "./Button.js";
4
+ import { default as x } from "./Badge.js";
5
+ import { default as m } from "./Button.js";
6
6
  import { default as n } from "./ButtonCompound.js";
7
7
  import { default as C } from "./ButtonLink.js";
8
- import { default as S } from "./ButtonToggle.js";
9
- import { default as v, CalendarMonth as P, CalendarNext as L, CalendarNow as T, CalendarPrev as c } from "./Calendar.js";
8
+ import { default as P } from "./ButtonToggle.js";
9
+ import { default as S, CalendarMonth as g, CalendarNext as L, CalendarNow as T, CalendarPrev as c } from "./Calendar.js";
10
10
  import { default as w } from "./Card.js";
11
11
  import { default as h, CheckboxGroup as k } from "./Checkbox.js";
12
12
  import { default as A } from "./Chip.js";
@@ -18,10 +18,10 @@ import { default as _, DrawerCancelButton as $, DrawerContent as ee, DrawerFoote
18
18
  import { default as ae } from "./Flex.js";
19
19
  import { default as le } from "./Grid.js";
20
20
  import { default as se } from "./Icon.js";
21
- import { default as ue, LayoutElement as xe, LayoutItem as de } from "./Layout.js";
21
+ import { default as de, LayoutElement as me, LayoutItem as ue } from "./Layout.js";
22
22
  import { default as ie } from "./Link.js";
23
- import { default as be, ListboxOption as Se, ListboxOptionGroup as ge } from "./Listbox.js";
24
- import { default as Pe, ListViewOption as Le, ListViewOptionCell as Te } from "./ListView.js";
23
+ import { default as be, ListboxOption as Pe, ListboxOptionGroup as ve } from "./Listbox.js";
24
+ import { default as ge, ListViewOption as Le, ListViewOptionCell as Te } from "./ListView.js";
25
25
  import { default as De, MenuItem as we } from "./Menu.js";
26
26
  import { default as he, OverflowText as ke } from "./Overflow.js";
27
27
  import { default as Ae, PageContent as Ne, PagePanel as Oe, PageSidebar as Fe, PageSidebarHeader as Ge } from "./Page.js";
@@ -31,10 +31,10 @@ import { default as qe, RadioGroup as Je } from "./Radio.js";
31
31
  import { default as Qe, SegmentedControlSegment as Ue } from "./SegmentedControl.js";
32
32
  import { default as Xe, SideNavCollapsible as Ze, SideNavGroup as _e, SideNavLink as $e } from "./SideNav.js";
33
33
  import { default as oo } from "./SrOnly.js";
34
- import { default as ro, StepperFinalPanel as ao, StepperList as fo, StepperNextButton as lo, StepperPanel as po, StepperPrevButton as so, StepperStep as mo } from "./Stepper.js";
35
- import { default as xo } from "./Switch.js";
36
- import { default as io, TabButton as Co, TabList as bo, TabPanel as So } from "./Tab.js";
37
- import { default as vo } from "./Text.js";
34
+ import { default as ro, StepperFinalPanel as ao, StepperList as fo, StepperNextButton as lo, StepperPanel as po, StepperPrevButton as so, StepperStep as xo } from "./Stepper.js";
35
+ import { default as uo } from "./Switch.js";
36
+ import { default as io, TabButton as Co, TabList as bo, TabPanel as Po } from "./Tab.js";
37
+ import { default as So } from "./Text.js";
38
38
  import { default as Lo } from "./Textarea.js";
39
39
  import { default as co } from "./TextField.js";
40
40
  import { Toaster as wo, default as Bo } from "./Toast.js";
@@ -47,7 +47,8 @@ import { useSwipe as Ho } from "./useSwipe.js";
47
47
  import { useTrackingId as Yo } from "./useTrackingId.js";
48
48
  import { Y as qo, M as Jo } from "./index-49242812.js";
49
49
  import { LocalizationContext as Qo, LocalizationProvider as Uo, useLocalizationContext as Wo } from "./LocalizationProvider.js";
50
- import { ThemeProvider as Zo } from "./ThemeProvider.js";
50
+ import { PortalProvider as Zo, PortalProviderContext as _o } from "./PortalProvider.js";
51
+ import { ThemeProvider as et } from "./ThemeProvider.js";
51
52
  export {
52
53
  t as Alert,
53
54
  a as Announcement,
@@ -55,13 +56,13 @@ export {
55
56
  Jo as AnvilProviderContext,
56
57
  l as Avatar,
57
58
  p as AvatarGroup,
58
- m as Badge,
59
- x as Button,
59
+ x as Badge,
60
+ m as Button,
60
61
  n as ButtonCompound,
61
62
  C as ButtonLink,
62
- S as ButtonToggle,
63
- v as Calendar,
64
- P as CalendarMonth,
63
+ P as ButtonToggle,
64
+ S as Calendar,
65
+ g as CalendarMonth,
65
66
  L as CalendarNext,
66
67
  T as CalendarNow,
67
68
  c as CalendarPrev,
@@ -93,16 +94,16 @@ export {
93
94
  ae as Flex,
94
95
  le as Grid,
95
96
  se as Icon,
96
- ue as Layout,
97
- xe as LayoutElement,
98
- de as LayoutItem,
97
+ de as Layout,
98
+ me as LayoutElement,
99
+ ue as LayoutItem,
99
100
  ie as Link,
100
- Pe as ListView,
101
+ ge as ListView,
101
102
  Le as ListViewOption,
102
103
  Te as ListViewOptionCell,
103
104
  be as Listbox,
104
- Se as ListboxOption,
105
- ge as ListboxOptionGroup,
105
+ Pe as ListboxOption,
106
+ ve as ListboxOptionGroup,
106
107
  Qo as LocalizationContext,
107
108
  Uo as LocalizationProvider,
108
109
  De as Menu,
@@ -119,6 +120,8 @@ export {
119
120
  ze as PopoverClose,
120
121
  Ee as PopoverContent,
121
122
  He as PopoverTrigger,
123
+ Zo as PortalProvider,
124
+ _o as PortalProviderContext,
122
125
  Ye as ProgressBar,
123
126
  qe as Radio,
124
127
  Je as RadioGroup,
@@ -135,16 +138,16 @@ export {
135
138
  lo as StepperNextButton,
136
139
  po as StepperPanel,
137
140
  so as StepperPrevButton,
138
- mo as StepperStep,
139
- xo as Switch,
141
+ xo as StepperStep,
142
+ uo as Switch,
140
143
  io as Tab,
141
144
  Co as TabButton,
142
145
  bo as TabList,
143
- So as TabPanel,
144
- vo as Text,
146
+ Po as TabPanel,
147
+ So as Text,
145
148
  co as TextField,
146
149
  Lo as Textarea,
147
- Zo as ThemeProvider,
150
+ et as ThemeProvider,
148
151
  wo as Toaster,
149
152
  ko as Tooltip,
150
153
  yo as TooltipContent,
package/anvil2.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"anvil2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"anvil2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/anvil2",
3
- "version": "1.3.4",
3
+ "version": "1.3.5",
4
4
  "scripts": {
5
5
  "dev": "storybook dev -p 6006",
6
6
  "build": "npm run check-types && npm run build:css-utils && npm run build:vite && npm run build:icon-indexes",