aboutsummaryrefslogtreecommitdiffstats
path: root/apps/kit/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/kit/src/lib')
-rw-r--r--apps/kit/src/lib/components/alert.svelte4
-rw-r--r--apps/kit/src/lib/components/button.svelte12
-rw-r--r--apps/kit/src/lib/components/checkbox.svelte2
-rw-r--r--apps/kit/src/lib/i18n/en/index.ts41
-rw-r--r--apps/kit/src/lib/i18n/i18n-types.ts252
-rw-r--r--apps/kit/src/lib/models/LoginPayload.ts3
6 files changed, 246 insertions, 68 deletions
diff --git a/apps/kit/src/lib/components/alert.svelte b/apps/kit/src/lib/components/alert.svelte
index 5bcb3ae..fa36a63 100644
--- a/apps/kit/src/lib/components/alert.svelte
+++ b/apps/kit/src/lib/components/alert.svelte
@@ -193,7 +193,9 @@
</script>
{#if visible}
- <div class="rounded-md bg-{colorClassPart}-50 p-4 ">
+ <div
+ class="rounded-md bg-{colorClassPart}-50 p-4 {$$restProps.class ?? ''}"
+ >
<div class="flex">
<div class="flex-shrink-0">
<svelte:component
diff --git a/apps/kit/src/lib/components/button.svelte b/apps/kit/src/lib/components/button.svelte
index 95dba5c..323c7ad 100644
--- a/apps/kit/src/lib/components/button.svelte
+++ b/apps/kit/src/lib/components/button.svelte
@@ -13,7 +13,7 @@
export let tabindex: string | undefined = undefined;
export let style: string | undefined = undefined;
export let title: string | undefined = undefined;
- export let disabled = false;
+ export let disabled: boolean | null = false;
export let href: string | undefined = undefined;
export let text: string;
export let loading = false;
@@ -78,8 +78,9 @@
on:click
class="{sizeClasses} {kindClasses} {loading
? 'disabled:'
- : ''} {$$restProps.class ??
- ''} {fullWidth ? 'w-full justify-center': ''} inline-flex items-center border font-medium rounded shadow-sm focus:outline-none focus:ring-2"
+ : ''} {$$restProps.class ?? ''} {fullWidth
+ ? 'w-full justify-center'
+ : ''} inline-flex items-center border font-medium rounded shadow-sm focus:outline-none focus:ring-2"
>
{#if loading}
<Spinner class={spinnerTextClasses + " " + spinnerMarginClasses} />
@@ -89,8 +90,9 @@
{:else}
<button
{...shared_props}
- class="{sizeClasses} {kindClasses} {$$restProps.class ??
- ''} {fullWidth ? 'w-full justify-center': ''} inline-flex items-center border font-medium rounded shadow-sm focus:outline-none focus:ring-2"
+ class="{sizeClasses} {kindClasses} {$$restProps.class ?? ''} {fullWidth
+ ? 'w-full justify-center'
+ : ''} inline-flex items-center border font-medium rounded shadow-sm focus:outline-none focus:ring-2"
>
{#if loading}
<Spinner class={spinnerTextClasses + " " + spinnerMarginClasses} />
diff --git a/apps/kit/src/lib/components/checkbox.svelte b/apps/kit/src/lib/components/checkbox.svelte
index bb22215..311d154 100644
--- a/apps/kit/src/lib/components/checkbox.svelte
+++ b/apps/kit/src/lib/components/checkbox.svelte
@@ -5,6 +5,7 @@
export let id: string | undefined = "input__" + random_string(4);
export let name: string | undefined = undefined;
export let disabled: boolean | null = null;
+ export let checked: boolean;
</script>
<div class="flex items-center">
@@ -13,6 +14,7 @@
{disabled}
{id}
type="checkbox"
+ bind:checked
class="h-4 w-4 text-teal-600 focus:ring-teal-500 border-gray-300 rounded"
/>
<label for={id} class="ml-2 block text-sm text-gray-900">{label}</label>
diff --git a/apps/kit/src/lib/i18n/en/index.ts b/apps/kit/src/lib/i18n/en/index.ts
index 003de0d..e084a6c 100644
--- a/apps/kit/src/lib/i18n/en/index.ts
+++ b/apps/kit/src/lib/i18n/en/index.ts
@@ -12,16 +12,39 @@ const en: BaseTranslation = {
submit: "Submit",
success: "Success",
tryAgainSoon: "Try again soon",
+ createANewAccount: "Create a new account",
unexpectedError: "An unexpected error occured",
- requestAPasswordReset: "Request a password reset",
- signIntoYourAccount: "sign into your account",
- requestSentMessage: "If we find your email address in our systems, you will receive an email with instructions on how to set a new password for your account.",
- signIn: "Sign In",
- createANewAccount: "create a new account",
- notMyComputer: "This is not my computer",
- resetPassword: "Reset password",
- createYourNewAccount: "Create your new account",
- newPassword: "New password"
+ notFound: "Not found",
+ documentation: "Documentation",
+ tos: "Terms of service",
+ privacyPolicy: "Privacy policy",
+ signIntoYourAccount: "Sign into your account",
+ signInPage: {
+ notMyComputer: "This is not my computer",
+ resetPassword: "Reset password",
+ yourPasswordIsUpdated: "Your password is updated",
+ signIn: "Sign In",
+ yourNewPasswordIsApplied: "Your new password is applied",
+ signInBelow: "Sign in below",
+ yourAccountIsDisabled: "Your account is disabled",
+ contactYourAdminIfDisabled: "Contact your administrator if this feels wrong",
+ youHaveReachedInactivityLimit: "You've reached the hidden inactivity limit",
+ feelFreeToSignInAgain: "Feel free to sign in again"
+ },
+ signUpPage: {
+ createYourNewAccount: "Create your new account",
+ },
+ resetPasswordPage: {
+ setANewPassword: "Set a new password",
+ expired: "Expired",
+ requestHasExpired: "Your request has expired",
+ requestANewReset: "Request a new reset",
+ newPassword: "New password",
+ requestSentMessage: "If we find your email address in our systems, you will receive an email with instructions on how to set a new password for your account.",
+ requestAPasswordReset: "Request a password reset",
+ requestNotFound: "Your request was not found",
+ submitANewRequestBelow: "Submit a new reset request below"
+ }
};
export default en;
diff --git a/apps/kit/src/lib/i18n/i18n-types.ts b/apps/kit/src/lib/i18n/i18n-types.ts
index aedf48b..2d76cef 100644
--- a/apps/kit/src/lib/i18n/i18n-types.ts
+++ b/apps/kit/src/lib/i18n/i18n-types.ts
@@ -64,45 +64,119 @@ type RootTranslation = {
*/
tryAgainSoon: string
/**
- * An unexpected error occured
- */
- unexpectedError: string
- /**
- * Request a password reset
+ * Create a new account
*/
- requestAPasswordReset: string
- /**
- * sign into your account
- */
- signIntoYourAccount: string
- /**
- * If we find your email address in our systems, you will receive an email with instructions on how to set a new password for your account.
- */
- requestSentMessage: string
+ createANewAccount: string
/**
- * Sign In
+ * An unexpected error occured
*/
- signIn: string
+ unexpectedError: string
/**
- * create a new account
+ * Not found
*/
- createANewAccount: string
+ notFound: string
/**
- * This is not my computer
+ * Documentation
*/
- notMyComputer: string
+ documentation: string
/**
- * Reset password
+ * Terms of service
*/
- resetPassword: string
+ tos: string
/**
- * Create your new account
+ * Privacy policy
*/
- createYourNewAccount: string
+ privacyPolicy: string
/**
- * New password
+ * Sign into your account
*/
- newPassword: string
+ signIntoYourAccount: string
+ signInPage: {
+ /**
+ * This is not my computer
+ */
+ notMyComputer: string
+ /**
+ * Reset password
+ */
+ resetPassword: string
+ /**
+ * Your password is updated
+ */
+ yourPasswordIsUpdated: string
+ /**
+ * Sign In
+ */
+ signIn: string
+ /**
+ * Your new password is applied
+ */
+ yourNewPasswordIsApplied: string
+ /**
+ * Sign in below
+ */
+ signInBelow: string
+ /**
+ * Your account is disabled
+ */
+ yourAccountIsDisabled: string
+ /**
+ * Contact your administrator if this feels wrong
+ */
+ contactYourAdminIfDisabled: string
+ /**
+ * You've reached the hidden inactivity limit
+ */
+ youHaveReachedInactivityLimit: string
+ /**
+ * Feel free to sign in again
+ */
+ feelFreeToSignInAgain: string
+ }
+ signUpPage: {
+ /**
+ * Create your new account
+ */
+ createYourNewAccount: string
+ }
+ resetPasswordPage: {
+ /**
+ * Set a new password
+ */
+ setANewPassword: string
+ /**
+ * Expired
+ */
+ expired: string
+ /**
+ * Your request has expired
+ */
+ requestHasExpired: string
+ /**
+ * Request a new reset
+ */
+ requestANewReset: string
+ /**
+ * New password
+ */
+ newPassword: string
+ /**
+ * If we find your email address in our systems, you will receive an email with instructions on how to set a new password for your account.
+ */
+ requestSentMessage: string
+ /**
+ * Request a password reset
+ */
+ requestAPasswordReset: string
+ /**
+ * Your request was not found
+ */
+ requestNotFound: string
+ /**
+ * Submit a new reset request below
+ */
+ submitANewRequestBelow: string
+ }
}
export type NamespaceAppTranslation = {
@@ -473,45 +547,119 @@ export type TranslationFunctions = {
*/
tryAgainSoon: () => LocalizedString
/**
- * An unexpected error occured
- */
- unexpectedError: () => LocalizedString
- /**
- * Request a password reset
+ * Create a new account
*/
- requestAPasswordReset: () => LocalizedString
- /**
- * sign into your account
- */
- signIntoYourAccount: () => LocalizedString
- /**
- * If we find your email address in our systems, you will receive an email with instructions on how to set a new password for your account.
- */
- requestSentMessage: () => LocalizedString
+ createANewAccount: () => LocalizedString
/**
- * Sign In
+ * An unexpected error occured
*/
- signIn: () => LocalizedString
+ unexpectedError: () => LocalizedString
/**
- * create a new account
+ * Not found
*/
- createANewAccount: () => LocalizedString
+ notFound: () => LocalizedString
/**
- * This is not my computer
+ * Documentation
*/
- notMyComputer: () => LocalizedString
+ documentation: () => LocalizedString
/**
- * Reset password
+ * Terms of service
*/
- resetPassword: () => LocalizedString
+ tos: () => LocalizedString
/**
- * Create your new account
+ * Privacy policy
*/
- createYourNewAccount: () => LocalizedString
+ privacyPolicy: () => LocalizedString
/**
- * New password
+ * Sign into your account
*/
- newPassword: () => LocalizedString
+ signIntoYourAccount: () => LocalizedString
+ signInPage: {
+ /**
+ * This is not my computer
+ */
+ notMyComputer: () => LocalizedString
+ /**
+ * Reset password
+ */
+ resetPassword: () => LocalizedString
+ /**
+ * Your password is updated
+ */
+ yourPasswordIsUpdated: () => LocalizedString
+ /**
+ * Sign In
+ */
+ signIn: () => LocalizedString
+ /**
+ * Your new password is applied
+ */
+ yourNewPasswordIsApplied: () => LocalizedString
+ /**
+ * Sign in below
+ */
+ signInBelow: () => LocalizedString
+ /**
+ * Your account is disabled
+ */
+ yourAccountIsDisabled: () => LocalizedString
+ /**
+ * Contact your administrator if this feels wrong
+ */
+ contactYourAdminIfDisabled: () => LocalizedString
+ /**
+ * You've reached the hidden inactivity limit
+ */
+ youHaveReachedInactivityLimit: () => LocalizedString
+ /**
+ * Feel free to sign in again
+ */
+ feelFreeToSignInAgain: () => LocalizedString
+ }
+ signUpPage: {
+ /**
+ * Create your new account
+ */
+ createYourNewAccount: () => LocalizedString
+ }
+ resetPasswordPage: {
+ /**
+ * Set a new password
+ */
+ setANewPassword: () => LocalizedString
+ /**
+ * Expired
+ */
+ expired: () => LocalizedString
+ /**
+ * Your request has expired
+ */
+ requestHasExpired: () => LocalizedString
+ /**
+ * Request a new reset
+ */
+ requestANewReset: () => LocalizedString
+ /**
+ * New password
+ */
+ newPassword: () => LocalizedString
+ /**
+ * If we find your email address in our systems, you will receive an email with instructions on how to set a new password for your account.
+ */
+ requestSentMessage: () => LocalizedString
+ /**
+ * Request a password reset
+ */
+ requestAPasswordReset: () => LocalizedString
+ /**
+ * Your request was not found
+ */
+ requestNotFound: () => LocalizedString
+ /**
+ * Submit a new reset request below
+ */
+ submitANewRequestBelow: () => LocalizedString
+ }
app: {
nav: {
/**
diff --git a/apps/kit/src/lib/models/LoginPayload.ts b/apps/kit/src/lib/models/LoginPayload.ts
index ccd9bed..beb96cf 100644
--- a/apps/kit/src/lib/models/LoginPayload.ts
+++ b/apps/kit/src/lib/models/LoginPayload.ts
@@ -1,4 +1,5 @@
export interface LoginPayload {
username: string,
- password: string
+ password: string,
+ persist: boolean
}