-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #616 from danskernesdigitalebibliotek/redesign-use…
…r-creation-form User registration form v2
- Loading branch information
Showing
10 changed files
with
206 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { ComponentStory } from "@storybook/react"; | ||
import { withDesign } from "storybook-addon-designs"; | ||
import CreatePatron, { CreatePatronProps } from "./CreatePatron"; | ||
|
||
export default { | ||
title: "Blocks / Create Patron", | ||
component: CreatePatron, | ||
decorators: [withDesign], | ||
argTypes: { | ||
headline: { | ||
name: "Title", | ||
defaultValue: "Register as patron", | ||
control: { type: "text" }, | ||
}, | ||
}, | ||
parameters: { | ||
design: { | ||
type: "figma", | ||
url: "https://www.figma.com/file/Zx9GrkFA3l4ISvyZD2q0Qi/Designsystem?type=design&node-id=14631%3A36424&mode=design&t=kNDJGSba8OVIdnRx-1", | ||
}, | ||
}, | ||
}; | ||
|
||
const Template: ComponentStory<typeof CreatePatron> = ( | ||
args: CreatePatronProps | ||
) => <CreatePatron {...args} />; | ||
|
||
export const Default = Template.bind({}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { Button } from "../../Library/Buttons/button/Button"; | ||
import DoubleInputRow from "../../Library/Forms/input/DoubleInputRow"; | ||
import { Dropdown } from "../../Library/dropdown/Dropdown"; | ||
import { Links } from "../../Library/links/Links"; | ||
|
||
export interface CreatePatronProps { | ||
headline: string; | ||
} | ||
|
||
const CreatePatron: React.FC<CreatePatronProps> = ({ headline }) => { | ||
return ( | ||
<div className="create-patron-page"> | ||
<h1 className="create-patron-page__title">{headline}</h1> | ||
<form> | ||
<section className="create-patron-page__row"> | ||
<DoubleInputRow leftLabel="Phone number*" rightLabel="Email*" /> | ||
</section> | ||
<section className="create-patron-page__row"> | ||
<DoubleInputRow | ||
leftLabel="New pin*" | ||
rightLabel="Confirm new pin*" | ||
descriptionLeft="Exactly 4 digits" | ||
descriptionRight="Exactly 4 digits" | ||
validationRight="Pin doesn't match" | ||
/> | ||
</section> | ||
<Dropdown | ||
ariaLabel="Choose pickup branch" | ||
arrowIcon="chevron" | ||
list={[ | ||
{ title: "Nothing selected" }, | ||
{ title: "Option 1" }, | ||
{ title: "Option 2" }, | ||
]} | ||
classNames="dropdown--grey-borders" | ||
labelComponent={ | ||
<label className="text-body-medium-medium mb-8"> | ||
Choose pickup branch* | ||
</label> | ||
} | ||
footnote="Choose preferred library for pickup of your future reservations." | ||
/> | ||
<div className="create-patron-page__buttons"> | ||
<Button | ||
buttonType="none" | ||
label="Create profile" | ||
size="small" | ||
variant="filled" | ||
classNames="mr-16" | ||
/> | ||
<Links href="#" linkText="Cancel" classNames="mt-8" /> | ||
</div> | ||
</form> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CreatePatron; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.create-patron-page { | ||
background: $color__global-primary; | ||
padding: $s-2xl $s-sm $s-6xl $s-sm; | ||
|
||
@include media-query__small { | ||
margin: auto; | ||
max-width: 550px; | ||
padding: $s-5xl 0 $s-2xl 0; | ||
} | ||
|
||
&__title { | ||
@include typography($typo__h1); | ||
margin-bottom: $s-2xl; | ||
|
||
@include media-query__small { | ||
margin-bottom: $s-5xl; | ||
} | ||
} | ||
|
||
&__row { | ||
@include media-query__small { | ||
margin-bottom: $s-3xl; | ||
} | ||
} | ||
|
||
&__buttons { | ||
display: flex; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import Input from "./Input"; | ||
|
||
export type DoubleInputRowProps = { | ||
leftLabel: string; | ||
rightLabel: string; | ||
descriptionLeft?: string; | ||
descriptionRight?: string; | ||
validationLeft?: string; | ||
validationRight?: string; | ||
}; | ||
|
||
const DoubleInputRow: React.FC<DoubleInputRowProps> = ({ | ||
leftLabel, | ||
rightLabel, | ||
descriptionLeft, | ||
descriptionRight, | ||
validationLeft, | ||
validationRight, | ||
}) => { | ||
return ( | ||
<div className="dpl-input__flex"> | ||
<Input | ||
id={leftLabel} | ||
label={leftLabel} | ||
description={descriptionLeft} | ||
validation={validationLeft} | ||
type="text" | ||
classNames="dpl-input dpl-input--double mr-16" | ||
/> | ||
<Input | ||
id={rightLabel} | ||
label={rightLabel} | ||
description={descriptionRight} | ||
validation={validationRight} | ||
type="text" | ||
classNames="dpl-input dpl-input--double" | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default DoubleInputRow; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters