diff --git a/webapp/src/coretsx.tsx b/webapp/src/coretsx.tsx index 017aa2690186..59b5e519471c 100644 --- a/webapp/src/coretsx.tsx +++ b/webapp/src/coretsx.tsx @@ -181,7 +181,8 @@ export class CoreDialog extends React.Component

Type '{options.confirmationText}' to confirm:

diff --git a/webapp/src/projects.tsx b/webapp/src/projects.tsx index 646e9110cbe7..5b1f1e1deee0 100644 --- a/webapp/src/projects.tsx +++ b/webapp/src/projects.tsx @@ -1641,10 +1641,9 @@ export class ExitAndSaveDialog extends data.Component
-

{prompt}

@@ -1779,10 +1778,9 @@ export class NewProjectDialog extends data.Component
-

{prompt}

diff --git a/webapp/src/sui.tsx b/webapp/src/sui.tsx index 9faf4e3ca05c..1754b0e033b6 100644 --- a/webapp/src/sui.tsx +++ b/webapp/src/sui.tsx @@ -6,7 +6,7 @@ import * as ReactTooltip from 'react-tooltip'; import * as data from "./data"; import * as core from "./core"; import { fireClickOnEnter } from "./util"; -import { focusLastActive } from "../../react-common/components/util"; +import { classList, focusLastActive } from "../../react-common/components/util"; import { ThemeManager } from "../../react-common/components/theming/themeManager"; export const appElement = document.getElementById('content'); @@ -618,28 +618,42 @@ export function helpIconLink(url: string, title: string) { export class Field extends data.Component<{ label?: string; + labelWrapper?: React.ElementType; + visuallyHidden?: boolean; children?: any; - ariaLabel?: string; htmlFor?: string; }, {}> { renderCore() { return (
- {this.props.label ? : null} - {this.props.ariaLabel && this.props.htmlFor ? () : ""} + + {this.props.label && this.props.htmlFor && ()} + {this.props.children}
); } } +const LabelWrapper = ({wrapperType, children}: {wrapperType?: React.ElementType, children: React.ReactNode}) => { + if (wrapperType) { + const Wrapper = wrapperType; + return {children} + } + return <>{children} +} + /////////////////////////////////////////////////////////// //////////// Input ///////////// /////////////////////////////////////////////////////////// export interface InputProps { label?: string; + labelWrapper?: React.ElementType inputLabel?: string; + visuallyHiddenLabel?: boolean; class?: string; value?: string; error?: string; @@ -653,7 +667,6 @@ export interface InputProps { copy?: boolean; selectOnClick?: boolean; id?: string; - ariaLabel?: string; autoFocus?: boolean; autoComplete?: boolean; selectOnMount?: boolean; @@ -746,14 +759,14 @@ export class Input extends data.Component { renderCore() { const p = this.props; - const { copy, error, ariaLabel, id, label, inputLabel, lines, autoFocus, placeholder, readOnly, autoComplete } = p; + const { copy, error, id, label, labelWrapper, inputLabel, lines, autoFocus, placeholder, readOnly, autoComplete, visuallyHiddenLabel } = p; const { value, copied } = this.state; const copyBtn = copy && document.queryCommandSupported('copy') ?