Skip to content

Commit a502255

Browse files
authored
fix: type definition of dialog headers and allowListForLockFocus (#1410)
* fix: allow lock focus for specific list in dialog * fix: fix lint * fix: optimize naming and description * fix: optimize check box * fix: optimize check box * fix: update storyshot * fix: fix ut similate behavior like checked in browser * fix: fix ut similate behavior like checked in browser * fix: type definition * fix: linting
1 parent 112db51 commit a502255

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/Dialog/Dialog.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ Dialog.propTypes = {
168168
actions: PropTypes.arrayOf(PropTypes.node).isRequired,
169169
/** Localized text for the heading */
170170
title: PropTypes.string.isRequired,
171-
/** Specific list of node to lock the focus*/
172-
allowListForLockFocus: PropTypes.node,
171+
/** Specific function to select list of node to lock the focus*/
172+
allowListForLockFocus: PropTypes.func,
173173
/** CSS class(es) to add to the dialog backdrop */
174174
backdropClassName: PropTypes.string,
175175
/** Additional props to be spread to the body section of the dialog */
@@ -182,8 +182,11 @@ Dialog.propTypes = {
182182
contentProps: PropTypes.object,
183183
/** Additional props to be spread to the footer of the dialog */
184184
footerProps: PropTypes.object,
185-
/** Text for the components header */
186-
header: PropTypes.string,
185+
/** Text or Custom React node for the components header */
186+
header: PropTypes.oneOfType([
187+
PropTypes.string,
188+
PropTypes.node
189+
]),
187190
/** Additional props to be spread to the header of the dialog */
188191
headerProps: PropTypes.object,
189192
/** Heading level. `<h1>` is reserved for the page title. It should not appear in components */

src/LayoutPanel/_LayoutPanelHead.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@ LayoutPanelHead.propTypes = {
4343
headingLevel: CustomPropTypes.range(2, 6),
4444
/** Heading style, if it should be different from the default style for the heading level. */
4545
headingStyle: CustomPropTypes.range(2, 6),
46-
/** Localized text for the heading */
47-
title: PropTypes.string
46+
/** Localized text or Custom React node for the heading */
47+
title: PropTypes.oneOfType([
48+
PropTypes.string,
49+
PropTypes.node
50+
])
4851
};
4952

5053
LayoutPanelHead.defaultProps = {

0 commit comments

Comments
 (0)