Merge pull request #311 from Budibase/login-component-UI

login component UI update
This commit is contained in:
Joe 2020-06-03 15:21:43 +01:00 committed by GitHub
commit 63ed718293
3 changed files with 91 additions and 47 deletions

View File

@ -267,7 +267,21 @@ export default {
"A component that automatically generates a login screen for your app.", "A component that automatically generates a login screen for your app.",
icon: "ri-login-box-fill", icon: "ri-login-box-fill",
children: [], children: [],
properties: { design: { ...all } }, properties: {
design: { ...all },
settings: [
{
label: "Name",
key: "name",
control: Input,
},
{
label: "Logo",
key: "logo",
control: Input,
},
],
},
}, },
{ {
name: "Table", name: "Table",

View File

@ -59,6 +59,7 @@
"props": { "props": {
"logo": "asset", "logo": "asset",
"loginRedirect": "string", "loginRedirect": "string",
"name": "string",
"usernameLabel": { "usernameLabel": {
"type": "string", "type": "string",
"default": "Username" "default": "Username"

View File

@ -1,10 +1,9 @@
<script> <script>
import Button from "./Button.svelte" import Button from "./Button.svelte"
export let usernameLabel = "Username"
export let passwordLabel = "Password"
export let loginButtonLabel = "Login" export let loginButtonLabel = "Login"
export let logo = "" export let logo = ""
export let name = ""
export let buttonClass = "" export let buttonClass = ""
export let inputClass = "" export let inputClass = ""
@ -51,14 +50,23 @@
</div> </div>
{/if} {/if}
<h1 class="header-content">Log in to {name}</h1>
<div class="form-root"> <div class="form-root">
<div class="label">{usernameLabel}</div>
<div class="control"> <div class="control">
<input bind:value={username} type="text" class={_inputClass} /> <input
bind:value={username}
type="text"
placeholder="Username"
class={_inputClass} />
</div> </div>
<div class="label">{passwordLabel}</div>
<div class="control"> <div class="control">
<input bind:value={password} type="password" class={_inputClass} /> <input
bind:value={password}
type="password"
placeholder="Password"
class={_inputClass} />
</div> </div>
</div> </div>
@ -77,15 +85,17 @@
<style> <style>
.root { .root {
height: 100%; height: 100%;
display: grid; display: flex;
grid-template-columns: [left] 1fr [middle] auto [right] 1fr; flex-direction: column;
grid-template-rows: [top] 1fr [center] auto [bottom] 1fr; align-items: center;
justify-content: center;
} }
.content { .content {
grid-column-start: middle; display: flex;
grid-row-start: center; flex-direction: column;
width: 400px; align-items: center;
justify-content: center;
} }
.logo-container { .logo-container {
@ -97,8 +107,20 @@
} }
.login-button-container { .login-button-container {
text-align: right; margin-top: 6px;
margin-top: 20px; max-width: 100%;
}
.header-content {
font-family: Inter;
font-weight: 700;
color: #1f1f1f;
font-size: 48px;
line-height: 72px;
margin-bottom: 30px;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
font-feature-settings: "case" "rlig" "calt" 0;
} }
.incorrect-details-panel { .incorrect-details-panel {
@ -114,48 +136,55 @@
} }
.form-root { .form-root {
display: grid; display: flex;
grid-template-columns: [label] auto [control] 1fr; /* [overflow] auto;*/ flex-direction: column;
align-items: center;
width: 300px;
} }
.label {
grid-column-start: label;
padding: 5px 10px;
vertical-align: middle;
}
.control { .control {
grid-column-start: control; padding: 6px 0px;
padding: 5px 10px;
}
.default-input {
font-family: inherit;
font-size: inherit;
padding: 0.4em;
margin: 0 0 0.5em 0;
box-sizing: border-box;
border: 1px solid #ccc;
border-radius: 2px;
width: 100%; width: 100%;
} }
.default-button { .default-input {
font-family: inherit; font-family: Inter;
font-size: inherit; font-size: 14px;
padding: 0.4em; color: #393c44;
padding: 2px 6px 2px 12px;
margin: 0 0 0.5em 0; margin: 0 0 0.5em 0;
box-sizing: border-box; box-sizing: border-box;
border: 1px solid #ccc; border: 0.5px solid #d8d8d8;
border-radius: 2px; border-radius: 4px;
color: #000333; width: 100%;
height: 40px;
transition: border-color 100ms ease-in 0s;
outline-color: #797979;
}
.default-button {
font-family: Inter;
font-size: 16px;
padding: 0.4em;
box-sizing: border-box;
border-radius: 4px;
color: white;
background-color: #393c44;
outline: none; outline: none;
width: 300px;
height: 40px;
cursor: pointer;
transition: all 0.2s ease 0s;
overflow: hidden;
outline: none;
user-select: none;
white-space: nowrap;
text-align: center;
} }
.default-button:active { .default-button:hover {
background-color: #f9f9f9; background-color: white;
} border-color: #393c44;
color: #393c44;
.default-button:focus {
border-color: #f9f9f9;
} }
</style> </style>