diff --git a/packages/bbui/src/FancyForm/FancyButton.svelte b/packages/bbui/src/FancyForm/FancyButton.svelte new file mode 100644 index 0000000000..09615df8fa --- /dev/null +++ b/packages/bbui/src/FancyForm/FancyButton.svelte @@ -0,0 +1,29 @@ + + + + {#if icon} + {#if icon.includes("/")} + button + {:else} + + {/if} + {/if} +
+ +
+
+ + diff --git a/packages/bbui/src/FancyForm/FancyField.svelte b/packages/bbui/src/FancyForm/FancyField.svelte new file mode 100644 index 0000000000..85f07f2a31 --- /dev/null +++ b/packages/bbui/src/FancyForm/FancyField.svelte @@ -0,0 +1,72 @@ + + +
+
+ +
+ {#if error} +
+ {error} +
+ {/if} +
+ + diff --git a/packages/bbui/src/FancyForm/FancyForm.svelte b/packages/bbui/src/FancyForm/FancyForm.svelte new file mode 100644 index 0000000000..f197d81118 --- /dev/null +++ b/packages/bbui/src/FancyForm/FancyForm.svelte @@ -0,0 +1,40 @@ + + +
+ +
+ + diff --git a/packages/bbui/src/FancyForm/FancyInput.svelte b/packages/bbui/src/FancyForm/FancyInput.svelte new file mode 100644 index 0000000000..1e46f96b1b --- /dev/null +++ b/packages/bbui/src/FancyForm/FancyInput.svelte @@ -0,0 +1,99 @@ + + + + {#if label} +
+ {label} +
+ {/if} + (focused = true)} + on:blur={() => (focused = false)} + class:placeholder + /> +
+ + diff --git a/packages/bbui/src/FancyForm/index.js b/packages/bbui/src/FancyForm/index.js new file mode 100644 index 0000000000..4b8e099b80 --- /dev/null +++ b/packages/bbui/src/FancyForm/index.js @@ -0,0 +1,3 @@ +export { default as FancyInput } from "./FancyInput.svelte" +export { default as FancyButton } from "./FancyButton.svelte" +export { default as FancyForm } from "./FancyForm.svelte" diff --git a/packages/bbui/src/index.js b/packages/bbui/src/index.js index 601c4dcbca..3de0bc2f46 100644 --- a/packages/bbui/src/index.js +++ b/packages/bbui/src/index.js @@ -101,3 +101,6 @@ export { banner, BANNER_TYPES } from "./Stores/banner" // Helpers export * as Helpers from "./helpers" + +// Fancy form components +export * from "./FancyForm" diff --git a/packages/builder/src/pages/builder/auth/_components/GoogleButton.svelte b/packages/builder/src/pages/builder/auth/_components/GoogleButton.svelte index 0acaa127cc..3c20192ce2 100644 --- a/packages/builder/src/pages/builder/auth/_components/GoogleButton.svelte +++ b/packages/builder/src/pages/builder/auth/_components/GoogleButton.svelte @@ -1,40 +1,30 @@ {#if show} - - window.open(`/api/global/auth/${tenantId}/google`, "_blank")} + { + window.open(`/api/global/auth/${tenantId}/google`, "_blank") + }} + icon={GoogleLogo} > -
- google icon -

Sign in with Google

-
-
+ Log in with Google + + { + window.open(`/api/global/auth/${tenantId}/google`, "_blank") + }} + icon={GoogleLogo} + > + Log in with Google + {/if} - - diff --git a/packages/builder/src/pages/builder/auth/login.svelte b/packages/builder/src/pages/builder/auth/login.svelte index d8633a4fbc..5a54cafcd5 100644 --- a/packages/builder/src/pages/builder/auth/login.svelte +++ b/packages/builder/src/pages/builder/auth/login.svelte @@ -5,11 +5,12 @@ Button, Divider, Heading, - Input, Layout, notifications, Link, } from "@budibase/bbui" + import { FancyInput, FancyForm } from "@budibase/bbui" + import { TestimonialPage } from "@budibase/frontend-core" import { goto } from "@roxi/routify" import { auth, organisation, oidc, admin } from "stores/portal" import GoogleButton from "./_components/GoogleButton.svelte" @@ -20,12 +21,16 @@ let username = "" let password = "" let loaded = false + let form $: company = $organisation.company || "Budibase" $: multiTenancyEnabled = $admin.multiTenancy $: cloud = $admin.cloud async function login() { + if (!form.validate()) { + return + } try { await auth.login({ username: username.trim(), @@ -57,60 +62,78 @@ -
-
- - - logo - Sign in to {company} - - {#if loaded} - - - {/if} - - - Sign in with email - - - - - + + + logo + Log in to {company} + + {#if loaded} + + + {/if} + + + !x && "Please enter your work email"} + label="Your work email" + value={username} + on:change={e => (username = e.detail)} + /> + (username = e.detail)} + /> + (username = e.detail)} + /> + !x && "Please enter your password"} + label="Password" + type="password" + value={password} + on:change={e => (password = e.detail)} + /> + + +
+ +
+ + $goto("./forgot")}> + Forgot password? + + {#if multiTenancyEnabled && !cloud} + { + admin.unload() + $goto("./org") + }} > - $goto("./forgot")}> - Forgot password? + Change organisation - {#if multiTenancyEnabled && !cloud} - { - admin.unload() - $goto("./org") - }} - > - Change organisation - - {/if} -
- {#if cloud} - - By using Budibase Cloud -
- you are agreeing to our - License Agreement - {/if}
-
-
+ {#if cloud} + + By using Budibase Cloud +
+ you are agreeing to our + + License Agreement + + + {/if} + +