it-data-nexus-ui-library 2.10.15 → 2.10.17
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{alpha as t}from"@mui/material/styles";import{AiCard as r}from"./AiCard.mjs";import{ButtonBase as o}from"./Buttons/ButtonBase.mjs";import{Card as a}from"./Card.mjs";import{H2 as s,H3 as d}from"./Typography.mjs";import{Stack as n}from"./_Primitives/Stack.mjs";import l from"@mui/material/Box";const m=e=>Array.isArray(e)?e:e?[e]:[],x=({ai:x=!1,title:p,subtitle:h,maxWidth:c=350,display:f=!1,icon:u,headerAdornment:b,children:y,footer:g,sx:v,cardSx:S,contentSx:w,headerSx:C,headerAdornmentSx:j,iconSx:A,titleSx:R,subtitleSx:k,bodySx:B,footerSx:I,...W})=>{const D=x?r:a;return e(o,{...W,sx:[{alignItems:"stretch",borderRadius:f?{xs:2,sm:4}:1,maxWidth:c,textAlign:"left",transition:"filter .18s ease","&:hover > div":{boxShadow:e=>`0 8px 20px ${t(e.palette.text.primary,.12)}, 0 1px 3px ${t(e.palette.text.primary,.07)}`,borderColor:e=>t(e.palette.primary.main,"dark"===e.palette.mode?.7:.3)},"&:active":{filter:"brightness(.98)",transitionDuration:".08s"},"&:active > div":{boxShadow:e=>`0 2px 6px ${t(e.palette.text.primary,.1)}`,transitionDuration:".08s"},"&:focus-visible":{outline:"2px solid",outlineColor:"primary.main",outlineOffset:3},"&.Mui-disabled":{opacity:.5},"& > div":{display:"flex",width:"100%",height:"100%",transition:"box-shadow .18s ease, border-color .18s ease",borderRadius:f?{xs:2,sm:4}:void 0},"& > div::before":{borderRadius:f?{xs:2,sm:4}:void 0},"& > div::after":{borderRadius:f?{xs:2,sm:4}:void 0}},...m(v)],children:e(D,{sx:[{width:"100%",height:"100%",borderRadius:f?{xs:2,sm:4}:void 0,border:x?"none":"1px solid",borderColor:x?void 0:e=>t(e.palette.primary.main,"dark"===e.palette.mode?.4:.2),"& .MuiCardContent-root":{display:"flex",width:"100%",height:"100%",flexDirection:"column"}},...m(S)],children:i(n,{sx:[{width:"100%",height:"100%",gap:1.5},...m(w)],children:[i(n,{direction:"row",sx:[{alignItems:"flex-start",justifyContent:"space-between",gap:1,flexWrap:"wrap"},...m(C)],children:[i(n,{direction:"row",sx:{alignItems:"center",gap:1,minWidth:0},children:[u&&e(l,{sx:[{display:"flex",alignItems:"center",flexShrink:0},...m(A)],children:u}),e(s,{sx:R,children:p})]}),b&&e(l,{sx:j,children:b})]}),h&&e(d,{sx:[{color:"text.secondary"},...m(k)],children:h}),y&&e(n,{sx:[{gap:1},...m(B)],children:y}),g&&e(n,{sx:[{mt:"auto"},...m(I)],children:g})]})})})},p=i=>e(x,{...i}),h=i=>e(x,{...i,ai:!0});export{h as AiButtonTile,p as ButtonTile};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useRef as r,Children as o,useState as i,useCallback as n,useEffect as l}from"react";import s from"@mui/icons-material/ChevronLeftRounded";import a from"@mui/icons-material/ChevronRightRounded";import c from"@mui/material/Box";import{Stack as d}from"./_Primitives/Stack.mjs";import{IconButton as m}from"./Buttons/IconButton.mjs";import{Caption as u}from"./Typography.mjs";const f={xs:1,sm:2,md:3,lg:4},h=["xs","sm","md","lg"],p={disableRipple:!0,disableFocusRipple:!0,sx:e=>({"&.Mui-focusVisible":{outline:`2px solid ${e.palette.primary.main}`,outlineOffset:2}})},b=({children:b,"aria-label":g,itemsPerView:x,gap:v=2.5,previousLabel:y="Previous",nextLabel:$="Next",itemLabel:w,itemsPerGroup:A=1,sx:L})=>{const S=r(null),W=r(null),j=r(null),B=o.toArray(b),R=B.length,[C,O]=i({start:!0,end:!0}),[k,E]=i(new Set),I=n(()=>{const e=S.current;e&&O({start:e.scrollLeft<=2,end:e.scrollLeft+e.clientWidth>=e.scrollWidth-2})},[]);l(()=>{const e=S.current;if(!e)return;I();const t=new ResizeObserver(I);t.observe(e),e.addEventListener("scroll",I,{passive:!0});const r=new Set,o=new IntersectionObserver(e=>{for(const t of e){const e=Number(t.target.dataset.index);t.intersectionRatio>=.5?r.add(e):r.delete(e)}E(new Set(r))},{root:e,threshold:[0,.5,1]});for(const t of Array.from(e.children))o.observe(t);return()=>{t.disconnect(),o.disconnect(),e.removeEventListener("scroll",I)}},[R,I]),l(()=>{Array.from(S.current?.children??[]).forEach((e,t)=>{e.toggleAttribute("inert",k.size>0&&!k.has(t))})},[k,R]),l(()=>{const e=C.end?"next":C.start?"previous":null;if(e&&j.current===e){const t="next"===e?"previous":"next";W.current?.querySelector(`[data-control="${t}"]:not(:disabled)`)?.focus()}},[C]);const M=e=>{const t=S.current,r=t?.children[0];if(!t||!r)return;const o=t.children[1],i=o?o.offsetLeft-r.offsetLeft:r.offsetWidth;t.scrollBy({left:e*i,behavior:"undefined"!=typeof window&&Boolean(window.matchMedia?.("(prefers-reduced-motion: reduce)").matches)?"instant":"smooth"})},P=Array.from(k).sort((e,t)=>e-t),F=R*A,N=0===P.length?"":1===P.length?`Showing ${P[0]*A+1} of ${F}`:`Showing ${P[0]*A+1}–${Math.min((P[P.length-1]+1)*A,F)} of ${F}`,z=x&&Object.keys(x).length>0?x:f,T={xs:h.map(e=>z[e]).find(e=>void 0!==e),...z},V=e=>Object.fromEntries(Object.entries(T).filter(e=>void 0!==e[1]).map(([t,r])=>[t,`calc((100% - ${e.spacing(v)} * ${r-1}) / ${r})`]));return e(d,{sx:[{gap:1.5,minWidth:0,maxWidth:"100%"},...Array.isArray(L)?L:L?[L]:[]],children:[t(c,{ref:S,role:"region","aria-label":g,tabIndex:0,sx:e=>({display:"grid",gridAutoFlow:"column",gridAutoColumns:V(e),gap:v,minWidth:0,overflowX:"auto",overscrollBehaviorX:"contain",scrollSnapType:"x mandatory",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},scrollBehavior:"smooth","@media (prefers-reduced-motion: reduce)":{scrollBehavior:"auto"},"&:focus-visible":{outline:`2px solid ${e.palette.primary.main}`,outlineOffset:2,borderRadius:1}}),children:B.map((e,r)=>t(c,{"data-index":r,role:"group","aria-roledescription":"slide","aria-label":A>1?`${r*A+1}–${Math.min((r+1)*A,F)} of ${F}`:`${r+1} of ${R}`,sx:{minWidth:0,scrollSnapAlign:"start"},children:e},r))}),e(d,{ref:W,direction:"row",onFocus:e=>{j.current=e.target.dataset.control??null},sx:{justifyContent:"center",alignItems:"center",gap:1.5},children:[t(m,{...p,"data-control":"previous",title:y,onClick:()=>M(-1),disabled:C.start,children:t(s,{})}),t(u,{"aria-live":"polite",sx:{minWidth:"9ch",textAlign:"center"},children:w?N?`${N} ${w}`:`${F} ${w}`:N}),t(m,{...p,"data-control":"next",title:$,onClick:()=>M(1),disabled:C.end,children:t(a,{})})]})]})};b.displayName="Carousel";export{b as Carousel};
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useRef as r,Children as o,useState as i,useCallback as n,useEffect as l}from"react";import s from"@mui/icons-material/ChevronLeftRounded";import a from"@mui/icons-material/ChevronRightRounded";import c from"@mui/material/Box";import{Stack as d}from"./_Primitives/Stack.mjs";import{IconButton as m}from"./Buttons/IconButton.mjs";import{Caption as u}from"./Typography.mjs";const f={xs:1,sm:2,md:3,lg:4},h=["xs","sm","md","lg","xl"],p={disableRipple:!0,disableFocusRipple:!0,sx:e=>({"&.Mui-focusVisible":{outline:`2px solid ${e.palette.primary.main}`,outlineOffset:2}})},b=({children:b,"aria-label":g,itemsPerView:x,gap:v=2.5,previousLabel:y="Previous",nextLabel:$="Next",itemLabel:w,itemsPerGroup:A=1,sx:L})=>{const S=r(null),W=r(null),j=r(null),B=o.toArray(b),R=B.length,[C,O]=i({start:!0,end:!0}),[k,E]=i(new Set),I=n(()=>{const e=S.current;e&&O({start:e.scrollLeft<=2,end:e.scrollLeft+e.clientWidth>=e.scrollWidth-2})},[]);l(()=>{const e=S.current;if(!e)return;I();const t=new ResizeObserver(I);t.observe(e),e.addEventListener("scroll",I,{passive:!0});const r=new Set,o=new IntersectionObserver(e=>{for(const t of e){const e=Number(t.target.dataset.index);t.intersectionRatio>=.5?r.add(e):r.delete(e)}E(new Set(r))},{root:e,threshold:[0,.5,1]});for(const t of Array.from(e.children))o.observe(t);return()=>{t.disconnect(),o.disconnect(),e.removeEventListener("scroll",I)}},[R,I]),l(()=>{Array.from(S.current?.children??[]).forEach((e,t)=>{e.toggleAttribute("inert",k.size>0&&!k.has(t))})},[k,R]),l(()=>{const e=C.end?"next":C.start?"previous":null;if(e&&j.current===e){const t="next"===e?"previous":"next";W.current?.querySelector(`[data-control="${t}"]:not(:disabled)`)?.focus()}},[C]);const M=e=>{const t=S.current,r=t?.children[0];if(!t||!r)return;const o=t.children[1],i=o?o.offsetLeft-r.offsetLeft:r.offsetWidth;t.scrollBy({left:e*i,behavior:"undefined"!=typeof window&&Boolean(window.matchMedia?.("(prefers-reduced-motion: reduce)").matches)?"instant":"smooth"})},P=Array.from(k).sort((e,t)=>e-t),F=R*A,N=0===P.length?"":1===P.length?`Showing ${P[0]*A+1} of ${F}`:`Showing ${P[0]*A+1}–${Math.min((P[P.length-1]+1)*A,F)} of ${F}`,z=x&&Object.keys(x).length>0?x:f,T={xs:h.map(e=>z[e]).find(e=>void 0!==e),...z},V=e=>Object.fromEntries(Object.entries(T).filter(e=>void 0!==e[1]).map(([t,r])=>[t,`calc((100% - ${e.spacing(v)} * ${r-1}) / ${r})`]));return e(d,{sx:[{gap:1.5,minWidth:0,maxWidth:"100%"},...Array.isArray(L)?L:L?[L]:[]],children:[t(c,{ref:S,role:"region","aria-label":g,tabIndex:0,sx:e=>({display:"grid",gridAutoFlow:"column",gridAutoColumns:V(e),gap:v,minWidth:0,overflowX:"auto",overscrollBehaviorX:"contain",scrollSnapType:"x mandatory",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},scrollBehavior:"smooth","@media (prefers-reduced-motion: reduce)":{scrollBehavior:"auto"},"&:focus-visible":{outline:`2px solid ${e.palette.primary.main}`,outlineOffset:2,borderRadius:1}}),children:B.map((e,r)=>t(c,{"data-index":r,role:"group","aria-roledescription":"slide","aria-label":A>1?`${r*A+1}–${Math.min((r+1)*A,F)} of ${F}`:`${r+1} of ${R}`,sx:{minWidth:0,scrollSnapAlign:"start"},children:e},r))}),e(d,{ref:W,direction:"row",onFocus:e=>{j.current=e.target.dataset.control??null},sx:{justifyContent:"center",alignItems:"center",gap:1.5},children:[t(m,{...p,"data-control":"previous",title:y,onClick:()=>M(-1),disabled:C.start,children:t(s,{})}),t(u,{"aria-live":"polite",sx:{minWidth:"9ch",textAlign:"center"},children:w?N?`${N} ${w}`:`${F} ${w}`:N}),t(m,{...p,"data-control":"next",title:$,onClick:()=>M(1),disabled:C.end,children:t(a,{})})]})]})};b.displayName="Carousel";export{b as Carousel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const o="2.10.
|
|
1
|
+
const o="2.10.17";export{o as SAGE_NEXUS_UI_VERSION};
|
package/dist/index.d.ts
CHANGED
|
@@ -898,6 +898,8 @@ interface ButtonTileProps extends Omit<ButtonBaseProps, "children" | "title"> {
|
|
|
898
898
|
icon?: ReactNode;
|
|
899
899
|
/** Non-interactive content displayed at the end of the title row, such as a status badge. */
|
|
900
900
|
headerAdornment?: ReactNode;
|
|
901
|
+
/** Applies the display-scale border radius (16px mobile / 32px desktop) for marketing and website contexts. */
|
|
902
|
+
display?: boolean;
|
|
901
903
|
children?: ReactNode;
|
|
902
904
|
footer?: ReactNode;
|
|
903
905
|
cardSx?: SxProps<Theme>;
|
|
@@ -1700,7 +1702,7 @@ interface SectionNavProps {
|
|
|
1700
1702
|
*/
|
|
1701
1703
|
declare const SectionNav: ({ items, "aria-label": ariaLabel, scrollRoot, sticky, glass, stickyOffset, justifyContent, sx, }: SectionNavProps) => react.JSX.Element;
|
|
1702
1704
|
|
|
1703
|
-
type CarouselBreakpoint = "xs" | "sm" | "md" | "lg";
|
|
1705
|
+
type CarouselBreakpoint = "xs" | "sm" | "md" | "lg" | "xl";
|
|
1704
1706
|
/** Cards visible at once per breakpoint. Fractions leave the next card peeking, e.g. `1.15`. */
|
|
1705
1707
|
type CarouselItemsPerView = Partial<Record<CarouselBreakpoint, number>>;
|
|
1706
1708
|
interface CarouselProps {
|