@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.
Files changed (135) hide show
  1. package/README.md +132 -20
  2. package/dist/components/Authenticator/Authenticator.svelte +230 -0
  3. package/dist/components/Authenticator/Authenticator.svelte.d.ts +41 -0
  4. package/dist/components/Authenticator/ConfirmResetPassword.svelte +119 -0
  5. package/dist/components/Authenticator/ConfirmResetPassword.svelte.d.ts +7 -0
  6. package/dist/components/Authenticator/ConfirmSignIn.svelte +110 -0
  7. package/dist/components/Authenticator/ConfirmSignIn.svelte.d.ts +7 -0
  8. package/dist/components/Authenticator/ConfirmSignUp.svelte +127 -0
  9. package/dist/components/Authenticator/ConfirmSignUp.svelte.d.ts +7 -0
  10. package/dist/components/Authenticator/ConfirmVerifyUser.svelte +106 -0
  11. package/dist/components/Authenticator/ConfirmVerifyUser.svelte.d.ts +7 -0
  12. package/dist/components/Authenticator/ForceNewPassword.svelte +120 -0
  13. package/dist/components/Authenticator/ForceNewPassword.svelte.d.ts +7 -0
  14. package/dist/components/Authenticator/ForgotPassword.svelte +107 -0
  15. package/dist/components/Authenticator/ForgotPassword.svelte.d.ts +7 -0
  16. package/dist/components/Authenticator/SelectMfaType.svelte +145 -0
  17. package/dist/components/Authenticator/SelectMfaType.svelte.d.ts +7 -0
  18. package/dist/components/Authenticator/SetupEmail.svelte +103 -0
  19. package/dist/components/Authenticator/SetupEmail.svelte.d.ts +7 -0
  20. package/dist/components/Authenticator/SetupTotp.svelte +178 -0
  21. package/dist/components/Authenticator/SetupTotp.svelte.d.ts +7 -0
  22. package/dist/components/Authenticator/SignIn.svelte +112 -0
  23. package/dist/components/Authenticator/SignIn.svelte.d.ts +8 -0
  24. package/dist/components/Authenticator/SignUp.svelte +98 -0
  25. package/dist/components/Authenticator/SignUp.svelte.d.ts +8 -0
  26. package/dist/components/Authenticator/VerifyUser.svelte +160 -0
  27. package/dist/components/Authenticator/VerifyUser.svelte.d.ts +7 -0
  28. package/dist/components/Authenticator/index.d.ts +14 -0
  29. package/dist/components/Authenticator/index.js +14 -0
  30. package/dist/components/controls/AliasField.svelte +98 -0
  31. package/dist/components/controls/AliasField.svelte.d.ts +17 -0
  32. package/dist/components/controls/Button.svelte +51 -0
  33. package/dist/components/controls/Button.svelte.d.ts +13 -0
  34. package/dist/components/controls/CheckBox.svelte +57 -0
  35. package/dist/components/controls/CheckBox.svelte.d.ts +6 -0
  36. package/dist/components/controls/FederatedSignIn.svelte +143 -0
  37. package/dist/components/controls/FederatedSignIn.svelte.d.ts +3 -0
  38. package/dist/components/controls/ForceNewPasswordFormFields.svelte +5 -0
  39. package/dist/components/controls/ForceNewPasswordFormFields.svelte.d.ts +18 -0
  40. package/dist/components/controls/PasswordField.svelte +119 -0
  41. package/dist/components/controls/PasswordField.svelte.d.ts +14 -0
  42. package/dist/components/controls/SignUpFormFields.svelte +5 -0
  43. package/dist/components/controls/SignUpFormFields.svelte.d.ts +18 -0
  44. package/dist/components/controls/TextField.svelte +46 -0
  45. package/dist/components/controls/TextField.svelte.d.ts +15 -0
  46. package/dist/components/controls/index.d.ts +8 -0
  47. package/dist/components/controls/index.js +8 -0
  48. package/dist/components/index.d.ts +4 -0
  49. package/dist/components/index.js +4 -0
  50. package/dist/components/primitives/Alert.svelte +61 -0
  51. package/dist/components/primitives/Alert.svelte.d.ts +7 -0
  52. package/dist/components/primitives/Box.svelte +9 -0
  53. package/dist/components/primitives/Box.svelte.d.ts +4 -0
  54. package/dist/components/primitives/FederatedSignInButton.svelte +27 -0
  55. package/dist/components/primitives/FederatedSignInButton.svelte.d.ts +7 -0
  56. package/dist/components/primitives/FieldSet.svelte +9 -0
  57. package/dist/components/primitives/FieldSet.svelte.d.ts +4 -0
  58. package/dist/components/primitives/Footer.svelte +9 -0
  59. package/dist/components/primitives/Footer.svelte.d.ts +4 -0
  60. package/dist/components/primitives/Form.svelte +9 -0
  61. package/dist/components/primitives/Form.svelte.d.ts +4 -0
  62. package/dist/components/primitives/FormField.svelte +72 -0
  63. package/dist/components/primitives/FormField.svelte.d.ts +8 -0
  64. package/dist/components/primitives/FormFields.svelte +29 -0
  65. package/dist/components/primitives/FormFields.svelte.d.ts +7 -0
  66. package/dist/components/primitives/Heading.svelte +13 -0
  67. package/dist/components/primitives/Heading.svelte.d.ts +7 -0
  68. package/dist/components/primitives/Input.svelte +20 -0
  69. package/dist/components/primitives/Input.svelte.d.ts +7 -0
  70. package/dist/components/primitives/Label.svelte +9 -0
  71. package/dist/components/primitives/Label.svelte.d.ts +4 -0
  72. package/dist/components/primitives/Select.svelte +28 -0
  73. package/dist/components/primitives/Select.svelte.d.ts +9 -0
  74. package/dist/components/primitives/Spacer.svelte +7 -0
  75. package/dist/components/primitives/Spacer.svelte.d.ts +5 -0
  76. package/dist/components/primitives/Text.svelte +9 -0
  77. package/dist/components/primitives/Text.svelte.d.ts +4 -0
  78. package/dist/components/primitives/TwoTabItem.svelte +26 -0
  79. package/dist/components/primitives/TwoTabItem.svelte.d.ts +9 -0
  80. package/dist/components/primitives/TwoTabs.svelte +19 -0
  81. package/dist/components/primitives/TwoTabs.svelte.d.ts +5 -0
  82. package/dist/components/primitives/Wrapper.svelte +9 -0
  83. package/dist/components/primitives/Wrapper.svelte.d.ts +4 -0
  84. package/dist/components/primitives/index.d.ts +17 -0
  85. package/dist/components/primitives/index.js +17 -0
  86. package/dist/index.d.ts +7 -3
  87. package/dist/index.js +8 -3
  88. package/dist/stores/authenticator.svelte.d.ts +18 -0
  89. package/dist/stores/authenticator.svelte.js +88 -0
  90. package/dist/styles/authenticator.css +13 -0
  91. package/dist/styles/index.js +3 -0
  92. package/dist/styles.css +2 -2827
  93. package/dist/types/index.d.ts +21 -0
  94. package/dist/types/index.js +1 -0
  95. package/dist/version.d.ts +1 -0
  96. package/dist/version.js +1 -0
  97. package/package.json +59 -50
  98. package/LICENSE +0 -201
  99. package/dist/LICENSE +0 -201
  100. package/dist/README.md +0 -38
  101. package/dist/components/AmplifySignUpFormFields.svelte +0 -41
  102. package/dist/components/AmplifySignUpFormFields.svelte.d.ts +0 -14
  103. package/dist/components/Authenticator.svelte +0 -50
  104. package/dist/components/Authenticator.svelte.d.ts +0 -22
  105. package/dist/components/ConfirmSignUp.svelte +0 -87
  106. package/dist/components/ConfirmSignUp.svelte.d.ts +0 -14
  107. package/dist/components/FederatedSignIn.svelte.d.ts +0 -19
  108. package/dist/components/SignIn.svelte +0 -69
  109. package/dist/components/SignIn.svelte.d.ts +0 -14
  110. package/dist/components/SignUp.svelte +0 -45
  111. package/dist/components/SignUp.svelte.d.ts +0 -14
  112. package/dist/components/UserNameAlias.svelte +0 -29
  113. package/dist/components/UserNameAlias.svelte.d.ts +0 -19
  114. package/dist/components/authStore.d.ts +0 -20
  115. package/dist/components/authStore.js +0 -101
  116. package/dist/components/primitives/AmplifyButton.svelte +0 -23
  117. package/dist/components/primitives/AmplifyButton.svelte.d.ts +0 -25
  118. package/dist/components/primitives/AmplifyError.svelte +0 -46
  119. package/dist/components/primitives/AmplifyError.svelte.d.ts +0 -16
  120. package/dist/components/primitives/AmplifyFormField.svelte +0 -121
  121. package/dist/components/primitives/AmplifyFormField.svelte.d.ts +0 -25
  122. package/dist/components/primitives/AmplifyFormSelect.svelte +0 -38
  123. package/dist/components/primitives/AmplifyFormSelect.svelte.d.ts +0 -20
  124. package/dist/components/primitives/AmplifyPasswordField.svelte +0 -75
  125. package/dist/components/primitives/AmplifyPasswordField.svelte.d.ts +0 -26
  126. package/dist/components/primitives/AmplifyPhoneNumberField.svelte +0 -50
  127. package/dist/components/primitives/AmplifyPhoneNumberField.svelte.d.ts +0 -27
  128. package/dist/components/primitives/AmplifyTabItem.svelte +0 -19
  129. package/dist/components/primitives/AmplifyTabItem.svelte.d.ts +0 -21
  130. package/dist/components/primitives/AmplifyTabs.svelte +0 -72
  131. package/dist/components/primitives/AmplifyTabs.svelte.d.ts +0 -26
  132. package/dist/components/primitives/AmplifyTextField.svelte +0 -31
  133. package/dist/components/primitives/AmplifyTextField.svelte.d.ts +0 -28
  134. package/dist/package.json +0 -69
  135. /package/dist/{components/FederatedSignIn.svelte → styles/index.d.ts} +0 -0
