@openfin/ui-library 0.16.0-alpha.1684433862 → 0.16.0
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.
package/README.md
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
> React component library for OpenFin Workspace products – Informed by [Spatial](https://www.figma.com/file/0Y3pKZj0tJWuleF12h5Sua/Spatial---Components).
|
|
4
4
|
|
|
5
|
-
**Storybook:** [
|
|
5
|
+
**Storybook:** [openfin-ui.netlify.com](https://openfin-ui.netlify.com) (pw: pizza)
|
|
6
6
|
**NPM Package:** [@openfin/ui-library](https://www.npmjs.com/package/@openfin/ui-library)
|
|
7
7
|
|
|
8
|
+
[](https://app.netlify.com/sites/openfin-ui/deploys)
|
|
8
9
|

|
|
9
10
|
|
|
10
11
|
## What is this for?
|
|
@@ -11,6 +11,5 @@ export type ExpandableButtonProps = Omit<ButtonProps, 'shape'> & {
|
|
|
11
11
|
closePanelOnSecondaryButtonClick?: boolean;
|
|
12
12
|
expandDirection?: ExpandDirection;
|
|
13
13
|
stretchExpandablePanel?: boolean;
|
|
14
|
-
document?: Document;
|
|
15
14
|
};
|
|
16
15
|
export declare const ExpandableButton: (props: ExpandableButtonProps) => JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -94,7 +94,7 @@ var e={8594:(e,t,n)=>{n.d(t,{Z:()=>o});var r=/^((children|dangerouslySetInnerHTM
|
|
|
94
94
|
&:focus {
|
|
95
95
|
border-color: ${({theme:e})=>e.palette.inputFocused};
|
|
96
96
|
}
|
|
97
|
-
`}}},4130: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(4249),t),o(n(6126),t)},9644:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ExpandDirection=void 0,(n=t.ExpandDirection||(t.ExpandDirection={}))[n.Up=0]="Up",n[n.Down=1]="Down"},4021: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.ExpandableButton=void 0;const o=n(5893),i=n(6689),a=n(4130),l=r(n(7518)),c=n(9634),s=n(9141),u=n(3030),d=n(1335),f=n(9644);t.ExpandableButton=e=>{var t,n,r,l,c,C;const[b,y]=(0,i.useState)({show:!1,requestedByCollapse:!1}),x={size:e.size,kind:e.kind,disabled:e.disabled},L=Object.assign(Object.assign({},e),{shape:a.ButtonShape.square,"aria-label":null!==(t=e["aria-label"])&&void 0!==t?t:`Primary Button ${e.title}`}),O=null!==(n=e.expandDirection)&&void 0!==n?n:f.ExpandDirection.Down;return(0,i.useEffect)((()=>{if(!b.requestedByCollapse)return;const e=setTimeout((()=>y({requestedByCollapse:!1,show:!1})),200);return()=>clearTimeout(e)}),[b.requestedByCollapse]),(0,o.jsxs)(w,{children:[(0,o.jsxs)(m,{children:[(0,o.jsx)(v,Object.assign({},L,{children:(0,o.jsx)(h,{children:null!==(r=e.children)&&void 0!==r?r:L.title})})),e.secondaryButtons&&e.secondaryButtons.length>0&&(0,o.jsx)(d.Box,Object.assign({id:"dropdown-container"},{children:(0,o.jsxs)(g,Object.assign({},x,{role:"combobox",onClick:()=>{b.requestedByCollapse||y({requestedByCollapse:!1,show:!b.show})},"aria-label":"Expand Secondary Buttons Panel","aria-expanded":b.show},{children:[O===f.ExpandDirection.Down&&(0,o.jsx)(p,{kind:null!==(l=e.kind)&&void 0!==l?l:a.ButtonKind.primary,icon:"CaretDownIcon"}),O===f.ExpandDirection.Up&&(0,o.jsx)(p,{kind:null!==(c=e.kind)&&void 0!==c?c:a.ButtonKind.primary,icon:"CaretUpIcon"})]}))}))]}),e.secondaryButtons&&e.secondaryButtons.length>0&&(0,o.jsx)(s.AnimatePresence,{children:b.show&&(0,o.jsx)(u.ExpandablePanel,{expandDirection:O,secondaryButtons:null!==(C=e.secondaryButtons)&&void 0!==C?C:[],stretch:e.stretchExpandablePanel,closePanelOnSecondaryButtonClick:e.closePanelOnSecondaryButtonClick,onCollapseRequest:()=>y({show:!1,requestedByCollapse:!0}),buttonSize:e.size
|
|
97
|
+
`}}},4130: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(4249),t),o(n(6126),t)},9644:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ExpandDirection=void 0,(n=t.ExpandDirection||(t.ExpandDirection={}))[n.Up=0]="Up",n[n.Down=1]="Down"},4021: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.ExpandableButton=void 0;const o=n(5893),i=n(6689),a=n(4130),l=r(n(7518)),c=n(9634),s=n(9141),u=n(3030),d=n(1335),f=n(9644);t.ExpandableButton=e=>{var t,n,r,l,c,C;const[b,y]=(0,i.useState)({show:!1,requestedByCollapse:!1}),x={size:e.size,kind:e.kind,disabled:e.disabled},L=Object.assign(Object.assign({},e),{shape:a.ButtonShape.square,"aria-label":null!==(t=e["aria-label"])&&void 0!==t?t:`Primary Button ${e.title}`}),O=null!==(n=e.expandDirection)&&void 0!==n?n:f.ExpandDirection.Down;return(0,i.useEffect)((()=>{if(!b.requestedByCollapse)return;const e=setTimeout((()=>y({requestedByCollapse:!1,show:!1})),200);return()=>clearTimeout(e)}),[b.requestedByCollapse]),(0,o.jsxs)(w,{children:[(0,o.jsxs)(m,{children:[(0,o.jsx)(v,Object.assign({},L,{children:(0,o.jsx)(h,{children:null!==(r=e.children)&&void 0!==r?r:L.title})})),e.secondaryButtons&&e.secondaryButtons.length>0&&(0,o.jsx)(d.Box,Object.assign({id:"dropdown-container"},{children:(0,o.jsxs)(g,Object.assign({},x,{role:"combobox",onClick:()=>{b.requestedByCollapse||y({requestedByCollapse:!1,show:!b.show})},"aria-label":"Expand Secondary Buttons Panel","aria-expanded":b.show},{children:[O===f.ExpandDirection.Down&&(0,o.jsx)(p,{kind:null!==(l=e.kind)&&void 0!==l?l:a.ButtonKind.primary,icon:"CaretDownIcon"}),O===f.ExpandDirection.Up&&(0,o.jsx)(p,{kind:null!==(c=e.kind)&&void 0!==c?c:a.ButtonKind.primary,icon:"CaretUpIcon"})]}))}))]}),e.secondaryButtons&&e.secondaryButtons.length>0&&(0,o.jsx)(s.AnimatePresence,{children:b.show&&(0,o.jsx)(u.ExpandablePanel,{expandDirection:O,secondaryButtons:null!==(C=e.secondaryButtons)&&void 0!==C?C:[],stretch:e.stretchExpandablePanel,closePanelOnSecondaryButtonClick:e.closePanelOnSecondaryButtonClick,onCollapseRequest:()=>y({show:!1,requestedByCollapse:!0}),buttonSize:e.size})})]})};const C={[a.ButtonKind.primary]:e=>e.palette.brandPrimaryText,[a.ButtonKind.secondary]:e=>e.palette.brandSecondaryText,[a.ButtonKind.textOnly]:e=>e.palette.textDefault},p=(0,l.default)(c.Icon)`
|
|
98
98
|
svg path {
|
|
99
99
|
color: ${({theme:e,kind:t})=>C[t](e)};
|
|
100
100
|
}
|
|
@@ -120,7 +120,7 @@ var e={8594:(e,t,n)=>{n.d(t,{Z:()=>o});var r=/^((children|dangerouslySetInnerHTM
|
|
|
120
120
|
`,w=l.default.div`
|
|
121
121
|
position: relative;
|
|
122
122
|
display: inline-block;
|
|
123
|
-
`},2128:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setupExpandablePanel=void 0;const r=n(9644);t.setupExpandablePanel=(e,t,n=!1)=>{if(!e||0===e.childNodes.length)return;const o=e.parentElement,i=null==o?void 0:o.getBoundingClientRect(),a=e.getBoundingClientRect();if(!i)return;const l=a.height,c=a.width<=i.width||n?a.width:i.width,s=i.x+c>document.body.clientWidth||c<i.width;e.style.width=`${c}px`,e.style.opacity="1",s?e.style.right="0px":e.style.left="0px",t===r.ExpandDirection.Down&&(e.style.top=`${i.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)),a=n(9141),l=n(4130),c=n(1335),s=n(2128),u=r(n(4483)),d={type:"spring",duration:.2,bounce:.25};t.ExpandablePanel=e=>{var t;const n=`${e.panelId}-expandable-panel`;return(0,o.jsx)(u.default,Object.assign({focusTrapOptions:{fallbackFocus:`#${n}`,clickOutsideDeactivates:!0,onDeactivate:e.onCollapseRequest,initialFocus:!1
|
|
123
|
+
`},2128:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setupExpandablePanel=void 0;const r=n(9644);t.setupExpandablePanel=(e,t,n=!1)=>{if(!e||0===e.childNodes.length)return;const o=e.parentElement,i=null==o?void 0:o.getBoundingClientRect(),a=e.getBoundingClientRect();if(!i)return;const l=a.height,c=a.width<=i.width||n?a.width:i.width,s=i.x+c>document.body.clientWidth||c<i.width;e.style.width=`${c}px`,e.style.opacity="1",s?e.style.right="0px":e.style.left="0px",t===r.ExpandDirection.Down&&(e.style.top=`${i.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)),a=n(9141),l=n(4130),c=n(1335),s=n(2128),u=r(n(4483)),d={type:"spring",duration:.2,bounce:.25};t.ExpandablePanel=e=>{var t;const n=`${e.panelId}-expandable-panel`;return(0,o.jsx)(u.default,Object.assign({focusTrapOptions:{fallbackFocus:`#${n}`,clickOutsideDeactivates:!0,onDeactivate:e.onCollapseRequest,initialFocus:!1}},{children:(0,o.jsx)(p,Object.assign({ref:t=>(0,s.setupExpandablePanel)(t,e.expandDirection,e.stretch),tabIndex:0,id:n,initial:"initial",exit:"hidden",buttonSize:null!==(t=e.buttonSize)&&void 0!==t?t:l.ButtonSize.base,animate:"visible",role:"menu",transition:d,onMouseOver:()=>{var e;return null===(e=document.activeElement)||void 0===e?void 0:e.blur()}},{children:e.secondaryButtons.map(((t,n)=>(0,o.jsx)(l.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)(f,Object.assign({"aria-label":t.title},{children:t.title}))}),n)))}),"expandablePanel")}))};const f=(0,i.default)(c.Box)`
|
|
124
124
|
padding-bottom: 1px;
|
|
125
125
|
padding-top: 1px;
|
|
126
126
|
white-space: nowrap;
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfin/ui-library",
|
|
3
3
|
"description": "OpenFin UI Component Library",
|
|
4
|
-
"version": "0.16.0
|
|
4
|
+
"version": "0.16.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"repository": "github:openfin/ui-library",
|
|
8
|
-
"homepage": "https://
|
|
8
|
+
"homepage": "https://openfin-ui.netlify.app",
|
|
9
9
|
"files": [
|
|
10
10
|
"dist/**/*"
|
|
11
11
|
],
|
|
@@ -17,13 +17,12 @@
|
|
|
17
17
|
"build:src": "webpack build --config webpack.config.js --mode production",
|
|
18
18
|
"build:clean": "rimraf dist",
|
|
19
19
|
"build:dev": "webpack build --config webpack.config.js --mode development && yalc push",
|
|
20
|
-
"test
|
|
21
|
-
"test": "jest --watch",
|
|
20
|
+
"test": "jest",
|
|
22
21
|
"lint": "npm run lint:typescript && npm run lint:styles",
|
|
23
22
|
"lint:typescript": "eslint \"./src/**/*.{ts,tsx}\"",
|
|
24
23
|
"lint:styles": "stylelint \"./src/**/*.{ts,tsx}\"",
|
|
25
|
-
"storybook": "storybook
|
|
26
|
-
"storybook:build": "storybook
|
|
24
|
+
"storybook": "start-storybook -p 6006 -s public --no-manager-cache",
|
|
25
|
+
"storybook:build": "build-storybook -s public",
|
|
27
26
|
"storybook:cache-clear": "rimraf ./node_modules/.cache/storybook"
|
|
28
27
|
},
|
|
29
28
|
"peerDependencies": {
|
|
@@ -39,13 +38,14 @@
|
|
|
39
38
|
},
|
|
40
39
|
"devDependencies": {
|
|
41
40
|
"@babel/core": "^7.18.6",
|
|
42
|
-
"@storybook/addon-actions": "^
|
|
43
|
-
"@storybook/addon-essentials": "^
|
|
44
|
-
"@storybook/addon-interactions": "^
|
|
45
|
-
"@storybook/addon-links": "^
|
|
46
|
-
"@storybook/
|
|
47
|
-
"@storybook/
|
|
48
|
-
"@storybook/
|
|
41
|
+
"@storybook/addon-actions": "^6.5.9",
|
|
42
|
+
"@storybook/addon-essentials": "^6.5.9",
|
|
43
|
+
"@storybook/addon-interactions": "^6.5.9",
|
|
44
|
+
"@storybook/addon-links": "^6.5.9",
|
|
45
|
+
"@storybook/builder-webpack5": "^6.5.9",
|
|
46
|
+
"@storybook/manager-webpack5": "^6.5.9",
|
|
47
|
+
"@storybook/node-logger": "^6.5.9",
|
|
48
|
+
"@storybook/react": "^6.5.9",
|
|
49
49
|
"@testing-library/dom": "^8.14.0",
|
|
50
50
|
"@testing-library/jest-dom": "^5.16.4",
|
|
51
51
|
"@testing-library/react": "^12.1.5",
|
|
@@ -58,30 +58,30 @@
|
|
|
58
58
|
"@types/react-dom": "^17.0.2",
|
|
59
59
|
"@types/styled-components": "^5.1.25",
|
|
60
60
|
"@types/tinycolor2": "^1.4.3",
|
|
61
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
62
|
-
"@typescript-eslint/parser": "^5.
|
|
61
|
+
"@typescript-eslint/eslint-plugin": "^5.29.0",
|
|
62
|
+
"@typescript-eslint/parser": "^5.29.0",
|
|
63
63
|
"babel-loader": "^8.2.5",
|
|
64
64
|
"copy-webpack-plugin": "^11.0.0",
|
|
65
65
|
"cross-env": "^7.0.3",
|
|
66
66
|
"css-loader": "^6.7.3",
|
|
67
|
-
"eslint": "^8.
|
|
68
|
-
"eslint-config-prettier": "^8.
|
|
69
|
-
"eslint-plugin-jest": "^
|
|
70
|
-
"eslint-plugin-prettier": "^4.
|
|
71
|
-
"eslint-plugin-react": "^7.
|
|
67
|
+
"eslint": "^8.18.0",
|
|
68
|
+
"eslint-config-prettier": "^8.5.0",
|
|
69
|
+
"eslint-plugin-jest": "^26.5.3",
|
|
70
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
71
|
+
"eslint-plugin-react": "^7.30.0",
|
|
72
72
|
"file-loader": "^6.2.0",
|
|
73
73
|
"identity-obj-proxy": "^3.0.0",
|
|
74
74
|
"jest": "^28.1.2",
|
|
75
75
|
"jest-environment-jsdom": "^28.1.2",
|
|
76
|
-
"
|
|
77
|
-
"prettier": "^2.8.8",
|
|
76
|
+
"prettier": "^2.7.1",
|
|
78
77
|
"react-is": "^17.0.2",
|
|
79
78
|
"react-refresh": "^0.14.0",
|
|
80
79
|
"rimraf": "^3.0.2",
|
|
81
|
-
"storybook": "^
|
|
82
|
-
"
|
|
83
|
-
"stylelint": "^
|
|
84
|
-
"stylelint-config-
|
|
80
|
+
"storybook-addon-performance": "^0.16.1",
|
|
81
|
+
"stylelint": "^14.9.1",
|
|
82
|
+
"stylelint-config-recommended": "^8.0.0",
|
|
83
|
+
"stylelint-config-styled-components": "^0.1.1",
|
|
84
|
+
"stylelint-processor-styled-components": "^1.10.0",
|
|
85
85
|
"ts-jest": "^28.0.5",
|
|
86
86
|
"ts-loader": "^9.3.1",
|
|
87
87
|
"typescript": "^4.7.4",
|
|
@@ -148,13 +148,13 @@
|
|
|
148
148
|
}
|
|
149
149
|
},
|
|
150
150
|
"stylelint": {
|
|
151
|
-
"
|
|
152
|
-
|
|
153
|
-
"stylelint-config-recommended"
|
|
151
|
+
"processors": [
|
|
152
|
+
"stylelint-processor-styled-components"
|
|
154
153
|
],
|
|
155
|
-
"
|
|
156
|
-
"
|
|
157
|
-
|
|
154
|
+
"extends": [
|
|
155
|
+
"stylelint-config-recommended",
|
|
156
|
+
"stylelint-config-styled-components"
|
|
157
|
+
]
|
|
158
158
|
},
|
|
159
159
|
"prettier": {
|
|
160
160
|
"endOfLine": "lf",
|