@synertech/ui 0.47.0 → 0.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/.claude/skills/use-synertech-ui/SKILL.md +49 -1
  2. package/README.md +23 -0
  3. package/dist/components/area-chart/AreaChart.cjs +1 -1
  4. package/dist/components/area-chart/AreaChart.js +1 -1
  5. package/dist/components/bar-chart/BarChart.cjs +1 -1
  6. package/dist/components/bar-chart/BarChart.js +1 -1
  7. package/dist/components/box-plot/BoxPlot.cjs +1 -1
  8. package/dist/components/box-plot/BoxPlot.js +1 -1
  9. package/dist/components/breadcrumb/Breadcrumb.cjs +1 -1
  10. package/dist/components/breadcrumb/Breadcrumb.js +1 -1
  11. package/dist/components/bullet-chart/BulletChart.cjs +1 -1
  12. package/dist/components/bullet-chart/BulletChart.js +1 -1
  13. package/dist/components/calendar/Calendar.cjs +1 -1
  14. package/dist/components/calendar/Calendar.js +1 -1
  15. package/dist/components/candlestick-chart/CandlestickChart.cjs +1 -1
  16. package/dist/components/candlestick-chart/CandlestickChart.js +1 -1
  17. package/dist/components/chart/ChartPeriodPicker.cjs +1 -1
  18. package/dist/components/chart/ChartPeriodPicker.js +1 -1
  19. package/dist/components/datagrid/DataGrid.cjs +1 -1
  20. package/dist/components/datagrid/DataGrid.js +1 -1
  21. package/dist/components/dumbbell-chart/DumbbellChart.cjs +1 -1
  22. package/dist/components/dumbbell-chart/DumbbellChart.js +1 -1
  23. package/dist/components/footer/FooterLink.cjs +1 -1
  24. package/dist/components/footer/FooterLink.js +1 -1
  25. package/dist/components/footer/FooterSocial.cjs +1 -1
  26. package/dist/components/footer/FooterSocial.js +1 -1
  27. package/dist/components/form/number-input/NumberInput.cjs +1 -1
  28. package/dist/components/form/number-input/NumberInput.js +1 -1
  29. package/dist/components/funnel-chart/FunnelChart.cjs +1 -1
  30. package/dist/components/funnel-chart/FunnelChart.js +1 -1
  31. package/dist/components/gantt-chart/GanttChart.cjs +1 -1
  32. package/dist/components/gantt-chart/GanttChart.js +1 -1
  33. package/dist/components/header/Header.cjs +1 -1
  34. package/dist/components/header/Header.js +1 -1
  35. package/dist/components/heat-map/Heatmap.cjs +1 -1
  36. package/dist/components/heat-map/Heatmap.js +1 -1
  37. package/dist/components/help-button/HelpButton.cjs +5 -5
  38. package/dist/components/help-button/HelpButton.js +6 -6
  39. package/dist/components/help-button/sanitize-html.cjs +1 -0
  40. package/dist/components/help-button/sanitize-html.js +1 -0
  41. package/dist/components/line-chart/LineChart.cjs +1 -1
  42. package/dist/components/line-chart/LineChart.js +1 -1
  43. package/dist/components/pie-chart/PieChart.cjs +1 -1
  44. package/dist/components/pie-chart/PieChart.js +1 -1
  45. package/dist/components/scatter-chart/ScatterChart.cjs +1 -1
  46. package/dist/components/scatter-chart/ScatterChart.js +1 -1
  47. package/dist/components/sidebar/Sidebar.cjs +1 -1
  48. package/dist/components/sidebar/Sidebar.js +1 -1
  49. package/dist/components/stat-card/StatCard.cjs +1 -1
  50. package/dist/components/stat-card/StatCard.js +1 -1
  51. package/dist/components/waterfall-chart/WaterfallChart.cjs +1 -1
  52. package/dist/components/waterfall-chart/WaterfallChart.js +1 -1
  53. package/dist/index.cjs +1 -1
  54. package/dist/index.d.cts +187 -25
  55. package/dist/index.d.ts +187 -25
  56. package/dist/index.js +1 -1
  57. package/dist/lib/i18n.cjs +1 -1
  58. package/dist/lib/i18n.js +1 -1
  59. package/dist/lib/safe-href.cjs +1 -0
  60. package/dist/lib/safe-href.js +1 -0
  61. package/package.json +1 -1
