Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/central-scan/frontend/src/screens/settings_screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export function SettingsScreen({
)}

<H2>Polling Place</H2>
<P>
<P as="div">
<PollingPlacePicker
mode={hasScannedBatches ? 'disabled' : 'default'}
includedTypes={['absentee', 'election_day', 'early_voting']}
Expand Down
2 changes: 1 addition & 1 deletion apps/design/frontend/src/districts_screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ function Contents(props: { editing: boolean }): React.ReactNode {
</strong>
</P>
) : (
<P>
<P as="div">
Are you sure you want to delete the following districts?{' '}
<strong>
This will delete all contests associated with these
Expand Down
4 changes: 2 additions & 2 deletions apps/design/frontend/src/proofing_status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export function ProofingStatus(): React.ReactNode {
Unfinalizing will clear exports and reenable editing. Enter a
reason for unfinalizing.
</P>
<P>
<P as="div">
<InputGroup label="Reason">
<TextArea
id="reason-for-unfinalizing"
Expand Down Expand Up @@ -327,7 +327,7 @@ function QaStatus({ qaRun }: { qaRun: ExportQaRun }): React.ReactNode {
return (
<Callout color="danger" icon="Danger">
<div>
<P style={{ lineHeight: 1 }} weight="bold">
<P as="div" style={{ lineHeight: 1 }} weight="bold">
QA Check Failed
{resultsUrl && (
<P>
Expand Down
2 changes: 1 addition & 1 deletion apps/mark-scan/frontend/src/pages/admin_screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export function AdminScreen({
{format.count(ballotsPrintedCount)}
</P>
<H3 as="h2">Configuration</H3>
<P>
<P as="div">
<LocationPicker
election={election}
pollsState={pollsState}
Expand Down
2 changes: 1 addition & 1 deletion apps/mark/frontend/src/pages/admin_screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export function AdminScreen({
{format.count(ballotsPrintedCount)}
</P>
<H3 as="h2">Configuration</H3>
<P>
<P as="div">
<LocationPicker
election={election}
pollsState={pollsState}
Expand Down
4 changes: 2 additions & 2 deletions apps/mark/frontend/src/pages/test_deck_screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function TestDeckScreen({
</Button>
</P>
{!isPrinterConnected && (
<P>
<P as="div">
<Callout icon="Warning" color="warning">
No printer detected. Connect it to print test decks.
</Callout>
Expand All @@ -85,7 +85,7 @@ export function TestDeckScreen({
: 'Print All Test Decks'}
</Button>
</P>
<P>
<P as="div">
<SearchSelect
aria-label="Select a precinct"
isMulti={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function InternalConnectionProblemScreen({
<PrinterErrorMessage printerStatus={printerStatus} />
</P>
)}
<P>
<P as="div">
{isPollWorkerAuth ? (
<P>
<PowerDownButton variant="primary" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export function BallotStyleSelect(props: BallotStyleSelectProps): JSX.Element {
)}

{selectedPrecinctOrSplit && (
<P>
<P as="div">
<Font weight="semiBold">Select ballot style:</Font>
<ButtonGrid>
{getBallotStyleGroupsForPrecinctOrSplit({
Expand Down
12 changes: 11 additions & 1 deletion libs/ui/src/typography.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ export interface FontProps {
maxLines?: number;
}

/** Props for {@link P}. */
export type ParagraphProps = FontProps & {
/**
* Renders a `<div>` instead of a `<p>`, keeping the paragraph styling. Use
* when the paragraph contains block-level content (e.g. a list, or a
* component that renders a `<div>`), which is invalid inside a `<p>`.
*/
as?: 'div';
};

/**
* Props for {@link H1}, {@link H2}, {@link H3}, {@link H4}, {@link H5}, and
* {@link H6}
Expand Down Expand Up @@ -173,7 +183,7 @@ export function H6(props: HeadingProps): JSX.Element {
}

/** Styled block paragraph text for regular copy. */
export function P(props: FontProps): JSX.Element {
export function P(props: ParagraphProps): JSX.Element {
return <StyledP {...props} />;
}

Expand Down