@equisoft/design-elements-react 10.0.1-snapshot.20260223145318 → 10.0.1-snapshot.20260223203157

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 (2) hide show
  1. package/dist/bundle.js +3 -3
  2. package/package.json +1 -1
package/dist/bundle.js CHANGED
@@ -1926,7 +1926,7 @@
1926
1926
  padding: var(--spacing-half) var(--spacing-2x);
1927
1927
 
1928
1928
  ${f};
1929
- `,hv=({align:t,idContent:r,buttonProps:n,className:o,children:a})=>{const i=Vl(r),{buttonType:l="tertiary",inverted:s=!1}=n,c=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(n,["buttonType","inverted"]),d="iconName"in n&&n.iconName?(0,e.jsx)(cn,{name:n.iconName}):void 0;return(0,e.jsx)(Oi,Object.assign({align:t,buttonType:l,className:o,dropdownMenuId:i,hasCaret:!1,icon:d,inverted:s,render:()=>(0,e.jsx)(mv,{"data-testid":"disclosure-content",children:a})},c))};hv.displayName="Disclosure";const fv="350px",gv="200px";var bv=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r};const vv=a().div`
1929
+ `,hv=({align:t,idContent:r,buttonProps:n,className:o,children:a})=>{const i=Vl(r),{buttonType:l="tertiary",inverted:s=!1}=n,c=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(n,["buttonType","inverted"]),d="iconName"in n&&n.iconName?(0,e.jsx)(cn,{name:n.iconName}):void 0;return(0,e.jsx)(Oi,Object.assign({align:t,buttonType:l,className:o,dropdownMenuId:i,dropdownMenuWidth:"auto",hasCaret:!1,icon:d,inverted:s,render:()=>(0,e.jsx)(mv,{"data-testid":"disclosure-content",children:a})},c))};hv.displayName="Disclosure";const fv="350px",gv="200px";var bv=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r};const vv=a().div`
1930
1930
  position: relative;
1931
1931
  `,yv=a()(wn)`
1932
1932
  font-size: 0.875rem;
@@ -2478,7 +2478,7 @@
2478
2478
  overflow: hidden;
2479
2479
  text-overflow: ellipsis;
2480
2480
  white-space: nowrap;