@@ -1,50 +0,0 @@
1
- <script >import { onDestroy } from 'svelte';
2
- import { setupMachine, route, toSignIn } from './authStore';
3
- import AmplifyTabs from './primitives/AmplifyTabs.svelte';
4
- import AmplifyTabItem from './primitives/AmplifyTabItem.svelte';
5
- import ConfirmSignUp from './ConfirmSignUp.svelte';
6
- export let initialState = undefined;
7
- export let loginMechanisms = undefined;
8
- export let services = undefined;
9
- export let signUpAttributes = undefined;
10
- export let socialProviders = undefined;
11
- const _subscription = setupMachine(initialState, loginMechanisms, services, signUpAttributes, socialProviders);
12
- onDestroy(() => {
13
- if (_subscription)
14
- _subscription.unsubscribe();
15
- });
16
- </script>
17
-
18
- {#if $route !== 'authenticated'}
19
- <div data-amplify-authenticator>
20
- <div data-amplify-container>
21
- <!--Slot header goes here-->
22
- <div data-amplify-router>
23
- {#if $route === 'signIn' || $route === 'signUp'}
24
- <AmplifyTabs let:tabs>
25
- {#each tabs as tab}
26
- <AmplifyTabItem
27
- active={tab.active}
28
- id={tab.id}
29
- labelledById={tab.labelledById}
30
- tabIndex={tab.tabIndex}
31
- >
32
- <svelte:component this={tab.component} />
33
- </AmplifyTabItem>
34
- {/each}
35
- </AmplifyTabs>
36
- {/if}
37
- {#if $route === 'resetPassword'}
38
- <p>reset password</p>
39
- <button on:click={toSignIn}>To Sign In</button>
40
- {/if}
41
- {#if $route === 'confirmSignUp'}
42
- <ConfirmSignUp />
43
- {/if}
44
- </div>
45
- </div>
46
- </div>
47
- {/if}
48
- {#if $route === 'authenticated'}
49
- <slot />
50
- {/if}
@@ -1,22 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- initialState?: any;
5
- loginMechanisms?: any;
6
- services?: any;
7
- signUpAttributes?: any;
8
- socialProviders?: any;
9
- };
10
- events: {
11
- [evt: string]: CustomEvent<any>;
12
- };
13
- slots: {
14
- default: {};
15
- };
16
- };
17
- export declare type AuthenticatorProps = typeof __propDef.props;
18
- export declare type AuthenticatorEvents = typeof __propDef.events;
19
- export declare type AuthenticatorSlots = typeof __propDef.slots;
20
- export default class Authenticator extends SvelteComponentTyped<AuthenticatorProps, AuthenticatorEvents, AuthenticatorSlots> {
21
- }
22
- export {};
@@ -1,87 +0,0 @@
1
- <script >import { codeDeliveryDetails, updateForm, submitForm, resendCode, error, isPending, } from './authStore';
2
- import { translate } from '@aws-amplify/ui';
3
- import AmplifyFormField from './primitives/AmplifyFormField.svelte';
4
- import AmplifyButton from './primitives/AmplifyButton.svelte';
5
- import AmplifyError from './primitives/AmplifyError.svelte';
6
- // translated texts
7
- const resendCodeText = translate('Resend Code');
8
- const confirmText = translate('Confirm');
9
- let confirmSignUpHeading = '';
10
- let subtitleText = '';
11
- $: {
12
- const { DeliveryMedium = {} } = $codeDeliveryDetails;
13
- confirmSignUpHeading =
14
- DeliveryMedium === 'EMAIL'
15
- ? translate('We Emailed You')
16
- : DeliveryMedium === 'SMS'
17
- ? translate('We Texted You')
18
- : translate('We Sent A Code');
19
- }
20
- $: {
21
- const { DeliveryMedium, Destination } = $codeDeliveryDetails;
22
- subtitleText =
23
- DeliveryMedium === 'EMAIL'
24
- ? `Your code is on the way. To log in, enter the code we emailed to ${Destination}. It may take a minute to arrive.`
25
- : DeliveryMedium === 'SMS'
26
- ? `Your code is on the way. To log in, enter the code we texted to ${Destination}. It may take a minute to arrive.`
27
- : translate(`Your code is on the way. To log in, enter the code we sent you. It may take a minute to arrive.`);
28
- }
29
- function onInput(event) {
30
- event.preventDefault();
31
- const { name, value } = event.target;
32
- updateForm({ name, value });
33
- }
34
- function onSubmit(event) {
35
- event.preventDefault();
36
- submitForm();
37
- }
38
- </script>
39
-
40
- <div data-amplify-container>
41
- <form
42
- data-amplify-form
43
- on:submit|preventDefault={onSubmit}
44
- on:input={onInput}
45
- >
46
- <fieldset
47
- class="amplify-flex"
48
- style="flex-direction: column"
49
- data-amplify-fieldset
50
- disabled={$isPending}
51
- >
52
- <h3 class="amplify-heading" style="font-size: 1.5rem">
53
- {confirmSignUpHeading}
54
- </h3>
55
- <span style="margin-bottom: 1rem">
56
- {subtitleText}
57
- </span>
58
- <AmplifyFormField
59
- name="confirmation_code"
60
- type="text"
61
- autocomplete="one-time-code"
62
- />
63
-
64
- {#if $error}
65
- <AmplifyError>
66
- {$error}
67
- </AmplifyError>
68
- {/if}
69
-
70
- <AmplifyButton
71
- amplify-AmplifyButton
72
- variation="primary"
73
- fullWidth="true"
74
- type="submit"
75
- >
76
- {confirmText}
77
- </AmplifyButton>
78
- <AmplifyButton
79
- amplify-button
80
- fontWeight="normal"
81
- on:click={() => resendCode()}
82
- >
83
- {resendCodeText}
84
- </AmplifyButton>
85
- </fieldset>
86
- </form>
87
- </div>
@@ -1,14 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- declare const __propDef: {
3
- props: {};
4
- events: {
5
- [evt: string]: CustomEvent<any>;
6
- };
7
- slots: {};
8
- };
9
- export declare type ConfirmSignUpProps = typeof __propDef.props;
10
- export declare type ConfirmSignUpEvents = typeof __propDef.events;
11
- export declare type ConfirmSignUpSlots = typeof __propDef.slots;
12
- export default class ConfirmSignUp extends SvelteComponentTyped<ConfirmSignUpProps, ConfirmSignUpEvents, ConfirmSignUpSlots> {
13
- }
14
- export {};
@@ -1,19 +0,0 @@
1
- /** @typedef {typeof __propDef.props} FederatedSignInProps */
2
- /** @typedef {typeof __propDef.events} FederatedSignInEvents */
3
- /** @typedef {typeof __propDef.slots} FederatedSignInSlots */
4
- export default class FederatedSignIn extends SvelteComponentTyped<{}, {
5
- [evt: string]: CustomEvent<any>;
6
- }, {}> {
7
- }
8
- export type FederatedSignInProps = typeof __propDef.props;
9
- export type FederatedSignInEvents = typeof __propDef.events;
10
- export type FederatedSignInSlots = typeof __propDef.slots;
11
- import { SvelteComponentTyped } from "svelte";
12
- declare const __propDef: {
13
- props: {};
14
- events: {
15
- [evt: string]: CustomEvent<any>;
16
- };
17
- slots: {};
18
- };
19
- export {};
@@ -1,69 +0,0 @@
1
- <script >import AmplifyFormField from './primitives/AmplifyFormField.svelte';
2
- import AmplifyError from './primitives/AmplifyError.svelte';
3
- import UserNameAlias from './UserNameAlias.svelte';
4
- import AmplifyButton from './primitives/AmplifyButton.svelte';
5
- import { translate } from '@aws-amplify/ui';
6
- import { updateForm, submitForm, isPending, error, toResetPassword, } from './authStore';
7
- const forgotPasswordText = translate('Forgot your password? ');
8
- const signInButtonText = translate('Sign in');
9
- const signingButtonText = translate('Signing in');
10
- function onInput(event) {
11
- event.preventDefault();
12
- const { name, value } = event.target;
13
- updateForm({ name, value });
14
- }
15
- function onSubmit(event) {
16
- event.preventDefault();
17
- submitForm();
18
- }
19
- </script>
20
-
21
- <div data-amplify-container>
22
- <form
23
- data-amplify-form
24
- on:submit|preventDefault={onSubmit}
25
- on:input={onInput}
26
- >
27
- <fieldset
28
- class="amplify-flex"
29
- style="flex-direction: column"
30
- data-amplify-fieldset
31
- disabled={$isPending}
32
- >
33
- <UserNameAlias />
34
- <AmplifyFormField
35
- data-amplify-password
36
- name="password"
37
- type="password"
38
- autocomplete="current-password"
39
- />
40
- <AmplifyButton
41
- disabled={$isPending}
42
- variation="primary"
43
- fullWidth="true"
44
- type="submit"
45
- >
46
- {$isPending ? signingButtonText : signInButtonText}
47
- </AmplifyButton>
48
-
49
- {#if $error}
50
- <AmplifyError>
51
- {$error}
52
- </AmplifyError>
53
- {/if}
54
- </fieldset>
55
- </form>
56
-
57
- <div data-amplify-footer>
58
- <AmplifyButton
59
- amplify-button
60
- fontWeight="normal"
61
- data-size="small"
62
- variation="link"
63
- fullWidth="true"
64
- on:click={toResetPassword}
65
- >
66
- {forgotPasswordText}
67
- </AmplifyButton>
68
- </div>
69
- </div>
@@ -1,14 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- declare const __propDef: {
3
- props: {};
4
- events: {
5
- [evt: string]: CustomEvent<any>;
6
- };
7
- slots: {};
8
- };
9
- export declare type SignInProps = typeof __propDef.props;
10
- export declare type SignInEvents = typeof __propDef.events;
11
- export declare type SignInSlots = typeof __propDef.slots;
12
- export default class SignIn extends SvelteComponentTyped<SignInProps, SignInEvents, SignInSlots> {
13
- }
14
- export {};
@@ -1,45 +0,0 @@
1
- <script >import { updateForm, submitForm, error, isPending, hasValidationErrors, } from './authStore';
2
- import AmplifyError from './primitives/AmplifyError.svelte';
3
- import AmplifyButton from './primitives/AmplifyButton.svelte';
4
- import AmplifySignUpFormFields from './AmplifySignUpFormFields.svelte';
5
- import { translate } from '@aws-amplify/ui';
6
- const createAccountText = translate('Create Account');
7
- function onInput(event) {
8
- let { checked, name, type, value } = event.target;
9
- if (type === 'checkbox' && !checked)
10
- value = undefined;
11
- updateForm({ name, value });
12
- }
13
- function onSubmit(event) {
14
- submitForm();
15
- }
16
- </script>
17
-
18
- <form data-amplify-form on:submit|preventDefault={onSubmit} on:input={onInput}>
19
- <div class="amplify-flex" style="flex-direction: column">
20
- <div class="amplify-flex" style="flex-direction: column">
21
- <fieldset
22
- class="amplify-flex"
23
- style="flex-direction: column"
24
- disabled={$isPending}
25
- >
26
- <AmplifySignUpFormFields />
27
- </fieldset>
28
- {#if $error}
29
- <AmplifyError>
30
- {$error}
31
- </AmplifyError>
32
- {/if}
33
- </div>
34
-
35
- <AmplifyButton
36
- disabled={$isPending || $hasValidationErrors}
37
- amplify-button
38
- variation="primary"
39
- fullWidth="true"
40
- type="submit"
41
- >
42
- {createAccountText}
43
- </AmplifyButton>
44
- </div>
45
- </form>
@@ -1,14 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- declare const __propDef: {
3
- props: {};
4
- events: {
5
- [evt: string]: CustomEvent<any>;
6
- };
7
- slots: {};
8
- };
9
- export declare type SignUpProps = typeof __propDef.props;
10
- export declare type SignUpEvents = typeof __propDef.events;
11
- export declare type SignUpSlots = typeof __propDef.slots;
12
- export default class SignUp extends SvelteComponentTyped<SignUpProps, SignUpEvents, SignUpSlots> {
13
- }
14
- export {};
@@ -1,29 +0,0 @@
1
- <script >import AmplifyFormField from './primitives/AmplifyFormField.svelte';
2
- import { onMount } from 'svelte';
3
- import { authState } from './authStore';
4
- import { getAliasInfoFromContext } from '@aws-amplify/ui';
5
- export let name = 'username';
6
- export let disabled = false;
7
- export let initialValue = '';
8
- export let required = true;
9
- let label;
10
- let type;
11
- let error;
12
- let placeholder;
13
- onMount(() => {
14
- const { label, type } = getAliasInfoFromContext($authState.context);
15
- placeholder = label;
16
- });
17
- </script>
18
-
19
- <AmplifyFormField
20
- data-amplify-usernamealias
21
- {name}
22
- {label}
23
- {type}
24
- {placeholder}
25
- {initialValue}
26
- {disabled}
27
- {required}
28
- autocomplete="username"
29
- />
@@ -1,19 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- name?: string;
5
- disabled?: boolean;
6
- initialValue?: string;
7
- required?: boolean;
8
- };
9
- events: {
10
- [evt: string]: CustomEvent<any>;
11
- };
12
- slots: {};
13
- };
14
- export declare type UserNameAliasProps = typeof __propDef.props;
15
- export declare type UserNameAliasEvents = typeof __propDef.events;
16
- export declare type UserNameAliasSlots = typeof __propDef.slots;
17
- export default class UserNameAlias extends SvelteComponentTyped<UserNameAliasProps, UserNameAliasEvents, UserNameAliasSlots> {
18
- }
19
- export {};
@@ -1,20 +0,0 @@
1
- export declare const error: import("svelte/store").Writable<any>;
2
- export declare const route: import("svelte/store").Writable<any>;
3
- export declare const isPending: import("svelte/store").Writable<any>;
4
- export declare const hasValidationErrors: import("svelte/store").Writable<any>;
5
- export declare const user: import("svelte/store").Writable<any>;
6
- export declare const validationErrors: import("svelte/store").Writable<any>;
7
- export declare const codeDeliveryDetails: import("svelte/store").Writable<any>;
8
- /** @deprecated For internal use only */
9
- export declare const authState: import("svelte/store").Writable<any>;
10
- export declare function setupMachine(initialState: any, loginMechanisms: any, services: any, signUpAttributes: any, socialProviders: any): import("xstate").Subscription;
11
- export declare function updateForm(...args: any[]): void;
12
- export declare function updateBlur(...args: any[]): void;
13
- export declare function resendCode(...args: any[]): void;
14
- export declare function signOut(...args: any[]): void;
15
- export declare function submitForm(...args: any[]): void;
16
- export declare function toFederatedSignIn(...args: any[]): void;
17
- export declare function toResetPassword(...args: any[]): void;
18
- export declare function toSignIn(...args: any[]): void;
19
- export declare function toSignUp(...args: any[]): void;
20
- export declare function skipVerification(...args: any[]): void;
@@ -1,101 +0,0 @@
1
- import { createAuthenticatorMachine, getSendEventAliases, translate, getServiceContextFacade, } from '@aws-amplify/ui';
2
- import { interpret } from 'xstate';
3
- import { writable, get } from 'svelte/store';
4
- let _facade = writable(null);
5
- export const error = writable(null);
6
- export const route = writable(null);
7
- export const isPending = writable(null);
8
- export const hasValidationErrors = writable(null);
9
- export const user = writable(null);
10
- export const validationErrors = writable(null);
11
- export const codeDeliveryDetails = writable(null);
12
- const _sendEventAliases = writable(null);
13
- const contextFacade = getServiceContextFacade;
14
- /** @deprecated For internal use only */
15
- export const authState = writable(null);
16
- export function setupMachine(initialState, loginMechanisms, services, signUpAttributes, socialProviders) {
17
- const machine = createAuthenticatorMachine({
18
- initialState,
19
- loginMechanisms,
20
- services,
21
- signUpAttributes,
22
- socialProviders,
23
- });
24
- const authService = interpret(machine, {
25
- devTools: process.env.NODE_ENV === 'development',
26
- }).start();
27
- const subscription = authService.subscribe((state) => {
28
- authState.update(() => state);
29
- _facade.update(() => contextFacade(state));
30
- setError();
31
- setRoute();
32
- setHasValidationErrors();
33
- setCodeDeliveryDetails();
34
- setIsPending();
35
- setUser();
36
- setValidationErrors();
37
- });
38
- _sendEventAliases.set(getSendEventAliases(authService.send));
39
- const _authService = authService;
40
- return subscription;
41
- }
42
- /**
43
- * Context facades
44
- */
45
- function setError() {
46
- error.set(translate(get(_facade).error));
47
- }
48
- function setRoute() {
49
- route.set(get(_facade).route);
50
- }
51
- function setHasValidationErrors() {
52
- hasValidationErrors.set(get(_facade).hasValidationErrors);
53
- }
54
- function setIsPending() {
55
- isPending.set(get(_facade).isPending);
56
- }
57
- function setUser() {
58
- user.set(get(_facade).user);
59
- }
60
- function setValidationErrors() {
61
- validationErrors.set(get(_facade).validationErrors);
62
- }
63
- function setCodeDeliveryDetails() {
64
- codeDeliveryDetails.set(get(_facade).codeDeliveryDetails);
65
- }
66
- // /**
67
- // * Service facades
68
- // */
69
- export function updateForm(...args) {
70
- return get(_sendEventAliases).updateForm(...args);
71
- }
72
- export function updateBlur(...args) {
73
- return get(_sendEventAliases).updateBlur(...args);
74
- }
75
- export function resendCode(...args) {
76
- return get(_sendEventAliases).resendCode(...args);
77
- }
78
- export function signOut(...args) {
79
- return get(_sendEventAliases).signOut(...args);
80
- }
81
- export function submitForm(...args) {
82
- return get(_sendEventAliases).submitForm(...args);
83
- }
84
- // /**
85
- // * Transition facades
86
- // */
87
- export function toFederatedSignIn(...args) {
88
- return get(_sendEventAliases).toFederatedSignIn(...args);
89
- }
90
- export function toResetPassword(...args) {
91
- return get(_sendEventAliases).toResetPassword(...args);
92
- }
93
- export function toSignIn(...args) {
94
- return get(_sendEventAliases).toSignIn(...args);
95
- }
96
- export function toSignUp(...args) {
97
- return get(_sendEventAliases).toSignUp(...args);
98
- }
99
- export function skipVerification(...args) {
100
- return get(_sendEventAliases).skipVerification(...args);
101
- }
@@ -1,23 +0,0 @@
1
- <script >import { createEventDispatcher } from 'svelte';
2
- export let type = 'button';
3
- export let fullWidth = false;
4
- export let size = 'medium';
5
- export let variation = 'default';
6
- export let fontWeight = 'normal';
7
- const dispatch = createEventDispatcher();
8
- </script>
9
-
10
- <button
11
- {...$$restProps}
12
- on:click={() => dispatch('click')}
13
- class={`amplify-button ${$$props.class ?? ''}`}
14
- {type}
15
- style="font-weight: {fontWeight} "
16
- data-fullwidth={fullWidth}
17
- data-size={size}
18
- data-fontWeight={fontWeight}
19
- data-variation={variation}
20
- data-amplify-button=""
21
- >
22
- <slot />
23
- </button>
@@ -1,25 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- [x: string]: any;
5
- type?: 'submit' | 'button';
6
- fullWidth?: boolean | string;
7
- size?: 'small' | 'medium' | 'large';
8
- variation?: 'primary' | 'default' | 'link';
9
- fontWeight?: 'normal' | 'bold' | 'lighter';
10
- };
11
- events: {
12
- click: CustomEvent<any>;
13
- } & {
14
- [evt: string]: CustomEvent<any>;
15
- };
16
- slots: {
17
- default: {};
18
- };
19
- };
20
- export declare type AmplifyButtonProps = typeof __propDef.props;
21
- export declare type AmplifyButtonEvents = typeof __propDef.events;
22
- export declare type AmplifyButtonSlots = typeof __propDef.slots;
23
- export default class AmplifyButton extends SvelteComponentTyped<AmplifyButtonProps, AmplifyButtonEvents, AmplifyButtonSlots> {
24
- }
25
- export {};
@@ -1,46 +0,0 @@
1
- <script >import AmplifyButton from './AmplifyButton.svelte';
2
- let isVisible = true;
3
- function close() {
4
- isVisible = false;
5
- }
6
- </script>
7
-
8
- {#if isVisible}
9
- <div
10
- class="amplify-flex amplify-alert"
11
- data-variation="error"
12
- style="align-items: center; justify-content: space-between"
13
- role="alert"
14
- >
15
- <div class="amplify-flex" style="align-items: center">
16
- <svg
17
- xmlns="http://www.w3.org/2000/svg"
18
- class="amplify-icon"
19
- viewBox="0 0 24 24"
20
- fill="currentColor"
21
- >
22
- <path
23
- d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"
24
- />
25
- </svg>
26
- <div><slot /></div>
27
- </div>
28
- <AmplifyButton
29
- class="amplify-field-group__control"
30
- variation="link"
31
- fullWidth={false}
32
- on:click={close}
33
- >
34
- <svg
35
- xmlns="http://www.w3.org/2000/svg"
36
- class="amplify-icon"
37
- viewBox="0 0 24 24"
38
- fill="currentColor"
39
- >
40
- <path
41
- d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
42
- />
43
- </svg>
44
- </AmplifyButton>
45
- </div>
46
- {/if}
@@ -1,16 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- declare const __propDef: {
3
- props: {};
4
- events: {
5
- [evt: string]: CustomEvent<any>;
6
- };
7
- slots: {
8
- default: {};
9
- };
10
- };
11
- export declare type AmplifyErrorProps = typeof __propDef.props;
12
- export declare type AmplifyErrorEvents = typeof __propDef.events;
13
- export declare type AmplifyErrorSlots = typeof __propDef.slots;
14
- export default class AmplifyError extends SvelteComponentTyped<AmplifyErrorProps, AmplifyErrorEvents, AmplifyErrorSlots> {
15
- }
16
- export {};