-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert the scheme page's sidebar and v1 form to govuk
- Loading branch information
1 parent
3d14558
commit a222b4c
Showing
14 changed files
with
206 additions
and
143 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<script lang="ts"> | ||
import FormElement from "../govuk/FormElement.svelte"; | ||
export let label: string; | ||
// A unique (per page) ID | ||
export let id: string; | ||
// A list of [value, label] representing the choices | ||
export let choices: [string, string][]; | ||
// Make the first option the empty string | ||
export let emptyOption = true; | ||
export let disabled = false; | ||
// The current value | ||
export let value: string; | ||
</script> | ||
|
||
<FormElement {label} {id}> | ||
<select class="govuk-select" {id} bind:value {disabled}> | ||
{#if emptyOption} | ||
<option value="" /> | ||
{/if} | ||
|
||
{#each choices as [thisValue, thisLabel]} | ||
<option value={thisValue}>{thisLabel}</option> | ||
{/each} | ||
</select> | ||
</FormElement> |
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,13 @@ | ||
<script lang="ts"> | ||
import FormElement from "./FormElement.svelte"; | ||
export let label: string; | ||
export let value: string; | ||
export let rows: number = 5; | ||
// TODO Using the label as a unique ID, so users don't have to invent an arbitrary string | ||
</script> | ||
|
||
<FormElement {label} id={label}> | ||
<textarea class="govuk-textarea" id={label} {rows} bind:value /> | ||
</FormElement> |
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,12 @@ | ||
<script lang="ts"> | ||
import FormElement from "./FormElement.svelte"; | ||
export let label: string; | ||
export let value: string; | ||
// TODO Using the label as a unique ID, so users don't have to invent an arbitrary string | ||
</script> | ||
|
||
<FormElement {label} id={label}> | ||
<input type="text" class="govuk-input" id={label} bind:value /> | ||
</FormElement> |
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,9 @@ | ||
<button | ||
type="button" | ||
class="govuk-button govuk-button--warning" | ||
data-module="govuk-button" | ||
{...$$props} | ||
on:click | ||
> | ||
<slot /> | ||
</button> |
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
Oops, something went wrong.