2481
- `;function BM(e){return"groupLabel"in e&&void 0!==e.groupLabel}function WM(e){return e.flatMap(e=>BM(e)?e.groupOptions:e)}function YM(e){const t=e.ref.current.getBoundingClientRect(),r=e.ref.current.parentElement.getBoundingClientRect();return{top:t.top-r.top-5,left:t.right-r.left-1}}const GM=(0,t.forwardRef)((r,n)=>{var{className:o,id:a,numberOfVisibleItems:i=4,options:s,onKeyDown:c,onOptionSelect:d}=r,u=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(r,["className","id","numberOfVisibleItems","options","onKeyDown","onOptionSelect"]);const p=(0,t.useMemo)(()=>a||l(),[a]),m=_(),f=(0,t.useMemo)(()=>function(e){const r=new Map,n=(e,o)=>e.map(e=>{var a,i;if("groupLabel"in(i=e)&&void 0!==i.groupLabel)return Object.assign(Object.assign({},e),{groupOptions:n(e.groupOptions,o)});const l=(null!==(a=r.get(o))&&void 0!==a?a:-1)+1;return r.set(o,l),Object.assign(Object.assign({},e),{focusIndex:l,ref:(0,t.createRef)(),options:e.options?n(e.options,o+1):void 0})});return n(e,0)}(s),[s]),[g,b]=(0,t.useState)(0),[v,y]=(0,t.useState)(f),[k,x]=(0,t.useState)(!1),[,w]=(0,t.useState)(null),M=(0,t.useCallback)(e=>{var t;const r=null===(t=WM(v)[e])||void 0===t?void 0:t.ref.current;r&&w(e=>{var t;return function(e){var t;e&&(null===(t=null==e?void 0:e.classList)||void 0===t||t.add(h))}(r),r.focus(),(t=e)&&(null==t||t.classList.remove(h)),r})},[v]);function S(e){e.options&&(x(!0),y(e.options))}function C(e){e.options&&(x(!1),y(f))}function E(e){var t;x(!1),null==c||c(e);const r=WM(v);if(Gg(e.key)){const n=r.find(t=>t.label.toLowerCase().startsWith(e.key.toLowerCase()));null===(t=null==n?void 0:n.ref.current)||void 0===t||t.focus()}switch(e.key){case"ArrowUp":{e.preventDefault();const t=$s(r,g,{wrapAround:!0});t&&b(t.focusIndex);break}case"ArrowDown":{e.preventDefault();const t=zs(r,g,{wrapAround:!0});t&&b(t.focusIndex);break}case"ArrowRight":{e.preventDefault();const t=r[g].options;t&&(y(t),b(0));break}case"ArrowLeft":{e.preventDefault();const t=f!==v,r=WM(f).find(e=>e.options===v);t&&(y(f),b(r?r.focusIndex:0));break}}}function O(e){return e.options===v}return(0,t.useEffect)(()=>{k||M(g)},[M,g,k]),(0,e.jsx)(LM,Object.assign({className:o,"data-testid":"menu",id:p,numberOfVisibleItems:WM(f).some(e=>null!=e.options)?void 0:i,onKeyDown:E,role:"menu",ref:n},u,{children:function r(n){const o=n!==f,a=e=>o?`sub-menu-option-${e}`:`menu-option-${e}`,l=n.some(e=>!BM(e)&&null!=e.iconName);return(0,e.jsx)(e.Fragment,{children:n.map((o,s)=>BM(o)?function(t,n){const o=`menu-group-${n}`;return(0,e.jsxs)("div",{role:"group","aria-labelledby":o,children:[(0,e.jsx)(UM,{$device:m,id:o,children:t.groupLabel}),t.groupOptions&&r(t.groupOptions)]},`${o}-${t.groupLabel}`)}(o,s):(0,e.jsxs)(t.Fragment,{children:[(0,e.jsxs)(VM,{"aria-haspopup":o.options?"menu":void 0,"aria-expanded":o.options?v===o.options:void 0,"data-testid":a(s),$device:m,$hasSubMenu:!!o.options,type:"button",role:"menuitem",tabIndex:-1,disabled:o.disabled,onClick:()=>function(e){var t;null===(t=e.onClick)||void 0===t||t.call(e),e.options?(y(e.options),b(0)):null==d||d(e)}(o),onMouseEnter:()=>S(o),onMouseLeave:()=>C(o),ref:o.ref,$withEmptyIcon:l&&!o.iconName,children:[o.iconName&&(0,e.jsx)(HM,{focusable:!1,"aria-hidden":!0,name:o.iconName,size:"1rem"}),(0,e.jsx)(qM,{children:o.label}),o.options&&(0,e.jsx)(cn,{"aria-hidden":!0,name:"chevronRight",size:"1rem"})]}),o.options&&O(o)&&(0,e.jsx)(IM,Object.assign({"data-testid":`menu-option-${s}-sub-menu`,id:p,numberOfVisibleItems:WM(n).some(e=>null!=e.options)?void 0:i,onKeyDown:E,role:"menu",onMouseEnter:()=>S(o),onMouseLeave:()=>C(o),top:YM(o).top,left:YM(o).left},u,{children:r(o.options)}))]},`${p}-${o.label}`))})}(f)}))});GM.displayName="Menu";const KM=a()(GM)`
2481
+ `;function BM(e){return"groupLabel"in e&&void 0!==e.groupLabel}function WM(e){return e.flatMap(e=>BM(e)?e.groupOptions:e)}function YM(e){const t=e.ref.current.getBoundingClientRect(),r=e.ref.current.parentElement.getBoundingClientRect();return{top:t.top-r.top-5,left:t.right-r.left-1}}const GM=(0,t.forwardRef)((r,n)=>{var{className:o,id:a,numberOfVisibleItems:i=4,options:s,onKeyDown:c,onOptionSelect:d}=r,u=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(r,["className","id","numberOfVisibleItems","options","onKeyDown","onOptionSelect"]);const p=(0,t.useMemo)(()=>a||l(),[a]),m=_(),f=(0,t.useMemo)(()=>function(e){const r=new Map,n=(e,o)=>e.map(e=>{var a,i;if("groupLabel"in(i=e)&&void 0!==i.groupLabel)return Object.assign(Object.assign({},e),{groupOptions:n(e.groupOptions,o)});const l=(null!==(a=r.get(o))&&void 0!==a?a:-1)+1;return r.set(o,l),Object.assign(Object.assign({},e),{focusIndex:l,ref:(0,t.createRef)(),options:e.options?n(e.options,o+1):void 0})});return n(e,0)}(s),[s]),[g,b]=(0,t.useState)(0),[v,y]=(0,t.useState)(f),[k,x]=(0,t.useState)(!1),[,w]=(0,t.useState)(null),M=(0,t.useCallback)(e=>{var t;const r=null===(t=WM(v)[e])||void 0===t?void 0:t.ref.current;r&&w(e=>{var t;return function(e){var t;e&&(null===(t=null==e?void 0:e.classList)||void 0===t||t.add(h))}(r),r.focus({preventScroll:!0}),(t=e)&&(null==t||t.classList.remove(h)),r})},[v]);function S(e){e.options&&(x(!0),y(e.options))}function C(e){e.options&&(x(!1),y(f))}function E(e){var t;x(!1),null==c||c(e);const r=WM(v);if(Gg(e.key)){const n=r.find(t=>t.label.toLowerCase().startsWith(e.key.toLowerCase()));null===(t=null==n?void 0:n.ref.current)||void 0===t||t.focus()}switch(e.key){case"ArrowUp":{e.preventDefault();const t=$s(r,g,{wrapAround:!0});t&&b(t.focusIndex);break}case"ArrowDown":{e.preventDefault();const t=zs(r,g,{wrapAround:!0});t&&b(t.focusIndex);break}case"ArrowRight":{e.preventDefault();const t=r[g].options;t&&(y(t),b(0));break}case"ArrowLeft":{e.preventDefault();const t=f!==v,r=WM(f).find(e=>e.options===v);t&&(y(f),b(r?r.focusIndex:0));break}}}function O(e){return e.options===v}return(0,t.useEffect)(()=>{k||M(g)},[M,g,k]),(0,e.jsx)(LM,Object.assign({className:o,"data-testid":"menu",id:p,numberOfVisibleItems:WM(f).some(e=>null!=e.options)?void 0:i,onKeyDown:E,role:"menu",ref:n},u,{children:function r(n){const o=n!==f,a=e=>o?`sub-menu-option-${e}`:`menu-option-${e}`,l=n.some(e=>!BM(e)&&null!=e.iconName);return(0,e.jsx)(e.Fragment,{children:n.map((o,s)=>BM(o)?function(t,n){const o=`menu-group-${n}`;return(0,e.jsxs)("div",{role:"group","aria-labelledby":o,children:[(0,e.jsx)(UM,{$device:m,id:o,children:t.groupLabel}),t.groupOptions&&r(t.groupOptions)]},`${o}-${t.groupLabel}`)}(o,s):(0,e.jsxs)(t.Fragment,{children:[(0,e.jsxs)(VM,{"aria-haspopup":o.options?"menu":void 0,"aria-expanded":o.options?v===o.options:void 0,"data-testid":a(s),$device:m,$hasSubMenu:!!o.options,type:"button",role:"menuitem",tabIndex:-1,disabled:o.disabled,onClick:()=>function(e){var t;null===(t=e.onClick)||void 0===t||t.call(e),e.options?(y(e.options),b(0)):null==d||d(e)}(o),onMouseEnter:()=>S(o),onMouseLeave:()=>C(o),ref:o.ref,$withEmptyIcon:l&&!o.iconName,children:[o.iconName&&(0,e.jsx)(HM,{focusable:!1,"aria-hidden":!0,name:o.iconName,size:"1rem"}),(0,e.jsx)(qM,{children:o.label}),o.options&&(0,e.jsx)(cn,{"aria-hidden":!0,name:"chevronRight",size:"1rem"})]}),o.options&&O(o)&&(0,e.jsx)(IM,Object.assign({"data-testid":`menu-option-${s}-sub-menu`,id:p,numberOfVisibleItems:WM(n).some(e=>null!=e.options)?void 0:i,onKeyDown:E,role:"menu",onMouseEnter:()=>S(o),onMouseLeave:()=>C(o),top:YM(o).top,left:YM(o).left},u,{children:r(o.options)}))]},`${p}-${o.label}`))})}(f)}))});GM.displayName="Menu";const KM=a()(GM)`
2482
2482
  left: ${e=>e.$left};