@@ -1 +1 @@
1
- "use client";import{createContext as ee,useContext as te,useState as v,useCallback as O,useEffect as E,useRef as C}from"react";import{useDialogA11y as re}from"../../hooks/useDialogA11y.js";import{cn as o}from"../../lib/cn.js";import{useUILabels as F}from"../../lib/i18n.js";import{Fragment as G,jsx as e,jsxs as m}from"react/jsx-runtime";var D=ee(null);function N(){let t=te(D);if(!t)throw new Error("Sidebar sub-components must be used within <Sidebar>");return t}function ce(){return N()}var ae=({className:t})=>e("svg",{className:o("w-4 h-4",t),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e("path",{fillRule:"evenodd",d:"M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z",clipRule:"evenodd"})}),oe=({className:t})=>e("svg",{className:o("w-4 h-4",t),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"})}),ne=({className:t})=>e("svg",{className:o("w-5 h-5",t),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})});function q({text:t,position:a,children:r}){let[n,p]=v(!1),[l,b]=v({top:0,left:0}),d=C(null);return m("div",{ref:d,onMouseEnter:()=>{if(d.current){let s=d.current.getBoundingClientRect();b({top:s.top+s.height/2,left:a==="left"?s.right+8:s.left-8})}p(!0)},onMouseLeave:()=>p(!1),className:"relative",children:[r,n&&e("div",{className:o("fixed z-[9999] px-2.5 py-1.5 text-xs font-medium text-white bg-gray-900 dark:bg-gray-700 rounded-md shadow-lg whitespace-nowrap pointer-events-none",a==="right"&&"-translate-x-full"),style:{top:l.top,left:l.left,transform:`translateY(-50%)${a==="right"?" translateX(-100%)":""}`},role:"tooltip",children:t})]})}function ue({collapsed:t,defaultCollapsed:a=!1,onCollapsedChange:r,expandedWidth:n=260,collapsedWidth:p=64,position:l="left",variant:b="default",mobileBreakpoint:d=768,mobileOpen:x,onMobileOpenChange:s,className:g,"aria-label":c,closeLabel:S,trapFocus:f=!0,initialFocus:k,returnFocus:M,lockScroll:R=!0,children:Q}){let W=F(),H=C(null),V=C(null),[$,U]=v(a),[X,L]=v(!1),[u,Y]=v(!1),P=t!==void 0,w=P?t:$,y=x!==void 0,h=y?x:X;E(()=>{if(typeof window.matchMedia!="function")return;let i=window.matchMedia(`(max-width: ${d}px)`),T=B=>{Y(B.matches),B.matches||(y||L(!1),s?.(!1))};return T(i),i.addEventListener("change",T),()=>i.removeEventListener("change",T)},[d,y,s]);let J=O(()=>{if(u){let i=!h;y||L(i),s?.(i)}else{let i=!w;P||U(i),r?.(i)}},[u,h,w,y,P,s,r]),I=O(()=>{y||L(!1),s?.(!1)},[y,s]);E(()=>{let i=V.current;i&&(u&&!h?(i.setAttribute("inert",""),i.setAttribute("aria-hidden","true")):(i.removeAttribute("inert"),i.removeAttribute("aria-hidden")))},[u,h]);let{dialogRef:K,dialogProps:Z}=re({open:u&&h,onClose:I,trapFocus:f,initialFocus:k,returnFocus:M,lockScroll:R,keepInteractive:[H]}),_={default:"bg-white dark:bg-gray-900",bordered:o("bg-white dark:bg-gray-900",l==="left"?"border-r border-gray-200 dark:border-gray-700":"border-l border-gray-200 dark:border-gray-700"),floating:"bg-white dark:bg-gray-900 m-3 rounded-xl shadow-xl border border-gray-200 dark:border-gray-700"},z=w&&!u?p:n,A=e("aside",{className:o("flex flex-col h-full overflow-hidden transition-[width] duration-200 ease-in-out",_[b],g),style:{width:u?n:z,minWidth:u?n:z},"data-testid":"sidebar","data-collapsed":w&&!u,"data-mobile":u,"data-position":l,children:Q}),j={collapsed:w&&!u,isMobile:u,mobileOpen:h,position:l,variant:b,expandedWidth:n,collapsedWidth:p,toggle:J,closeMobile:I,closeLabel:S};return u?m(D.Provider,{value:j,children:[h&&e("div",{ref:H,className:"fixed inset-0 z-40 bg-black/50 transition-opacity",onClick:I,"aria-hidden":"true","data-testid":"sidebar-overlay"}),e("div",{ref:i=>{V.current=i,K.current=i},...Z,"aria-label":c??W.sidebar,className:o("fixed top-0 z-50 h-full transition-transform duration-200 ease-in-out focus:outline-none",l==="left"?"left-0":"right-0",h?"translate-x-0":l==="left"?"-translate-x-full":"translate-x-full"),children:A})]}):e(D.Provider,{value:j,children:A})}function pe({className:t,children:a}){let r=N(),n=F();return m("div",{className:o("flex items-center shrink-0 px-4 h-14 overflow-hidden",r.collapsed&&"justify-center px-2",t),"data-testid":"sidebar-header",children:[a,r.isMobile&&r.mobileOpen&&e("button",{type:"button",onClick:r.closeMobile,className:"ml-auto p-1 rounded-md text-gray-500 dark:text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 cursor-pointer","aria-label":r.closeLabel??n.closeSidebar,children:e(ne,{})})]})}function be({className:t,children:a}){return e("div",{className:o("flex-1 overflow-y-auto overflow-x-hidden py-2",t),"data-testid":"sidebar-content",children:a})}function fe({className:t,children:a}){let r=N();return e("div",{className:o("shrink-0 border-t border-gray-200 dark:border-gray-700 px-4 py-3 overflow-hidden",r.collapsed&&"px-2 flex justify-center",t),"data-testid":"sidebar-footer",children:a})}function ge({label:t,className:a,children:r}){let n=N();return m("div",{className:o("py-2",a),"data-testid":"sidebar-group",children:[t&&!n.collapsed&&e("div",{className:"px-4 py-1.5 text-[11px] font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400",children:t}),t&&n.collapsed&&e("div",{className:"mx-auto my-1 w-6 border-t border-gray-200 dark:border-gray-700"}),e("div",{className:"space-y-0.5 px-2",children:r})]})}function me({icon:t,label:a,badge:r,badgeColor:n="bg-synertech-primary-600 text-synertech-on-primary",active:p=!1,disabled:l=!1,href:b,onClick:d,tooltip:x,className:s}){let g=N(),c=g.collapsed,S=x??a,f=m(G,{children:[t&&e("span",{className:o("shrink-0 w-5 h-5",c&&"w-5 h-5"),children:t}),!c&&m(G,{children:[e("span",{className:"flex-1 truncate",children:a}),r!=null&&e("span",{className:o("shrink-0 inline-flex items-center justify-center rounded-full text-[10px] font-semibold min-w-[18px] h-[18px] px-1",n),children:r})]}),c&&r!==void 0&&r!==null&&e("span",{className:"absolute top-1 right-1 w-2 h-2 rounded-full bg-synertech-primary-600"})]}),k=o("relative flex items-center gap-3 rounded-md text-sm font-medium transition-colors w-full",c?"justify-center px-2 py-2.5":"px-3 py-2",p?"bg-synertech-primary-50 text-synertech-primary-700 dark:bg-synertech-primary-900/30 dark:text-synertech-primary-400":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800",l&&"opacity-50 pointer-events-none",!l&&"cursor-pointer",s),M=()=>{l||(d?.(),g.isMobile&&g.closeMobile())},R=b?e("a",{href:l?void 0:b,className:k,onClick:M,"aria-current":p?"page":void 0,"data-testid":"sidebar-item",children:f}):e("button",{type:"button",className:k,onClick:M,disabled:l,"aria-current":p?"page":void 0,"data-testid":"sidebar-item",children:f});return c?e(q,{text:S,position:g.position,children:R}):R}function xe({icon:t,label:a,badge:r,defaultOpen:n=!1,className:p,children:l}){let b=N(),[d,x]=v(n),s=C(null),[g,c]=v(n?void 0:0),S=C(!0);return E(()=>{if(S.current){S.current=!1,c(d?void 0:0);return}if(d){let f=s.current;if(f){c(f.scrollHeight);let k=setTimeout(()=>c(void 0),200);return()=>clearTimeout(k)}}else{let f=s.current;f&&(c(f.scrollHeight),requestAnimationFrame(()=>c(0)))}},[d]),b.collapsed?e(q,{text:a,position:b.position,children:m("button",{type:"button",className:o("relative flex items-center justify-center gap-3 rounded-md text-sm font-medium transition-colors w-full px-2 py-2.5","text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 cursor-pointer",p),onClick:()=>{b.toggle(),x(!0)},"data-testid":"sidebar-submenu-trigger",children:[t&&e("span",{className:"shrink-0 w-5 h-5",children:t}),r!=null&&e("span",{className:"absolute top-1 right-1 w-2 h-2 rounded-full bg-synertech-primary-600"})]})}):m("div",{className:p,"data-testid":"sidebar-submenu",children:[m("button",{type:"button",className:o("flex items-center gap-3 rounded-md text-sm font-medium transition-colors w-full px-3 py-2","text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 cursor-pointer"),onClick:()=>x(!d),"aria-expanded":d,"data-testid":"sidebar-submenu-trigger",children:[t&&e("span",{className:"shrink-0 w-5 h-5",children:t}),e("span",{className:"flex-1 truncate text-left",children:a}),r!=null&&e("span",{className:"shrink-0 inline-flex items-center justify-center rounded-full text-[10px] font-semibold min-w-[18px] h-[18px] px-1 bg-synertech-primary-600 text-synertech-on-primary",children:r}),e(oe,{className:o("shrink-0 text-gray-500 dark:text-gray-400 transition-transform duration-200",d&&"rotate-180")})]}),e("div",{className:"overflow-hidden transition-[height] duration-200 ease-in-out",style:{height:g===void 0?"auto":g},children:e("div",{ref:s,className:"pl-4 py-0.5",children:l})})]})}function he({className:t}){let a=N(),r=F(),n=a.isMobile?a.mobileOpen?a.closeLabel??r.closeSidebar:r.openSidebar:a.collapsed?r.expandSidebar:r.collapseSidebar;return e("button",{type:"button",onClick:a.toggle,className:o("p-1.5 rounded-md text-gray-500 dark:text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors cursor-pointer",t),"aria-label":n,"data-testid":"sidebar-toggle",children:e(ae,{className:o("transition-transform duration-200",a.collapsed&&"rotate-180",a.position==="right"&&!a.collapsed&&"rotate-180",a.position==="right"&&a.collapsed&&"rotate-0")})})}export{ue as Sidebar,be as SidebarContent,fe as SidebarFooter,ge as SidebarGroup,pe as SidebarHeader,me as SidebarItem,xe as SidebarSubMenu,he as SidebarToggle,ce as useSidebar};
1
+ "use client";import{createContext as ee,useContext as te,useState as v,useCallback as G,useEffect as H,useRef as C}from"react";import{useDialogA11y as re}from"../../hooks/useDialogA11y.js";import{cn as o}from"../../lib/cn.js";import{componentHref as ae}from"../../lib/safe-href.js";import{useUILabels as F}from"../../lib/i18n.js";import{Fragment as q,jsx as e,jsxs as m}from"react/jsx-runtime";var D=ee(null);function N(){let t=te(D);if(!t)throw new Error("Sidebar sub-components must be used within <Sidebar>");return t}function pe(){return N()}var oe=({className:t})=>e("svg",{className:o("w-4 h-4",t),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e("path",{fillRule:"evenodd",d:"M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z",clipRule:"evenodd"})}),ne=({className:t})=>e("svg",{className:o("w-4 h-4",t),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"})}),ie=({className:t})=>e("svg",{className:o("w-5 h-5",t),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})});function Q({text:t,position:a,children:r}){let[n,p]=v(!1),[l,b]=v({top:0,left:0}),d=C(null);return m("div",{ref:d,onMouseEnter:()=>{if(d.current){let s=d.current.getBoundingClientRect();b({top:s.top+s.height/2,left:a==="left"?s.right+8:s.left-8})}p(!0)},onMouseLeave:()=>p(!1),className:"relative",children:[r,n&&e("div",{className:o("fixed z-[9999] px-2.5 py-1.5 text-xs font-medium text-white bg-gray-900 dark:bg-gray-700 rounded-md shadow-lg whitespace-nowrap pointer-events-none",a==="right"&&"-translate-x-full"),style:{top:l.top,left:l.left,transform:`translateY(-50%)${a==="right"?" translateX(-100%)":""}`},role:"tooltip",children:t})]})}function be({collapsed:t,defaultCollapsed:a=!1,onCollapsedChange:r,expandedWidth:n=260,collapsedWidth:p=64,position:l="left",variant:b="default",mobileBreakpoint:d=768,mobileOpen:x,onMobileOpenChange:s,className:g,"aria-label":c,closeLabel:S,trapFocus:f=!0,initialFocus:k,returnFocus:M,lockScroll:R=!0,children:L}){let W=F(),V=C(null),z=C(null),[$,U]=v(a),[X,P]=v(!1),[u,Y]=v(!1),I=t!==void 0,w=I?t:$,y=x!==void 0,h=y?x:X;H(()=>{if(typeof window.matchMedia!="function")return;let i=window.matchMedia(`(max-width: ${d}px)`),E=O=>{Y(O.matches),O.matches||(y||P(!1),s?.(!1))};return E(i),i.addEventListener("change",E),()=>i.removeEventListener("change",E)},[d,y,s]);let J=G(()=>{if(u){let i=!h;y||P(i),s?.(i)}else{let i=!w;I||U(i),r?.(i)}},[u,h,w,y,I,s,r]),T=G(()=>{y||P(!1),s?.(!1)},[y,s]);H(()=>{let i=z.current;i&&(u&&!h?(i.setAttribute("inert",""),i.setAttribute("aria-hidden","true")):(i.removeAttribute("inert"),i.removeAttribute("aria-hidden")))},[u,h]);let{dialogRef:K,dialogProps:Z}=re({open:u&&h,onClose:T,trapFocus:f,initialFocus:k,returnFocus:M,lockScroll:R,keepInteractive:[V]}),_={default:"bg-white dark:bg-gray-900",bordered:o("bg-white dark:bg-gray-900",l==="left"?"border-r border-gray-200 dark:border-gray-700":"border-l border-gray-200 dark:border-gray-700"),floating:"bg-white dark:bg-gray-900 m-3 rounded-xl shadow-xl border border-gray-200 dark:border-gray-700"},A=w&&!u?p:n,j=e("aside",{className:o("flex flex-col h-full overflow-hidden transition-[width] duration-200 ease-in-out",_[b],g),style:{width:u?n:A,minWidth:u?n:A},"data-testid":"sidebar","data-collapsed":w&&!u,"data-mobile":u,"data-position":l,children:L}),B={collapsed:w&&!u,isMobile:u,mobileOpen:h,position:l,variant:b,expandedWidth:n,collapsedWidth:p,toggle:J,closeMobile:T,closeLabel:S};return u?m(D.Provider,{value:B,children:[h&&e("div",{ref:V,className:"fixed inset-0 z-40 bg-black/50 transition-opacity",onClick:T,"aria-hidden":"true","data-testid":"sidebar-overlay"}),e("div",{ref:i=>{z.current=i,K.current=i},...Z,"aria-label":c??W.sidebar,className:o("fixed top-0 z-50 h-full transition-transform duration-200 ease-in-out focus:outline-none",l==="left"?"left-0":"right-0",h?"translate-x-0":l==="left"?"-translate-x-full":"translate-x-full"),children:j})]}):e(D.Provider,{value:B,children:j})}function fe({className:t,children:a}){let r=N(),n=F();return m("div",{className:o("flex items-center shrink-0 px-4 h-14 overflow-hidden",r.collapsed&&"justify-center px-2",t),"data-testid":"sidebar-header",children:[a,r.isMobile&&r.mobileOpen&&e("button",{type:"button",onClick:r.closeMobile,className:"ml-auto p-1 rounded-md text-gray-500 dark:text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 cursor-pointer","aria-label":r.closeLabel??n.closeSidebar,children:e(ie,{})})]})}function ge({className:t,children:a}){return e("div",{className:o("flex-1 overflow-y-auto overflow-x-hidden py-2",t),"data-testid":"sidebar-content",children:a})}function me({className:t,children:a}){let r=N();return e("div",{className:o("shrink-0 border-t border-gray-200 dark:border-gray-700 px-4 py-3 overflow-hidden",r.collapsed&&"px-2 flex justify-center",t),"data-testid":"sidebar-footer",children:a})}function xe({label:t,className:a,children:r}){let n=N();return m("div",{className:o("py-2",a),"data-testid":"sidebar-group",children:[t&&!n.collapsed&&e("div",{className:"px-4 py-1.5 text-[11px] font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400",children:t}),t&&n.collapsed&&e("div",{className:"mx-auto my-1 w-6 border-t border-gray-200 dark:border-gray-700"}),e("div",{className:"space-y-0.5 px-2",children:r})]})}function he({icon:t,label:a,badge:r,badgeColor:n="bg-synertech-primary-600 text-synertech-on-primary",active:p=!1,disabled:l=!1,href:b,onClick:d,tooltip:x,className:s}){let g=N(),c=g.collapsed,S=x??a,f=m(q,{children:[t&&e("span",{className:o("shrink-0 w-5 h-5",c&&"w-5 h-5"),children:t}),!c&&m(q,{children:[e("span",{className:"flex-1 truncate",children:a}),r!=null&&e("span",{className:o("shrink-0 inline-flex items-center justify-center rounded-full text-[10px] font-semibold min-w-[18px] h-[18px] px-1",n),children:r})]}),c&&r!==void 0&&r!==null&&e("span",{className:"absolute top-1 right-1 w-2 h-2 rounded-full bg-synertech-primary-600"})]}),k=o("relative flex items-center gap-3 rounded-md text-sm font-medium transition-colors w-full",c?"justify-center px-2 py-2.5":"px-3 py-2",p?"bg-synertech-primary-50 text-synertech-primary-700 dark:bg-synertech-primary-900/30 dark:text-synertech-primary-400":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800",l&&"opacity-50 pointer-events-none",!l&&"cursor-pointer",s),M=()=>{l||(d?.(),g.isMobile&&g.closeMobile())},R=ae("SidebarItem",b),L=R?e("a",{href:l?void 0:R,className:k,onClick:M,"aria-current":p?"page":void 0,"data-testid":"sidebar-item",children:f}):e("button",{type:"button",className:k,onClick:M,disabled:l,"aria-current":p?"page":void 0,"data-testid":"sidebar-item",children:f});return c?e(Q,{text:S,position:g.position,children:L}):L}function ye({icon:t,label:a,badge:r,defaultOpen:n=!1,className:p,children:l}){let b=N(),[d,x]=v(n),s=C(null),[g,c]=v(n?void 0:0),S=C(!0);return H(()=>{if(S.current){S.current=!1,c(d?void 0:0);return}if(d){let f=s.current;if(f){c(f.scrollHeight);let k=setTimeout(()=>c(void 0),200);return()=>clearTimeout(k)}}else{let f=s.current;f&&(c(f.scrollHeight),requestAnimationFrame(()=>c(0)))}},[d]),b.collapsed?e(Q,{text:a,position:b.position,children:m("button",{type:"button",className:o("relative flex items-center justify-center gap-3 rounded-md text-sm font-medium transition-colors w-full px-2 py-2.5","text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 cursor-pointer",p),onClick:()=>{b.toggle(),x(!0)},"data-testid":"sidebar-submenu-trigger",children:[t&&e("span",{className:"shrink-0 w-5 h-5",children:t}),r!=null&&e("span",{className:"absolute top-1 right-1 w-2 h-2 rounded-full bg-synertech-primary-600"})]})}):m("div",{className:p,"data-testid":"sidebar-submenu",children:[m("button",{type:"button",className:o("flex items-center gap-3 rounded-md text-sm font-medium transition-colors w-full px-3 py-2","text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 cursor-pointer"),onClick:()=>x(!d),"aria-expanded":d,"data-testid":"sidebar-submenu-trigger",children:[t&&e("span",{className:"shrink-0 w-5 h-5",children:t}),e("span",{className:"flex-1 truncate text-left",children:a}),r!=null&&e("span",{className:"shrink-0 inline-flex items-center justify-center rounded-full text-[10px] font-semibold min-w-[18px] h-[18px] px-1 bg-synertech-primary-600 text-synertech-on-primary",children:r}),e(ne,{className:o("shrink-0 text-gray-500 dark:text-gray-400 transition-transform duration-200",d&&"rotate-180")})]}),e("div",{className:"overflow-hidden transition-[height] duration-200 ease-in-out",style:{height:g===void 0?"auto":g},children:e("div",{ref:s,className:"pl-4 py-0.5",children:l})})]})}function ve({className:t}){let a=N(),r=F(),n=a.isMobile?a.mobileOpen?a.closeLabel??r.closeSidebar:r.openSidebar:a.collapsed?r.expandSidebar:r.collapseSidebar;return e("button",{type:"button",onClick:a.toggle,className:o("p-1.5 rounded-md text-gray-500 dark:text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors cursor-pointer",t),"aria-label":n,"data-testid":"sidebar-toggle",children:e(oe,{className:o("transition-transform duration-200",a.collapsed&&"rotate-180",a.position==="right"&&!a.collapsed&&"rotate-180",a.position==="right"&&a.collapsed&&"rotate-0")})})}export{be as Sidebar,ge as SidebarContent,me as SidebarFooter,xe as SidebarGroup,fe as SidebarHeader,he as SidebarItem,ye as SidebarSubMenu,ve as SidebarToggle,pe as useSidebar};
@@ -1 +1 @@
1
- "use strict";var m=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var R=(t,r)=>{for(var o in r)m(t,o,{get:r[o],enumerable:!0})},P=(t,r,o,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of N(r))!k.call(t,i)&&i!==o&&m(t,i,{get:()=>r[i],enumerable:!(a=D(r,i))||a.enumerable});return t};var L=t=>P(m({},"__esModule",{value:!0}),t);var j={};R(j,{StatCard:()=>Z});module.exports=L(j);var s=require("../../lib/cn.cjs"),d=require("../chart/utils/format.cjs"),h=require("../circular-progress/CircularProgress.cjs"),f=require("../sparkline/Sparkline.cjs"),e=require("react/jsx-runtime"),z={sm:"p-3",md:"p-4",lg:"p-5"},T={sm:"text-[11px]",md:"text-xs",lg:"text-sm"},W={sm:"text-xl",md:"text-2xl",lg:"text-3xl"},p={sm:{width:72,height:22},md:{width:96,height:28},lg:{width:120,height:34}};function A(t){return t.direction?t.direction:t.value>0?"up":t.value<0?"down":"flat"}function B(t,r){return t==="flat"||r==="neutral"?"text-gray-500 dark:text-gray-400":t===r?"text-green-700 dark:text-green-400":"text-red-600 dark:text-red-400"}function M({direction:t}){return t==="flat"?(0,e.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor","aria-hidden":"true",children:(0,e.jsx)("rect",{x:"1",y:"4.25",width:"8",height:"1.5",rx:"0.75"})}):(0,e.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor","aria-hidden":"true",children:(0,e.jsx)("path",{d:t==="up"?"M5 1 L9.5 8 L0.5 8 Z":"M5 9 L0.5 2 L9.5 2 Z"})})}function Z({label:t,value:r,format:o,delta:a,trend:i,trendColor:x,icon:c,size:n="md",loading:l=!1,variant:C="card",footer:u,className:v,...y}){let S=typeof r=="number"?(o??d.formatAuto)(r):r,g=a?A(a):"flat",b=a?(a.format??(w=>(0,d.formatPercent)(w,{signed:!0})))(a.value):null;return(0,e.jsxs)("div",{className:(0,s.cn)("flex flex-col gap-2",C==="card"&&(0,s.cn)("rounded-lg border border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-800",z[n]),v),...y,children:[(0,e.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,e.jsx)("span",{className:(0,s.cn)("font-medium text-gray-500 dark:text-gray-400",T[n]),children:t}),c?(0,e.jsx)("span",{className:"shrink-0 text-gray-500 dark:text-gray-400",children:c}):null]}),(0,e.jsxs)("div",{className:"flex items-end justify-between gap-3",children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[l?(0,e.jsx)("div",{className:"flex items-center",style:{height:n==="lg"?30:24},"aria-busy":"true","aria-live":"polite",children:(0,e.jsx)(h.CircularProgress,{indeterminate:!0,size:n==="lg"?"sm":"xs",thickness:"thin","aria-hidden":"true"})}):(0,e.jsx)("span",{className:(0,s.cn)("leading-none font-semibold text-gray-900 dark:text-gray-100",W[n]),children:S}),a&&!l?(0,e.jsxs)("span",{className:(0,s.cn)("flex items-center gap-1 text-xs font-medium",B(g,a.goodWhen??"up")),children:[(0,e.jsx)(M,{direction:g}),b,a.period?(0,e.jsx)("span",{className:"font-normal text-gray-500 dark:text-gray-400",children:a.period}):null]}):null]}),i&&i.length>0&&!l?(0,e.jsx)(f.Sparkline,{data:i,color:x,emphasizeLast:!0,area:!0,width:p[n].width,height:p[n].height,className:"shrink-0"}):null]}),u?(0,e.jsx)("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:u}):null]})}0&&(module.exports={StatCard});
1
+ "use strict";var g=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var L=(t,r)=>{for(var i in r)g(t,i,{get:r[i],enumerable:!0})},z=(t,r,i,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of R(r))!P.call(t,a)&&a!==i&&g(t,a,{get:()=>r[a],enumerable:!(s=k(r,a))||s.enumerable});return t};var T=t=>z(g({},"__esModule",{value:!0}),t);var V={};L(V,{StatCard:()=>O});module.exports=T(V);var o=require("../../lib/cn.cjs"),l=require("../chart/utils/format.cjs"),v=require("../circular-progress/CircularProgress.cjs"),y=require("../sparkline/Sparkline.cjs"),e=require("react/jsx-runtime"),W={sm:"p-3",md:"p-4",lg:"p-5"},A={sm:"text-[11px]",md:"text-xs",lg:"text-sm"},B={sm:"text-xl",md:"text-2xl",lg:"text-3xl"},C={sm:{width:72,height:22},md:{width:96,height:28},lg:{width:120,height:34}};function M(t,r,i){return t.direction?t.direction:r===i?"flat":t.value>0?"up":t.value<0?"down":"flat"}function Z(t,r){return t==="flat"||r==="neutral"?"text-gray-500 dark:text-gray-400":t===r?"text-green-700 dark:text-green-400":"text-red-600 dark:text-red-400"}function j({direction:t}){return t==="flat"?(0,e.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor","aria-hidden":"true",children:(0,e.jsx)("rect",{x:"1",y:"4.25",width:"8",height:"1.5",rx:"0.75"})}):(0,e.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor","aria-hidden":"true",children:(0,e.jsx)("path",{d:t==="up"?"M5 1 L9.5 8 L0.5 8 Z":"M5 9 L0.5 2 L9.5 2 Z"})})}function O({label:t,value:r,format:i,locale:s,delta:a,trend:d,trendColor:S,icon:p,size:n="md",loading:m=!1,variant:b="card",footer:f,className:D,...w}){let N=typeof r=="number"?(i??(u=>(0,l.formatAuto)(u,s)))(r):r,h=a?.format??(u=>(0,l.formatPercent)(u,{locale:s,signed:!0})),c=a?h(a.value):null,x=a&&c!==null?M(a,c,h(0)):"flat";return(0,e.jsxs)("div",{className:(0,o.cn)("flex flex-col gap-2",b==="card"&&(0,o.cn)("rounded-lg border border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-800",W[n]),D),...w,children:[(0,e.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,e.jsx)("span",{className:(0,o.cn)("font-medium text-gray-500 dark:text-gray-400",A[n]),children:t}),p?(0,e.jsx)("span",{className:"shrink-0 text-gray-500 dark:text-gray-400",children:p}):null]}),(0,e.jsxs)("div",{className:"flex items-end justify-between gap-3",children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[m?(0,e.jsx)("div",{className:"flex items-center",style:{height:n==="lg"?30:24},"aria-busy":"true","aria-live":"polite",children:(0,e.jsx)(v.CircularProgress,{indeterminate:!0,size:n==="lg"?"sm":"xs",thickness:"thin","aria-hidden":"true"})}):(0,e.jsx)("span",{className:(0,o.cn)("leading-none font-semibold text-gray-900 dark:text-gray-100",B[n]),children:N}),a&&!m?(0,e.jsxs)("span",{className:(0,o.cn)("flex items-center gap-1 text-xs font-medium",Z(x,a.goodWhen??"up")),children:[(0,e.jsx)(j,{direction:x}),c,a.period?(0,e.jsx)("span",{className:"font-normal text-gray-500 dark:text-gray-400",children:a.period}):null]}):null]}),d&&d.length>0&&!m?(0,e.jsx)(y.Sparkline,{data:d,color:S,emphasizeLast:!0,area:!0,width:C[n].width,height:C[n].height,className:"shrink-0"}):null]}),f?(0,e.jsx)("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:f}):null]})}0&&(module.exports={StatCard});
@@ -1 +1 @@
1
- import{cn as n}from"../../lib/cn.js";import{formatAuto as S,formatPercent as b}from"../chart/utils/format.js";import{CircularProgress as w}from"../circular-progress/CircularProgress.js";import{Sparkline as D}from"../sparkline/Sparkline.js";import{jsx as t,jsxs as o}from"react/jsx-runtime";var N={sm:"p-3",md:"p-4",lg:"p-5"},k={sm:"text-[11px]",md:"text-xs",lg:"text-sm"},R={sm:"text-xl",md:"text-2xl",lg:"text-3xl"},u={sm:{width:72,height:22},md:{width:96,height:28},lg:{width:120,height:34}};function P(e){return e.direction?e.direction:e.value>0?"up":e.value<0?"down":"flat"}function L(e,i){return e==="flat"||i==="neutral"?"text-gray-500 dark:text-gray-400":e===i?"text-green-700 dark:text-green-400":"text-red-600 dark:text-red-400"}function z({direction:e}){return e==="flat"?t("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor","aria-hidden":"true",children:t("rect",{x:"1",y:"4.25",width:"8",height:"1.5",rx:"0.75"})}):t("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor","aria-hidden":"true",children:t("path",{d:e==="up"?"M5 1 L9.5 8 L0.5 8 Z":"M5 9 L0.5 2 L9.5 2 Z"})})}function M({label:e,value:i,format:g,delta:r,trend:s,trendColor:p,icon:l,size:a="md",loading:d=!1,variant:h="card",footer:m,className:f,...x}){let C=typeof i=="number"?(g??S)(i):i,c=r?P(r):"flat",v=r?(r.format??(y=>b(y,{signed:!0})))(r.value):null;return o("div",{className:n("flex flex-col gap-2",h==="card"&&n("rounded-lg border border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-800",N[a]),f),...x,children:[o("div",{className:"flex items-start justify-between gap-2",children:[t("span",{className:n("font-medium text-gray-500 dark:text-gray-400",k[a]),children:e}),l?t("span",{className:"shrink-0 text-gray-500 dark:text-gray-400",children:l}):null]}),o("div",{className:"flex items-end justify-between gap-3",children:[o("div",{className:"flex min-w-0 flex-col gap-1",children:[d?t("div",{className:"flex items-center",style:{height:a==="lg"?30:24},"aria-busy":"true","aria-live":"polite",children:t(w,{indeterminate:!0,size:a==="lg"?"sm":"xs",thickness:"thin","aria-hidden":"true"})}):t("span",{className:n("leading-none font-semibold text-gray-900 dark:text-gray-100",R[a]),children:C}),r&&!d?o("span",{className:n("flex items-center gap-1 text-xs font-medium",L(c,r.goodWhen??"up")),children:[t(z,{direction:c}),v,r.period?t("span",{className:"font-normal text-gray-500 dark:text-gray-400",children:r.period}):null]}):null]}),s&&s.length>0&&!d?t(D,{data:s,color:p,emphasizeLast:!0,area:!0,width:u[a].width,height:u[a].height,className:"shrink-0"}):null]}),m?t("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:m}):null]})}export{M as StatCard};
1
+ import{cn as n}from"../../lib/cn.js";import{formatAuto as D,formatPercent as w}from"../chart/utils/format.js";import{CircularProgress as N}from"../circular-progress/CircularProgress.js";import{Sparkline as k}from"../sparkline/Sparkline.js";import{jsx as t,jsxs as o}from"react/jsx-runtime";var R={sm:"p-3",md:"p-4",lg:"p-5"},P={sm:"text-[11px]",md:"text-xs",lg:"text-sm"},L={sm:"text-xl",md:"text-2xl",lg:"text-3xl"},x={sm:{width:72,height:22},md:{width:96,height:28},lg:{width:120,height:34}};function z(e,a,s){return e.direction?e.direction:a===s?"flat":e.value>0?"up":e.value<0?"down":"flat"}function T(e,a){return e==="flat"||a==="neutral"?"text-gray-500 dark:text-gray-400":e===a?"text-green-700 dark:text-green-400":"text-red-600 dark:text-red-400"}function W({direction:e}){return e==="flat"?t("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor","aria-hidden":"true",children:t("rect",{x:"1",y:"4.25",width:"8",height:"1.5",rx:"0.75"})}):t("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor","aria-hidden":"true",children:t("path",{d:e==="up"?"M5 1 L9.5 8 L0.5 8 Z":"M5 9 L0.5 2 L9.5 2 Z"})})}function j({label:e,value:a,format:s,locale:u,delta:r,trend:l,trendColor:C,icon:g,size:i="md",loading:d=!1,variant:v="card",footer:p,className:y,...S}){let b=typeof a=="number"?(s??(c=>D(c,u)))(a):a,f=r?.format??(c=>w(c,{locale:u,signed:!0})),m=r?f(r.value):null,h=r&&m!==null?z(r,m,f(0)):"flat";return o("div",{className:n("flex flex-col gap-2",v==="card"&&n("rounded-lg border border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-800",R[i]),y),...S,children:[o("div",{className:"flex items-start justify-between gap-2",children:[t("span",{className:n("font-medium text-gray-500 dark:text-gray-400",P[i]),children:e}),g?t("span",{className:"shrink-0 text-gray-500 dark:text-gray-400",children:g}):null]}),o("div",{className:"flex items-end justify-between gap-3",children:[o("div",{className:"flex min-w-0 flex-col gap-1",children:[d?t("div",{className:"flex items-center",style:{height:i==="lg"?30:24},"aria-busy":"true","aria-live":"polite",children:t(N,{indeterminate:!0,size:i==="lg"?"sm":"xs",thickness:"thin","aria-hidden":"true"})}):t("span",{className:n("leading-none font-semibold text-gray-900 dark:text-gray-100",L[i]),children:b}),r&&!d?o("span",{className:n("flex items-center gap-1 text-xs font-medium",T(h,r.goodWhen??"up")),children:[t(W,{direction:h}),m,r.period?t("span",{className:"font-normal text-gray-500 dark:text-gray-400",children:r.period}):null]}):null]}),l&&l.length>0&&!d?t(k,{data:l,color:C,emphasizeLast:!0,area:!0,width:x[i].width,height:x[i].height,className:"shrink-0"}):null]}),p?t("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:p}):null]})}export{j as StatCard};
@@ -1 +1 @@
1
- "use strict";"use client";var se=Object.defineProperty;var Re=Object.getOwnPropertyDescriptor;var Se=Object.getOwnPropertyNames;var We=Object.prototype.hasOwnProperty;var Le=(c,a)=>{for(var i in a)se(c,i,{get:a[i],enumerable:!0})},Ee=(c,a,i,r)=>{if(a&&typeof a=="object"||typeof a=="function")for(let d of Se(a))!We.call(c,d)&&d!==i&&se(c,d,{get:()=>a[d],enumerable:!(r=Re(a,d))||r.enumerable});return c};var Pe=c=>Ee(se({},"__esModule",{value:!0}),c);var Be={};Le(Be,{WaterfallChart:()=>Me});module.exports=Pe(Be);var u=require("react"),me=require("../../lib/i18n.cjs"),ce=require("../chart/ChartAxis.cjs"),ue=require("../chart/ChartContainer.cjs"),ge=require("../chart/ChartGrid.cjs"),he=require("../chart/ChartLegend.cjs"),fe=require("../chart/ChartTableView.cjs"),ye=require("../chart/ChartTooltip.cjs"),V=require("../chart/palette.cjs"),be=require("../chart/utils/cartesian.cjs"),re=require("../chart/utils/data.cjs"),ne=require("../chart/utils/format.cjs"),Ce=require("../chart/utils/keyboard.cjs"),pe=require("../chart/utils/path.cjs"),ve=require("../chart/utils/scales.cjs"),ke=require("../chart/utils/text.cjs"),xe=require("../chart/utils/touch.cjs"),t=require("react/jsx-runtime"),Ve=24,Te=4,K=6,Ne=(0,V.rampColor)(V.CHART_DIVERGING_COLORS,1),we=(0,V.rampColor)(V.CHART_DIVERGING_COLORS,0),Ae=(0,u.memo)(function({bars:a,connectors:i}){return(0,t.jsxs)("g",{children:[(0,t.jsx)("g",{className:"stroke-gray-300 dark:stroke-gray-600",strokeWidth:1,shapeRendering:"crispEdges","aria-hidden":"true",children:i.map(r=>(0,t.jsx)("line",{x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2},r.key))}),a.map(r=>(0,t.jsxs)("g",{children:[(0,t.jsx)("path",{d:r.d,fill:r.color}),r.label?(0,t.jsx)("text",{x:r.label.x,y:r.label.y,textAnchor:r.label.anchor,dominantBaseline:"middle",className:"fill-gray-600 text-[10px] [font-variant-numeric:tabular-nums] dark:fill-gray-300",children:r.label.text}):null]},r.key))]})});function Ie({width:c,height:a,steps:i,data:r,x:d,y:v,grid:I,size:F,orientation:O,connectors:J,showValues:T,barSize:H,palette:$,margin:M,tooltip:N,plotLabel:B,totalLabel:le,formatValue:G,formatX:_,onStepClick:w}){let[z,D]=(0,u.useState)(null),g=z!==null&&z<i.length?z:null,e=(0,u.useMemo)(()=>{let s=O==="vertical",S=i.flatMap(n=>[n.start,n.end]),C=(0,be.buildCartesianGeometry)({width:c,height:a,data:r,x:d,y:v,bounds:S.length===0?null:[Math.min(...S),Math.max(...S)],margin:M,orientation:O,placement:"band",formatValue:G,formatX:_,defaultIncludeZero:!0}),{valueScale:k,bandwidth:W,categoryPositions:Z,innerWidth:Q,innerHeight:ee}=C,L=k(0),m=Math.min(H??Ve,W),E=[],x=[];return i.forEach((n,b)=>{let P=Z[b]+(W-m)/2,te=k(n.start),ae=k(n.end),j=Math.min(te,ae),l=Math.abs(ae-te),h=n.end>=n.start,A=s?h?"top":"bottom":h?"right":"left",X=s?{x:P,y:j,width:m,height:l}:{x:j,y:P,width:l,height:m},f=null;if(T&&n.value!==null){let p=n.kind==="total"?n.formattedEnd:n.formattedValue,R=(0,ke.estimateTextWidth)(p,10),y=k(h?Math.max(n.start,n.end):Math.min(n.start,n.end));if(s){let q=h?y-K:y+K;R<=W&&q>8&&q<ee-4&&(f={x:P+m/2,y:q,anchor:"middle",text:p})}else{let q=h?Q-y-K:y-K;R<=q&&(f={x:h?y+K:y-K,y:P+m/2,anchor:h?"start":"end",text:p})}}E.push({key:`${b}`,color:$[n.kind],d:(0,pe.buildBarPath)({...X,radius:Te,round:A}),label:f});let de=i[b+1];if(J&&de){let p=k(n.end),R=Z[b+1]+(W-m)/2;x.push(s?{key:`${b}`,x1:P+m,y1:p,x2:R,y2:p}:{key:`${b}`,x1:p,y1:P+m,x2:p,y2:R})}}),{vertical:s,bars:E,rules:x,baseline:L,bandwidth:W,categoryPositions:Z,categoryCenters:C.categoryCenters,categoryTicks:C.categoryTicks,valueTicks:C.valueTicks,valueScale:k,innerWidth:Q,innerHeight:ee,margin:C.margin}},[i,r,d,v,c,a,M,O,J,T,H,$,G,_]),ie=(0,u.useCallback)(s=>{if(N===!1||i.length===0)return;let S=s.currentTarget.getBoundingClientRect(),C=e.vertical?s.clientX-S.left-e.margin.left:s.clientY-S.top-e.margin.top;D((0,ve.nearestIndex)(e.categoryCenters,C))},[N,i.length,e.vertical,e.margin,e.categoryCenters]),U=(0,u.useCallback)(()=>{!w||g===null||w(i[g])},[w,g,i]),oe=(0,u.useCallback)(s=>(0,Ce.handleChartKeyDown)(s,{count:i.length,current:g,axis:e.vertical?"x":"y",onMove:D,pick:w?U:null}),[i.length,g,e.vertical,w,U]),o=g===null?null:i[g],Y=g===null||o===void 0||o===null?null:e.vertical?{x:e.margin.left+e.categoryCenters[g],y:e.margin.top+Math.min(e.valueScale(o.start),e.valueScale(o.end))}:{x:e.margin.left+Math.max(e.valueScale(o.start),e.valueScale(o.end)),y:e.margin.top+e.categoryCenters[g]};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("svg",{width:c,height:a,role:"img","aria-label":B??i.map(s=>s.label).join(", "),tabIndex:0,className:`${xe.CHART_TOUCH} focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-synertech-primary-500`,onPointerMove:ie,onPointerLeave:()=>D(null),onKeyDown:oe,onBlur:()=>D(null),onClick:U,children:[(0,t.jsxs)("g",{transform:`translate(${e.margin.left}, ${e.margin.top})`,children:[(0,t.jsx)(ge.ChartGrid,{width:e.innerWidth,height:e.innerHeight,horizontal:e.vertical&&(I==="y"||I==="both")?e.valueTicks.map(s=>s.offset):void 0,vertical:!e.vertical&&(I==="y"||I==="both")?e.valueTicks.map(s=>s.offset):void 0}),g!==null?(0,t.jsx)("rect",{x:e.vertical?e.categoryPositions[g]:0,y:e.vertical?0:e.categoryPositions[g],width:e.vertical?e.bandwidth:e.innerWidth,height:e.vertical?e.innerHeight:e.bandwidth,className:"fill-gray-400 dark:fill-gray-500",opacity:.12,"aria-hidden":"true"}):null,(0,t.jsx)(Ae,{bars:e.bars,connectors:e.rules}),(0,t.jsx)("line",{x1:e.vertical?0:e.baseline,y1:e.vertical?e.baseline:0,x2:e.vertical?e.innerWidth:e.baseline,y2:e.vertical?e.baseline:e.innerHeight,className:"stroke-gray-300 dark:stroke-gray-600",strokeWidth:1,shapeRendering:"crispEdges"})]}),(0,t.jsx)("g",{transform:`translate(${e.margin.left}, ${e.margin.top+e.innerHeight})`,children:(e.vertical?d.hidden:v?.hidden)?null:(0,t.jsx)(ce.ChartAxis,{orientation:"bottom",ticks:e.vertical?e.categoryTicks:e.valueTicks,length:e.innerWidth,label:e.vertical?d.label:v?.label,size:F})}),(0,t.jsx)("g",{transform:`translate(${e.margin.left}, ${e.margin.top})`,children:(e.vertical?v?.hidden:d.hidden)?null:(0,t.jsx)(ce.ChartAxis,{orientation:"left",ticks:e.vertical?e.valueTicks:e.categoryTicks,length:e.innerHeight,showLine:!1,label:e.vertical?v?.label:d.label,size:F})})]}),o&&Y&&N!==!1?(0,t.jsx)(ye.ChartTooltip,{x:Y.x,y:Y.y,containerWidth:c,children:typeof N=="function"?N(o):(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("div",{className:"font-medium text-gray-900 dark:text-gray-100",children:o.label}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:$[o.kind]},"aria-hidden":"true"}),(0,t.jsx)("span",{className:"font-semibold text-gray-900 [font-variant-numeric:tabular-nums] dark:text-gray-100",children:o.kind==="total"?o.formattedEnd:o.formattedValue})]}),o.kind==="total"?null:(0,t.jsxs)("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[(0,t.jsx)("span",{children:le}),(0,t.jsx)("span",{className:"[font-variant-numeric:tabular-nums]",children:o.formattedEnd})]})]})}):null]})}function Me({data:c,x:a,y:i,value:r,total:d,start:v=0,orientation:I="vertical",connectors:F=!0,showValues:O=!0,barSize:J,colors:T,height:H=280,width:$,size:M="md",grid:N="y",legend:B,tooltip:le=!0,tableView:G=!1,title:_,description:w,loading:z=!1,emptyState:D,error:g=!1,errorState:e,onRetry:ie,actions:U,margin:oe,locale:o,plotLabel:Y,valueLabel:s,totalLabel:S,increaseLabel:C,decreaseLabel:k,format:W,onStepClick:Z,className:Q,...ee}){let L=(0,me.useUILabels)(),m=(0,u.useMemo)(()=>W??(l=>(0,ne.formatAuto)(l,o)),[W,o]),E=(0,u.useMemo)(()=>a.format??(l=>(0,ne.formatXValue)(l,o)),[a.format,o]),x=(0,u.useMemo)(()=>{let l=v;return c.map((h,A)=>{let X=(0,re.readXValue)(h,a.key,A),f=(0,re.readNumber)(h,r);if(d?!!h[d]:!1){let y=f??l;return l=y,{index:A,x:X,label:E(X,A),value:y,start:0,end:y,kind:"total",formattedValue:m(y),formattedEnd:m(y),datum:h}}let p=l,R=f===null?l:l+f;return l=R,{index:A,x:X,label:E(X,A),value:f,start:p,end:R,kind:f!==null&&f<0?"decrease":"increase",formattedValue:f===null?"\u2014":`${f>0?"+":""}${m(f)}`,formattedEnd:m(R),datum:h}})},[c,a.key,r,d,v,m,E]),n=(0,u.useMemo)(()=>({increase:T?.increase??Ne,decrease:T?.decrease??we,total:T?.total??V.CHART_MUTED_COLOR}),[T]),b=S??L.chartRunningTotal,P=(0,u.useMemo)(()=>{let l=[{key:"increase",label:C??L.chartIncrease,color:n.increase,marker:"rect"},{key:"decrease",label:k??L.chartDecrease,color:n.decrease,marker:"rect"}];return x.some(h=>h.kind==="total")&&l.push({key:"total",label:b,color:n.total,marker:"rect"}),l},[n,x,C,k,b,L.chartIncrease,L.chartDecrease]),te=(0,u.useMemo)(()=>x.map(l=>({[a.key]:l.x,[r]:l.kind==="total"?null:l.value,__running:l.end})),[x,a.key,r]),ae=B===void 0?!0:B!==!1,j=typeof B=="string"?B:"bottom";return(0,t.jsx)(ue.ChartContainer,{title:_,description:w,height:H,width:$,size:M,loading:z,empty:x.length===0,emptyState:D,error:g,errorState:e,onRetry:ie,actions:U,tableView:G,legendPosition:j,legend:ae?(0,t.jsx)(he.ChartLegend,{items:P,position:j,marker:"rect",size:M}):void 0,table:G?(0,t.jsx)(fe.ChartTableView,{data:te,series:[{key:r,label:s??L.chartValue},{key:"__running",label:b}],xKey:a.key,xLabel:a.label??a.key,formatX:E,formatValue:m,caption:typeof _=="string"?_:void 0}):void 0,className:Q,...ee,children:({width:l})=>(0,t.jsx)(Ie,{width:l,height:H,steps:x,data:c,x:a,y:i,grid:N,size:M,orientation:I,connectors:F,showValues:O,barSize:J,palette:n,margin:oe,tooltip:le,plotLabel:Y,totalLabel:b,formatValue:m,formatX:E,onStepClick:Z})})}0&&(module.exports={WaterfallChart});
1
+ "use strict";"use client";var de=Object.defineProperty;var Re=Object.getOwnPropertyDescriptor;var Se=Object.getOwnPropertyNames;var Le=Object.prototype.hasOwnProperty;var We=(s,r)=>{for(var o in r)de(s,o,{get:r[o],enumerable:!0})},Ee=(s,r,o,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let d of Se(r))!Le.call(s,d)&&d!==o&&de(s,d,{get:()=>r[d],enumerable:!(n=Re(r,d))||n.enumerable});return s};var Pe=s=>Ee(de({},"__esModule",{value:!0}),s);var Be={};We(Be,{WaterfallChart:()=>Me});module.exports=Pe(Be);var m=require("react"),ne=require("../../lib/i18n.cjs"),me=require("../chart/ChartAxis.cjs"),ue=require("../chart/ChartContainer.cjs"),ge=require("../chart/ChartGrid.cjs"),he=require("../chart/ChartLegend.cjs"),fe=require("../chart/ChartTableView.cjs"),ye=require("../chart/ChartTooltip.cjs"),V=require("../chart/palette.cjs"),be=require("../chart/utils/cartesian.cjs"),le=require("../chart/utils/data.cjs"),oe=require("../chart/utils/format.cjs"),Ce=require("../chart/utils/keyboard.cjs"),pe=require("../chart/utils/path.cjs"),ve=require("../chart/utils/scales.cjs"),ke=require("../chart/utils/text.cjs"),xe=require("../chart/utils/touch.cjs"),t=require("react/jsx-runtime"),Ve=24,Te=4,O=6,Ne=(0,V.rampColor)(V.CHART_DIVERGING_COLORS,1),we=(0,V.rampColor)(V.CHART_DIVERGING_COLORS,0),Ae=(0,m.memo)(function({bars:r,connectors:o}){return(0,t.jsxs)("g",{children:[(0,t.jsx)("g",{className:"stroke-gray-300 dark:stroke-gray-600",strokeWidth:1,shapeRendering:"crispEdges","aria-hidden":"true",children:o.map(n=>(0,t.jsx)("line",{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2},n.key))}),r.map(n=>(0,t.jsxs)("g",{children:[(0,t.jsx)("path",{d:n.d,fill:n.color}),n.label?(0,t.jsx)("text",{x:n.label.x,y:n.label.y,textAnchor:n.label.anchor,dominantBaseline:"middle",className:"fill-gray-600 text-[10px] [font-variant-numeric:tabular-nums] dark:fill-gray-300",children:n.label.text}):null]},n.key))]})});function Ie({width:s,height:r,steps:o,data:n,x:d,y:k,grid:M,size:F,orientation:H,connectors:J,showValues:T,barSize:$,palette:G,margin:B,tooltip:N,plotLabel:_,totalLabel:ie,formatValue:z,formatX:D,onStepClick:w}){let[U,X]=(0,m.useState)(null),u=U!==null&&U<o.length?U:null,e=(0,m.useMemo)(()=>{let i=H==="vertical",L=o.flatMap(l=>[l.start,l.end]),C=(0,be.buildCartesianGeometry)({width:s,height:r,data:n,x:d,y:k,bounds:L.length===0?null:[Math.min(...L),Math.max(...L)],margin:B,orientation:H,placement:"band",formatValue:z,formatX:D,defaultIncludeZero:!0}),{valueScale:x,bandwidth:W,categoryPositions:j,innerWidth:Q,innerHeight:ee}=C,K=x(0),g=Math.min($??Ve,W),p=[],E=[];return o.forEach((l,h)=>{let f=j[h]+(W-g)/2,te=x(l.start),ae=x(l.end),re=Math.min(te,ae),q=Math.abs(ae-te),a=l.end>=l.start,R=i?a?"top":"bottom":a?"right":"left",A=i?{x:f,y:re,width:g,height:q}:{x:re,y:f,width:q,height:g},P=null;if(T&&l.value!==null){let S=l.kind==="total"?l.formattedEnd:l.formattedValue,I=(0,ke.estimateTextWidth)(S,10),v=x(a?Math.max(l.start,l.end):Math.min(l.start,l.end));if(i){let b=a?v-O:v+O;I<=W&&b>8&&b<ee-4&&(P={x:f+g/2,y:b,anchor:"middle",text:S})}else{let b=a?Q-v-O:v-O;I<=b&&(P={x:a?v+O:v-O,y:f+g/2,anchor:a?"start":"end",text:S})}}p.push({key:`${h}`,color:G[l.kind],d:(0,pe.buildBarPath)({...A,radius:Te,round:R}),label:P});let y=o[h+1];if(J&&y){let S=x(l.end),I=j[h+1]+(W-g)/2;E.push(i?{key:`${h}`,x1:f+g,y1:S,x2:I,y2:S}:{key:`${h}`,x1:S,y1:f+g,x2:S,y2:I})}}),{vertical:i,bars:p,rules:E,baseline:K,bandwidth:W,categoryPositions:j,categoryCenters:C.categoryCenters,categoryTicks:C.categoryTicks,valueTicks:C.valueTicks,valueScale:x,innerWidth:Q,innerHeight:ee,margin:C.margin}},[o,n,d,k,s,r,B,H,J,T,$,G,z,D]),se=(0,m.useCallback)(i=>{if(N===!1||o.length===0)return;let L=i.currentTarget.getBoundingClientRect(),C=e.vertical?i.clientX-L.left-e.margin.left:i.clientY-L.top-e.margin.top;X((0,ve.nearestIndex)(e.categoryCenters,C))},[N,o.length,e.vertical,e.margin,e.categoryCenters]),Y=(0,m.useCallback)(()=>{!w||u===null||w(o[u])},[w,u,o]),ce=(0,m.useCallback)(i=>(0,Ce.handleChartKeyDown)(i,{count:o.length,current:u,axis:e.vertical?"x":"y",onMove:X,pick:w?Y:null}),[o.length,u,e.vertical,w,Y]),c=u===null?null:o[u],Z=u===null||c===void 0||c===null?null:e.vertical?{x:e.margin.left+e.categoryCenters[u],y:e.margin.top+Math.min(e.valueScale(c.start),e.valueScale(c.end))}:{x:e.margin.left+Math.max(e.valueScale(c.start),e.valueScale(c.end)),y:e.margin.top+e.categoryCenters[u]};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("svg",{width:s,height:r,role:"img","aria-label":_??o.map(i=>i.label).join(", "),tabIndex:0,className:`${xe.CHART_TOUCH} focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-synertech-primary-500`,onPointerMove:se,onPointerLeave:()=>X(null),onKeyDown:ce,onBlur:()=>X(null),onClick:Y,children:[(0,t.jsxs)("g",{transform:`translate(${e.margin.left}, ${e.margin.top})`,children:[(0,t.jsx)(ge.ChartGrid,{width:e.innerWidth,height:e.innerHeight,horizontal:e.vertical&&(M==="y"||M==="both")?e.valueTicks.map(i=>i.offset):void 0,vertical:!e.vertical&&(M==="y"||M==="both")?e.valueTicks.map(i=>i.offset):void 0}),u!==null?(0,t.jsx)("rect",{x:e.vertical?e.categoryPositions[u]:0,y:e.vertical?0:e.categoryPositions[u],width:e.vertical?e.bandwidth:e.innerWidth,height:e.vertical?e.innerHeight:e.bandwidth,className:"fill-gray-400 dark:fill-gray-500",opacity:.12,"aria-hidden":"true"}):null,(0,t.jsx)(Ae,{bars:e.bars,connectors:e.rules}),(0,t.jsx)("line",{x1:e.vertical?0:e.baseline,y1:e.vertical?e.baseline:0,x2:e.vertical?e.innerWidth:e.baseline,y2:e.vertical?e.baseline:e.innerHeight,className:"stroke-gray-300 dark:stroke-gray-600",strokeWidth:1,shapeRendering:"crispEdges"})]}),(0,t.jsx)("g",{transform:`translate(${e.margin.left}, ${e.margin.top+e.innerHeight})`,children:(e.vertical?d.hidden:k?.hidden)?null:(0,t.jsx)(me.ChartAxis,{orientation:"bottom",ticks:e.vertical?e.categoryTicks:e.valueTicks,length:e.innerWidth,label:e.vertical?d.label:k?.label,size:F})}),(0,t.jsx)("g",{transform:`translate(${e.margin.left}, ${e.margin.top})`,children:(e.vertical?k?.hidden:d.hidden)?null:(0,t.jsx)(me.ChartAxis,{orientation:"left",ticks:e.vertical?e.valueTicks:e.categoryTicks,length:e.innerHeight,showLine:!1,label:e.vertical?k?.label:d.label,size:F})})]}),c&&Z&&N!==!1?(0,t.jsx)(ye.ChartTooltip,{x:Z.x,y:Z.y,containerWidth:s,children:typeof N=="function"?N(c):(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("div",{className:"font-medium text-gray-900 dark:text-gray-100",children:c.label}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:G[c.kind]},"aria-hidden":"true"}),(0,t.jsx)("span",{className:"font-semibold text-gray-900 [font-variant-numeric:tabular-nums] dark:text-gray-100",children:c.kind==="total"?c.formattedEnd:c.formattedValue})]}),c.kind==="total"?null:(0,t.jsxs)("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[(0,t.jsx)("span",{children:ie}),(0,t.jsx)("span",{className:"[font-variant-numeric:tabular-nums]",children:c.formattedEnd})]})]})}):null]})}function Me({data:s,x:r,y:o,value:n,total:d,start:k=0,orientation:M="vertical",connectors:F=!0,showValues:H=!0,barSize:J,colors:T,height:$=280,width:G,size:B="md",grid:N="y",legend:_,tooltip:ie=!0,tableView:z=!1,title:D,description:w,loading:U=!1,emptyState:X,error:u=!1,errorState:e,onRetry:se,actions:Y,margin:ce,locale:c,plotLabel:Z,valueLabel:i,totalLabel:L,increaseLabel:C,decreaseLabel:x,format:W,onStepClick:j,className:Q,...ee}){let K=(0,ne.useUILocale)(c),g=(0,ne.useUILabels)(),p=(0,m.useMemo)(()=>W??(a=>(0,oe.formatAuto)(a,K)),[W,K]),E=(0,m.useMemo)(()=>r.format??(a=>(0,oe.formatXValue)(a,K)),[r.format,K]),l=(0,m.useMemo)(()=>{let a=k;return s.map((R,A)=>{let P=(0,le.readXValue)(R,r.key,A),y=(0,le.readNumber)(R,n);if(d?!!R[d]:!1){let b=y??a;return a=b,{index:A,x:P,label:E(P,A),value:b,start:0,end:b,kind:"total",formattedValue:p(b),formattedEnd:p(b),datum:R}}let I=a,v=y===null?a:a+y;return a=v,{index:A,x:P,label:E(P,A),value:y,start:I,end:v,kind:y!==null&&y<0?"decrease":"increase",formattedValue:y===null?"\u2014":`${y>0?"+":""}${p(y)}`,formattedEnd:p(v),datum:R}})},[s,r.key,n,d,k,p,E]),h=(0,m.useMemo)(()=>({increase:T?.increase??Ne,decrease:T?.decrease??we,total:T?.total??V.CHART_MUTED_COLOR}),[T]),f=L??g.chartRunningTotal,te=(0,m.useMemo)(()=>{let a=[{key:"increase",label:C??g.chartIncrease,color:h.increase,marker:"rect"},{key:"decrease",label:x??g.chartDecrease,color:h.decrease,marker:"rect"}];return l.some(R=>R.kind==="total")&&a.push({key:"total",label:f,color:h.total,marker:"rect"}),a},[h,l,C,x,f,g.chartIncrease,g.chartDecrease]),ae=(0,m.useMemo)(()=>l.map(a=>({[r.key]:a.x,[n]:a.kind==="total"?null:a.value,__running:a.end})),[l,r.key,n]),re=_===void 0?!0:_!==!1,q=typeof _=="string"?_:"bottom";return(0,t.jsx)(ue.ChartContainer,{title:D,description:w,height:$,width:G,size:B,loading:U,empty:l.length===0,emptyState:X,error:u,errorState:e,onRetry:se,actions:Y,tableView:z,legendPosition:q,legend:re?(0,t.jsx)(he.ChartLegend,{items:te,position:q,marker:"rect",size:B}):void 0,table:z?(0,t.jsx)(fe.ChartTableView,{data:ae,series:[{key:n,label:i??g.chartValue},{key:"__running",label:f}],xKey:r.key,xLabel:r.label??r.key,formatX:E,formatValue:p,caption:typeof D=="string"?D:void 0}):void 0,className:Q,...ee,children:({width:a})=>(0,t.jsx)(Ie,{width:a,height:$,steps:l,data:s,x:r,y:o,grid:N,size:B,orientation:M,connectors:F,showValues:H,barSize:J,palette:h,margin:ce,tooltip:ie,plotLabel:Z,totalLabel:f,formatValue:p,formatX:E,onStepClick:j})})}0&&(module.exports={WaterfallChart});
@@ -1 +1 @@
1
- "use client";import{memo as me,useCallback as ie,useMemo as A,useState as ue}from"react";import{useUILabels as ge}from"../../lib/i18n.js";import{ChartAxis as se}from"../chart/ChartAxis.js";import{ChartContainer as he}from"../chart/ChartContainer.js";import{ChartGrid as fe}from"../chart/ChartGrid.js";import{ChartLegend as ye}from"../chart/ChartLegend.js";import{ChartTableView as be}from"../chart/ChartTableView.js";import{ChartTooltip as Ce}from"../chart/ChartTooltip.js";import{CHART_DIVERGING_COLORS as ce,CHART_MUTED_COLOR as pe,rampColor as de}from"../chart/palette.js";import{buildCartesianGeometry as ve}from"../chart/utils/cartesian.js";import{readNumber as ke,readXValue as xe}from"../chart/utils/data.js";import{formatAuto as Re,formatXValue as Se}from"../chart/utils/format.js";import{handleChartKeyDown as We}from"../chart/utils/keyboard.js";import{buildBarPath as Le}from"../chart/utils/path.js";import{nearestIndex as Ee}from"../chart/utils/scales.js";import{estimateTextWidth as Pe}from"../chart/utils/text.js";import{CHART_TOUCH as Ve}from"../chart/utils/touch.js";import{Fragment as Be,jsx as n,jsxs as P}from"react/jsx-runtime";var Te=24,Ne=4,K=6,we=de(ce,1),Ae=de(ce,0),Ie=me(function({bars:s,connectors:o}){return P("g",{children:[n("g",{className:"stroke-gray-300 dark:stroke-gray-600",strokeWidth:1,shapeRendering:"crispEdges","aria-hidden":"true",children:o.map(t=>n("line",{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2},t.key))}),s.map(t=>P("g",{children:[n("path",{d:t.d,fill:t.color}),t.label?n("text",{x:t.label.x,y:t.label.y,textAnchor:t.label.anchor,dominantBaseline:"middle",className:"fill-gray-600 text-[10px] [font-variant-numeric:tabular-nums] dark:fill-gray-300",children:t.label.text}):null]},t.key))]})});function Me({width:C,height:s,steps:o,data:t,x:f,y:p,grid:I,size:F,orientation:O,connectors:J,showValues:V,barSize:H,palette:$,margin:M,tooltip:T,plotLabel:B,totalLabel:re,formatValue:G,formatX:_,onStepClick:N}){let[z,D]=ue(null),d=z!==null&&z<o.length?z:null,e=A(()=>{let i=O==="vertical",R=o.flatMap(a=>[a.start,a.end]),y=ve({width:C,height:s,data:t,x:f,y:p,bounds:R.length===0?null:[Math.min(...R),Math.max(...R)],margin:M,orientation:O,placement:"band",formatValue:G,formatX:_,defaultIncludeZero:!0}),{valueScale:v,bandwidth:S,categoryPositions:Z,innerWidth:Q,innerHeight:ee}=y,W=v(0),c=Math.min(H??Te,S),L=[],k=[];return o.forEach((a,h)=>{let E=Z[h]+(S-c)/2,te=v(a.start),ae=v(a.end),j=Math.min(te,ae),r=Math.abs(ae-te),m=a.end>=a.start,w=i?m?"top":"bottom":m?"right":"left",X=i?{x:E,y:j,width:c,height:r}:{x:j,y:E,width:r,height:c},u=null;if(V&&a.value!==null){let b=a.kind==="total"?a.formattedEnd:a.formattedValue,x=Pe(b,10),g=v(m?Math.max(a.start,a.end):Math.min(a.start,a.end));if(i){let q=m?g-K:g+K;x<=S&&q>8&&q<ee-4&&(u={x:E+c/2,y:q,anchor:"middle",text:b})}else{let q=m?Q-g-K:g-K;x<=q&&(u={x:m?g+K:g-K,y:E+c/2,anchor:m?"start":"end",text:b})}}L.push({key:`${h}`,color:$[a.kind],d:Le({...X,radius:Ne,round:w}),label:u});let oe=o[h+1];if(J&&oe){let b=v(a.end),x=Z[h+1]+(S-c)/2;k.push(i?{key:`${h}`,x1:E+c,y1:b,x2:x,y2:b}:{key:`${h}`,x1:b,y1:E+c,x2:b,y2:x})}}),{vertical:i,bars:L,rules:k,baseline:W,bandwidth:S,categoryPositions:Z,categoryCenters:y.categoryCenters,categoryTicks:y.categoryTicks,valueTicks:y.valueTicks,valueScale:v,innerWidth:Q,innerHeight:ee,margin:y.margin}},[o,t,f,p,C,s,M,O,J,V,H,$,G,_]),ne=ie(i=>{if(T===!1||o.length===0)return;let R=i.currentTarget.getBoundingClientRect(),y=e.vertical?i.clientX-R.left-e.margin.left:i.clientY-R.top-e.margin.top;D(Ee(e.categoryCenters,y))},[T,o.length,e.vertical,e.margin,e.categoryCenters]),U=ie(()=>{!N||d===null||N(o[d])},[N,d,o]),le=ie(i=>We(i,{count:o.length,current:d,axis:e.vertical?"x":"y",onMove:D,pick:N?U:null}),[o.length,d,e.vertical,N,U]),l=d===null?null:o[d],Y=d===null||l===void 0||l===null?null:e.vertical?{x:e.margin.left+e.categoryCenters[d],y:e.margin.top+Math.min(e.valueScale(l.start),e.valueScale(l.end))}:{x:e.margin.left+Math.max(e.valueScale(l.start),e.valueScale(l.end)),y:e.margin.top+e.categoryCenters[d]};return P(Be,{children:[P("svg",{width:C,height:s,role:"img","aria-label":B??o.map(i=>i.label).join(", "),tabIndex:0,className:`${Ve} focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-synertech-primary-500`,onPointerMove:ne,onPointerLeave:()=>D(null),onKeyDown:le,onBlur:()=>D(null),onClick:U,children:[P("g",{transform:`translate(${e.margin.left}, ${e.margin.top})`,children:[n(fe,{width:e.innerWidth,height:e.innerHeight,horizontal:e.vertical&&(I==="y"||I==="both")?e.valueTicks.map(i=>i.offset):void 0,vertical:!e.vertical&&(I==="y"||I==="both")?e.valueTicks.map(i=>i.offset):void 0}),d!==null?n("rect",{x:e.vertical?e.categoryPositions[d]:0,y:e.vertical?0:e.categoryPositions[d],width:e.vertical?e.bandwidth:e.innerWidth,height:e.vertical?e.innerHeight:e.bandwidth,className:"fill-gray-400 dark:fill-gray-500",opacity:.12,"aria-hidden":"true"}):null,n(Ie,{bars:e.bars,connectors:e.rules}),n("line",{x1:e.vertical?0:e.baseline,y1:e.vertical?e.baseline:0,x2:e.vertical?e.innerWidth:e.baseline,y2:e.vertical?e.baseline:e.innerHeight,className:"stroke-gray-300 dark:stroke-gray-600",strokeWidth:1,shapeRendering:"crispEdges"})]}),n("g",{transform:`translate(${e.margin.left}, ${e.margin.top+e.innerHeight})`,children:(e.vertical?f.hidden:p?.hidden)?null:n(se,{orientation:"bottom",ticks:e.vertical?e.categoryTicks:e.valueTicks,length:e.innerWidth,label:e.vertical?f.label:p?.label,size:F})}),n("g",{transform:`translate(${e.margin.left}, ${e.margin.top})`,children:(e.vertical?p?.hidden:f.hidden)?null:n(se,{orientation:"left",ticks:e.vertical?e.valueTicks:e.categoryTicks,length:e.innerHeight,showLine:!1,label:e.vertical?p?.label:f.label,size:F})})]}),l&&Y&&T!==!1?n(Ce,{x:Y.x,y:Y.y,containerWidth:C,children:typeof T=="function"?T(l):P("div",{className:"flex flex-col gap-1",children:[n("div",{className:"font-medium text-gray-900 dark:text-gray-100",children:l.label}),P("div",{className:"flex items-center gap-2",children:[n("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:$[l.kind]},"aria-hidden":"true"}),n("span",{className:"font-semibold text-gray-900 [font-variant-numeric:tabular-nums] dark:text-gray-100",children:l.kind==="total"?l.formattedEnd:l.formattedValue})]}),l.kind==="total"?null:P("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[n("span",{children:re}),n("span",{className:"[font-variant-numeric:tabular-nums]",children:l.formattedEnd})]})]})}):null]})}function et({data:C,x:s,y:o,value:t,total:f,start:p=0,orientation:I="vertical",connectors:F=!0,showValues:O=!0,barSize:J,colors:V,height:H=280,width:$,size:M="md",grid:T="y",legend:B,tooltip:re=!0,tableView:G=!1,title:_,description:N,loading:z=!1,emptyState:D,error:d=!1,errorState:e,onRetry:ne,actions:U,margin:le,locale:l,plotLabel:Y,valueLabel:i,totalLabel:R,increaseLabel:y,decreaseLabel:v,format:S,onStepClick:Z,className:Q,...ee}){let W=ge(),c=A(()=>S??(r=>Re(r,l)),[S,l]),L=A(()=>s.format??(r=>Se(r,l)),[s.format,l]),k=A(()=>{let r=p;return C.map((m,w)=>{let X=xe(m,s.key,w),u=ke(m,t);if(f?!!m[f]:!1){let g=u??r;return r=g,{index:w,x:X,label:L(X,w),value:g,start:0,end:g,kind:"total",formattedValue:c(g),formattedEnd:c(g),datum:m}}let b=r,x=u===null?r:r+u;return r=x,{index:w,x:X,label:L(X,w),value:u,start:b,end:x,kind:u!==null&&u<0?"decrease":"increase",formattedValue:u===null?"\u2014":`${u>0?"+":""}${c(u)}`,formattedEnd:c(x),datum:m}})},[C,s.key,t,f,p,c,L]),a=A(()=>({increase:V?.increase??we,decrease:V?.decrease??Ae,total:V?.total??pe}),[V]),h=R??W.chartRunningTotal,E=A(()=>{let r=[{key:"increase",label:y??W.chartIncrease,color:a.increase,marker:"rect"},{key:"decrease",label:v??W.chartDecrease,color:a.decrease,marker:"rect"}];return k.some(m=>m.kind==="total")&&r.push({key:"total",label:h,color:a.total,marker:"rect"}),r},[a,k,y,v,h,W.chartIncrease,W.chartDecrease]),te=A(()=>k.map(r=>({[s.key]:r.x,[t]:r.kind==="total"?null:r.value,__running:r.end})),[k,s.key,t]),ae=B===void 0?!0:B!==!1,j=typeof B=="string"?B:"bottom";return n(he,{title:_,description:N,height:H,width:$,size:M,loading:z,empty:k.length===0,emptyState:D,error:d,errorState:e,onRetry:ne,actions:U,tableView:G,legendPosition:j,legend:ae?n(ye,{items:E,position:j,marker:"rect",size:M}):void 0,table:G?n(be,{data:te,series:[{key:t,label:i??W.chartValue},{key:"__running",label:h}],xKey:s.key,xLabel:s.label??s.key,formatX:L,formatValue:c,caption:typeof _=="string"?_:void 0}):void 0,className:Q,...ee,children:({width:r})=>n(Me,{width:r,height:H,steps:k,data:C,x:s,y:o,grid:T,size:M,orientation:I,connectors:F,showValues:O,barSize:J,palette:a,margin:le,tooltip:re,plotLabel:Y,totalLabel:h,formatValue:c,formatX:L,onStepClick:Z})})}export{et as WaterfallChart};
1
+ "use client";import{memo as me,useCallback as ie,useMemo as I,useState as ue}from"react";import{useUILabels as ge,useUILocale as he}from"../../lib/i18n.js";import{ChartAxis as se}from"../chart/ChartAxis.js";import{ChartContainer as fe}from"../chart/ChartContainer.js";import{ChartGrid as ye}from"../chart/ChartGrid.js";import{ChartLegend as be}from"../chart/ChartLegend.js";import{ChartTableView as Ce}from"../chart/ChartTableView.js";import{ChartTooltip as pe}from"../chart/ChartTooltip.js";import{CHART_DIVERGING_COLORS as ce,CHART_MUTED_COLOR as ve,rampColor as de}from"../chart/palette.js";import{buildCartesianGeometry as ke}from"../chart/utils/cartesian.js";import{readNumber as xe,readXValue as Re}from"../chart/utils/data.js";import{formatAuto as Se,formatXValue as Le}from"../chart/utils/format.js";import{handleChartKeyDown as We}from"../chart/utils/keyboard.js";import{buildBarPath as Ee}from"../chart/utils/path.js";import{nearestIndex as Pe}from"../chart/utils/scales.js";import{estimateTextWidth as Ve}from"../chart/utils/text.js";import{CHART_TOUCH as Te}from"../chart/utils/touch.js";import{Fragment as _e,jsx as n,jsxs as P}from"react/jsx-runtime";var Ne=24,we=4,O=6,Ae=de(ce,1),Ie=de(ce,0),Me=me(function({bars:s,connectors:o}){return P("g",{children:[n("g",{className:"stroke-gray-300 dark:stroke-gray-600",strokeWidth:1,shapeRendering:"crispEdges","aria-hidden":"true",children:o.map(r=>n("line",{x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2},r.key))}),s.map(r=>P("g",{children:[n("path",{d:r.d,fill:r.color}),r.label?n("text",{x:r.label.x,y:r.label.y,textAnchor:r.label.anchor,dominantBaseline:"middle",className:"fill-gray-600 text-[10px] [font-variant-numeric:tabular-nums] dark:fill-gray-300",children:r.label.text}):null]},r.key))]})});function Be({width:p,height:s,steps:o,data:r,x:f,y:v,grid:M,size:F,orientation:H,connectors:J,showValues:V,barSize:$,palette:G,margin:B,tooltip:T,plotLabel:_,totalLabel:ne,formatValue:z,formatX:D,onStepClick:N}){let[U,X]=ue(null),c=U!==null&&U<o.length?U:null,e=I(()=>{let l=H==="vertical",S=o.flatMap(a=>[a.start,a.end]),y=ke({width:p,height:s,data:r,x:f,y:v,bounds:S.length===0?null:[Math.min(...S),Math.max(...S)],margin:B,orientation:H,placement:"band",formatValue:z,formatX:D,defaultIncludeZero:!0}),{valueScale:k,bandwidth:L,categoryPositions:j,innerWidth:Q,innerHeight:ee}=y,K=k(0),d=Math.min($??Ne,L),b=[],W=[];return o.forEach((a,m)=>{let u=j[m]+(L-d)/2,te=k(a.start),ae=k(a.end),re=Math.min(te,ae),q=Math.abs(ae-te),t=a.end>=a.start,x=l?t?"top":"bottom":t?"right":"left",w=l?{x:u,y:re,width:d,height:q}:{x:re,y:u,width:q,height:d},E=null;if(V&&a.value!==null){let R=a.kind==="total"?a.formattedEnd:a.formattedValue,A=Ve(R,10),C=k(t?Math.max(a.start,a.end):Math.min(a.start,a.end));if(l){let h=t?C-O:C+O;A<=L&&h>8&&h<ee-4&&(E={x:u+d/2,y:h,anchor:"middle",text:R})}else{let h=t?Q-C-O:C-O;A<=h&&(E={x:t?C+O:C-O,y:u+d/2,anchor:t?"start":"end",text:R})}}b.push({key:`${m}`,color:G[a.kind],d:Ee({...w,radius:we,round:x}),label:E});let g=o[m+1];if(J&&g){let R=k(a.end),A=j[m+1]+(L-d)/2;W.push(l?{key:`${m}`,x1:u+d,y1:R,x2:A,y2:R}:{key:`${m}`,x1:R,y1:u+d,x2:R,y2:A})}}),{vertical:l,bars:b,rules:W,baseline:K,bandwidth:L,categoryPositions:j,categoryCenters:y.categoryCenters,categoryTicks:y.categoryTicks,valueTicks:y.valueTicks,valueScale:k,innerWidth:Q,innerHeight:ee,margin:y.margin}},[o,r,f,v,p,s,B,H,J,V,$,G,z,D]),le=ie(l=>{if(T===!1||o.length===0)return;let S=l.currentTarget.getBoundingClientRect(),y=e.vertical?l.clientX-S.left-e.margin.left:l.clientY-S.top-e.margin.top;X(Pe(e.categoryCenters,y))},[T,o.length,e.vertical,e.margin,e.categoryCenters]),Y=ie(()=>{!N||c===null||N(o[c])},[N,c,o]),oe=ie(l=>We(l,{count:o.length,current:c,axis:e.vertical?"x":"y",onMove:X,pick:N?Y:null}),[o.length,c,e.vertical,N,Y]),i=c===null?null:o[c],Z=c===null||i===void 0||i===null?null:e.vertical?{x:e.margin.left+e.categoryCenters[c],y:e.margin.top+Math.min(e.valueScale(i.start),e.valueScale(i.end))}:{x:e.margin.left+Math.max(e.valueScale(i.start),e.valueScale(i.end)),y:e.margin.top+e.categoryCenters[c]};return P(_e,{children:[P("svg",{width:p,height:s,role:"img","aria-label":_??o.map(l=>l.label).join(", "),tabIndex:0,className:`${Te} focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-synertech-primary-500`,onPointerMove:le,onPointerLeave:()=>X(null),onKeyDown:oe,onBlur:()=>X(null),onClick:Y,children:[P("g",{transform:`translate(${e.margin.left}, ${e.margin.top})`,children:[n(ye,{width:e.innerWidth,height:e.innerHeight,horizontal:e.vertical&&(M==="y"||M==="both")?e.valueTicks.map(l=>l.offset):void 0,vertical:!e.vertical&&(M==="y"||M==="both")?e.valueTicks.map(l=>l.offset):void 0}),c!==null?n("rect",{x:e.vertical?e.categoryPositions[c]:0,y:e.vertical?0:e.categoryPositions[c],width:e.vertical?e.bandwidth:e.innerWidth,height:e.vertical?e.innerHeight:e.bandwidth,className:"fill-gray-400 dark:fill-gray-500",opacity:.12,"aria-hidden":"true"}):null,n(Me,{bars:e.bars,connectors:e.rules}),n("line",{x1:e.vertical?0:e.baseline,y1:e.vertical?e.baseline:0,x2:e.vertical?e.innerWidth:e.baseline,y2:e.vertical?e.baseline:e.innerHeight,className:"stroke-gray-300 dark:stroke-gray-600",strokeWidth:1,shapeRendering:"crispEdges"})]}),n("g",{transform:`translate(${e.margin.left}, ${e.margin.top+e.innerHeight})`,children:(e.vertical?f.hidden:v?.hidden)?null:n(se,{orientation:"bottom",ticks:e.vertical?e.categoryTicks:e.valueTicks,length:e.innerWidth,label:e.vertical?f.label:v?.label,size:F})}),n("g",{transform:`translate(${e.margin.left}, ${e.margin.top})`,children:(e.vertical?v?.hidden:f.hidden)?null:n(se,{orientation:"left",ticks:e.vertical?e.valueTicks:e.categoryTicks,length:e.innerHeight,showLine:!1,label:e.vertical?v?.label:f.label,size:F})})]}),i&&Z&&T!==!1?n(pe,{x:Z.x,y:Z.y,containerWidth:p,children:typeof T=="function"?T(i):P("div",{className:"flex flex-col gap-1",children:[n("div",{className:"font-medium text-gray-900 dark:text-gray-100",children:i.label}),P("div",{className:"flex items-center gap-2",children:[n("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:G[i.kind]},"aria-hidden":"true"}),n("span",{className:"font-semibold text-gray-900 [font-variant-numeric:tabular-nums] dark:text-gray-100",children:i.kind==="total"?i.formattedEnd:i.formattedValue})]}),i.kind==="total"?null:P("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[n("span",{children:ne}),n("span",{className:"[font-variant-numeric:tabular-nums]",children:i.formattedEnd})]})]})}):null]})}function tt({data:p,x:s,y:o,value:r,total:f,start:v=0,orientation:M="vertical",connectors:F=!0,showValues:H=!0,barSize:J,colors:V,height:$=280,width:G,size:B="md",grid:T="y",legend:_,tooltip:ne=!0,tableView:z=!1,title:D,description:N,loading:U=!1,emptyState:X,error:c=!1,errorState:e,onRetry:le,actions:Y,margin:oe,locale:i,plotLabel:Z,valueLabel:l,totalLabel:S,increaseLabel:y,decreaseLabel:k,format:L,onStepClick:j,className:Q,...ee}){let K=he(i),d=ge(),b=I(()=>L??(t=>Se(t,K)),[L,K]),W=I(()=>s.format??(t=>Le(t,K)),[s.format,K]),a=I(()=>{let t=v;return p.map((x,w)=>{let E=Re(x,s.key,w),g=xe(x,r);if(f?!!x[f]:!1){let h=g??t;return t=h,{index:w,x:E,label:W(E,w),value:h,start:0,end:h,kind:"total",formattedValue:b(h),formattedEnd:b(h),datum:x}}let A=t,C=g===null?t:t+g;return t=C,{index:w,x:E,label:W(E,w),value:g,start:A,end:C,kind:g!==null&&g<0?"decrease":"increase",formattedValue:g===null?"\u2014":`${g>0?"+":""}${b(g)}`,formattedEnd:b(C),datum:x}})},[p,s.key,r,f,v,b,W]),m=I(()=>({increase:V?.increase??Ae,decrease:V?.decrease??Ie,total:V?.total??ve}),[V]),u=S??d.chartRunningTotal,te=I(()=>{let t=[{key:"increase",label:y??d.chartIncrease,color:m.increase,marker:"rect"},{key:"decrease",label:k??d.chartDecrease,color:m.decrease,marker:"rect"}];return a.some(x=>x.kind==="total")&&t.push({key:"total",label:u,color:m.total,marker:"rect"}),t},[m,a,y,k,u,d.chartIncrease,d.chartDecrease]),ae=I(()=>a.map(t=>({[s.key]:t.x,[r]:t.kind==="total"?null:t.value,__running:t.end})),[a,s.key,r]),re=_===void 0?!0:_!==!1,q=typeof _=="string"?_:"bottom";return n(fe,{title:D,description:N,height:$,width:G,size:B,loading:U,empty:a.length===0,emptyState:X,error:c,errorState:e,onRetry:le,actions:Y,tableView:z,legendPosition:q,legend:re?n(be,{items:te,position:q,marker:"rect",size:B}):void 0,table:z?n(Ce,{data:ae,series:[{key:r,label:l??d.chartValue},{key:"__running",label:u}],xKey:s.key,xLabel:s.label??s.key,formatX:W,formatValue:b,caption:typeof D=="string"?D:void 0}):void 0,className:Q,...ee,children:({width:t})=>n(Be,{width:t,height:$,steps:a,data:p,x:s,y:o,grid:T,size:B,orientation:M,connectors:F,showValues:H,barSize:J,palette:m,margin:oe,tooltip:ne,plotLabel:Z,totalLabel:u,formatValue:b,formatX:W,onStepClick:j})})}export{tt as WaterfallChart};
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var p=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var E=(l,o)=>{for(var a in o)p(l,a,{get:o[a],enumerable:!0})},m=(l,o,a,L)=>{if(o&&typeof o=="object"||typeof o=="function")for(let f of x(o))!n.call(l,f)&&f!==a&&p(l,f,{get:()=>o[f],enumerable:!(L=U(o,f))||L.enumerable});return l},r=(l,o,a)=>(m(l,o,"default"),a&&m(a,o,"default"));var d=l=>m(p({},"__esModule",{value:!0}),l);var e={};E(e,{FOCUSABLE_SELECTOR:()=>t.FOCUSABLE_SELECTOR,INERT_IGNORE_ATTRIBUTE:()=>s.INERT_IGNORE_ATTRIBUTE,UILabelsProvider:()=>i.UILabelsProvider,cn:()=>I.cn,defaultUILabels:()=>b.defaultUILabels,findOwnedLayers:()=>s.findOwnedLayers,formatUILabel:()=>b.formatUILabel,frenchUILabels:()=>b.frenchUILabels,getFocusableElements:()=>t.getFocusableElements,hideOthers:()=>s.hideOthers,isElementVisible:()=>t.isElementVisible,isFocusable:()=>t.isFocusable,registerFloatingLayer:()=>s.registerFloatingLayer,useUILabels:()=>i.useUILabels});module.exports=d(e);r(e,require("./components/index.cjs"),module.exports);r(e,require("./hooks/index.cjs"),module.exports);var I=require("./lib/cn.cjs"),i=require("./lib/i18n.cjs"),b=require("./lib/ui-labels.cjs"),s=require("./lib/aria-hide.cjs"),t=require("./lib/focus.cjs");0&&(module.exports={FOCUSABLE_SELECTOR,INERT_IGNORE_ATTRIBUTE,UILabelsProvider,cn,defaultUILabels,findOwnedLayers,formatUILabel,frenchUILabels,getFocusableElements,hideOthers,isElementVisible,isFocusable,registerFloatingLayer,useUILabels,...require("./components/index.cjs"),...require("./hooks/index.cjs")});
1
+ "use strict";var m=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var E=(l,o)=>{for(var a in o)m(l,a,{get:o[a],enumerable:!0})},L=(l,o,a,p)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of x(o))!n.call(l,i)&&i!==a&&m(l,i,{get:()=>o[i],enumerable:!(p=U(o,i))||p.enumerable});return l},r=(l,o,a)=>(L(l,o,"default"),a&&L(a,o,"default"));var d=l=>L(m({},"__esModule",{value:!0}),l);var e={};E(e,{FOCUSABLE_SELECTOR:()=>t.FOCUSABLE_SELECTOR,INERT_IGNORE_ATTRIBUTE:()=>s.INERT_IGNORE_ATTRIBUTE,UILabelsProvider:()=>b.UILabelsProvider,cn:()=>I.cn,defaultUILabels:()=>f.defaultUILabels,findOwnedLayers:()=>s.findOwnedLayers,formatUILabel:()=>f.formatUILabel,frenchUILabels:()=>f.frenchUILabels,getFocusableElements:()=>t.getFocusableElements,hideOthers:()=>s.hideOthers,isElementVisible:()=>t.isElementVisible,isFocusable:()=>t.isFocusable,registerFloatingLayer:()=>s.registerFloatingLayer,useUILabels:()=>b.useUILabels,useUILocale:()=>b.useUILocale});module.exports=d(e);r(e,require("./components/index.cjs"),module.exports);r(e,require("./hooks/index.cjs"),module.exports);var I=require("./lib/cn.cjs"),b=require("./lib/i18n.cjs"),f=require("./lib/ui-labels.cjs"),s=require("./lib/aria-hide.cjs"),t=require("./lib/focus.cjs");0&&(module.exports={FOCUSABLE_SELECTOR,INERT_IGNORE_ATTRIBUTE,UILabelsProvider,cn,defaultUILabels,findOwnedLayers,formatUILabel,frenchUILabels,getFocusableElements,hideOthers,isElementVisible,isFocusable,registerFloatingLayer,useUILabels,useUILocale,...require("./components/index.cjs"),...require("./hooks/index.cjs")});