- .c1 {
- border: none;
- border-radius: 0.25rem;
- box-sizing: border-box;
- background: rgb(211,211,211);
- cursor: pointer;
- padding: 0.4rem 0.7rem;
- line-height: 1;
- white-space: nowrap;
- color: black;
-}
-
-.c0 {
+ .c0 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
@@ -5871,7 +6147,7 @@ button.c7 {
order: -1;
border-bottom: 1px solid rgb(169,169,169);
background: #455a64;
- padding: 0.5rem;
+ padding: 0.25rem;
}
.c0 > *:first-child {
@@ -5887,6 +6163,17 @@ button.c7 {
margin: 0.25rem;
}
+.c1 {
+ border: none;
+ border-radius: 0.25rem;
+ box-sizing: border-box;
+ background: rgb(211,211,211);
+ cursor: pointer;
+ padding: 0.75rem 1rem;
+ line-height: 1.25;
+ color: black;
+}
+
@media (min-width:480px) {
.c0 > *:first-child {
margin-left: auto;
diff --git a/src/__snapshots__/AppSetElection.test.tsx.snap b/src/__snapshots__/AppSetElection.test.tsx.snap
index 8f54ef3..2abfda5 100644
--- a/src/__snapshots__/AppSetElection.test.tsx.snap
+++ b/src/__snapshots__/AppSetElection.test.tsx.snap
@@ -17,12 +17,14 @@ exports[`Sets election config file 1`] = `
.c3 {
margin: auto auto;
+ width: 100%;
max-width: 35rem;
padding: 1rem;
}
.c4 {
margin: auto;
+ width: 100%;
max-width: 66ch;
text-align: center;
line-height: 1.2;
@@ -41,7 +43,8 @@ exports[`Sets election config file 1`] = `
.c4 h3,
.c4 p {
- margin: 1rem 0;
+ margin-top: 1rem;
+ margin-bottom: 1rem;
font-size: 1rem;
}
@@ -72,9 +75,8 @@ exports[`Sets election config file 1`] = `
box-sizing: border-box;
background: rgb(211,211,211);
cursor: pointer;
- padding: 0.4rem 0.7rem;
- line-height: 1;
- white-space: nowrap;
+ padding: 0.75rem 1rem;
+ line-height: 1.25;
color: black;
}
diff --git a/src/components/Ballot.test.tsx b/src/components/Ballot.test.tsx
index c472126..24365cc 100644
--- a/src/components/Ballot.test.tsx
+++ b/src/components/Ballot.test.tsx
@@ -12,10 +12,13 @@ import Ballot from './Ballot'
it(`can navigate all ballot pages`, () => {
window.print = jest.fn()
- const { container, getByText, getByTestId, history } = render(, {
- ballotStyleId: '',
- precinctId: '',
- })
+ const { container, getByText, getByTestId, queryByText, history } = render(
+ ,
+ {
+ ballotStyleId: '',
+ precinctId: '',
+ }
+ )
expect(container.firstChild).toMatchSnapshot()
fireEvent.change(getByTestId('activation-code'), {
@@ -26,6 +29,7 @@ it(`can navigate all ballot pages`, () => {
// TODO: replace next line with "Enter" keyDown on activation code input
fireEvent.click(getByText('Submit'))
fireEvent.click(getByText('Get Started'))
+ fireEvent.click(getByText('Start Voting'))
fireEvent.click(getByText('Help'))
getByText('Help content will be available here.')
fireEvent.click(getByText('Back'))
@@ -37,24 +41,25 @@ it(`can navigate all ballot pages`, () => {
electionSample.contests.forEach(() => {
fireEvent.click(getByText('Next'))
})
-
- // Pre Review Screen
- getByText('Pre Review Screen')
+ // Go to Pre Review Screen, through all contest pages.
+ while (!queryByText('Review Your Selections')) {
+ fireEvent.click(getByText('Next'))
+ }
// Review Screen
- fireEvent.click(getByText('Next'))
+ fireEvent.click(getByText('Review Selections'))
getByText('Review Your Ballot Selections')
// Print Screen
fireEvent.click(getByText('Next'))
- getByText('Print your ballot')
+ getByText('Print your official ballot')
// Manually load cast page (as full BallotContext not provided to integration test)
history.push('/cast')
// Verify and Cast Screen
- getByText('Verify and Cast Your Ballot')
- fireEvent.click(getByText('Start Over'))
+ getByText('Cast your printed ballot')
+ fireEvent.click(getByText('Okay, I will review and cast my printed ballot.'))
// Back to beginning
getByText('Scan Your Activation Code')
diff --git a/src/components/Ballot.tsx b/src/components/Ballot.tsx
index 92ba741..f016a07 100644
--- a/src/components/Ballot.tsx
+++ b/src/components/Ballot.tsx
@@ -13,6 +13,7 @@ import PrintPage from '../pages/PrintPage'
import ReviewPage from '../pages/ReviewPage'
import SettingsPage from '../pages/SettingsPage'
import StartPage from '../pages/StartPage'
+import InstructionsPage from '../pages/InstructionsPage'
const Ballot = () => {
const { ballotStyleId, contests, election, precinctId } = useContext(
@@ -35,6 +36,7 @@ const Ballot = () => {
+
`
+ position: relative;
+ border-radius: 50%;
+ background: ${({ completed, current }) =>
+ completed ? '#ffffff' : current ? '#35809c' : '#c7d7df'};
+ width: 100%;
+ height: 0;
+ padding-top: 100%;
+ & > span {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ text-align: center;
+ color: ${({ completed }) => (completed ? '#35809c' : '#ffffff')};
+ font-size: 7vw;
+ font-weight: 700;
+ @media (min-width: 686px) {
+ font-size: 2rem;
+ }
+ }
+`
+
+const StepLabel = styled.div`
+ position: absolute;
+ margin: 0.25rem -1rem 0;
+ width: calc(100% + 2rem);
+ text-align: center;
+ color: ${({ current }) => (current ? undefined : '#c7d7df')};
+ font-weight: ${({ current }) => (current ? '600' : undefined)};
+`
+
+const Breadcrumbs = ({ step }: { step: number }) => (
+
+
+ {['Mark', 'Review', 'Print', 'Cast'].map((label, i) => {
+ const stepNumber = i + 1
+ const completed = stepNumber < step
+ return (
+
+
+ {completed ? '✓' : stepNumber}
+
+ {label}
+
+
+
+ )
+ })}
+
+
+)
+
+export default Breadcrumbs
diff --git a/src/components/Button.test.tsx b/src/components/Button.test.tsx
index d57608e..9701bd7 100644
--- a/src/components/Button.test.tsx
+++ b/src/components/Button.test.tsx
@@ -18,6 +18,16 @@ it(`renders danger Button`, () => {
expect(container.firstChild).toMatchSnapshot()
})
+it(`renders big Button`, () => {
+ const { container } = render()
+ expect(container.firstChild).toMatchSnapshot()
+})
+
+it(`renders small Button`, () => {
+ const { container } = render()
+ expect(container.firstChild).toMatchSnapshot()
+})
+
it(`renders DecoyButton`, () => {
const { container } = render(DecoyButton)
expect(container.firstChild).toMatchSnapshot()
diff --git a/src/components/Button.tsx b/src/components/Button.tsx
index e5b086d..5771c1e 100644
--- a/src/components/Button.tsx
+++ b/src/components/Button.tsx
@@ -8,6 +8,8 @@ export interface ButtonInterface {
readonly danger?: boolean
readonly primary?: boolean
readonly fullWidth?: boolean
+ readonly small?: boolean
+ readonly big?: boolean
}
interface Props
@@ -22,16 +24,17 @@ const buttonStyles = css`
(danger && 'red') ||
(primary && 'rgb(71, 167, 75)') ||
'rgb(211, 211, 211)'};
- cursor: pointer;
+ cursor: ${({ disabled = false }) => (disabled ? undefined : 'pointer')};
width: ${({ fullWidth = false }) => (fullWidth ? '100%' : undefined)};
- padding: 0.4rem 0.7rem;
- line-height: 1;
- white-space: nowrap;
+ padding: ${({ big = false, small = false }) =>
+ small ? '0.35rem 0.5rem' : big ? '1rem 1.75rem' : '0.75rem 1rem'};
+ line-height: 1.25;
color: ${({ disabled = false, danger = false, primary = false }) =>
(disabled && 'rgb(169, 169, 169)') ||
(danger && '#FFFFFF') ||
(primary && '#FFFFFF') ||
'black'};
+ font-size: ${({ big = false }) => (big ? '1.25rem' : undefined)};
`
export const DecoyButton = styled.div`
diff --git a/src/components/ButtonBar.tsx b/src/components/ButtonBar.tsx
index fe0a67c..b2df5fa 100644
--- a/src/components/ButtonBar.tsx
+++ b/src/components/ButtonBar.tsx
@@ -16,7 +16,7 @@ const ButtonBar = styled('nav')`
border-bottom: 1px solid rgb(169, 169, 169);
background: ${({ dark = true }) =>
dark ? '#455a64' : 'rgba(0, 0, 0, 0.05)'};
- padding: 0.5rem;
+ padding: 0.25rem;
& > *:first-child {
order: 2;
diff --git a/src/components/Main.tsx b/src/components/Main.tsx
index 51212ac..471055d 100644
--- a/src/components/Main.tsx
+++ b/src/components/Main.tsx
@@ -35,6 +35,7 @@ export const MainChild = styled('div')`
centerVertical = center,
centerHorizontal = center,
}) => `${centerVertical ? 'auto' : '0'} ${centerHorizontal ? 'auto' : '0'}`};
+ width: 100%;
max-width: 35rem;
padding: ${({ padded = false }) => (padded ? '1rem' : undefined)};
@media print {
diff --git a/src/components/Prose.tsx b/src/components/Prose.tsx
index aee1302..4fe7ff5 100644
--- a/src/components/Prose.tsx
+++ b/src/components/Prose.tsx
@@ -7,6 +7,7 @@ interface Props {
const Prose = styled('div')`
margin: ${({ textCenter }) => (textCenter ? 'auto' : undefined)};
+ width: 100%;
max-width: 66ch;
text-align: ${({ textCenter }) => (textCenter ? 'center' : undefined)};
line-height: 1.2;
@@ -24,7 +25,8 @@ const Prose = styled('div')`
}
& h3,
& p {
- margin: ${({ compact }) => (compact ? 0 : '1rem 0')};
+ margin-top: ${({ compact }) => (compact ? '0' : '1rem')};
+ margin-bottom: ${({ compact }) => (compact ? '0' : '1rem')};
font-size: 1rem;
}
& h1 + h2 {
diff --git a/src/components/Text.tsx b/src/components/Text.tsx
index 8542649..a434d83 100644
--- a/src/components/Text.tsx
+++ b/src/components/Text.tsx
@@ -9,6 +9,7 @@ interface Props {
error?: boolean
italic?: boolean
muted?: boolean
+ narrow?: boolean
small?: boolean
warning?: boolean
warningIcon?: boolean
@@ -39,6 +40,9 @@ const iconStyles = css`
`
const Text = styled('p')`
+ margin-right: ${({ narrow }) => (narrow ? 'auto' : undefined)};
+ margin-left: ${({ narrow }) => (narrow ? 'auto' : undefined)};
+ max-width: ${({ narrow }) => (narrow ? '33ch' : undefined)};
text-align: ${({ center }) => (center ? 'center' : undefined)};
color: ${({ error, muted, warning, white }) =>
(error && 'red') ||
diff --git a/src/components/__snapshots__/Ballot.test.tsx.snap b/src/components/__snapshots__/Ballot.test.tsx.snap
index 56fa852..d6285e7 100644
--- a/src/components/__snapshots__/Ballot.test.tsx.snap
+++ b/src/components/__snapshots__/Ballot.test.tsx.snap
@@ -18,11 +18,13 @@ exports[`can navigate all ballot pages 1`] = `
.c1 {
margin: auto auto;
+ width: 100%;
max-width: 35rem;
}
.c3 {
margin: auto;
+ width: 100%;
max-width: 66ch;
text-align: center;
line-height: 1.2;
@@ -41,7 +43,8 @@ exports[`can navigate all ballot pages 1`] = `
.c3 h3,
.c3 p {
- margin: 1rem 0;
+ margin-top: 1rem;
+ margin-bottom: 1rem;
font-size: 1rem;
}
diff --git a/src/components/__snapshots__/Button.test.tsx.snap b/src/components/__snapshots__/Button.test.tsx.snap
index 871d679..8f32dde 100644
--- a/src/components/__snapshots__/Button.test.tsx.snap
+++ b/src/components/__snapshots__/Button.test.tsx.snap
@@ -7,9 +7,8 @@ exports[`renders Button 1`] = `
box-sizing: border-box;
background: rgb(211,211,211);
cursor: pointer;
- padding: 0.4rem 0.7rem;
- line-height: 1;
- white-space: nowrap;
+ padding: 0.75rem 1rem;
+ line-height: 1.25;
color: black;
}
@@ -28,9 +27,8 @@ exports[`renders DecoyButton 1`] = `
box-sizing: border-box;
background: rgb(211,211,211);
cursor: pointer;
- padding: 0.4rem 0.7rem;
- line-height: 1;
- white-space: nowrap;
+ padding: 0.75rem 1rem;
+ line-height: 1.25;
color: black;
}
@@ -41,6 +39,27 @@ exports[`renders DecoyButton 1`] = `
`;
+exports[`renders big Button 1`] = `
+.c0 {
+ border: none;
+ border-radius: 0.25rem;
+ box-sizing: border-box;
+ background: rgb(211,211,211);
+ cursor: pointer;
+ padding: 1rem 1.75rem;
+ line-height: 1.25;
+ color: black;
+ font-size: 1.25rem;
+}
+
+