2483
2483
  max-width: ${fv};
2484
2484
  min-width: ${gv};
@@ -2487,7 +2487,7 @@
2487
2487
  z-index: 99998;
2488
2488
  `,QM=a()(cn)`
2489
2489
  margin-left: var(--spacing-1x);
2490
- `,XM=({autofocus:r,buttonType:n,children:o,className:a,defaultOpen:i,disabled:l,iconName:s,iconLabel:c,inverted:d,options:u,onMenuVisibilityChanged:p,menuPlacement:m="right",tooltip:h})=>{const{t:f}=j("menu-button"),[g,b]=(0,t.useState)(!!i),v=(0,t.useRef)(null),y="right"===m?"bottom-start":"bottom-end",_=Mo(),k=hi({open:g,placement:y}),{x,y:w}=k,M=k.refs,{reference:S}=M,C=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(M,["reference"]),E=gi(_),O=(0,t.useCallback)(e=>{const t=!yi(e,v.current,C.floating.current);g&&t&&b(!1)},[C.floating,g]),$=(0,t.useCallback)(()=>{b(!g)},[g]),z=(0,t.useCallback)(()=>{var e,t;g?null===(t=S.current)||void 0===t||t.blur():null===(e=S.current)||void 0===e||e.focus(),b(!g)},[g,S]);(0,t.useEffect)(()=>{null==p||p(g)},[g,p]),(0,t.useEffect)(()=>(document.addEventListener("mouseup",O),()=>document.removeEventListener("mouseup",O)),[O]);const D=s?(0,e.jsx)(Sn,{ref:C.setReference,autofocus:r,"data-testid":"menu-button",type:"button",label:null!=c?c:f("buttonAriaLabel"),"aria-haspopup":"menu","aria-expanded":g,disabled:l,buttonType:n,inverted:d,iconName:s,onClick:$}):(0,e.jsxs)(wn,{ref:C.setReference,autofocus:r,"data-testid":"menu-button",type:"button","aria-haspopup":"menu","aria-expanded":g,disabled:l,buttonType:n,inverted:d,onClick:$,children:[o,(0,e.jsx)(QM,{"aria-hidden":"true","data-testid":"chevron-icon",name:g?"chevronUp":"chevronDown",size:"16"})]}),R=h?(0,e.jsx)(Sd,Object.assign({},h,{children:D})):D;return(0,e.jsxs)("div",{className:a,ref:v,onKeyDown:e=>{var t;"Tab"!==e.key&&"Escape"!==e.key||(null===(t=S.current)||void 0===t||t.focus(),b(!1))},children:[R,g&&(0,lo.createPortal)((0,e.jsx)(KM,{ref:C.setFloating,options:u,onOptionSelect:z,$left:`${x}px`,$top:`${w}px`}),E)]})};XM.displayName="MenuButton";var ZM=c(373),JM=c.n(ZM),eS=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r};function tS({$noPadding:e,isMobile:t}){return e?"0":t?"var(--spacing-2x)":"var(--spacing-4x)"}function rS({$noPadding:e,isMobile:t}){return e?"0":t?"var(--spacing-2x)":"var(--spacing-3x)"}const nS=a()(JM())`
2490
+ `,XM=({autofocus:r,buttonType:n,children:o,className:a,defaultOpen:i,disabled:l,iconName:s,iconLabel:c,inverted:d,options:u,onMenuVisibilityChanged:p,menuPlacement:m="right",tooltip:h})=>{const{t:f}=j("menu-button"),[g,b]=(0,t.useState)(!!i),v=(0,t.useRef)(null),y="right"===m?"bottom-start":"bottom-end",_=Mo(),k=hi({open:g,placement:y}),{x,y:w}=k,M=k.refs,{reference:S}=M,C=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(M,["reference"]),E=gi(_),O=(0,t.useCallback)(e=>{const t=!yi(e,v.current,C.floating.current);g&&t&&b(!1)},[C.floating,g]),$=(0,t.useCallback)(()=>{b(!g)},[g]),z=(0,t.useCallback)(()=>{var e,t;g?null===(t=S.current)||void 0===t||t.blur():null===(e=S.current)||void 0===e||e.focus(),b(!g)},[g,S]);(0,t.useLayoutEffect)(()=>{null==p||p(g)},[g,p]),(0,t.useEffect)(()=>(document.addEventListener("mouseup",O),()=>document.removeEventListener("mouseup",O)),[O]);const D=s?(0,e.jsx)(Sn,{ref:C.setReference,autofocus:r,"data-testid":"menu-button",type:"button",label:null!=c?c:f("buttonAriaLabel"),"aria-haspopup":"menu","aria-expanded":g,disabled:l,buttonType:n,inverted:d,iconName:s,onClick:$}):(0,e.jsxs)(wn,{ref:C.setReference,autofocus:r,"data-testid":"menu-button",type:"button","aria-haspopup":"menu","aria-expanded":g,disabled:l,buttonType:n,inverted:d,onClick:$,children:[o,(0,e.jsx)(QM,{"aria-hidden":"true","data-testid":"chevron-icon",name:g?"chevronUp":"chevronDown",size:"16"})]}),R=h?(0,e.jsx)(Sd,Object.assign({},h,{children:D})):D;return(0,e.jsxs)("div",{className:a,ref:v,onKeyDown:e=>{var t;"Tab"!==e.key&&"Escape"!==e.key||(null===(t=S.current)||void 0===t||t.focus(),b(!1))},children:[R,g&&(0,lo.createPortal)((0,e.jsx)(KM,{ref:C.setFloating,options:u,onOptionSelect:z,$left:`${x}px`,$top:`${w}px`}),E)]})};XM.displayName="MenuButton";var ZM=c(373),JM=c.n(ZM),eS=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r};function tS({$noPadding:e,isMobile:t}){return e?"0":t?"var(--spacing-2x)":"var(--spacing-4x)"}function rS({$noPadding:e,isMobile:t}){return e?"0":t?"var(--spacing-2x)":"var(--spacing-3x)"}const nS=a()(JM())`
2491
2491
  background-color: ${({theme:e})=>e.component["modal-background-color"]};
2492
2492
  border-radius: var(--border-radius-2x);
2493
2493
  box-shadow: 0 6px 10px 0 rgb(0 0 0 / 10%);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equisoft/design-elements-react",
3
- "version": "10.0.1-snapshot.20260223145318",
3
+ "version": "10.0.1-snapshot.20260223203157",
4
4
  "description": "React implementation of the Equisoft design system.",
5
5
  "license": "UNLICENSED",
6
6
  "main": "dist/bundle.js",