@equinor/amplify-component-lib 8.10.2 → 8.10.3
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.
|
@@ -27,6 +27,7 @@ export interface DialogProps extends Omit<EDSDialogProps, 'title'> {
|
|
|
27
27
|
actions?: DialogAction[];
|
|
28
28
|
withContentPadding?: boolean;
|
|
29
29
|
withBorders?: boolean;
|
|
30
|
+
contentMaxHeight?: string;
|
|
30
31
|
}
|
|
31
32
|
/**
|
|
32
33
|
* @param title - String or up to 2 react elements in a flex-column
|
|
@@ -36,6 +37,7 @@ export interface DialogProps extends Omit<EDSDialogProps, 'title'> {
|
|
|
36
37
|
* @param actions - Dialog actions, { position: "right" is default }
|
|
37
38
|
* @param withContentPadding - Defaults to true
|
|
38
39
|
* @param withBorders - Defaults to false
|
|
40
|
+
* @param contentMaxHeight - Defaults to '60vh'
|
|
39
41
|
* Also inherits props from EDS dialog
|
|
40
42
|
*/
|
|
41
43
|
export declare const Dialog: import("react").ForwardRefExoticComponent<DialogProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as i,jsxs as t}from"react/jsx-runtime";import{forwardRef as
|
|
1
|
+
import{jsx as i,jsxs as t}from"react/jsx-runtime";import{forwardRef as e}from"react";import{Typography as o,Button as n,Icon as r}from"@equinor/eds-core-react";import{close as d}from"@equinor/eds-icons";import{DialogElement as l,DialogTitle as s,DialogContent as c,DialogActions as h}from"./Dialog.styles.js";import{DialogAction as a}from"./DialogAction.js";const p=e((({title:e,children:p,width:g,actions:m,withContentPadding:f=!0,withBorders:x=!1,contentMaxHeight:w="60vh",...y},v)=>{const $=m?.filter((i=>"left"===i.position)),u=m?.filter((i=>"center"===i.position)),C=m?.filter((i=>void 0===i.position||"right"===i.position)),j="string"==typeof e?i(o,{variant:"h6",children:e}):e,B="string"==typeof p?i(o,{variant:"body_long",children:p}):p;return t(l,{...y,ref:v,style:{width:g?`${g}px`:void 0,...y.style},children:[t(s,{$withBorders:x,style:{width:g?`${g}px`:void 0},children:[i("section",{children:j}),i(n,{variant:"ghost_icon",onClick:y.onClose,children:i(r,{data:d})})]}),i(c,{$withContentPadding:f,style:{width:g?`${g}px`:void 0,maxHeight:w},children:B}),m&&m.length>0&&t(h,{$withBorders:x,style:{width:g?`${g}px`:void 0},children:[$&&$.length>0&&i("section",{id:"dialog-actions-left",children:$.map((t=>i(a,{...t},t.text)))}),u&&u.length>0&&i("section",{id:"dialog-actions-center",children:u.map((t=>i(a,{...t},t.text)))}),C&&C.length>0&&i("section",{id:"dialog-actions-right",children:C.map((t=>i(a,{...t},t.text)))})]})]})}));p.displayName="Dialog";export{p as Dialog};
|