This repository was archived by the owner on Mar 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +31
-16
lines changed
Expand file tree Collapse file tree 6 files changed +31
-16
lines changed Original file line number Diff line number Diff line change @@ -18,9 +18,11 @@ import { useScrollPosition } from 'react-hooks-shareable'
1818
1919import { Typography } from '../Typography'
2020import { ModalProps } from '../Modal'
21- import { Header } from './components/Header'
22- import { Footer } from './components/Footer'
23- import { MainSection } from './components/Content'
21+ import {
22+ DialogHeaderContent ,
23+ DialogMainSection ,
24+ DialogFooterContent ,
25+ } from './components'
2426import {
2527 BaseDialog ,
2628 DialogWidth ,
@@ -78,16 +80,23 @@ export const Dialog: React.FC<DialogProps> = ({
7880 >
7981 { header !== undefined ? (
8082 < DialogHeader >
81- < Header shadowHidden = { atTop !== false } > { header } </ Header >
83+ < DialogHeaderContent shadowHidden = { atTop !== false } >
84+ { header }
85+ </ DialogHeaderContent >
8286 </ DialogHeader >
8387 ) : null }
8488 < DialogContent >
85- < MainSection scrollRef = { scrollRef } hasHeader = { header !== undefined } >
89+ < DialogMainSection
90+ scrollRef = { scrollRef }
91+ hasHeader = { header !== undefined }
92+ >
8693 { children }
87- </ MainSection >
94+ </ DialogMainSection >
8895 </ DialogContent >
8996 < DialogFooter >
90- < Footer shadowHidden = { atBottom !== false } > { controls } </ Footer >
97+ < DialogFooterContent shadowHidden = { atBottom !== false } >
98+ { controls }
99+ </ DialogFooterContent >
91100 </ DialogFooter >
92101 </ BaseDialog >
93102 )
Original file line number Diff line number Diff line change 11/**
2- * Footer
2+ * DialogFooterContent
33 *
4- * The Footer component adds a small margin to all its children
4+ * The `DialogFooterContent` component adds a small margin to all its children
55 *
66 * Note: the footer items are rendered from right to left!! This also causes the
77 * focus to land on the most important button first. If focus behaviour needs to
@@ -15,7 +15,9 @@ import styled from 'styled-components'
1515import { spacing } from '../../designparams'
1616import { DIALOG_PADDING } from './padding'
1717
18- export const Footer = styled . div < { readonly shadowHidden : boolean } > `
18+ export const DialogFooterContent = styled . div < {
19+ readonly shadowHidden : boolean
20+ } > `
1921 display: flex;
2022 flex-direction: row-reverse;
2123 box-sizing: border-box;
Original file line number Diff line number Diff line change 11import styled from 'styled-components'
2+
23import { spacing } from '../../designparams'
34import { DIALOG_PADDING } from './padding'
45
5- export const Header = styled . div < {
6+ export const DialogHeaderContent = styled . div < {
67 readonly shadowHidden : boolean
78} > `
89 box-sizing: border-box;
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { spacing } from '../../designparams'
55import { DIALOG_PADDING } from './padding'
66
77/**
8- * Content
8+ * DialogMainSection
99 *
1010 * Simple div to base other sections on. It comes with a default padding to make
1111 * sure this isn't left out of anything put in the dialog body. Sections can be
@@ -55,7 +55,7 @@ interface ScrollSectionProps {
5555 readonly scrollRef : React . Dispatch < React . SetStateAction < HTMLElement | null > >
5656}
5757
58- export const ScrollSection : React . FunctionComponent < ScrollSectionProps > = ( {
58+ export const ScrollSection : React . FC < ScrollSectionProps > = ( {
5959 className,
6060 maxHeight,
6161 scrollRef,
@@ -66,8 +66,7 @@ export const ScrollSection: React.FunctionComponent<ScrollSectionProps> = ({
6666 </ ScrollContainer >
6767)
6868
69- /* stylelint-disable selector-type-no-unknown */
70- export const MainSection = styled ( ScrollSection ) < {
69+ export const DialogMainSection = styled ( ScrollSection ) < {
7170 readonly hasHeader : boolean
7271 readonly scrollRef : React . Dispatch < React . SetStateAction < HTMLElement | null > >
7372} > `
Original file line number Diff line number Diff line change 1+ export * from './DialogFooterContent'
2+ export * from './DialogHeaderContent'
3+ export * from './DialogMainSection'
Original file line number Diff line number Diff line change @@ -2,13 +2,14 @@ export * from './BaseDialog'
22export * from './AlertDialog'
33export * from './ConfirmDialog'
44export { DialogProps } from './Dialog'
5+ export * from './components'
56
67import { Dialog as DialogOriginal , HeaderTitle } from './Dialog'
78import {
89 EdgeToEdgeSection ,
910 CenteredSection ,
1011 ScrollSection ,
11- } from './components/Content '
12+ } from './components/DialogMainSection '
1213
1314type DialogOriginalType = typeof DialogOriginal
1415
You can’t perform that action at this time.
0 commit comments