@aws-amplify/ui-svelte 0.0.0-next-b4d0af6-20220107001542 → 0.0.0-next-23d2233-20251017111356
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/README.md +132 -20
- package/dist/components/Authenticator/Authenticator.svelte +230 -0
- package/dist/components/Authenticator/Authenticator.svelte.d.ts +41 -0
- package/dist/components/Authenticator/ConfirmResetPassword.svelte +119 -0
- package/dist/components/Authenticator/ConfirmResetPassword.svelte.d.ts +7 -0
- package/dist/components/Authenticator/ConfirmSignIn.svelte +110 -0
- package/dist/components/Authenticator/ConfirmSignIn.svelte.d.ts +7 -0
- package/dist/components/Authenticator/ConfirmSignUp.svelte +127 -0
- package/dist/components/Authenticator/ConfirmSignUp.svelte.d.ts +7 -0
- package/dist/components/Authenticator/ConfirmVerifyUser.svelte +106 -0
- package/dist/components/Authenticator/ConfirmVerifyUser.svelte.d.ts +7 -0
- package/dist/components/Authenticator/ForceNewPassword.svelte +120 -0
- package/dist/components/Authenticator/ForceNewPassword.svelte.d.ts +7 -0
- package/dist/components/Authenticator/ForgotPassword.svelte +107 -0
- package/dist/components/Authenticator/ForgotPassword.svelte.d.ts +7 -0
- package/dist/components/Authenticator/SelectMfaType.svelte +145 -0
- package/dist/components/Authenticator/SelectMfaType.svelte.d.ts +7 -0
- package/dist/components/Authenticator/SetupEmail.svelte +103 -0
- package/dist/components/Authenticator/SetupEmail.svelte.d.ts +7 -0
- package/dist/components/Authenticator/SetupTotp.svelte +178 -0
- package/dist/components/Authenticator/SetupTotp.svelte.d.ts +7 -0
- package/dist/components/Authenticator/SignIn.svelte +112 -0
- package/dist/components/Authenticator/SignIn.svelte.d.ts +8 -0
- package/dist/components/Authenticator/SignUp.svelte +98 -0
- package/dist/components/Authenticator/SignUp.svelte.d.ts +8 -0
- package/dist/components/Authenticator/VerifyUser.svelte +160 -0
- package/dist/components/Authenticator/VerifyUser.svelte.d.ts +7 -0
- package/dist/components/Authenticator/index.d.ts +14 -0
- package/dist/components/Authenticator/index.js +14 -0
- package/dist/components/controls/AliasField.svelte +98 -0
- package/dist/components/controls/AliasField.svelte.d.ts +17 -0
- package/dist/components/controls/Button.svelte +51 -0
- package/dist/components/controls/Button.svelte.d.ts +13 -0
- package/dist/components/controls/CheckBox.svelte +57 -0
- package/dist/components/controls/CheckBox.svelte.d.ts +6 -0
- package/dist/components/controls/FederatedSignIn.svelte +143 -0
- package/dist/components/controls/FederatedSignIn.svelte.d.ts +3 -0
- package/dist/components/controls/ForceNewPasswordFormFields.svelte +5 -0
- package/dist/components/controls/ForceNewPasswordFormFields.svelte.d.ts +18 -0
- package/dist/components/controls/PasswordField.svelte +119 -0
- package/dist/components/controls/PasswordField.svelte.d.ts +14 -0
- package/dist/components/controls/SignUpFormFields.svelte +5 -0
- package/dist/components/controls/SignUpFormFields.svelte.d.ts +18 -0
- package/dist/components/controls/TextField.svelte +46 -0
- package/dist/components/controls/TextField.svelte.d.ts +15 -0
- package/dist/components/controls/index.d.ts +8 -0
- package/dist/components/controls/index.js +8 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +4 -0
- package/dist/components/primitives/Alert.svelte +61 -0
- package/dist/components/primitives/Alert.svelte.d.ts +7 -0
- package/dist/components/primitives/Box.svelte +9 -0
- package/dist/components/primitives/Box.svelte.d.ts +4 -0
- package/dist/components/primitives/FederatedSignInButton.svelte +27 -0
- package/dist/components/primitives/FederatedSignInButton.svelte.d.ts +7 -0
- package/dist/components/primitives/FieldSet.svelte +9 -0
- package/dist/components/primitives/FieldSet.svelte.d.ts +4 -0
- package/dist/components/primitives/Footer.svelte +9 -0
- package/dist/components/primitives/Footer.svelte.d.ts +4 -0
- package/dist/components/primitives/Form.svelte +9 -0
- package/dist/components/primitives/Form.svelte.d.ts +4 -0
- package/dist/components/primitives/FormField.svelte +72 -0
- package/dist/components/primitives/FormField.svelte.d.ts +8 -0
- package/dist/components/primitives/FormFields.svelte +29 -0
- package/dist/components/primitives/FormFields.svelte.d.ts +7 -0
- package/dist/components/primitives/Heading.svelte +13 -0
- package/dist/components/primitives/Heading.svelte.d.ts +7 -0
- package/dist/components/primitives/Input.svelte +20 -0
- package/dist/components/primitives/Input.svelte.d.ts +7 -0
- package/dist/components/primitives/Label.svelte +9 -0
- package/dist/components/primitives/Label.svelte.d.ts +4 -0
- package/dist/components/primitives/Select.svelte +28 -0
- package/dist/components/primitives/Select.svelte.d.ts +9 -0
- package/dist/components/primitives/Spacer.svelte +7 -0
- package/dist/components/primitives/Spacer.svelte.d.ts +5 -0
- package/dist/components/primitives/Text.svelte +9 -0
- package/dist/components/primitives/Text.svelte.d.ts +4 -0
- package/dist/components/primitives/TwoTabItem.svelte +26 -0
- package/dist/components/primitives/TwoTabItem.svelte.d.ts +9 -0
- package/dist/components/primitives/TwoTabs.svelte +19 -0
- package/dist/components/primitives/TwoTabs.svelte.d.ts +5 -0
- package/dist/components/primitives/Wrapper.svelte +9 -0
- package/dist/components/primitives/Wrapper.svelte.d.ts +4 -0
- package/dist/components/primitives/index.d.ts +17 -0
- package/dist/components/primitives/index.js +17 -0
- package/dist/index.d.ts +7 -3
- package/dist/index.js +8 -3
- package/dist/stores/authenticator.svelte.d.ts +18 -0
- package/dist/stores/authenticator.svelte.js +88 -0
- package/dist/styles/authenticator.css +13 -0
- package/dist/styles/index.js +3 -0
- package/dist/styles.css +2 -2827
- package/dist/types/index.d.ts +21 -0
- package/dist/types/index.js +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +1 -0
- package/package.json +59 -50
- package/LICENSE +0 -201
- package/dist/LICENSE +0 -201
- package/dist/README.md +0 -38
- package/dist/components/Authenticator.svelte +0 -43
- package/dist/components/Authenticator.svelte.d.ts +0 -22
- package/dist/components/SignIn.svelte +0 -69
- package/dist/components/SignIn.svelte.d.ts +0 -14
- package/dist/components/UserNameAlias.svelte +0 -29
- package/dist/components/UserNameAlias.svelte.d.ts +0 -19
- package/dist/components/authStore.d.ts +0 -20
- package/dist/components/authStore.js +0 -101
- package/dist/components/primitives/AmplifyButton.svelte +0 -23
- package/dist/components/primitives/AmplifyButton.svelte.d.ts +0 -25
- package/dist/components/primitives/AmplifyError.svelte +0 -46
- package/dist/components/primitives/AmplifyError.svelte.d.ts +0 -16
- package/dist/components/primitives/AmplifyFormField.svelte +0 -121
- package/dist/components/primitives/AmplifyFormField.svelte.d.ts +0 -25
- package/dist/components/primitives/AmplifyFormSelect.svelte +0 -38
- package/dist/components/primitives/AmplifyFormSelect.svelte.d.ts +0 -20
- package/dist/components/primitives/AmplifyPasswordField.svelte +0 -75
- package/dist/components/primitives/AmplifyPasswordField.svelte.d.ts +0 -26
- package/dist/components/primitives/AmplifyPhoneNumberField.svelte +0 -50
- package/dist/components/primitives/AmplifyPhoneNumberField.svelte.d.ts +0 -27
- package/dist/components/primitives/AmplifyTabItem.svelte.d.ts +0 -19
- package/dist/components/primitives/AmplifyTabs.svelte +0 -50
- package/dist/components/primitives/AmplifyTabs.svelte.d.ts +0 -14
- package/dist/components/primitives/AmplifyTextField.svelte +0 -31
- package/dist/components/primitives/AmplifyTextField.svelte.d.ts +0 -28
- package/dist/package.json +0 -65
- /package/dist/{components/primitives/AmplifyTabItem.svelte → styles/index.d.ts} +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Authenticator from './Authenticator.svelte';
|
|
2
|
+
import ConfirmResetPassword from './ConfirmResetPassword.svelte';
|
|
3
|
+
import ConfirmSignIn from './ConfirmSignIn.svelte';
|
|
4
|
+
import ConfirmSignUp from './ConfirmSignUp.svelte';
|
|
5
|
+
import ConfirmVerifyUser from './ConfirmVerifyUser.svelte';
|
|
6
|
+
import ForceNewPassword from './ForceNewPassword.svelte';
|
|
7
|
+
import ForgotPassword from './ForgotPassword.svelte';
|
|
8
|
+
import SelectMfaType from './SelectMfaType.svelte';
|
|
9
|
+
import SetupEmail from './SetupEmail.svelte';
|
|
10
|
+
import SetupTotp from './SetupTotp.svelte';
|
|
11
|
+
import SignIn from './SignIn.svelte';
|
|
12
|
+
import SignUp from './SignUp.svelte';
|
|
13
|
+
import VerifyUser from './VerifyUser.svelte';
|
|
14
|
+
export { Authenticator, ConfirmResetPassword, ConfirmSignIn, ConfirmSignUp, ConfirmVerifyUser, ForceNewPassword, ForgotPassword, SelectMfaType, SetupEmail, SetupTotp, SignIn, SignUp, VerifyUser, };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Authenticator from './Authenticator.svelte';
|
|
2
|
+
import ConfirmResetPassword from './ConfirmResetPassword.svelte';
|
|
3
|
+
import ConfirmSignIn from './ConfirmSignIn.svelte';
|
|
4
|
+
import ConfirmSignUp from './ConfirmSignUp.svelte';
|
|
5
|
+
import ConfirmVerifyUser from './ConfirmVerifyUser.svelte';
|
|
6
|
+
import ForceNewPassword from './ForceNewPassword.svelte';
|
|
7
|
+
import ForgotPassword from './ForgotPassword.svelte';
|
|
8
|
+
import SelectMfaType from './SelectMfaType.svelte';
|
|
9
|
+
import SetupEmail from './SetupEmail.svelte';
|
|
10
|
+
import SetupTotp from './SetupTotp.svelte';
|
|
11
|
+
import SignIn from './SignIn.svelte';
|
|
12
|
+
import SignUp from './SignUp.svelte';
|
|
13
|
+
import VerifyUser from './VerifyUser.svelte';
|
|
14
|
+
export { Authenticator, ConfirmResetPassword, ConfirmSignIn, ConfirmSignUp, ConfirmVerifyUser, ForceNewPassword, ForgotPassword, SelectMfaType, SetupEmail, SetupTotp, SignIn, SignUp, VerifyUser, };
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { type FullAutoFill } from 'svelte/elements';
|
|
3
|
+
import { Input, Label, Select, Wrapper } from '../primitives';
|
|
4
|
+
|
|
5
|
+
interface PropsInterface {
|
|
6
|
+
label: string;
|
|
7
|
+
name: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
autocomplete?: FullAutoFill;
|
|
10
|
+
labelHidden?: boolean;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
dialCode?: string;
|
|
13
|
+
dialCodeList?: Array<string>;
|
|
14
|
+
type?: string;
|
|
15
|
+
hasError?: boolean;
|
|
16
|
+
describedBy?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const {
|
|
20
|
+
label = 'Username',
|
|
21
|
+
name = 'username',
|
|
22
|
+
placeholder = '',
|
|
23
|
+
autocomplete = '',
|
|
24
|
+
labelHidden,
|
|
25
|
+
required = true,
|
|
26
|
+
dialCode,
|
|
27
|
+
dialCodeList,
|
|
28
|
+
type = 'text',
|
|
29
|
+
hasError,
|
|
30
|
+
describedBy,
|
|
31
|
+
}: PropsInterface = $props();
|
|
32
|
+
|
|
33
|
+
const random = Math.floor(Math.random() * 999999);
|
|
34
|
+
const randomPhone = Math.floor(Math.random() * 999999);
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<Wrapper
|
|
38
|
+
class="amplify-flex amplify-field amplify-textfield amplify-phonenumberfield"
|
|
39
|
+
>
|
|
40
|
+
<Label
|
|
41
|
+
for={`amplify-field-${random}`}
|
|
42
|
+
class={['amplify-label', labelHidden && 'amplify-visually-hidden']}
|
|
43
|
+
>
|
|
44
|
+
{label}
|
|
45
|
+
</Label>
|
|
46
|
+
<Wrapper class="amplify-flex amplify-field-group">
|
|
47
|
+
{#if type === 'tel'}
|
|
48
|
+
<Wrapper class="amplify-field-group__outer-start">
|
|
49
|
+
<Wrapper
|
|
50
|
+
class="amplify-flex amplify-field amplify-selectfield amplify-countrycodeselect amplify-dialcodeselect amplify-authenticator__column"
|
|
51
|
+
>
|
|
52
|
+
<Label
|
|
53
|
+
for={`amplify-field-${randomPhone}`}
|
|
54
|
+
class="amplify-label amplify-visually-hidden"
|
|
55
|
+
>
|
|
56
|
+
Country Code
|
|
57
|
+
</Label>
|
|
58
|
+
<Wrapper class="amplify-select__wrapper">
|
|
59
|
+
<Select
|
|
60
|
+
class="amplify-select amplify-field-group__control"
|
|
61
|
+
id={`amplify-field-${randomPhone}`}
|
|
62
|
+
autocomplete="tel-country-code"
|
|
63
|
+
aria-label="country code"
|
|
64
|
+
name="country_code"
|
|
65
|
+
options={dialCodeList}
|
|
66
|
+
selectValue={dialCode}
|
|
67
|
+
/>
|
|
68
|
+
<Wrapper class="amplify-flex amplify-select__icon">
|
|
69
|
+
<svg
|
|
70
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
71
|
+
fill="currentColor"
|
|
72
|
+
viewBox="0 0 24 24"
|
|
73
|
+
class="amplify-icon"
|
|
74
|
+
>
|
|
75
|
+
<path d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"></path>
|
|
76
|
+
</svg>
|
|
77
|
+
</Wrapper>
|
|
78
|
+
</Wrapper>
|
|
79
|
+
</Wrapper>
|
|
80
|
+
</Wrapper>
|
|
81
|
+
{/if}
|
|
82
|
+
<Wrapper class="amplify-field-group__field-wrapper">
|
|
83
|
+
<!--Phone input-->
|
|
84
|
+
<Input
|
|
85
|
+
class="amplify-input amplify-field-group__control"
|
|
86
|
+
id={`amplify-field-${random}`}
|
|
87
|
+
{autocomplete}
|
|
88
|
+
{name}
|
|
89
|
+
{required}
|
|
90
|
+
{type}
|
|
91
|
+
{placeholder}
|
|
92
|
+
aria-invalid={hasError}
|
|
93
|
+
aria-describedby={describedBy}
|
|
94
|
+
autocapitalize="off"
|
|
95
|
+
/>
|
|
96
|
+
</Wrapper>
|
|
97
|
+
</Wrapper>
|
|
98
|
+
</Wrapper>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type FullAutoFill } from 'svelte/elements';
|
|
2
|
+
interface PropsInterface {
|
|
3
|
+
label: string;
|
|
4
|
+
name: string;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
autocomplete?: FullAutoFill;
|
|
7
|
+
labelHidden?: boolean;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
dialCode?: string;
|
|
10
|
+
dialCodeList?: Array<string>;
|
|
11
|
+
type?: string;
|
|
12
|
+
hasError?: boolean;
|
|
13
|
+
describedBy?: string;
|
|
14
|
+
}
|
|
15
|
+
declare const AliasField: import("svelte").Component<PropsInterface, {}, "">;
|
|
16
|
+
type AliasField = ReturnType<typeof AliasField>;
|
|
17
|
+
export default AliasField;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { type HTMLButtonAttributes } from 'svelte/elements';
|
|
3
|
+
|
|
4
|
+
interface PropsInterface extends HTMLButtonAttributes {
|
|
5
|
+
type?: 'submit' | 'button';
|
|
6
|
+
fullWidth?: boolean | string;
|
|
7
|
+
size?: 'small' | 'medium' | 'large';
|
|
8
|
+
variation?: 'primary' | 'default' | 'link';
|
|
9
|
+
fontWeight?: 'normal' | 'bold' | 'lighter';
|
|
10
|
+
loading?: boolean | string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const {
|
|
15
|
+
type,
|
|
16
|
+
fullWidth,
|
|
17
|
+
size,
|
|
18
|
+
variation,
|
|
19
|
+
fontWeight,
|
|
20
|
+
loading,
|
|
21
|
+
disabled,
|
|
22
|
+
children,
|
|
23
|
+
style,
|
|
24
|
+
...rest
|
|
25
|
+
}: PropsInterface = $props();
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<button
|
|
29
|
+
{...rest}
|
|
30
|
+
class={{
|
|
31
|
+
'amplify-button': true,
|
|
32
|
+
'amplify-field-group__control': true,
|
|
33
|
+
[`amplify-button--${variation}`]: variation,
|
|
34
|
+
[`amplify-button--${size}`]: size,
|
|
35
|
+
'amplify-button--fullwidth': fullWidth,
|
|
36
|
+
'amplify-button--loading': loading,
|
|
37
|
+
'amplify-button--disabled': disabled,
|
|
38
|
+
}}
|
|
39
|
+
{type}
|
|
40
|
+
style={`fontWeight: ${fontWeight || 'normal'} ${style}`}
|
|
41
|
+
data-fullwidth={fullWidth}
|
|
42
|
+
data-size={size}
|
|
43
|
+
data-fontWeight={fontWeight}
|
|
44
|
+
data-variation={variation}
|
|
45
|
+
data-loading={loading}
|
|
46
|
+
data-disabled={disabled}
|
|
47
|
+
{disabled}
|
|
48
|
+
data-amplify-button=""
|
|
49
|
+
>
|
|
50
|
+
{@render children?.()}
|
|
51
|
+
</button>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type HTMLButtonAttributes } from 'svelte/elements';
|
|
2
|
+
interface PropsInterface extends HTMLButtonAttributes {
|
|
3
|
+
type?: 'submit' | 'button';
|
|
4
|
+
fullWidth?: boolean | string;
|
|
5
|
+
size?: 'small' | 'medium' | 'large';
|
|
6
|
+
variation?: 'primary' | 'default' | 'link';
|
|
7
|
+
fontWeight?: 'normal' | 'bold' | 'lighter';
|
|
8
|
+
loading?: boolean | string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const Button: import("svelte").Component<PropsInterface, {}, "">;
|
|
12
|
+
type Button = ReturnType<typeof Button>;
|
|
13
|
+
export default Button;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { translate } from '@aws-amplify/ui';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
errorMessage?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const { errorMessage = '' }: Props = $props();
|
|
9
|
+
let checked = $state(false);
|
|
10
|
+
const checkboxLabel = translate('I agree with the Terms and Conditions');
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div class="amplify-flex amplify-field amplify-checkboxfield">
|
|
14
|
+
<label class="amplify-flex amplify-checkbox">
|
|
15
|
+
<span class="amplify-visually-hidden">
|
|
16
|
+
<input
|
|
17
|
+
bind:checked
|
|
18
|
+
class="amplify-input amplify-field-group__control amplify-checkbox__input"
|
|
19
|
+
aria-invalid="false"
|
|
20
|
+
type="checkbox"
|
|
21
|
+
name="acknowledgement"
|
|
22
|
+
value="yes"
|
|
23
|
+
/>
|
|
24
|
+
</span>
|
|
25
|
+
<span
|
|
26
|
+
class={[
|
|
27
|
+
'amplify-flex amplify-checkbox__button',
|
|
28
|
+
!checked && 'amplify-checkbox__button--error',
|
|
29
|
+
]}
|
|
30
|
+
aria-hidden="true"
|
|
31
|
+
data-focus="false"
|
|
32
|
+
data-error={!checked}
|
|
33
|
+
data-checked={checked}
|
|
34
|
+
>
|
|
35
|
+
<svg
|
|
36
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
37
|
+
class={{
|
|
38
|
+
'amplify-icon amplify-checkbox__icon': true,
|
|
39
|
+
'amplify-checkbox__icon--checked': checked,
|
|
40
|
+
}}
|
|
41
|
+
viewBox="0 0 24 24"
|
|
42
|
+
fill="currentColor"
|
|
43
|
+
data-checked={checked}
|
|
44
|
+
>
|
|
45
|
+
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"></path>
|
|
46
|
+
</svg>
|
|
47
|
+
</span>
|
|
48
|
+
<span class="amplify-text amplify-checkbox__label">
|
|
49
|
+
{checkboxLabel}
|
|
50
|
+
</span>
|
|
51
|
+
</label>
|
|
52
|
+
{#if !checked}
|
|
53
|
+
<p class="amplify-text amplify-field__error-message">
|
|
54
|
+
{errorMessage}
|
|
55
|
+
</p>
|
|
56
|
+
{/if}
|
|
57
|
+
</div>
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { FederatedSignInButton, Wrapper } from '../primitives';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
authenticatorTextUtil,
|
|
6
|
+
FederatedIdentityProviders,
|
|
7
|
+
} from '@aws-amplify/ui';
|
|
8
|
+
import { useAuthenticator } from '../../stores/authenticator.svelte.js';
|
|
9
|
+
|
|
10
|
+
const { authenticator } = $derived(useAuthenticator());
|
|
11
|
+
|
|
12
|
+
const includeAmazon = $derived(
|
|
13
|
+
authenticator.socialProviders?.includes('amazon')
|
|
14
|
+
);
|
|
15
|
+
const includeApple = $derived(
|
|
16
|
+
authenticator.socialProviders?.includes('apple')
|
|
17
|
+
);
|
|
18
|
+
const includeFacebook = $derived(
|
|
19
|
+
authenticator.socialProviders?.includes('facebook')
|
|
20
|
+
);
|
|
21
|
+
const includeGoogle = $derived(
|
|
22
|
+
authenticator.socialProviders?.includes('google')
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const shouldShowFederatedSignIn = $derived(
|
|
26
|
+
includeFacebook || includeGoogle || includeAmazon || includeApple
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
// Text Util
|
|
30
|
+
const { getSignInWithFederationText, getOrText } = authenticatorTextUtil;
|
|
31
|
+
|
|
32
|
+
// Computed Properties
|
|
33
|
+
const fp = $derived.by(() => FederatedIdentityProviders);
|
|
34
|
+
const signInWithAmazon = $derived.by(() =>
|
|
35
|
+
getSignInWithFederationText(authenticator.route, 'amazon')
|
|
36
|
+
);
|
|
37
|
+
const signInWithApple = $derived.by(() =>
|
|
38
|
+
getSignInWithFederationText(authenticator.route, 'apple')
|
|
39
|
+
);
|
|
40
|
+
const signInWithFacebook = $derived.by(() =>
|
|
41
|
+
getSignInWithFederationText(authenticator.route, 'facebook')
|
|
42
|
+
);
|
|
43
|
+
const signInWithGoogle = $derived.by(() =>
|
|
44
|
+
getSignInWithFederationText(authenticator.route, 'google')
|
|
45
|
+
);
|
|
46
|
+
const orText = $derived.by(() => getOrText());
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
{#if shouldShowFederatedSignIn}
|
|
50
|
+
<Wrapper class="amplify-flex amplify-authenticator__federated-buttons">
|
|
51
|
+
{#if includeAmazon}
|
|
52
|
+
<FederatedSignInButton provider={fp.Amazon}>
|
|
53
|
+
<svg
|
|
54
|
+
aria-label="Amazon icon"
|
|
55
|
+
class="amplify-icon"
|
|
56
|
+
viewBox="0 0 248 268"
|
|
57
|
+
>
|
|
58
|
+
<path
|
|
59
|
+
d="M139.056521,147.024612 C133.548808,156.744524 124.782731,162.726926 115.087401,162.726926 C101.790721,162.726926 93.9937779,152.612964 93.9937779,137.68681 C93.9937779,108.224571 120.447551,102.879017 145.533369,102.879017 L145.533369,110.365976 C145.533369,123.831358 145.876354,135.063787 139.056521,147.024612 M207.206992,162.579655 C209.400505,165.692256 209.887066,169.437725 207.063416,171.770186 C199.996315,177.653081 187.429476,188.590967 180.513926,194.716661 L180.46208,194.621133 C178.176838,196.663031 174.862638,196.810303 172.27828,195.445057 C160.780281,185.9162 158.686473,181.494078 152.405048,172.403055 C133.405233,191.751331 119.909143,197.534719 95.309886,197.534719 C66.1281801,197.534719 43.4791563,179.599451 43.4791563,143.669212 C43.4791563,115.616003 58.6782107,96.5105248 80.4019706,87.1727225 C99.2063636,78.9096034 125.464714,77.4528107 145.533369,75.1641337 L145.533369,70.694248 C145.533369,62.4749122 146.167493,52.7510201 141.297893,45.6541312 C137.110277,39.2856386 129.018206,36.6586354 121.859376,36.6586354 C108.658413,36.6586354 96.9171331,43.4171982 94.0416364,57.4199213 C93.4593582,60.532522 91.1701278,63.5933787 88.003492,63.7406501 L54.4387473,60.1424518 C51.6150972,59.5095829 48.4484614,57.2248862 49.2740201,52.8982915 C56.9712583,12.2553679 93.7983558,0 126.732964,0 C143.587124,0 165.606011,4.47386604 178.902691,17.2148315 C195.760839,32.917146 194.149604,53.8694866 194.149604,76.6726704 L194.149604,130.542157 C194.149604,146.734049 200.87372,153.830938 207.206992,162.579655 Z M233.826346,208.038962 C230.467669,203.683255 211.550709,205.9821 203.056405,206.998432 C200.470662,207.321077 200.076227,205.042397 202.406981,203.404973 C217.475208,192.664928 242.201125,195.766353 245.081698,199.363845 C247.966255,202.981502 244.336653,228.071183 230.172839,240.049379 C228.001452,241.888455 225.929671,240.904388 226.89783,238.468418 C230.077218,230.430525 237.204944,212.418868 233.826346,208.038962 Z M126.768855,264 C74.0234043,264 42.0764048,241.955028 17.7852554,217.541992 C12.9733903,212.705982 6.71799208,206.295994 3.31151296,200.690918 C1.90227474,198.372135 5.59096074,195.021875 8.0442063,196.84375 C38.2390146,219.267578 82.1011654,239.538304 125.529506,239.538304 C154.819967,239.538304 191.046475,227.469543 220.66851,214.867659 C225.146771,212.966167 225.146771,219.180222 224.511585,221.060516 C224.183264,222.03242 209.514625,236.221149 189.247207,247.047411 C170.304273,257.166172 146.397132,264 126.768855,264 Z"
|
|
60
|
+
fill="#FF9900"
|
|
61
|
+
></path>
|
|
62
|
+
</svg>
|
|
63
|
+
<span class="amplify-text">
|
|
64
|
+
{signInWithAmazon}
|
|
65
|
+
</span>
|
|
66
|
+
</FederatedSignInButton>
|
|
67
|
+
{/if}
|
|
68
|
+
{#if includeApple}
|
|
69
|
+
<FederatedSignInButton provider={fp.Apple}>
|
|
70
|
+
<svg
|
|
71
|
+
aria-label="Apple icon"
|
|
72
|
+
class="amplify-icon"
|
|
73
|
+
fill="#000"
|
|
74
|
+
preserveAspectRatio="xMidYMid"
|
|
75
|
+
stroke="#000"
|
|
76
|
+
stroke-width="0"
|
|
77
|
+
viewBox="0 0 1024 1024"
|
|
78
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
79
|
+
>
|
|
80
|
+
<path
|
|
81
|
+
d="M747.4 535.7c-.4-68.2 30.5-119.6 92.9-157.5-34.9-50-87.7-77.5-157.3-82.8-65.9-5.2-138 38.4-164.4 38.4-27.9 0-91.7-36.6-141.9-36.6C273.1 298.8 163 379.8 163 544.6c0 48.7 8.9 99 26.7 150.8 23.8 68.2 109.6 235.3 199.1 232.6 46.8-1.1 79.9-33.2 140.8-33.2 59.1 0 89.7 33.2 141.9 33.2 90.3-1.3 167.9-153.2 190.5-221.6-121.1-57.1-114.6-167.2-114.6-170.7zm-105.1-305c50.7-60.2 46.1-115 44.6-134.7-44.8 2.6-96.6 30.5-126.1 64.8-32.5 36.8-51.6 82.3-47.5 133.6 48.4 3.7 92.6-21.2 129-63.7z"
|
|
82
|
+
></path>
|
|
83
|
+
</svg>
|
|
84
|
+
<span class="amplify-text">
|
|
85
|
+
{signInWithApple}
|
|
86
|
+
</span>
|
|
87
|
+
</FederatedSignInButton>
|
|
88
|
+
{/if}
|
|
89
|
+
{#if includeFacebook}
|
|
90
|
+
<FederatedSignInButton provider={fp.Facebook}>
|
|
91
|
+
<svg
|
|
92
|
+
aria-label="Facebook icon"
|
|
93
|
+
class="amplify-icon"
|
|
94
|
+
viewBox="0 0 279 538"
|
|
95
|
+
>
|
|
96
|
+
<path
|
|
97
|
+
d="M82.3409742,538 L82.3409742,292.936652 L0,292.936652 L0,196.990154 L82.2410458,196.990154 L82.2410458,126.4295 C82.2410458,44.575144 132.205229,0 205.252865,0 C240.227794,0 270.306232,2.59855099 279,3.79788222 L279,89.2502322 L228.536175,89.2502322 C188.964542,89.2502322 181.270057,108.139699 181.270057,135.824262 L181.270057,196.89021 L276.202006,196.89021 L263.810888,292.836708 L181.16913,292.836708 L181.16913,538 L82.3409742,538 Z"
|
|
98
|
+
fill="#1877F2"
|
|
99
|
+
></path>
|
|
100
|
+
</svg>
|
|
101
|
+
<span class="amplify-text">
|
|
102
|
+
{signInWithFacebook}
|
|
103
|
+
</span>
|
|
104
|
+
</FederatedSignInButton>
|
|
105
|
+
{/if}
|
|
106
|
+
{#if includeGoogle}
|
|
107
|
+
<FederatedSignInButton provider={fp.Google}>
|
|
108
|
+
<svg
|
|
109
|
+
aria-label="Google icon"
|
|
110
|
+
class="amplify-icon"
|
|
111
|
+
viewBox="0 0 256 262"
|
|
112
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
113
|
+
preserveAspectRatio="xMidYMid"
|
|
114
|
+
>
|
|
115
|
+
<path
|
|
116
|
+
d="M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622 38.755 30.023 2.685.268c24.659-22.774 38.875-56.282 38.875-96.027"
|
|
117
|
+
fill="#4285F4"
|
|
118
|
+
></path>
|
|
119
|
+
<path
|
|
120
|
+
d="M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055-34.523 0-63.824-22.773-74.269-54.25l-1.531.13-40.298 31.187-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1"
|
|
121
|
+
fill="#34A853"
|
|
122
|
+
></path>
|
|
123
|
+
<path
|
|
124
|
+
d="M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82 0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602l42.356-32.782"
|
|
125
|
+
fill="#FBBC05"
|
|
126
|
+
></path>
|
|
127
|
+
<path
|
|
128
|
+
d="M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251"
|
|
129
|
+
fill="#EB4335"
|
|
130
|
+
></path>
|
|
131
|
+
</svg>
|
|
132
|
+
<span class="amplify-text">
|
|
133
|
+
{signInWithGoogle}
|
|
134
|
+
</span>
|
|
135
|
+
</FederatedSignInButton>
|
|
136
|
+
{/if}
|
|
137
|
+
<hr
|
|
138
|
+
class="amplify-divider amplify-divider--horizontal amplify-divider--small"
|
|
139
|
+
aria-orientation="horizontal"
|
|
140
|
+
data-label={orText}
|
|
141
|
+
/>
|
|
142
|
+
</Wrapper>
|
|
143
|
+
{/if}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const ForceNewPasswordFormFields: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type ForceNewPasswordFormFields = InstanceType<typeof ForceNewPasswordFormFields>;
|
|
18
|
+
export default ForceNewPasswordFormFields;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { ComponentClassName, translate } from '@aws-amplify/ui';
|
|
3
|
+
|
|
4
|
+
import { Input, Label, Wrapper } from '../primitives';
|
|
5
|
+
import { type FullAutoFill } from 'svelte/elements';
|
|
6
|
+
|
|
7
|
+
const showPassword = translate('Show password');
|
|
8
|
+
const hidePassword = translate('Hide password');
|
|
9
|
+
let showHideType = $state('password');
|
|
10
|
+
let showHideLabel = $state(showPassword);
|
|
11
|
+
|
|
12
|
+
const random = Math.floor(Math.random() * 999999);
|
|
13
|
+
|
|
14
|
+
interface PropsInterface {
|
|
15
|
+
name: string;
|
|
16
|
+
label: string;
|
|
17
|
+
autocomplete?: FullAutoFill;
|
|
18
|
+
hasError?: boolean;
|
|
19
|
+
labelHidden?: boolean;
|
|
20
|
+
placeholder?: string | null;
|
|
21
|
+
required?: boolean;
|
|
22
|
+
describedBy?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const {
|
|
26
|
+
name,
|
|
27
|
+
label,
|
|
28
|
+
autocomplete = 'new-password',
|
|
29
|
+
hasError = false,
|
|
30
|
+
labelHidden,
|
|
31
|
+
placeholder,
|
|
32
|
+
required = true,
|
|
33
|
+
describedBy,
|
|
34
|
+
}: PropsInterface = $props();
|
|
35
|
+
|
|
36
|
+
let password = $state('');
|
|
37
|
+
|
|
38
|
+
function togglePasswordText(): void {
|
|
39
|
+
showHideLabel =
|
|
40
|
+
showHideLabel === showPassword ? hidePassword : showPassword;
|
|
41
|
+
showHideType = showHideType === 'password' ? 'text' : 'password';
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const placeholderValue = translate(placeholder ?? label);
|
|
45
|
+
const labelValue = translate(label);
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<Wrapper
|
|
49
|
+
class={[
|
|
50
|
+
ComponentClassName.Flex,
|
|
51
|
+
ComponentClassName.Field,
|
|
52
|
+
ComponentClassName.TextField,
|
|
53
|
+
ComponentClassName.PasswordField,
|
|
54
|
+
]}
|
|
55
|
+
>
|
|
56
|
+
<Label
|
|
57
|
+
class={['amplify-label', labelHidden && 'amplify-visually-hidden']}
|
|
58
|
+
for={`amplify-field-${random}`}>{labelValue}</Label
|
|
59
|
+
>
|
|
60
|
+
<Wrapper class={[ComponentClassName.Flex, ComponentClassName.FieldGroup]}>
|
|
61
|
+
<Wrapper class={ComponentClassName.FieldGroupFieldWrapper}>
|
|
62
|
+
<Input
|
|
63
|
+
aria-describedby={describedBy}
|
|
64
|
+
aria-invalid={hasError}
|
|
65
|
+
autocapitalize="off"
|
|
66
|
+
{autocomplete}
|
|
67
|
+
bind:value={password}
|
|
68
|
+
class={[ComponentClassName.Input, ComponentClassName.FieldGroupControl]}
|
|
69
|
+
data-amplify-password="true"
|
|
70
|
+
id={`amplify-field-${random}`}
|
|
71
|
+
{name}
|
|
72
|
+
placeholder={placeholderValue}
|
|
73
|
+
required={required ?? true}
|
|
74
|
+
type={showHideType}
|
|
75
|
+
/>
|
|
76
|
+
</Wrapper>
|
|
77
|
+
<Wrapper class={ComponentClassName.FieldGroupOuterEnd}>
|
|
78
|
+
<button
|
|
79
|
+
aria-checked={showHideType !== 'password'}
|
|
80
|
+
aria-label={showHideLabel}
|
|
81
|
+
class={[
|
|
82
|
+
ComponentClassName.Button,
|
|
83
|
+
ComponentClassName.FieldGroupControl,
|
|
84
|
+
ComponentClassName.FieldShowPassword,
|
|
85
|
+
]}
|
|
86
|
+
data-fullwidth="false"
|
|
87
|
+
onclick={() => togglePasswordText()}
|
|
88
|
+
role="switch"
|
|
89
|
+
type="button"
|
|
90
|
+
>
|
|
91
|
+
{#if showHideType === 'password'}
|
|
92
|
+
<svg
|
|
93
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
94
|
+
viewBox="0 0 24 24"
|
|
95
|
+
class={ComponentClassName.Icon}
|
|
96
|
+
>
|
|
97
|
+
<path
|
|
98
|
+
d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"
|
|
99
|
+
></path>
|
|
100
|
+
</svg>
|
|
101
|
+
{:else}
|
|
102
|
+
<svg
|
|
103
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
104
|
+
viewBox="0 0 24 24"
|
|
105
|
+
class={ComponentClassName.Icon}
|
|
106
|
+
>
|
|
107
|
+
<path
|
|
108
|
+
d="M0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0z"
|
|
109
|
+
fill="none"
|
|
110
|
+
></path>
|
|
111
|
+
<path
|
|
112
|
+
d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"
|
|
113
|
+
></path>
|
|
114
|
+
</svg>
|
|
115
|
+
{/if}
|
|
116
|
+
</button>
|
|
117
|
+
</Wrapper>
|
|
118
|
+
</Wrapper>
|
|
119
|
+
</Wrapper>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type FullAutoFill } from 'svelte/elements';
|
|
2
|
+
interface PropsInterface {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
autocomplete?: FullAutoFill;
|
|
6
|
+
hasError?: boolean;
|
|
7
|
+
labelHidden?: boolean;
|
|
8
|
+
placeholder?: string | null;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
describedBy?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const PasswordField: import("svelte").Component<PropsInterface, {}, "">;
|
|
13
|
+
type PasswordField = ReturnType<typeof PasswordField>;
|
|
14
|
+
export default PasswordField;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const SignUpFormFields: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type SignUpFormFields = InstanceType<typeof SignUpFormFields>;
|
|
18
|
+
export default SignUpFormFields;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Input, Label, Wrapper } from '../primitives';
|
|
3
|
+
import { type FullAutoFill } from 'svelte/elements';
|
|
4
|
+
|
|
5
|
+
interface TextFields {
|
|
6
|
+
label?: string;
|
|
7
|
+
id?: string;
|
|
8
|
+
autocomplete?: FullAutoFill;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
required?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
name?: string;
|
|
13
|
+
type?: string;
|
|
14
|
+
hideLabel?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const {
|
|
18
|
+
label = '',
|
|
19
|
+
id = '',
|
|
20
|
+
autocomplete = '',
|
|
21
|
+
placeholder = '',
|
|
22
|
+
required = true,
|
|
23
|
+
disabled = false,
|
|
24
|
+
name = '',
|
|
25
|
+
type = 'text',
|
|
26
|
+
hideLabel = true,
|
|
27
|
+
}: TextFields = $props();
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<Label
|
|
31
|
+
class={['amplify-label', hideLabel && 'amplify-visually-hidden']}
|
|
32
|
+
for={id}>{label}</Label
|
|
33
|
+
>
|
|
34
|
+
<Wrapper class="amplify-field-group__field-wrapper">
|
|
35
|
+
<Input
|
|
36
|
+
class="amplify-input amplify-field-group__control"
|
|
37
|
+
{id}
|
|
38
|
+
aria-invalid="false"
|
|
39
|
+
{autocomplete}
|
|
40
|
+
{placeholder}
|
|
41
|
+
{required}
|
|
42
|
+
{name}
|
|
43
|
+
{disabled}
|
|
44
|
+
{type}
|
|
45
|
+
/>
|
|
46
|
+
</Wrapper>
|