@stonecrop/aform 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +8 -8
- package/src/components/utilities/Login.vue +72 -0
- package/src/theme/login.css +132 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stonecrop/aform",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"uuid": "^9.0.0",
|
|
35
35
|
"vue": "^3.4.23",
|
|
36
|
-
"@stonecrop/
|
|
37
|
-
"@stonecrop/
|
|
36
|
+
"@stonecrop/themes": "0.2.7",
|
|
37
|
+
"@stonecrop/utilities": "0.2.7"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@histoire/plugin-vue": "^0.17.17",
|
|
41
41
|
"@types/uuid": "^9.0.0",
|
|
42
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
43
|
-
"@typescript-eslint/parser": "^
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^7.6.0",
|
|
43
|
+
"@typescript-eslint/parser": "^7.6.0",
|
|
44
44
|
"@vitejs/plugin-vue": "^5.0.4",
|
|
45
45
|
"@vitest/coverage-v8": "^1.5.0",
|
|
46
46
|
"@vitest/ui": "^1.5.0",
|
|
@@ -51,14 +51,14 @@
|
|
|
51
51
|
"eslint-plugin-vue": "^9.11.1",
|
|
52
52
|
"histoire": "^0.17.17",
|
|
53
53
|
"jsdom": "^22.0.0",
|
|
54
|
-
"typescript": "^5.
|
|
54
|
+
"typescript": "^5.4.5",
|
|
55
55
|
"vite": "^5.2.9",
|
|
56
56
|
"vitest": "^1.5.0",
|
|
57
57
|
"vue-router": "^4",
|
|
58
|
-
"@stonecrop/atable": "0.2.
|
|
58
|
+
"@stonecrop/atable": "0.2.7"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@stonecrop/atable": "0.2.
|
|
61
|
+
"@stonecrop/atable": "0.2.7"
|
|
62
62
|
},
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="login-container">
|
|
3
|
+
<div>
|
|
4
|
+
<div class="account-container">
|
|
5
|
+
<div class="account-header">
|
|
6
|
+
<h1 id="account-title">{{ headerTitle }}</h1>
|
|
7
|
+
<p id="account-subtitle">{{ headerSubtitle }}</p>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<form @submit="onSubmit">
|
|
11
|
+
<div class="login-form-container">
|
|
12
|
+
<div class="login-form-email login-form-element">
|
|
13
|
+
<label id="login-email" for="email" class="login-label">Email</label>
|
|
14
|
+
<input
|
|
15
|
+
id="email"
|
|
16
|
+
class="login-field"
|
|
17
|
+
name="email"
|
|
18
|
+
placeholder="name@example.com"
|
|
19
|
+
type="email"
|
|
20
|
+
auto-capitalize="none"
|
|
21
|
+
auto-complete="email"
|
|
22
|
+
auto-correct="off"
|
|
23
|
+
:disabled="isLoading" />
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<div class="login-form-password login-form-element">
|
|
27
|
+
<label id="login-password" for="password" class="login-label">Password</label>
|
|
28
|
+
<input id="password" class="login-field" name="password" type="password" :disabled="isLoading" />
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<button class="btn" :disabled="isLoading">
|
|
32
|
+
<span v-if="isLoading" class="material-symbols-outlined loading-icon"> progress_activity </span>
|
|
33
|
+
<span id="login-form-button">Login</span>
|
|
34
|
+
</button>
|
|
35
|
+
</div>
|
|
36
|
+
</form>
|
|
37
|
+
|
|
38
|
+
<button class="btn">
|
|
39
|
+
<span id="forgot-password-button">Forgot password?</span>
|
|
40
|
+
</button>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<script setup lang="ts">
|
|
47
|
+
import { ref } from 'vue'
|
|
48
|
+
|
|
49
|
+
withDefaults(
|
|
50
|
+
defineProps<{
|
|
51
|
+
headerTitle?: string
|
|
52
|
+
headerSubtitle?: string
|
|
53
|
+
}>(),
|
|
54
|
+
{
|
|
55
|
+
headerTitle: 'Login',
|
|
56
|
+
headerSubtitle: 'Enter your email and password to login',
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
const isLoading = ref(false)
|
|
61
|
+
|
|
62
|
+
function onSubmit(event: Event) {
|
|
63
|
+
event.preventDefault()
|
|
64
|
+
isLoading.value = true
|
|
65
|
+
|
|
66
|
+
// TODO: handle submit logic
|
|
67
|
+
}
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<style>
|
|
71
|
+
@import url('../../theme/login.css');
|
|
72
|
+
</style>
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
@import url('https://fonts.googleapis.com/css2?family=Arimo:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap');
|
|
2
|
+
@import url('@stonecrop/themes/default/default.css');
|
|
3
|
+
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');
|
|
4
|
+
|
|
5
|
+
:root {
|
|
6
|
+
/* BTNS */
|
|
7
|
+
--btn-color: white;
|
|
8
|
+
--btn-border: #cccccc;
|
|
9
|
+
--btn-hover: #f2f2f2;
|
|
10
|
+
--btn-label-color: black;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.login-container {
|
|
14
|
+
width: 100%;
|
|
15
|
+
position: relative;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
font-family: var(--font-family);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.account-container {
|
|
24
|
+
width: 100%;
|
|
25
|
+
margin-left: auto;
|
|
26
|
+
margin-top: 0.5rem;
|
|
27
|
+
margin-right: auto;
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.account-header {
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
text-align: center;
|
|
37
|
+
margin-top: 0.5rem;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
#account-title {
|
|
41
|
+
font-size: 1.5rem;
|
|
42
|
+
line-height: 2rem;
|
|
43
|
+
font-weight: 600;
|
|
44
|
+
letter-spacing: -0.025em;
|
|
45
|
+
margin: 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
#account-subtitle {
|
|
49
|
+
font-size: 0.875rem;
|
|
50
|
+
line-height: 1.25rem;
|
|
51
|
+
margin: 1rem;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.login-form-container {
|
|
55
|
+
display: grid;
|
|
56
|
+
gap: 0.5rem;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.login-form-email,
|
|
60
|
+
.login-form-password {
|
|
61
|
+
display: grid;
|
|
62
|
+
gap: 0.25rem;
|
|
63
|
+
}
|
|
64
|
+
.login-form-element {
|
|
65
|
+
margin: 0.5rem 0;
|
|
66
|
+
}
|
|
67
|
+
.login-field {
|
|
68
|
+
padding: 0.5rem 0.25rem 0.25rem 0.5rem;
|
|
69
|
+
outline: 1px solid transparent;
|
|
70
|
+
border: 1px solid var(--input-border-color);
|
|
71
|
+
border-radius: 0.25rem;
|
|
72
|
+
|
|
73
|
+
&:focus {
|
|
74
|
+
border: 1px solid black;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
.login-label {
|
|
78
|
+
position: absolute;
|
|
79
|
+
padding: 0;
|
|
80
|
+
background: white;
|
|
81
|
+
white-space: nowrap;
|
|
82
|
+
border-width: 0;
|
|
83
|
+
font-size: 0.7rem;
|
|
84
|
+
margin-left: 0.5rem;
|
|
85
|
+
margin-top: -0.7rem;
|
|
86
|
+
padding: 0.3rem;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
#login-form-button {
|
|
90
|
+
margin-right: 0.5rem;
|
|
91
|
+
height: 1rem;
|
|
92
|
+
width: 1rem;
|
|
93
|
+
}
|
|
94
|
+
.btn {
|
|
95
|
+
background-color: var(--btn-color);
|
|
96
|
+
color: var(--btn-label-color);
|
|
97
|
+
border: 1px solid var(--btn-border);
|
|
98
|
+
margin: 0.5rem 0;
|
|
99
|
+
padding: 0.25rem;
|
|
100
|
+
position: relative;
|
|
101
|
+
|
|
102
|
+
&:hover {
|
|
103
|
+
background-color: var(--btn-hover);
|
|
104
|
+
}
|
|
105
|
+
&:disabled {
|
|
106
|
+
background-color: light-dark(rgba(239, 239, 239, 0.3), rgba(59, 59, 59, 0.3));
|
|
107
|
+
color: light-dark(rgb(84, 84, 84), rgb(170, 170, 170));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
.disabled {
|
|
111
|
+
opacity: 0.5;
|
|
112
|
+
}
|
|
113
|
+
.loading-icon {
|
|
114
|
+
animation: spin 1s linear infinite forwards;
|
|
115
|
+
display: inline-block;
|
|
116
|
+
margin-right: 0.2rem;
|
|
117
|
+
line-height: 0;
|
|
118
|
+
font-size: 1rem;
|
|
119
|
+
position: relative;
|
|
120
|
+
top: 0.2rem;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* ANIMATION */
|
|
124
|
+
@keyframes spin {
|
|
125
|
+
from {
|
|
126
|
+
transform: rotate(0deg);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
to {
|
|
130
|
+
transform: rotate(360deg);
|
|
131
|
+
}
|
|
132
|
+
}
|