it-data-nexus-ui-library 2.4.6 → 2.4.8

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 r}from"react/jsx-runtime";import{ToggleButtonGroup as o,ToggleButton as e}from"@mui/material";import{colours as a}from"../theme/tokens.mjs";function i({options:i,value:l,onChange:t,ariaLabel:n,size:s="small",sx:b,...d}){return r(o,{exclusive:!0,value:l,onChange:(r,o)=>{null!==o&&t(o)},size:s,"aria-label":n,sx:[{bgcolor:"rgba(255, 255, 255, 0.85)",borderRadius:"999px",border:"1px solid",borderColor:"divider",boxShadow:"inset 0 1px 2px rgba(10, 22, 34, 0.05)",p:"3px",gap:"2px","& .MuiToggleButton-root":{border:"none",borderRadius:"999px !important",textTransform:"none",fontWeight:600,px:2,color:a.darkGrey,transition:"background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease","&:not(.Mui-selected):hover":{bgcolor:"rgba(0, 0, 0, 0.08)",color:"rgba(0, 0, 0, 0.87)"}},"&& .MuiToggleButton-root.Mui-selected":{bgcolor:"primary.main",color:"primary.contrastText",boxShadow:"0 1px 4px rgba(20, 39, 59, 0.3), inset 0 1px 0 rgba(255,255,255,0.12)","&:hover":{bgcolor:"primary.dark"}}},...Array.isArray(b)?b:b?[b]:[]],...d,children:i.map(o=>r(e,{value:o.value,disabled:o.disabled,"aria-label":o.ariaLabel,children:o.label},o.value))})}export{i as SegmentedControl};
1
+ import{jsx as e}from"react/jsx-runtime";import{ToggleButtonGroup as r,ToggleButton as o}from"@mui/material";const t={small:{height:32,px:"14px",fontSize:"0.8125rem"},medium:{height:40,px:"20px",fontSize:"0.9375rem"},large:{height:48,px:"28px",fontSize:"1rem"}};function a({options:a,value:i,onChange:l,ariaLabel:n,size:p="medium",sx:d,...s}){const{height:x,px:g,fontSize:m}=t[p];return e(r,{exclusive:!0,value:i,onChange:(e,r)=>{null!==r&&l(r)},"aria-label":n,sx:[e=>({bgcolor:"dark"===e.palette.mode?"rgba(255,255,255,0.08)":"rgba(255,255,255,0.85)",borderRadius:"999px",border:"1px solid",borderColor:"divider",boxShadow:"inset 0 1px 2px rgba(10, 22, 34, 0.05)",p:"3px",gap:"2px",minHeight:x,width:"fit-content","& .MuiToggleButton-root":{border:"none",borderRadius:"999px !important",textTransform:"none",fontWeight:600,paddingInline:g,paddingBlock:0,fontSize:m,lineHeight:1,alignSelf:"stretch",color:e.palette.text.primary,transition:"background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease","&:not(.Mui-selected):hover":{bgcolor:e.palette.action.hover,color:e.palette.text.primary}},"&& .MuiToggleButton-root.Mui-selected":{bgcolor:e.palette.primary.main,color:e.palette.primary.contrastText,boxShadow:"0 1px 4px rgba(20, 39, 59, 0.3), inset 0 1px 0 rgba(255,255,255,0.12)","&:hover":{bgcolor:e.palette.primary.dark}}}),...Array.isArray(d)?d:d?[d]:[]],...s,children:a.map(r=>e(o,{value:r.value,disabled:r.disabled,"aria-label":r.ariaLabel,children:r.label},r.value))})}export{a as SegmentedControl};
@@ -1 +1 @@
1
- const o="2.4.6";export{o as SAGE_NEXUS_UI_VERSION};
1
+ const o="2.4.8";export{o as SAGE_NEXUS_UI_VERSION};
package/dist/index.d.ts CHANGED
@@ -486,12 +486,13 @@ interface SegmentedControlOption<T extends string = string> {
486
486
  ariaLabel?: string;
487
487
  disabled?: boolean;
488
488
  }
489
- interface SegmentedControlProps<T extends string = string> extends Omit<ToggleButtonGroupProps, "value" | "onChange" | "exclusive" | "color"> {
489
+ interface SegmentedControlProps<T extends string = string> extends Omit<ToggleButtonGroupProps, "value" | "onChange" | "exclusive" | "color" | "size"> {
490
490
  options: SegmentedControlOption<T>[];
491
491
  value: T;
492
492
  onChange: (value: T) => void;
493
493
  /** Accessible group label, e.g. "Level of detail". */
494
494
  ariaLabel?: string;
495
+ size?: "small" | "medium" | "large";
495
496
  }
496
497
  /**
497
498
  * Segmented pill-track toggle for switching between a small set of mutually exclusive
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "it-data-nexus-ui-library",
3
- "version": "2.4.6",
3
+ "version": "2.4.8",
4
4
  "description": "Nexus core components",
5
5
  "license": "ISC",
6
6
  "author": "emsmart-sage",