diff --git a/base.scss b/base.scss index 08ac5e7d3..69c6389c8 100644 --- a/base.scss +++ b/base.scss @@ -161,6 +161,7 @@ @import "./src/stories/Blocks/loan-page/loan-page-skeleton"; @import "./src/stories/Blocks/registration-page/registration-page"; @import "./src/stories/Blocks/form/form"; +@import "./src/stories/Blocks/create-patron/create-patron"; @import "./src/styles/scss/shared"; @import "./src/styles/scss/internal"; diff --git a/src/stories/Blocks/create-patron/CreatePatron.stories.tsx b/src/stories/Blocks/create-patron/CreatePatron.stories.tsx new file mode 100644 index 000000000..a9b5cf341 --- /dev/null +++ b/src/stories/Blocks/create-patron/CreatePatron.stories.tsx @@ -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 = ( + args: CreatePatronProps +) => ; + +export const Default = Template.bind({}); diff --git a/src/stories/Blocks/create-patron/CreatePatron.tsx b/src/stories/Blocks/create-patron/CreatePatron.tsx new file mode 100644 index 000000000..b7dfd3138 --- /dev/null +++ b/src/stories/Blocks/create-patron/CreatePatron.tsx @@ -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 = ({ headline }) => { + return ( +
+

{headline}

+
+
+ +
+
+ +
+ + Choose pickup branch* + + } + footnote="Choose preferred library for pickup of your future reservations." + /> +
+
+ +
+ ); +}; + +export default CreatePatron; diff --git a/src/stories/Blocks/create-patron/create-patron.scss b/src/stories/Blocks/create-patron/create-patron.scss new file mode 100644 index 000000000..00f3b140c --- /dev/null +++ b/src/stories/Blocks/create-patron/create-patron.scss @@ -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; + } +} diff --git a/src/stories/Library/Forms/input/DoubleInputRow.tsx b/src/stories/Library/Forms/input/DoubleInputRow.tsx new file mode 100644 index 000000000..81b37fd82 --- /dev/null +++ b/src/stories/Library/Forms/input/DoubleInputRow.tsx @@ -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 = ({ + leftLabel, + rightLabel, + descriptionLeft, + descriptionRight, + validationLeft, + validationRight, +}) => { + return ( +
+ + +
+ ); +}; + +export default DoubleInputRow; diff --git a/src/stories/Library/Forms/input/Input.tsx b/src/stories/Library/Forms/input/Input.tsx index 197933397..d5d6efbc5 100644 --- a/src/stories/Library/Forms/input/Input.tsx +++ b/src/stories/Library/Forms/input/Input.tsx @@ -1,3 +1,4 @@ +import clsx from "clsx"; import Label from "../label/Label"; export type InputProps = { @@ -6,13 +7,18 @@ export type InputProps = { id: string; description?: string; validation?: string; + classNames?: string; }; const Input = (props: InputProps) => { - const { label, type, id, description, validation } = props; + const { label, type, id, description, validation, classNames } = props; const invalid = validation ? "true" : "false"; return ( -
+
= ({ @@ -25,6 +26,7 @@ const DropdownElement: React.FC = ({ list, classNames, innerClassNames, + footnote, }) => { const Icon = () => { if (arrowIcon === "triangles") { @@ -70,6 +72,7 @@ const DropdownElement: React.FC = ({
+ {footnote &&
{footnote}
} ); }; @@ -82,6 +85,7 @@ export type DropdownProps = { classNames?: string; innerClassNames?: { select?: string; option?: string; arrowWrapper?: string }; hideInputWrapper?: boolean; + footnote?: string; }; export const Dropdown: React.FC = ({ @@ -92,6 +96,7 @@ export const Dropdown: React.FC = ({ classNames, innerClassNames, hideInputWrapper = false, + footnote, }) => { if (hideInputWrapper) { return ( @@ -102,6 +107,7 @@ export const Dropdown: React.FC = ({ list={list} classNames={classNames} innerClassNames={innerClassNames} + footnote={footnote} /> ); } @@ -115,6 +121,7 @@ export const Dropdown: React.FC = ({ list={list} classNames={classNames} innerClassNames={innerClassNames} + footnote={footnote} /> ); diff --git a/src/stories/Library/dropdown/dropdown.scss b/src/stories/Library/dropdown/dropdown.scss index 5c6d87c68..9c1a519d7 100644 --- a/src/stories/Library/dropdown/dropdown.scss +++ b/src/stories/Library/dropdown/dropdown.scss @@ -96,3 +96,8 @@ $_dropdown-icon-size: 50px; .dropdown__arrows--inline { height: 100%; } + +.dropdown__footnote { + @include typography($typo__small-caption); + margin: $s-sm 0 $s-3xl 0; +} diff --git a/src/stories/Library/patron-info/patron-info.scss b/src/stories/Library/patron-info/patron-info.scss index dbad5b637..d415f6f83 100644 --- a/src/stories/Library/patron-info/patron-info.scss +++ b/src/stories/Library/patron-info/patron-info.scss @@ -40,6 +40,7 @@ display: flex; flex-direction: column; @include typography($typo__body-medium); + margin-bottom: $s-xl; label { @include typography($typo__body-medium); @@ -76,6 +77,7 @@ } input[type="number"] { + appearance: textfield; -moz-appearance: textfield; } }