@aws-amplify/ui-svelte 0.0.0-next-9a4f1cf-20220113211745 → 0.0.0-next-1e584a1-20251021081955
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/AmplifySignUpFormFields.svelte +0 -41
- package/dist/components/AmplifySignUpFormFields.svelte.d.ts +0 -14
- package/dist/components/Authenticator.svelte +0 -50
- package/dist/components/Authenticator.svelte.d.ts +0 -22
- package/dist/components/ConfirmSignUp.svelte +0 -87
- package/dist/components/ConfirmSignUp.svelte.d.ts +0 -14
- package/dist/components/FederatedSignIn.svelte.d.ts +0 -19
- package/dist/components/SignIn.svelte +0 -69
- package/dist/components/SignIn.svelte.d.ts +0 -14
- package/dist/components/SignUp.svelte +0 -45
- package/dist/components/SignUp.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 +0 -19
- package/dist/components/primitives/AmplifyTabItem.svelte.d.ts +0 -21
- package/dist/components/primitives/AmplifyTabs.svelte +0 -72
- package/dist/components/primitives/AmplifyTabs.svelte.d.ts +0 -26
- package/dist/components/primitives/AmplifyTextField.svelte +0 -31
- package/dist/components/primitives/AmplifyTextField.svelte.d.ts +0 -28
- package/dist/package.json +0 -69
- /package/dist/{components/FederatedSignIn.svelte → styles/index.d.ts} +0 -0
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
<script >import AmplifyPhoneNumberField from './AmplifyPhoneNumberField.svelte';
|
|
2
|
-
import AmplifyPasswordField from './AmplifyPasswordField.svelte';
|
|
3
|
-
import AmplifyTextField from './AmplifyTextField.svelte';
|
|
4
|
-
import AmplifyError from './AmplifyError.svelte';
|
|
5
|
-
import { authState, updateForm, updateBlur } from '../authStore';
|
|
6
|
-
import { authInputAttributes, getActorContext, translate, } from '@aws-amplify/ui';
|
|
7
|
-
import { onMount } from 'svelte';
|
|
8
|
-
export let name;
|
|
9
|
-
export let type;
|
|
10
|
-
export let required = true;
|
|
11
|
-
export let placeholder = '';
|
|
12
|
-
export let label = '';
|
|
13
|
-
export let initialValue = '';
|
|
14
|
-
export let disabled = false;
|
|
15
|
-
export let autocomplete = '';
|
|
16
|
-
export let labelHidden = true;
|
|
17
|
-
const getAttributeMap = () => authInputAttributes;
|
|
18
|
-
let defaultCountryCode;
|
|
19
|
-
onMount(() => {
|
|
20
|
-
if (isPhoneField) {
|
|
21
|
-
const state = $authState;
|
|
22
|
-
const { country_code } = getActorContext(state);
|
|
23
|
-
defaultCountryCode = country_code;
|
|
24
|
-
// TODO: remove this side-effect
|
|
25
|
-
updateForm({
|
|
26
|
-
name: 'country_code',
|
|
27
|
-
value: country_code,
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
const attributeMap = getAttributeMap();
|
|
32
|
-
let error;
|
|
33
|
-
$: {
|
|
34
|
-
const formContext = getActorContext($authState);
|
|
35
|
-
const { validationError } = formContext;
|
|
36
|
-
error = translate(validationError[name]);
|
|
37
|
-
}
|
|
38
|
-
function onBlur($event) {
|
|
39
|
-
let { name } = $event?.detail?.target;
|
|
40
|
-
updateBlur({ name });
|
|
41
|
-
}
|
|
42
|
-
let inferLabel;
|
|
43
|
-
$: {
|
|
44
|
-
const myLabel = label || attributeMap[name]?.label;
|
|
45
|
-
inferLabel = translate(myLabel);
|
|
46
|
-
}
|
|
47
|
-
let inferPlaceholder;
|
|
48
|
-
$: {
|
|
49
|
-
const myPlaceholder = placeholder || attributeMap[name]?.placeholder || inferLabel;
|
|
50
|
-
inferPlaceholder = translate(myPlaceholder);
|
|
51
|
-
}
|
|
52
|
-
// infers what the `type` of underlying input element should be.
|
|
53
|
-
let inferType;
|
|
54
|
-
$: {
|
|
55
|
-
inferType = type ?? attributeMap[name]?.type ?? 'text';
|
|
56
|
-
}
|
|
57
|
-
let inferAutocomplete;
|
|
58
|
-
$: {
|
|
59
|
-
inferAutocomplete = autocomplete || attributeMap[name]?.autocomplete;
|
|
60
|
-
}
|
|
61
|
-
// TODO(enhancement): use enum to differentiate special field types
|
|
62
|
-
let isPasswordField;
|
|
63
|
-
$: {
|
|
64
|
-
isPasswordField = inferType === 'password';
|
|
65
|
-
}
|
|
66
|
-
let isPhoneField;
|
|
67
|
-
isPhoneField = inferType === 'tel';
|
|
68
|
-
</script>
|
|
69
|
-
|
|
70
|
-
<div class="amplify-flex amplify-field" style="flex-direction: column">
|
|
71
|
-
<!-- Country code field -->
|
|
72
|
-
{#if isPhoneField}
|
|
73
|
-
<AmplifyPhoneNumberField
|
|
74
|
-
{defaultCountryCode}
|
|
75
|
-
type={inferType}
|
|
76
|
-
{name}
|
|
77
|
-
label={inferLabel}
|
|
78
|
-
placeholder={inferPlaceholder}
|
|
79
|
-
{required}
|
|
80
|
-
{initialValue}
|
|
81
|
-
{disabled}
|
|
82
|
-
{labelHidden}
|
|
83
|
-
autocomplete={inferAutocomplete}
|
|
84
|
-
/>
|
|
85
|
-
{/if}
|
|
86
|
-
|
|
87
|
-
{#if isPasswordField}
|
|
88
|
-
<AmplifyPasswordField
|
|
89
|
-
{...$$restProps}
|
|
90
|
-
{name}
|
|
91
|
-
label={inferLabel}
|
|
92
|
-
placeholder={inferPlaceholder}
|
|
93
|
-
{required}
|
|
94
|
-
{initialValue}
|
|
95
|
-
{disabled}
|
|
96
|
-
{labelHidden}
|
|
97
|
-
autocomplete={inferAutocomplete}
|
|
98
|
-
/>
|
|
99
|
-
{/if}
|
|
100
|
-
|
|
101
|
-
{#if !isPasswordField && !isPhoneField}
|
|
102
|
-
<AmplifyTextField
|
|
103
|
-
on:blur={onBlur}
|
|
104
|
-
type={inferType}
|
|
105
|
-
{name}
|
|
106
|
-
label={inferLabel}
|
|
107
|
-
placeholder={inferPlaceholder}
|
|
108
|
-
{required}
|
|
109
|
-
{initialValue}
|
|
110
|
-
{disabled}
|
|
111
|
-
{labelHidden}
|
|
112
|
-
autocomplete={inferAutocomplete}
|
|
113
|
-
/>
|
|
114
|
-
{/if}
|
|
115
|
-
|
|
116
|
-
{#if error}
|
|
117
|
-
<AmplifyError>
|
|
118
|
-
{error}
|
|
119
|
-
</AmplifyError>
|
|
120
|
-
{/if}
|
|
121
|
-
</div>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
[x: string]: any;
|
|
5
|
-
name: string;
|
|
6
|
-
type: string;
|
|
7
|
-
required?: boolean;
|
|
8
|
-
placeholder?: string;
|
|
9
|
-
label?: string;
|
|
10
|
-
initialValue?: string;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
autocomplete?: string;
|
|
13
|
-
labelHidden?: boolean;
|
|
14
|
-
};
|
|
15
|
-
events: {
|
|
16
|
-
[evt: string]: CustomEvent<any>;
|
|
17
|
-
};
|
|
18
|
-
slots: {};
|
|
19
|
-
};
|
|
20
|
-
export declare type AmplifyFormFieldProps = typeof __propDef.props;
|
|
21
|
-
export declare type AmplifyFormFieldEvents = typeof __propDef.events;
|
|
22
|
-
export declare type AmplifyFormFieldSlots = typeof __propDef.slots;
|
|
23
|
-
export default class AmplifyFormField extends SvelteComponentTyped<AmplifyFormFieldProps, AmplifyFormFieldEvents, AmplifyFormFieldSlots> {
|
|
24
|
-
}
|
|
25
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
<script >export let items;
|
|
2
|
-
export let name;
|
|
3
|
-
export let label;
|
|
4
|
-
export let id;
|
|
5
|
-
export let defaultValue;
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<label class="amplify-label sr-only" for={id}>
|
|
9
|
-
{label}
|
|
10
|
-
</label>
|
|
11
|
-
<div class="amplify-select__wrapper">
|
|
12
|
-
<select
|
|
13
|
-
class="amplify-select amplify-field-group__control"
|
|
14
|
-
autocomplete="tel-country-code"
|
|
15
|
-
{id}
|
|
16
|
-
{name}
|
|
17
|
-
>
|
|
18
|
-
{#each items as item}
|
|
19
|
-
<option value={item} selected={item === defaultValue}>
|
|
20
|
-
{item}
|
|
21
|
-
</option>
|
|
22
|
-
{/each}
|
|
23
|
-
</select>
|
|
24
|
-
<div
|
|
25
|
-
class="amplify-flex amplify-select__icon-wrapper"
|
|
26
|
-
style="align-items: center; justify-content: center"
|
|
27
|
-
>
|
|
28
|
-
<svg
|
|
29
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
30
|
-
class="amplify-icon"
|
|
31
|
-
viewBox="0 0 24 24"
|
|
32
|
-
data-size="large"
|
|
33
|
-
fill="currentColor"
|
|
34
|
-
>
|
|
35
|
-
<path d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z" />
|
|
36
|
-
</svg>
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
items: string[];
|
|
5
|
-
name: string;
|
|
6
|
-
label: string;
|
|
7
|
-
id: string;
|
|
8
|
-
defaultValue: string;
|
|
9
|
-
};
|
|
10
|
-
events: {
|
|
11
|
-
[evt: string]: CustomEvent<any>;
|
|
12
|
-
};
|
|
13
|
-
slots: {};
|
|
14
|
-
};
|
|
15
|
-
export declare type AmplifyFormSelectProps = typeof __propDef.props;
|
|
16
|
-
export declare type AmplifyFormSelectEvents = typeof __propDef.events;
|
|
17
|
-
export declare type AmplifyFormSelectSlots = typeof __propDef.slots;
|
|
18
|
-
export default class AmplifyFormSelect extends SvelteComponentTyped<AmplifyFormSelectProps, AmplifyFormSelectEvents, AmplifyFormSelectSlots> {
|
|
19
|
-
}
|
|
20
|
-
export {};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
<script >import AmplifyButton from './AmplifyButton.svelte';
|
|
2
|
-
import { nanoid } from 'nanoid';
|
|
3
|
-
import { translate } from '@aws-amplify/ui';
|
|
4
|
-
export let autocomplete = 'new-password';
|
|
5
|
-
export let disabled = false;
|
|
6
|
-
export let fieldId = `amplify-field-${nanoid(12)}`;
|
|
7
|
-
export let initialValue = '';
|
|
8
|
-
export let label = '';
|
|
9
|
-
export let name;
|
|
10
|
-
export let placeholder = '';
|
|
11
|
-
export let required = true;
|
|
12
|
-
export let labelHidden = false;
|
|
13
|
-
export let type = 'password';
|
|
14
|
-
let showPassword = false;
|
|
15
|
-
let showPasswordButtonlabel = translate('Show password');
|
|
16
|
-
function togglePasswordText() {
|
|
17
|
-
showPassword = !showPassword;
|
|
18
|
-
showPasswordButtonlabel = showPassword
|
|
19
|
-
? translate('Show password')
|
|
20
|
-
: translate('Hide password');
|
|
21
|
-
type = showPassword ? 'text' : 'password';
|
|
22
|
-
}
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<label class="amplify-label {labelHidden ? 'sr-only' : ''}" for={fieldId}>
|
|
26
|
-
{label}
|
|
27
|
-
</label>
|
|
28
|
-
<div class="amplify-flex amplify-field-group">
|
|
29
|
-
<input
|
|
30
|
-
{...$$restProps}
|
|
31
|
-
class={`amplify-input amplify-field-group__control ${$$props.class ?? ''}`}
|
|
32
|
-
id={fieldId}
|
|
33
|
-
{type}
|
|
34
|
-
{name}
|
|
35
|
-
{placeholder}
|
|
36
|
-
{required}
|
|
37
|
-
value={initialValue}
|
|
38
|
-
{disabled}
|
|
39
|
-
{autocomplete}
|
|
40
|
-
/>
|
|
41
|
-
<div class="amplify-field-group__outer-end">
|
|
42
|
-
<AmplifyButton
|
|
43
|
-
amplify-button
|
|
44
|
-
aria-label={showPasswordButtonlabel}
|
|
45
|
-
class="amplify-field-group__control amplify-field__show-password"
|
|
46
|
-
on:click={togglePasswordText}
|
|
47
|
-
>
|
|
48
|
-
{#if !showPassword}
|
|
49
|
-
<svg
|
|
50
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
51
|
-
fill="currentColor"
|
|
52
|
-
viewBox="0 0 24 24"
|
|
53
|
-
class="amplify-icon"
|
|
54
|
-
>
|
|
55
|
-
<path
|
|
56
|
-
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"
|
|
57
|
-
/>
|
|
58
|
-
</svg>
|
|
59
|
-
{/if}
|
|
60
|
-
{#if showPassword}
|
|
61
|
-
<svg
|
|
62
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
63
|
-
fill="currentColor"
|
|
64
|
-
viewBox="0 0 24 24"
|
|
65
|
-
class="amplify-icon"
|
|
66
|
-
>
|
|
67
|
-
<path d="M0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0z" fill="none" />
|
|
68
|
-
<path
|
|
69
|
-
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"
|
|
70
|
-
/>
|
|
71
|
-
</svg>
|
|
72
|
-
{/if}
|
|
73
|
-
</AmplifyButton>
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
[x: string]: any;
|
|
5
|
-
autocomplete?: string;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
fieldId?: string;
|
|
8
|
-
initialValue?: string;
|
|
9
|
-
label?: string;
|
|
10
|
-
name: string;
|
|
11
|
-
placeholder?: string;
|
|
12
|
-
required?: boolean;
|
|
13
|
-
labelHidden?: boolean;
|
|
14
|
-
type?: 'text' | 'password';
|
|
15
|
-
};
|
|
16
|
-
events: {
|
|
17
|
-
[evt: string]: CustomEvent<any>;
|
|
18
|
-
};
|
|
19
|
-
slots: {};
|
|
20
|
-
};
|
|
21
|
-
export declare type AmplifyPasswordFieldProps = typeof __propDef.props;
|
|
22
|
-
export declare type AmplifyPasswordFieldEvents = typeof __propDef.events;
|
|
23
|
-
export declare type AmplifyPasswordFieldSlots = typeof __propDef.slots;
|
|
24
|
-
export default class AmplifyPasswordField extends SvelteComponentTyped<AmplifyPasswordFieldProps, AmplifyPasswordFieldEvents, AmplifyPasswordFieldSlots> {
|
|
25
|
-
}
|
|
26
|
-
export {};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
<script >import AmplifyFormSelect from './AmplifyFormSelect.svelte';
|
|
2
|
-
import { nanoid } from 'nanoid';
|
|
3
|
-
import { countryDialCodes } from '@aws-amplify/ui';
|
|
4
|
-
export let autocomplete = 'new-password';
|
|
5
|
-
export let disabled = false;
|
|
6
|
-
export let defaultCountryCode;
|
|
7
|
-
export let selectFieldId = `amplify-field-${nanoid(12)}`;
|
|
8
|
-
export let textFieldId = `amplify-field-${nanoid(12)}`;
|
|
9
|
-
export let initialValue = '';
|
|
10
|
-
export let label = '';
|
|
11
|
-
export let name;
|
|
12
|
-
export let placeholder = '';
|
|
13
|
-
export let required = true;
|
|
14
|
-
export let type;
|
|
15
|
-
export let labelHidden = false;
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
<label class="amplify-label {labelHidden ? 'sr-only' : ''}" for={textFieldId}>
|
|
19
|
-
{label}
|
|
20
|
-
</label>
|
|
21
|
-
<div class="amplify-flex amplify-phonenumberfield" amplify-field-group style="gap: 0px">
|
|
22
|
-
<div class="amplify-field-group__outer-start">
|
|
23
|
-
<div
|
|
24
|
-
class="
|
|
25
|
-
amplify-flex amplify-field amplify-selectfield amplify-countrycodeselect
|
|
26
|
-
"
|
|
27
|
-
style="flex-direction: column"
|
|
28
|
-
>
|
|
29
|
-
<AmplifyFormSelect
|
|
30
|
-
name="country_code"
|
|
31
|
-
label="Country Code"
|
|
32
|
-
id={selectFieldId}
|
|
33
|
-
items={countryDialCodes}
|
|
34
|
-
defaultValue={defaultCountryCode}
|
|
35
|
-
/>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
|
|
39
|
-
<input
|
|
40
|
-
class="amplify-input"
|
|
41
|
-
id={textFieldId}
|
|
42
|
-
{type}
|
|
43
|
-
{name}
|
|
44
|
-
{placeholder}
|
|
45
|
-
{required}
|
|
46
|
-
value={initialValue}
|
|
47
|
-
{disabled}
|
|
48
|
-
{autocomplete}
|
|
49
|
-
/>
|
|
50
|
-
</div>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
autocomplete?: string;
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
defaultCountryCode: string;
|
|
7
|
-
selectFieldId?: string;
|
|
8
|
-
textFieldId?: string;
|
|
9
|
-
initialValue?: string;
|
|
10
|
-
label?: string;
|
|
11
|
-
name: string;
|
|
12
|
-
placeholder?: string;
|
|
13
|
-
required?: boolean;
|
|
14
|
-
type: string;
|
|
15
|
-
labelHidden?: boolean;
|
|
16
|
-
};
|
|
17
|
-
events: {
|
|
18
|
-
[evt: string]: CustomEvent<any>;
|
|
19
|
-
};
|
|
20
|
-
slots: {};
|
|
21
|
-
};
|
|
22
|
-
export declare type AmplifyPhoneNumberFieldProps = typeof __propDef.props;
|
|
23
|
-
export declare type AmplifyPhoneNumberFieldEvents = typeof __propDef.events;
|
|
24
|
-
export declare type AmplifyPhoneNumberFieldSlots = typeof __propDef.slots;
|
|
25
|
-
export default class AmplifyPhoneNumberField extends SvelteComponentTyped<AmplifyPhoneNumberFieldProps, AmplifyPhoneNumberFieldEvents, AmplifyPhoneNumberFieldSlots> {
|
|
26
|
-
}
|
|
27
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<script >import 'svelte';
|
|
2
|
-
export let active = false;
|
|
3
|
-
export let id;
|
|
4
|
-
export let labelledById;
|
|
5
|
-
export let tabIndex;
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<div
|
|
9
|
-
data-orientation="horizontal"
|
|
10
|
-
role="tabpanel"
|
|
11
|
-
{id}
|
|
12
|
-
aria-labelledby={labelledById}
|
|
13
|
-
data-state={active ? 'active' : 'inactive'}
|
|
14
|
-
tabindex={tabIndex}
|
|
15
|
-
>
|
|
16
|
-
{#if active}
|
|
17
|
-
<slot />
|
|
18
|
-
{/if}
|
|
19
|
-
</div>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
active?: boolean;
|
|
5
|
-
id: string;
|
|
6
|
-
labelledById: string;
|
|
7
|
-
tabIndex: number;
|
|
8
|
-
};
|
|
9
|
-
events: {
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
};
|
|
12
|
-
slots: {
|
|
13
|
-
default: {};
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
export declare type AmplifyTabItemProps = typeof __propDef.props;
|
|
17
|
-
export declare type AmplifyTabItemEvents = typeof __propDef.events;
|
|
18
|
-
export declare type AmplifyTabItemSlots = typeof __propDef.slots;
|
|
19
|
-
export default class AmplifyTabItem extends SvelteComponentTyped<AmplifyTabItemProps, AmplifyTabItemEvents, AmplifyTabItemSlots> {
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
<script >import SignIn from '../SignIn.svelte';
|
|
2
|
-
import SignUp from '../SignUp.svelte';
|
|
3
|
-
import { toSignIn, toSignUp } from '../authStore';
|
|
4
|
-
//tab list
|
|
5
|
-
let tabs = [
|
|
6
|
-
{
|
|
7
|
-
active: true,
|
|
8
|
-
labelledById: '1',
|
|
9
|
-
id: '1',
|
|
10
|
-
title: 'Sign In',
|
|
11
|
-
tabIndex: 0,
|
|
12
|
-
component: SignIn,
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
active: false,
|
|
16
|
-
labelledById: '2',
|
|
17
|
-
id: '2',
|
|
18
|
-
title: 'Sign Up',
|
|
19
|
-
tabIndex: -1,
|
|
20
|
-
component: SignUp,
|
|
21
|
-
},
|
|
22
|
-
];
|
|
23
|
-
function handleTabClick(e) {
|
|
24
|
-
if (e.id === '1') {
|
|
25
|
-
toSignIn();
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
toSignUp();
|
|
29
|
-
}
|
|
30
|
-
tabs = tabs.map((tab) => {
|
|
31
|
-
if (tab.id === e.id) {
|
|
32
|
-
return { ...tab, active: true };
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
return { ...tab, active: false };
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
</script>
|
|
40
|
-
|
|
41
|
-
<div
|
|
42
|
-
tabindex="0"
|
|
43
|
-
aria-orientation="horizontal"
|
|
44
|
-
data-orientation="horizontal"
|
|
45
|
-
role="tablist"
|
|
46
|
-
style="outline: none"
|
|
47
|
-
>
|
|
48
|
-
<div
|
|
49
|
-
class="amplify-flex amplify-tabs"
|
|
50
|
-
data-indicator-position="top"
|
|
51
|
-
style="gap: 0px; justify-content: center"
|
|
52
|
-
>
|
|
53
|
-
{#each tabs as tab}
|
|
54
|
-
<div
|
|
55
|
-
class="amplify-tabs-item"
|
|
56
|
-
data-spacing="equal"
|
|
57
|
-
data-orientation="horizontal"
|
|
58
|
-
role="tab"
|
|
59
|
-
id={tab.labelledById}
|
|
60
|
-
tabindex={tab.active ? 0 : 1}
|
|
61
|
-
aria-selected={tab.active}
|
|
62
|
-
aria-controls={tab.id}
|
|
63
|
-
data-state={tab.active ? 'active' : 'inactive'}
|
|
64
|
-
on:click={() => handleTabClick(tab)}
|
|
65
|
-
>
|
|
66
|
-
{tab.title}
|
|
67
|
-
</div>
|
|
68
|
-
{/each}
|
|
69
|
-
</div>
|
|
70
|
-
</div>
|
|
71
|
-
|
|
72
|
-
<slot {tabs} />
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import SignIn from '../SignIn.svelte';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {};
|
|
5
|
-
events: {
|
|
6
|
-
[evt: string]: CustomEvent<any>;
|
|
7
|
-
};
|
|
8
|
-
slots: {
|
|
9
|
-
default: {
|
|
10
|
-
tabs: {
|
|
11
|
-
active: boolean;
|
|
12
|
-
labelledById: string;
|
|
13
|
-
id: string;
|
|
14
|
-
title: string;
|
|
15
|
-
tabIndex: number;
|
|
16
|
-
component: typeof SignIn;
|
|
17
|
-
}[];
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export declare type AmplifyTabsProps = typeof __propDef.props;
|
|
22
|
-
export declare type AmplifyTabsEvents = typeof __propDef.events;
|
|
23
|
-
export declare type AmplifyTabsSlots = typeof __propDef.slots;
|
|
24
|
-
export default class AmplifyTabs extends SvelteComponentTyped<AmplifyTabsProps, AmplifyTabsEvents, AmplifyTabsSlots> {
|
|
25
|
-
}
|
|
26
|
-
export {};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<script >import { createEventDispatcher } from 'svelte';
|
|
2
|
-
import { nanoid } from 'nanoid';
|
|
3
|
-
export let autocomplete = 'new-password';
|
|
4
|
-
export let disabled = false;
|
|
5
|
-
export let fieldId = `amplify-field-${nanoid(12)}`;
|
|
6
|
-
export let initialValue = '';
|
|
7
|
-
export let label = '';
|
|
8
|
-
export let name;
|
|
9
|
-
export let placeholder = '';
|
|
10
|
-
export let required = true;
|
|
11
|
-
export let type;
|
|
12
|
-
export let labelHidden = false;
|
|
13
|
-
const dispatch = createEventDispatcher();
|
|
14
|
-
</script>
|
|
15
|
-
|
|
16
|
-
<label class="amplify-label {labelHidden ? 'sr-only' : ''}" for={fieldId}>
|
|
17
|
-
{label}
|
|
18
|
-
</label>
|
|
19
|
-
<input
|
|
20
|
-
{...$$restProps}
|
|
21
|
-
on:blur={($event) => dispatch('blur', $event)}
|
|
22
|
-
class={`amplify-input ${$$props.class ?? ''}`}
|
|
23
|
-
id={fieldId}
|
|
24
|
-
{type}
|
|
25
|
-
{name}
|
|
26
|
-
{placeholder}
|
|
27
|
-
{required}
|
|
28
|
-
value={initialValue}
|
|
29
|
-
{disabled}
|
|
30
|
-
{autocomplete}
|
|
31
|
-
/>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
[x: string]: any;
|
|
5
|
-
autocomplete?: string;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
fieldId?: string;
|
|
8
|
-
initialValue?: string;
|
|
9
|
-
label?: string;
|
|
10
|
-
name: string;
|
|
11
|
-
placeholder?: string;
|
|
12
|
-
required?: boolean;
|
|
13
|
-
type: string;
|
|
14
|
-
labelHidden?: boolean;
|
|
15
|
-
};
|
|
16
|
-
events: {
|
|
17
|
-
blur: CustomEvent<any>;
|
|
18
|
-
} & {
|
|
19
|
-
[evt: string]: CustomEvent<any>;
|
|
20
|
-
};
|
|
21
|
-
slots: {};
|
|
22
|
-
};
|
|
23
|
-
export declare type AmplifyTextFieldProps = typeof __propDef.props;
|
|
24
|
-
export declare type AmplifyTextFieldEvents = typeof __propDef.events;
|
|
25
|
-
export declare type AmplifyTextFieldSlots = typeof __propDef.slots;
|
|
26
|
-
export default class AmplifyTextField extends SvelteComponentTyped<AmplifyTextFieldProps, AmplifyTextFieldEvents, AmplifyTextFieldSlots> {
|
|
27
|
-
}
|
|
28
|
-
export {};
|
package/dist/package.json
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@aws-amplify/ui-svelte",
|
|
3
|
-
"version": "0.0.1",
|
|
4
|
-
"type": "module",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"svelte": "dist/index.js",
|
|
7
|
-
"exports": {
|
|
8
|
-
"./package.json": "./package.json",
|
|
9
|
-
"./components/AmplifySignUpFormFields.svelte": "./components/AmplifySignUpFormFields.svelte",
|
|
10
|
-
"./components/Authenticator.svelte": "./components/Authenticator.svelte",
|
|
11
|
-
"./components/ConfirmSignUp.svelte": "./components/ConfirmSignUp.svelte",
|
|
12
|
-
"./components/FederatedSignIn.svelte": "./components/FederatedSignIn.svelte",
|
|
13
|
-
"./components/SignIn.svelte": "./components/SignIn.svelte",
|
|
14
|
-
"./components/SignUp.svelte": "./components/SignUp.svelte",
|
|
15
|
-
"./components/UserNameAlias.svelte": "./components/UserNameAlias.svelte",
|
|
16
|
-
"./components/authStore": "./components/authStore.js",
|
|
17
|
-
"./components/primitives/AmplifyButton.svelte": "./components/primitives/AmplifyButton.svelte",
|
|
18
|
-
"./components/primitives/AmplifyError.svelte": "./components/primitives/AmplifyError.svelte",
|
|
19
|
-
"./components/primitives/AmplifyFormField.svelte": "./components/primitives/AmplifyFormField.svelte",
|
|
20
|
-
"./components/primitives/AmplifyFormSelect.svelte": "./components/primitives/AmplifyFormSelect.svelte",
|
|
21
|
-
"./components/primitives/AmplifyPasswordField.svelte": "./components/primitives/AmplifyPasswordField.svelte",
|
|
22
|
-
"./components/primitives/AmplifyPhoneNumberField.svelte": "./components/primitives/AmplifyPhoneNumberField.svelte",
|
|
23
|
-
"./components/primitives/AmplifyTabItem.svelte": "./components/primitives/AmplifyTabItem.svelte",
|
|
24
|
-
"./components/primitives/AmplifyTabs.svelte": "./components/primitives/AmplifyTabs.svelte",
|
|
25
|
-
"./components/primitives/AmplifyTextField.svelte": "./components/primitives/AmplifyTextField.svelte",
|
|
26
|
-
".": {
|
|
27
|
-
"import": "./dist/index.js"
|
|
28
|
-
},
|
|
29
|
-
"./styles.css": "./dist/styles.css"
|
|
30
|
-
},
|
|
31
|
-
"browser": {
|
|
32
|
-
"./styles.css": "./dist/styles.css"
|
|
33
|
-
},
|
|
34
|
-
"files": [
|
|
35
|
-
"dist",
|
|
36
|
-
"LICENSE"
|
|
37
|
-
],
|
|
38
|
-
"devDependencies": {
|
|
39
|
-
"@sveltejs/adapter-auto": "next",
|
|
40
|
-
"@sveltejs/adapter-node": "^1.0.0-next.56",
|
|
41
|
-
"@sveltejs/adapter-static": "^1.0.0-next.23",
|
|
42
|
-
"@sveltejs/kit": "next",
|
|
43
|
-
"@typescript-eslint/eslint-plugin": "^4.31.1",
|
|
44
|
-
"@typescript-eslint/parser": "^4.31.1",
|
|
45
|
-
"eslint": "^7.32.0",
|
|
46
|
-
"eslint-config-prettier": "^8.3.0",
|
|
47
|
-
"eslint-plugin-svelte3": "^3.2.1",
|
|
48
|
-
"prettier": "^2.4.1",
|
|
49
|
-
"prettier-plugin-svelte": "^2.4.0",
|
|
50
|
-
"shx": "^0.3.3",
|
|
51
|
-
"svelte": "^3.44.0",
|
|
52
|
-
"svelte-check": "^2.2.6",
|
|
53
|
-
"svelte-preprocess": "^4.9.4",
|
|
54
|
-
"svelte2tsx": "^0.4.12",
|
|
55
|
-
"tslib": "^2.3.1",
|
|
56
|
-
"typescript": "^4.4.3"
|
|
57
|
-
},
|
|
58
|
-
"peerDependencies": {
|
|
59
|
-
"aws-amplify": "^4.2.2"
|
|
60
|
-
},
|
|
61
|
-
"dependencies": {
|
|
62
|
-
"@aws-amplify/ui": "3.0.6",
|
|
63
|
-
"@rollup/plugin-replace": "^3.0.0",
|
|
64
|
-
"nanoid": "^3.1.30",
|
|
65
|
-
"qrcode": "^1.5.0",
|
|
66
|
-
"svelte2tsx": "^0.4.12",
|
|
67
|
-
"xstate": "^4.26.1"
|
|
68
|
-
}
|
|
69
|
-
}
|
|
File without changes
|