@openfin/ui-library 0.21.0-alpha.1691008222 → 0.21.0-alpha.1691437502

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,10 +1,15 @@
1
1
  import { FC, ReactNode } from 'react';
2
- export type CollapsibleCardProps = {
2
+ export interface CollapsibleCardProps extends Omit<CollapsibleCardStatelessProps, 'expanded' | 'onExpand'> {
3
+ expanded?: boolean;
4
+ }
5
+ export declare const CollapsibleCard: FC<CollapsibleCardProps>;
6
+ export interface CollapsibleCardStatelessProps {
3
7
  title: string | ReactNode;
4
8
  badgeText?: number;
5
9
  maxHeight?: number;
6
10
  fixedHeader?: boolean;
7
11
  children: ReactNode;
8
- expanded?: boolean;
9
- };
10
- export declare const CollapsibleCard: FC<CollapsibleCardProps>;
12
+ expanded: boolean;
13
+ onExpand: (expanded: boolean) => void;
14
+ }
15
+ export declare const CollapsibleCardStateless: (props: CollapsibleCardStatelessProps) => JSX.Element;
package/dist/index.js CHANGED
@@ -107,7 +107,7 @@ var e={8594:(e,t,n)=>{n.d(t,{Z:()=>o});var r=/^((children|dangerouslySetInnerHTM
107
107
  padding: ${({theme:e})=>e.px.small} ${({theme:e})=>e.px.small} 0px
108
108
  ${({theme:e})=>e.px.base};
109
109
  width: 100%;
110
- `},124: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.CollapsibleCard=void 0;const o=n(5893),i=n(6689),a=r(n(7518)),l=n(3136),c=n(9634),s=n(1335),u=n(3911),d=n(7769),f=n(9507);t.CollapsibleCard=e=>{const[t,n]=(0,i.useState)(e.expanded||!1),r=e=>{n(null!=e?e:!t)};return(0,o.jsxs)(C,Object.assign({"data-testid":"collapsible-card"},{children:[(0,o.jsxs)(h,Object.assign({"aria-expanded":t,"data-testid":"heading-container",style:{position:e.fixedHeader?"sticky":void 0,top:0},onClick:()=>r(),tabIndex:0,onKeyDown:e=>{switch(e.code){case"Enter":case"Space":e.preventDefault(),r()}}},{children:[(0,o.jsx)(p,{children:e.title}),(0,o.jsxs)("div",Object.assign({id:"icon-container"},{children:[void 0!==e.badgeText&&(0,o.jsx)(l.Badge,{count:e.badgeText,id:"collapsible-card-heading-badge","data-testid":"collapsible-card-heading-badge"}),(0,o.jsx)(c.Icon,{icon:t?"ChevronUpIcon":"ChevronDownIcon"})]}))]})),t&&(0,o.jsx)(u.CardContainer,Object.assign({maxHeight:e.maxHeight||"none"},{children:(0,o.jsx)("div",{children:e.children})}))]}))};const C=a.default.div`
110
+ `},124: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.CollapsibleCardStateless=t.CollapsibleCard=void 0;const o=n(5893),i=n(6689),a=r(n(7518)),l=n(3136),c=n(9634),s=n(1335),u=n(3911),d=n(7769),f=n(9507);t.CollapsibleCard=e=>{const[n,r]=(0,i.useState)(e.expanded||!1);return(0,o.jsx)(t.CollapsibleCardStateless,Object.assign({},e,{expanded:n,onExpand:e=>r(!e)}))},t.CollapsibleCardStateless=e=>(0,o.jsxs)(C,Object.assign({"data-testid":"collapsible-card"},{children:[(0,o.jsxs)(h,Object.assign({"aria-expanded":e.expanded,"data-testid":"heading-container",style:{position:e.fixedHeader?"sticky":void 0,top:0},onClick:()=>e.onExpand(e.expanded),tabIndex:0,onKeyDown:t=>{switch(t.code){case"Enter":case"Space":t.preventDefault(),e.onExpand(e.expanded)}}},{children:[(0,o.jsx)(p,{children:e.title}),(0,o.jsxs)("div",Object.assign({id:"icon-container"},{children:[void 0!==e.badgeText&&(0,o.jsx)(l.Badge,{count:e.badgeText,id:"collapsible-card-heading-badge","data-testid":"collapsible-card-heading-badge"}),(0,o.jsx)(c.Icon,{icon:e.expanded?"ChevronUpIcon":"ChevronDownIcon"})]}))]})),e.expanded&&(0,o.jsx)(u.CardContainer,Object.assign({maxHeight:e.maxHeight||"none"},{children:(0,o.jsx)("div",{children:e.children})}))]}));const C=a.default.div`
111
111
  position: relative;
112
112
  display: inline-block;
113
113
  width: 100%;
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.21.0-alpha.1691008222",
4
+ "version": "0.21.0-alpha.1691437502",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "repository": "github:openfin/ui-library",