@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,15 @@
|
|
|
1
|
+
import { type FullAutoFill } from 'svelte/elements';
|
|
2
|
+
interface TextFields {
|
|
3
|
+
label?: string;
|
|
4
|
+
id?: string;
|
|
5
|
+
autocomplete?: FullAutoFill;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
name?: string;
|
|
10
|
+
type?: string;
|
|
11
|
+
hideLabel?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const TextField: import("svelte").Component<TextFields, {}, "">;
|
|
14
|
+
type TextField = ReturnType<typeof TextField>;
|
|
15
|
+
export default TextField;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as AliasField } from './AliasField.svelte';
|
|
2
|
+
export { default as Button } from './Button.svelte';
|
|
3
|
+
export { default as FederatedSignIn } from './FederatedSignIn.svelte';
|
|
4
|
+
export { default as PasswordField } from './PasswordField.svelte';
|
|
5
|
+
export { default as TextField } from './TextField.svelte';
|
|
6
|
+
export { default as Checkbox } from './CheckBox.svelte';
|
|
7
|
+
export { default as SignUpFormFields } from './SignUpFormFields.svelte';
|
|
8
|
+
export { default as ForceNewPasswordFormFields } from './ForceNewPasswordFormFields.svelte';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as AliasField } from './AliasField.svelte';
|
|
2
|
+
export { default as Button } from './Button.svelte';
|
|
3
|
+
export { default as FederatedSignIn } from './FederatedSignIn.svelte';
|
|
4
|
+
export { default as PasswordField } from './PasswordField.svelte';
|
|
5
|
+
export { default as TextField } from './TextField.svelte';
|
|
6
|
+
export { default as Checkbox } from './CheckBox.svelte';
|
|
7
|
+
export { default as SignUpFormFields } from './SignUpFormFields.svelte';
|
|
8
|
+
export { default as ForceNewPasswordFormFields } from './ForceNewPasswordFormFields.svelte';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { translate } from '@aws-amplify/ui';
|
|
3
|
+
import Button from '../controls/Button.svelte';
|
|
4
|
+
import { type Snippet } from 'svelte';
|
|
5
|
+
|
|
6
|
+
let show = $state(true);
|
|
7
|
+
|
|
8
|
+
const dismissAriaLabel = translate('Dismiss alert');
|
|
9
|
+
|
|
10
|
+
function close() {
|
|
11
|
+
show = false;
|
|
12
|
+
}
|
|
13
|
+
const {
|
|
14
|
+
children,
|
|
15
|
+
}: {
|
|
16
|
+
children?: Snippet;
|
|
17
|
+
} = $props();
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
{#if show}
|
|
21
|
+
<div
|
|
22
|
+
class="amplify-flex amplify-alert amplify-alert--error amplify-authenticator__base"
|
|
23
|
+
data-variation="error"
|
|
24
|
+
role="alert"
|
|
25
|
+
>
|
|
26
|
+
<div class="amplify-flex amplify-authenticator__icon-wrapper">
|
|
27
|
+
<svg
|
|
28
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
29
|
+
class="amplify-icon"
|
|
30
|
+
aria-hidden="true"
|
|
31
|
+
viewBox="0 0 24 24"
|
|
32
|
+
fill="currentColor"
|
|
33
|
+
>
|
|
34
|
+
<path
|
|
35
|
+
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"
|
|
36
|
+
></path>
|
|
37
|
+
</svg>
|
|
38
|
+
<div>{@render children?.()}</div>
|
|
39
|
+
</div>
|
|
40
|
+
<Button
|
|
41
|
+
class="amplify-field-group__control amplify-alert__dismiss"
|
|
42
|
+
aria-label={dismissAriaLabel}
|
|
43
|
+
fullWidth={false}
|
|
44
|
+
variation="link"
|
|
45
|
+
type="button"
|
|
46
|
+
onclick={() => close()}
|
|
47
|
+
>
|
|
48
|
+
<svg
|
|
49
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
50
|
+
class="amplify-icon"
|
|
51
|
+
aria-hidden="true"
|
|
52
|
+
viewBox="0 0 24 24"
|
|
53
|
+
fill="currentColor"
|
|
54
|
+
>
|
|
55
|
+
<path
|
|
56
|
+
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"
|
|
57
|
+
></path>
|
|
58
|
+
</svg>
|
|
59
|
+
</Button>
|
|
60
|
+
</div>
|
|
61
|
+
{/if}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { type HTMLButtonAttributes } from 'svelte/elements';
|
|
3
|
+
import { useAuthenticator } from '../../stores/authenticator.svelte';
|
|
4
|
+
|
|
5
|
+
import Button from '../controls/Button.svelte';
|
|
6
|
+
|
|
7
|
+
interface Props extends HTMLButtonAttributes {
|
|
8
|
+
provider: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const { provider, children }: Props = $props();
|
|
12
|
+
|
|
13
|
+
const { authenticator } = useAuthenticator();
|
|
14
|
+
|
|
15
|
+
// Methods
|
|
16
|
+
const onClick = (): void => {
|
|
17
|
+
authenticator.toFederatedSignIn({ provider });
|
|
18
|
+
};
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<Button
|
|
22
|
+
class="amplify-authenticator__federated-button"
|
|
23
|
+
type="button"
|
|
24
|
+
onclick={() => onClick()}
|
|
25
|
+
>
|
|
26
|
+
{@render children?.()}
|
|
27
|
+
</Button>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type HTMLButtonAttributes } from 'svelte/elements';
|
|
2
|
+
interface Props extends HTMLButtonAttributes {
|
|
3
|
+
provider: string;
|
|
4
|
+
}
|
|
5
|
+
declare const FederatedSignInButton: import("svelte").Component<Props, {}, "">;
|
|
6
|
+
type FederatedSignInButton = ReturnType<typeof FederatedSignInButton>;
|
|
7
|
+
export default FederatedSignInButton;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { nanoid } from 'nanoid';
|
|
3
|
+
import { type FullAutoFill } from 'svelte/elements';
|
|
4
|
+
|
|
5
|
+
import { type FormFieldOptions, getErrors, translate } from '@aws-amplify/ui';
|
|
6
|
+
import { useAuthenticator } from '../../stores/authenticator.svelte';
|
|
7
|
+
import PasswordField from '../controls/PasswordField.svelte';
|
|
8
|
+
import AliasField from '../controls/AliasField.svelte';
|
|
9
|
+
|
|
10
|
+
interface BaseFormField {
|
|
11
|
+
name?: string;
|
|
12
|
+
formField?: FormFieldOptions;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const { name = '', formField = {} }: BaseFormField = $props();
|
|
16
|
+
|
|
17
|
+
const { authenticator } = $derived(useAuthenticator());
|
|
18
|
+
|
|
19
|
+
const { type } = formField;
|
|
20
|
+
|
|
21
|
+
const isPasswordField = $derived(type === 'password');
|
|
22
|
+
|
|
23
|
+
const errorId = nanoid(12);
|
|
24
|
+
|
|
25
|
+
const errors = $derived(getErrors(authenticator.validationErrors[name]));
|
|
26
|
+
const hasError = $derived(errors?.length > 0);
|
|
27
|
+
const ariaDescribedBy = $derived(hasError ? errorId : undefined);
|
|
28
|
+
const autocomplete = $derived(
|
|
29
|
+
formField.autocomplete ?? ''
|
|
30
|
+
) as unknown as FullAutoFill;
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
{#if isPasswordField}
|
|
34
|
+
<PasswordField
|
|
35
|
+
{name}
|
|
36
|
+
{hasError}
|
|
37
|
+
{autocomplete}
|
|
38
|
+
label={formField.label ?? ''}
|
|
39
|
+
placeholder={formField.placeholder}
|
|
40
|
+
required={formField.isRequired}
|
|
41
|
+
labelHidden={formField.labelHidden}
|
|
42
|
+
describedBy={ariaDescribedBy}
|
|
43
|
+
/>
|
|
44
|
+
{:else}
|
|
45
|
+
<AliasField
|
|
46
|
+
{name}
|
|
47
|
+
{hasError}
|
|
48
|
+
{autocomplete}
|
|
49
|
+
label={formField.label ?? ''}
|
|
50
|
+
placeholder={formField.placeholder}
|
|
51
|
+
required={formField.isRequired}
|
|
52
|
+
labelHidden={formField.labelHidden}
|
|
53
|
+
dialCode={formField.dialCode}
|
|
54
|
+
dialCodeList={formField.dialCodeList}
|
|
55
|
+
type={formField.type}
|
|
56
|
+
describedBy={ariaDescribedBy}
|
|
57
|
+
/>
|
|
58
|
+
{/if}
|
|
59
|
+
|
|
60
|
+
{#if hasError}
|
|
61
|
+
<div id={ariaDescribedBy}>
|
|
62
|
+
{#each errors as error, idx (idx)}
|
|
63
|
+
<p
|
|
64
|
+
role="alert"
|
|
65
|
+
data-variation="error"
|
|
66
|
+
class="amplify-text amplify-text--error"
|
|
67
|
+
>
|
|
68
|
+
{translate(error)}
|
|
69
|
+
</p>
|
|
70
|
+
{/each}
|
|
71
|
+
</div>
|
|
72
|
+
{/if}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type FormFieldOptions } from '@aws-amplify/ui';
|
|
2
|
+
interface BaseFormField {
|
|
3
|
+
name?: string;
|
|
4
|
+
formField?: FormFieldOptions;
|
|
5
|
+
}
|
|
6
|
+
declare const FormField: import("svelte").Component<BaseFormField, {}, "">;
|
|
7
|
+
type FormField = ReturnType<typeof FormField>;
|
|
8
|
+
export default FormField;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
type FormFieldComponents,
|
|
4
|
+
type FormFieldsArray,
|
|
5
|
+
getSortedFormFields,
|
|
6
|
+
} from '@aws-amplify/ui';
|
|
7
|
+
import FormField from './FormField.svelte';
|
|
8
|
+
|
|
9
|
+
import { useAuth } from '../../stores/authenticator.svelte';
|
|
10
|
+
import { onMount } from 'svelte';
|
|
11
|
+
import { get } from 'svelte/store';
|
|
12
|
+
|
|
13
|
+
let formFields: FormFieldsArray = $state([]);
|
|
14
|
+
|
|
15
|
+
interface BaseFormFields {
|
|
16
|
+
route: FormFieldComponents;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const { route }: BaseFormFields = $props();
|
|
20
|
+
const { state: authState } = useAuth();
|
|
21
|
+
|
|
22
|
+
onMount(() => {
|
|
23
|
+
formFields = getSortedFormFields(route, get(authState));
|
|
24
|
+
});
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
{#each formFields as [name, formField] (name)}
|
|
28
|
+
<FormField {name} {formField} />
|
|
29
|
+
{/each}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type FormFieldComponents } from '@aws-amplify/ui';
|
|
2
|
+
interface BaseFormFields {
|
|
3
|
+
route: FormFieldComponents;
|
|
4
|
+
}
|
|
5
|
+
declare const FormFields: import("svelte").Component<BaseFormFields, {}, "">;
|
|
6
|
+
type FormFields = ReturnType<typeof FormFields>;
|
|
7
|
+
export default FormFields;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { type HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
|
|
4
|
+
interface Props extends HTMLAttributes<HTMLHeadingElement> {
|
|
5
|
+
level?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const { level = 'h1', children, ...rest }: Props = $props();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<svelte:element this={level} {...rest}>
|
|
12
|
+
{@render children?.()}
|
|
13
|
+
</svelte:element>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
interface Props extends HTMLAttributes<HTMLHeadingElement> {
|
|
3
|
+
level?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
4
|
+
}
|
|
5
|
+
declare const Heading: import("svelte").Component<Props, {}, "">;
|
|
6
|
+
type Heading = ReturnType<typeof Heading>;
|
|
7
|
+
export default Heading;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { type HTMLInputAttributes } from 'svelte/elements';
|
|
3
|
+
|
|
4
|
+
interface Props extends HTMLInputAttributes {
|
|
5
|
+
onInput?: (value: string) => void;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
let { onInput, value = $bindable(), ...rest }: Props = $props();
|
|
9
|
+
|
|
10
|
+
const handleInput = (e: Event): void => {
|
|
11
|
+
onInput?.((e.target as HTMLInputElement).value);
|
|
12
|
+
};
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<input
|
|
16
|
+
{...rest}
|
|
17
|
+
bind:value
|
|
18
|
+
onchange={(event) => handleInput(event)}
|
|
19
|
+
data-amplify-input
|
|
20
|
+
/>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type HTMLInputAttributes } from 'svelte/elements';
|
|
2
|
+
interface Props extends HTMLInputAttributes {
|
|
3
|
+
onInput?: (value: string) => void;
|
|
4
|
+
}
|
|
5
|
+
declare const Input: import("svelte").Component<Props, {}, "value">;
|
|
6
|
+
type Input = ReturnType<typeof Input>;
|
|
7
|
+
export default Input;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { type HTMLSelectAttributes } from 'svelte/elements';
|
|
3
|
+
|
|
4
|
+
interface Props extends HTMLSelectAttributes {
|
|
5
|
+
selectValue?: string;
|
|
6
|
+
options?: string[];
|
|
7
|
+
onChange?: (value: string) => void;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { selectValue = '', options, onChange, ...rest }: Props = $props();
|
|
11
|
+
|
|
12
|
+
const handleChange = (e: Event): void => {
|
|
13
|
+
onChange?.((e.target as HTMLInputElement).value);
|
|
14
|
+
};
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
{#if options}
|
|
18
|
+
<select {...rest} onchange={(e) => handleChange(e)}>
|
|
19
|
+
{#each options as option, idx (idx)}
|
|
20
|
+
<option
|
|
21
|
+
value={option}
|
|
22
|
+
selected={option === selectValue ? true : undefined}
|
|
23
|
+
>
|
|
24
|
+
{option}
|
|
25
|
+
</option>
|
|
26
|
+
{/each}
|
|
27
|
+
</select>
|
|
28
|
+
{/if}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type HTMLSelectAttributes } from 'svelte/elements';
|
|
2
|
+
interface Props extends HTMLSelectAttributes {
|
|
3
|
+
selectValue?: string;
|
|
4
|
+
options?: string[];
|
|
5
|
+
onChange?: (value: string) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const Select: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type Select = ReturnType<typeof Select>;
|
|
9
|
+
export default Select;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { type HTMLButtonAttributes } from 'svelte/elements';
|
|
3
|
+
|
|
4
|
+
interface Props extends HTMLButtonAttributes {
|
|
5
|
+
active?: boolean;
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { active = false, id, label, ...rest }: Props = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<button
|
|
14
|
+
{...rest}
|
|
15
|
+
tabindex={active ? 0 : -1}
|
|
16
|
+
aria-selected={active ? 'true' : 'false'}
|
|
17
|
+
class={{
|
|
18
|
+
'amplify-tabs__item': true,
|
|
19
|
+
'amplify-tabs__item--active': active,
|
|
20
|
+
}}
|
|
21
|
+
id={`${id}-tab`}
|
|
22
|
+
aria-controls={`${id}-panel`}
|
|
23
|
+
role="tab"
|
|
24
|
+
>
|
|
25
|
+
{label}
|
|
26
|
+
</button>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type HTMLButtonAttributes } from 'svelte/elements';
|
|
2
|
+
interface Props extends HTMLButtonAttributes {
|
|
3
|
+
active?: boolean;
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
declare const TwoTabItem: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type TwoTabItem = ReturnType<typeof TwoTabItem>;
|
|
9
|
+
export default TwoTabItem;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Wrapper from './Wrapper.svelte';
|
|
3
|
+
|
|
4
|
+
const { children } = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<Wrapper
|
|
8
|
+
tabindex={0}
|
|
9
|
+
aria-orientation="horizontal"
|
|
10
|
+
data-orientation="horizontal"
|
|
11
|
+
class="amplify-authenticator__tabs amplify-tabs"
|
|
12
|
+
>
|
|
13
|
+
<Wrapper
|
|
14
|
+
class="amplify-tabs__list amplify-tabs__list--top amplify-tabs__list--equal amplify-authenticator__tabs-wrapper"
|
|
15
|
+
role="tablist"
|
|
16
|
+
>
|
|
17
|
+
{@render children?.()}
|
|
18
|
+
</Wrapper>
|
|
19
|
+
</Wrapper>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { default as Alert } from './Alert.svelte';
|
|
2
|
+
export { default as Box } from './Box.svelte';
|
|
3
|
+
export { default as FederatedSignInButton } from './FederatedSignInButton.svelte';
|
|
4
|
+
export { default as FieldSet } from './FieldSet.svelte';
|
|
5
|
+
export { default as Footer } from './Footer.svelte';
|
|
6
|
+
export { default as Form } from './Form.svelte';
|
|
7
|
+
export { default as FormField } from './FormField.svelte';
|
|
8
|
+
export { default as FormFields } from './FormFields.svelte';
|
|
9
|
+
export { default as Heading } from './Heading.svelte';
|
|
10
|
+
export { default as Input } from './Input.svelte';
|
|
11
|
+
export { default as Label } from './Label.svelte';
|
|
12
|
+
export { default as Select } from './Select.svelte';
|
|
13
|
+
export { default as Spacer } from './Spacer.svelte';
|
|
14
|
+
export { default as Text } from './Text.svelte';
|
|
15
|
+
export { default as TwoTabItem } from './TwoTabItem.svelte';
|
|
16
|
+
export { default as TwoTabs } from './TwoTabs.svelte';
|
|
17
|
+
export { default as Wrapper } from './Wrapper.svelte';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { default as Alert } from './Alert.svelte';
|
|
2
|
+
export { default as Box } from './Box.svelte';
|
|
3
|
+
export { default as FederatedSignInButton } from './FederatedSignInButton.svelte';
|
|
4
|
+
export { default as FieldSet } from './FieldSet.svelte';
|
|
5
|
+
export { default as Footer } from './Footer.svelte';
|
|
6
|
+
export { default as Form } from './Form.svelte';
|
|
7
|
+
export { default as FormField } from './FormField.svelte';
|
|
8
|
+
export { default as FormFields } from './FormFields.svelte';
|
|
9
|
+
export { default as Heading } from './Heading.svelte';
|
|
10
|
+
export { default as Input } from './Input.svelte';
|
|
11
|
+
export { default as Label } from './Label.svelte';
|
|
12
|
+
export { default as Select } from './Select.svelte';
|
|
13
|
+
export { default as Spacer } from './Spacer.svelte';
|
|
14
|
+
export { default as Text } from './Text.svelte';
|
|
15
|
+
export { default as TwoTabItem } from './TwoTabItem.svelte';
|
|
16
|
+
export { default as TwoTabs } from './TwoTabs.svelte';
|
|
17
|
+
export { default as Wrapper } from './Wrapper.svelte';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import './styles.css';
|
|
2
|
+
export * from './components/Authenticator';
|
|
3
|
+
export * from './components/controls';
|
|
4
|
+
export * from './components/primitives';
|
|
5
|
+
export * from './types';
|
|
6
|
+
export { useAuthenticator } from './stores/authenticator.svelte';
|
|
7
|
+
export { translations } from '@aws-amplify/ui';
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
export
|
|
1
|
+
// Reexport your entry components here
|
|
2
|
+
import './styles.css';
|
|
3
|
+
export * from './components/Authenticator';
|
|
4
|
+
export * from './components/controls';
|
|
5
|
+
export * from './components/primitives';
|
|
6
|
+
export * from './types';
|
|
7
|
+
export { useAuthenticator } from './stores/authenticator.svelte';
|
|
8
|
+
export { translations } from '@aws-amplify/ui';
|