@openfin/ui-library 0.13.5-alpha.1679493105 → 0.13.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -351,7 +351,7 @@ var e={8594:(e,t,n)=>{n.d(t,{Z:()=>o});var r=/^((children|dangerouslySetInnerHTM
351
351
  border-radius: 100px;
352
352
  }
353
353
  }
354
- `},9734:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(6895),t)},6062:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DropdownMenu=void 0;const o=n(5893),i=n(6689),a=n(1335),l=n(9634),c=r(n(7518)),s=n(7261),u=n(279),d=n(347);t.DropdownMenu=({label:e,options:t=[[]],placeholder:n="Select an option",selected:r,onOptionHover:c,onChange:v,renderLabel:h,fitContent:g})=>{var m,w;const[b,y]=(0,i.useState)(!1);(0,i.useEffect)((()=>{1===t[0].length&&x(!1)}),[t]);const x=e=>{y(null!=e?e:!b)},{focusedOption:L,handleKeyDown:O}=(0,d.useDropdownKeyboardNavigation)(t,r,b,x,v);return(0,o.jsx)(f,Object.assign({flexDirection:"column",onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||y(!1)},onKeyDown:O},{children:(0,o.jsxs)(a.Box,Object.assign({gap:"base",flexDirection:"column",style:{width:"100%"}},{children:[e&&(0,o.jsx)("label",Object.assign({htmlFor:"dropdown-button"},{children:(0,o.jsx)(s.OptionTitle,{children:e})})),(0,o.jsxs)(C,{children:[h?h(r||{title:n,value:null},b,x):(0,o.jsxs)(p,Object.assign({role:"comboxbox",tabIndex:0,"aria-activedescendant":`menu-option-${null==L?void 0:L.value}`,"aria-expanded":b,"aria-haspopup":"listbox","aria-controls":"dropdown-listbox",onClick:()=>x(),as:"button","data-testid":"dropdown-button",title:null!==(m=null==r?void 0:r.title)&&void 0!==m?m:n},{children:[(null==r?void 0:r.iconUrl)&&(0,o.jsx)(u.ButtonImage,{src:r.iconUrl}),(0,o.jsx)(s.OptionTitle,Object.assign({"aria-live":"polite","data-testid":"selected-option"},{children:null!==(w=null==r?void 0:r.title)&&void 0!==w?w:n})),(0,o.jsx)(l.Icon,{icon:b&&t[0].length>1?"ChevronUpIcon":"ChevronDownIcon"})]})),t.length&&t[0].length>1&&b&&(0,o.jsx)(u.Menu,{menuId:"dropdown-listbox",options:t,selected:r,handleExpandMenu:x,onOptionHover:c,onChange:v,fitContent:g,focusedOption:L,absolutePosition:!0})]})]}))}))};const f=(0,c.default)(a.Box)`
354
+ `},9734:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(6895),t)},6062:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DropdownMenu=void 0;const o=n(5893),i=n(6689),a=n(1335),l=n(9634),c=r(n(7518)),s=n(7261),u=n(279),d=n(347);t.DropdownMenu=({label:e,options:t=[[]],placeholder:n="Select an option",selected:r,onOptionHover:c,onChange:v,renderLabel:h,fitContent:g})=>{var m;const[w,b]=(0,i.useState)(!1);(0,i.useEffect)((()=>{1===t[0].length&&y(!1)}),[t]);const y=e=>{b(null!=e?e:!w)},{focusedOption:x,handleKeyDown:L}=(0,d.useDropdownKeyboardNavigation)(t,r,w,y,v);return(0,o.jsx)(f,Object.assign({flexDirection:"column",onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||b(!1)},onKeyDown:L},{children:(0,o.jsxs)(a.Box,Object.assign({gap:"base",flexDirection:"column",style:{width:"100%"}},{children:[e&&(0,o.jsx)("label",Object.assign({htmlFor:"dropdown-button"},{children:(0,o.jsx)(s.OptionTitle,{children:e})})),(0,o.jsxs)(C,{children:[h?h(r||{title:n,value:null},w,y):(0,o.jsxs)(p,Object.assign({role:"comboxbox",tabIndex:0,"aria-activedescendant":`menu-option-${null==x?void 0:x.value}`,"aria-expanded":w,"aria-haspopup":"listbox","aria-controls":"dropdown-listbox",onClick:()=>y(),as:"button","data-testid":"dropdown-button"},{children:[(null==r?void 0:r.iconUrl)&&(0,o.jsx)(u.ButtonImage,{src:r.iconUrl}),(0,o.jsx)(s.OptionTitle,Object.assign({"aria-live":"polite","data-testid":"selected-option"},{children:null!==(m=null==r?void 0:r.title)&&void 0!==m?m:n})),(0,o.jsx)(l.Icon,{icon:w?"ChevronUpIcon":"ChevronDownIcon"})]})),t.length&&t[0].length>1&&w&&(0,o.jsx)(u.Menu,{menuId:"dropdown-listbox",options:t,selected:r,handleExpandMenu:y,onOptionHover:c,onChange:v,fitContent:g,focusedOption:x,absolutePosition:!0})]})]}))}))};const f=(0,c.default)(a.Box)`
355
355
  user-select: none;
356
356
  position: relative;
357
357
  `,C=(0,c.default)(a.Box)``,p=(0,c.default)(a.Box)`
@@ -381,7 +381,7 @@ var e={8594:(e,t,n)=>{n.d(t,{Z:()=>o});var r=/^((children|dangerouslySetInnerHTM
381
381
  &:focus-within {
382
382
  border-color: ${({theme:e})=>e.palette.inputFocused};
383
383
  }
384
- `},6026:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(6062),t),o(n(279),t)},279:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ButtonImage=t.Menu=void 0;const o=n(5893),i=r(n(6689)),a=r(n(7518)),l=n(9634),c=n(1335),s=n(7261);t.Menu=({options:e,selected:n,menuId:r,handleExpandMenu:a,onOptionHover:l,onChange:c,width:v,height:h,header:g,focusedOption:m,absolutePosition:w})=>{const b=e=>{null==l||l(e)};return(0,o.jsxs)(u,Object.assign({role:"listbox",flexDirection:"column",onMouseLeave:()=>{b(null)},"data-testid":"menu",id:r,width:v,height:h,absolutePosition:w},{children:[g&&(0,o.jsxs)(i.default.Fragment,{children:[(0,o.jsx)(f,{children:(0,o.jsx)(s.OptionTitle,{children:g})}),(0,o.jsx)(p,{})]}),e.map(((e,r)=>(0,o.jsxs)(i.default.Fragment,{children:[0!==r&&(0,o.jsx)(p,{}),e.map(((e,r)=>(0,o.jsxs)(d,Object.assign({role:"option",isFocused:(null==m?void 0:m.value)===e.value,"aria-selected":(null==n?void 0:n.value)===e.value,alignItems:"center",as:"button","data-testid":`menu-option-${r}`,id:`menu-option-${e.value}`,title:e.title,onClick:()=>{e.overrideOnClick?e.overrideOnClick(e):c(e),null==a||a()},onMouseOver:()=>b(e.value)},{children:[(null==e?void 0:e.iconUrl)&&(0,o.jsx)(t.ButtonImage,{src:e.iconUrl,style:{marginRight:"8px"}}),(0,o.jsx)(s.OptionTitle,{children:e.title}),(null==n?void 0:n.value)===e.value?(0,o.jsx)(C,{icon:"CheckIcon"}):(0,o.jsx)(C,{children:(0,o.jsx)(o.Fragment,{})})]}),r)))]},r)))]}))};const u=(0,a.default)(c.Box)`
384
+ `},6026:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(6062),t),o(n(279),t)},279:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ButtonImage=t.Menu=void 0;const o=n(5893),i=r(n(6689)),a=r(n(7518)),l=n(9634),c=n(1335),s=n(7261);t.Menu=({options:e,selected:n,menuId:r,handleExpandMenu:a,onOptionHover:l,onChange:c,width:v,height:h,header:g,focusedOption:m,absolutePosition:w})=>{const b=e=>{null==l||l(e)};return(0,o.jsxs)(u,Object.assign({role:"listbox",flexDirection:"column",onMouseLeave:()=>{b(null)},"data-testid":"menu",id:r,width:v,height:h,absolutePosition:w},{children:[g&&(0,o.jsxs)(i.default.Fragment,{children:[(0,o.jsx)(f,{children:(0,o.jsx)(s.OptionTitle,{children:g})}),(0,o.jsx)(p,{})]}),e.map(((e,r)=>(0,o.jsxs)(i.default.Fragment,{children:[0!==r&&(0,o.jsx)(p,{}),e.map(((e,r)=>(0,o.jsxs)(d,Object.assign({role:"option",isFocused:(null==m?void 0:m.value)===e.value,"aria-selected":(null==n?void 0:n.value)===e.value,alignItems:"center",as:"button","data-testid":`menu-option-${r}`,id:`menu-option-${e.value}`,onClick:()=>{e.overrideOnClick?e.overrideOnClick(e):c(e),null==a||a()},onMouseOver:()=>b(e.value)},{children:[(null==e?void 0:e.iconUrl)&&(0,o.jsx)(t.ButtonImage,{src:e.iconUrl,style:{marginRight:"8px"}}),(0,o.jsx)(s.OptionTitle,{children:e.title}),(null==n?void 0:n.value)===e.value?(0,o.jsx)(C,{icon:"CheckIcon"}):(0,o.jsx)(C,{children:(0,o.jsx)(o.Fragment,{})})]}),r)))]},r)))]}))};const u=(0,a.default)(c.Box)`
385
385
  width: ${({width:e,fitContent:t})=>e||(t?"fit-content":"100%")};
386
386
  max-height: ${({height:e})=>null!=e?e:"fit-content"};
387
387
  top: ${({theme:e})=>`calc(100% + ${e.px.xsmall})`};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@openfin/ui-library",
3
3
  "description": "OpenFin UI Component Library",
4
- "version": "0.13.5-alpha.1679493105",
4
+ "version": "0.13.5",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "repository": "github:openfin/ui-library",