@openfin/ui-library 0.8.0-alpha.1669734513 → 0.8.0-alpha.1669761878

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,9 +1,10 @@
1
+ import React from 'react';
1
2
  import { ButtonProps } from '../Button';
2
3
  import { ExpandDirection } from './expandDirection';
3
4
  export declare type SecondaryButtonProps = {
4
5
  title: string;
5
6
  disabled?: boolean;
6
- onClick: (closeSecondaryButtonsPanel?: () => void) => void;
7
+ onClick: (event: React.MouseEvent, closeSecondaryButtonsPanel?: () => void) => void;
7
8
  };
8
9
  export declare type ExpandableButtonProps = Omit<ButtonProps, "shape"> & {
9
10
  secondaryButtons?: SecondaryButtonProps[];
package/dist/index.js CHANGED
@@ -109,7 +109,7 @@ var e={1521:(e,t,n)=>{n.r(t),n.d(t,{ActivityLogIcon:()=>i,AlignBaselineIcon:()=>
109
109
  `,p=a.default.div`
110
110
  position: relative;
111
111
  display: inline-block;
112
- `},2128:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setupExpandablePanel=void 0;const r=n(9644);t.setupExpandablePanel=(e,t)=>{if(!e||0===e.childNodes.length)return;const n=e.parentElement,o=null==n?void 0:n.getBoundingClientRect(),i=e.getBoundingClientRect();if(!o)return;const l=i.height,a=i.width>o.width?o.width:i.width;e.style.width=`${a}px`,e.style.opacity="1",e.style.left="0px",t===r.ExpandDirection.Down&&(e.style.top=`${o.height}px`),t===r.ExpandDirection.Up&&(e.style.top=-1*l+"px")}},3030: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.ExpandablePanel=void 0;const o=n(5893),i=r(n(7518)),l=n(9141),a=n(4130),c=n(1335),s=n(2128),u=r(n(4483)),d={type:"spring",duration:.2,bounce:.25};t.ExpandablePanel=e=>{const t=t=>()=>{e.closePanelOnSecondaryButtonClick?(t.onClick(),e.onCollapseRequest()):t.onClick((()=>e.onCollapseRequest()))},n=`${e.panelId}-expandable-panel`;return(0,o.jsx)(u.default,Object.assign({focusTrapOptions:{fallbackFocus:`#${n}`,clickOutsideDeactivates:!0,onDeactivate:e.onCollapseRequest}},{children:(0,o.jsx)(f,Object.assign({ref:t=>(0,s.setupExpandablePanel)(t,e.expandDirection),tabIndex:0,id:n,initial:"initial",exit:"hidden",animate:"visible",role:"menu",transition:d},{children:e.secondaryButtons.map(((n,r)=>(0,o.jsx)(a.Button,Object.assign({className:"menu-item",tabIndex:r+1,title:n.title,role:"menuitem",size:e.buttonSize,disabled:n.disabled,kind:"textOnly",onClick:t(n),"aria-label":n.title},{children:(0,o.jsx)(C,Object.assign({"aria-label":n.title},{children:n.title}))}),r)))}),"expandablePanel")}))};const C=(0,i.default)(c.Box)`
112
+ `},2128:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setupExpandablePanel=void 0;const r=n(9644);t.setupExpandablePanel=(e,t)=>{if(!e||0===e.childNodes.length)return;const n=e.parentElement,o=null==n?void 0:n.getBoundingClientRect(),i=e.getBoundingClientRect();if(!o)return;const l=i.height,a=i.width>o.width?o.width:i.width;e.style.width=`${a}px`,e.style.opacity="1",e.style.left="0px",t===r.ExpandDirection.Down&&(e.style.top=`${o.height}px`),t===r.ExpandDirection.Up&&(e.style.top=-1*l+"px")}},3030: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.ExpandablePanel=void 0;const o=n(5893),i=r(n(7518)),l=n(9141),a=n(4130),c=n(1335),s=n(2128),u=r(n(4483)),d={type:"spring",duration:.2,bounce:.25};t.ExpandablePanel=e=>{const t=`${e.panelId}-expandable-panel`;return(0,o.jsx)(u.default,Object.assign({focusTrapOptions:{fallbackFocus:`#${t}`,clickOutsideDeactivates:!0,onDeactivate:e.onCollapseRequest}},{children:(0,o.jsx)(f,Object.assign({ref:t=>(0,s.setupExpandablePanel)(t,e.expandDirection),tabIndex:0,id:t,initial:"initial",exit:"hidden",animate:"visible",role:"menu",transition:d},{children:e.secondaryButtons.map(((t,n)=>(0,o.jsx)(a.Button,Object.assign({className:"menu-item",tabIndex:n+1,title:t.title,role:"menuitem",size:e.buttonSize,disabled:t.disabled,kind:"textOnly",onClick:n=>((t,n)=>{e.closePanelOnSecondaryButtonClick?(n.onClick(t),e.onCollapseRequest()):n.onClick(t,(()=>e.onCollapseRequest()))})(n,t),"aria-label":t.title},{children:(0,o.jsx)(C,Object.assign({"aria-label":t.title},{children:t.title}))}),n)))}),"expandablePanel")}))};const C=(0,i.default)(c.Box)`
113
113
  padding: ${({theme:e})=>`0 ${e.px.xsmall}`};
114
114
  white-space: nowrap;
115
115
  text-overflow: ellipsis;
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.8.0-alpha.1669734513",
4
+ "version": "0.8.0-alpha.1669761878",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "repository": "github:openfin/ui-library",