@aws-amplify/ui-svelte 0.0.0-next-c8114c5-20220105200507

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 (57) hide show
  1. package/.eslintrc.cjs +20 -0
  2. package/.turbo/turbo-build.log +135 -0
  3. package/CHANGELOG.md +15 -0
  4. package/README.md +38 -0
  5. package/dist/README.md +38 -0
  6. package/dist/components/Authenticator.svelte +43 -0
  7. package/dist/components/Authenticator.svelte.d.ts +22 -0
  8. package/dist/components/SignIn.svelte +69 -0
  9. package/dist/components/SignIn.svelte.d.ts +14 -0
  10. package/dist/components/UserNameAlias.svelte +29 -0
  11. package/dist/components/UserNameAlias.svelte.d.ts +19 -0
  12. package/dist/components/authStore.d.ts +20 -0
  13. package/dist/components/authStore.js +100 -0
  14. package/dist/components/primitives/AmplifyButton.svelte +23 -0
  15. package/dist/components/primitives/AmplifyButton.svelte.d.ts +25 -0
  16. package/dist/components/primitives/AmplifyError.svelte +46 -0
  17. package/dist/components/primitives/AmplifyError.svelte.d.ts +16 -0
  18. package/dist/components/primitives/AmplifyFormField.svelte +121 -0
  19. package/dist/components/primitives/AmplifyFormField.svelte.d.ts +25 -0
  20. package/dist/components/primitives/AmplifyFormSelect.svelte +38 -0
  21. package/dist/components/primitives/AmplifyFormSelect.svelte.d.ts +20 -0
  22. package/dist/components/primitives/AmplifyPasswordField.svelte +75 -0
  23. package/dist/components/primitives/AmplifyPasswordField.svelte.d.ts +26 -0
  24. package/dist/components/primitives/AmplifyPhoneNumberField.svelte +50 -0
  25. package/dist/components/primitives/AmplifyPhoneNumberField.svelte.d.ts +27 -0
  26. package/dist/components/primitives/AmplifyTabItem.svelte +0 -0
  27. package/dist/components/primitives/AmplifyTabItem.svelte.d.ts +19 -0
  28. package/dist/components/primitives/AmplifyTabs.svelte +50 -0
  29. package/dist/components/primitives/AmplifyTabs.svelte.d.ts +14 -0
  30. package/dist/components/primitives/AmplifyTextField.svelte +31 -0
  31. package/dist/components/primitives/AmplifyTextField.svelte.d.ts +28 -0
  32. package/dist/index.d.ts +3 -0
  33. package/dist/index.js +3 -0
  34. package/dist/package.json +60 -0
  35. package/dist/styles.css +1 -0
  36. package/package.json +57 -0
  37. package/src/app.html +21 -0
  38. package/src/global.d.ts +1 -0
  39. package/src/lib/components/Authenticator.svelte +52 -0
  40. package/src/lib/components/SignIn.svelte +79 -0
  41. package/src/lib/components/UserNameAlias.svelte +32 -0
  42. package/src/lib/components/authStore.ts +138 -0
  43. package/src/lib/components/primitives/AmplifyButton.svelte +25 -0
  44. package/src/lib/components/primitives/AmplifyError.svelte +48 -0
  45. package/src/lib/components/primitives/AmplifyFormField.svelte +146 -0
  46. package/src/lib/components/primitives/AmplifyFormSelect.svelte +39 -0
  47. package/src/lib/components/primitives/AmplifyPasswordField.svelte +78 -0
  48. package/src/lib/components/primitives/AmplifyPhoneNumberField.svelte +52 -0
  49. package/src/lib/components/primitives/AmplifyTabItem.svelte +0 -0
  50. package/src/lib/components/primitives/AmplifyTabs.svelte +52 -0
  51. package/src/lib/components/primitives/AmplifyTextField.svelte +33 -0
  52. package/src/lib/index.ts +4 -0
  53. package/src/lib/styles.css +1 -0
  54. package/src/routes/index.svelte +8 -0
  55. package/static/favicon.png +0 -0
  56. package/svelte.config.js +41 -0
  57. package/tsconfig.json +31 -0
@@ -0,0 +1,46 @@
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}
@@ -0,0 +1,16 @@
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 {};
@@ -0,0 +1,121 @@
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>
@@ -0,0 +1,25 @@
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 {};
@@ -0,0 +1,38 @@
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>
@@ -0,0 +1,20 @@
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 {};
@@ -0,0 +1,75 @@
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>
@@ -0,0 +1,26 @@
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 {};
@@ -0,0 +1,50 @@
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>
@@ -0,0 +1,27 @@
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 {};
@@ -0,0 +1,19 @@
1
+ /** @typedef {typeof __propDef.props} AmplifyTabItemProps */
2
+ /** @typedef {typeof __propDef.events} AmplifyTabItemEvents */
3
+ /** @typedef {typeof __propDef.slots} AmplifyTabItemSlots */
4
+ export default class AmplifyTabItem extends SvelteComponentTyped<{}, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> {
7
+ }
8
+ export type AmplifyTabItemProps = typeof __propDef.props;
9
+ export type AmplifyTabItemEvents = typeof __propDef.events;
10
+ export type AmplifyTabItemSlots = 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 {};
@@ -0,0 +1,50 @@
1
+ <script >//tab list
2
+ const tabs = [
3
+ {
4
+ active: true,
5
+ labelledById: '1',
6
+ id: '1',
7
+ title: 'Sign In'
8
+ },
9
+ {
10
+ active: false,
11
+ labelledById: '2',
12
+ id: '2',
13
+ title: 'Sign Up'
14
+ }
15
+ ];
16
+ function handleTabClick(e) {
17
+ // future
18
+ }
19
+ </script>
20
+
21
+ <div
22
+ tabindex="0"
23
+ aria-orientation="horizontal"
24
+ data-orientation="horizontal"
25
+ role="tablist"
26
+ style="outline: none"
27
+ >
28
+ <div
29
+ class="amplify-flex amplify-tabs"
30
+ data-indicator-position="top"
31
+ style="gap: 0px; justify-content: center"
32
+ >
33
+ {#each tabs as tab}
34
+ <div
35
+ class="amplify-tabs-item"
36
+ data-spacing="equal"
37
+ data-orientation="horizontal"
38
+ role="tab"
39
+ id={tab.labelledById}
40
+ tabindex={tab.active ? 0 : 1}
41
+ aria-selected={tab.active}
42
+ aria-controls={tab.id}
43
+ data-state={tab.active ? 'active' : 'inactive'}
44
+ on:click={() => handleTabClick(tab)}
45
+ >
46
+ {tab.title}
47
+ </div>
48
+ {/each}
49
+ </div>
50
+ </div>
@@ -0,0 +1,14 @@
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 AmplifyTabsProps = typeof __propDef.props;
10
+ export declare type AmplifyTabsEvents = typeof __propDef.events;
11
+ export declare type AmplifyTabsSlots = typeof __propDef.slots;
12
+ export default class AmplifyTabs extends SvelteComponentTyped<AmplifyTabsProps, AmplifyTabsEvents, AmplifyTabsSlots> {
13
+ }
14
+ export {};
@@ -0,0 +1,31 @@
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
+ />
@@ -0,0 +1,28 @@
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 {};
@@ -0,0 +1,3 @@
1
+ import Authenticator from './components/Authenticator.svelte';
2
+ import * as authStore from './components/authStore';
3
+ export { Authenticator, authStore };
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ import Authenticator from './components/Authenticator.svelte';
2
+ import * as authStore from './components/authStore';
3
+ export { Authenticator, authStore };
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@aws-amplify/ui-svelte",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "main": "dist/index.js",
6
+ "svelte": "index.js",
7
+ "exports": {
8
+ "./package.json": "./package.json",
9
+ "./components/Authenticator.svelte": "./components/Authenticator.svelte",
10
+ "./components/SignIn.svelte": "./components/SignIn.svelte",
11
+ "./components/UserNameAlias.svelte": "./components/UserNameAlias.svelte",
12
+ "./components/authStore": "./components/authStore.js",
13
+ "./components/primitives/AmplifyButton.svelte": "./components/primitives/AmplifyButton.svelte",
14
+ "./components/primitives/AmplifyError.svelte": "./components/primitives/AmplifyError.svelte",
15
+ "./components/primitives/AmplifyFormField.svelte": "./components/primitives/AmplifyFormField.svelte",
16
+ "./components/primitives/AmplifyFormSelect.svelte": "./components/primitives/AmplifyFormSelect.svelte",
17
+ "./components/primitives/AmplifyPasswordField.svelte": "./components/primitives/AmplifyPasswordField.svelte",
18
+ "./components/primitives/AmplifyPhoneNumberField.svelte": "./components/primitives/AmplifyPhoneNumberField.svelte",
19
+ "./components/primitives/AmplifyTabItem.svelte": "./components/primitives/AmplifyTabItem.svelte",
20
+ "./components/primitives/AmplifyTabs.svelte": "./components/primitives/AmplifyTabs.svelte",
21
+ "./components/primitives/AmplifyTextField.svelte": "./components/primitives/AmplifyTextField.svelte",
22
+ ".": {
23
+ "import": "./dist/index.js"
24
+ },
25
+ "./styles.css": "./dist/styles.css"
26
+ },
27
+ "browser": {
28
+ "./styles.css": "./dist/styles.css"
29
+ },
30
+ "devDependencies": {
31
+ "@sveltejs/adapter-auto": "next",
32
+ "@sveltejs/adapter-node": "^1.0.0-next.56",
33
+ "@sveltejs/adapter-static": "^1.0.0-next.23",
34
+ "@sveltejs/kit": "next",
35
+ "@typescript-eslint/eslint-plugin": "^4.31.1",
36
+ "@typescript-eslint/parser": "^4.31.1",
37
+ "eslint": "^7.32.0",
38
+ "eslint-config-prettier": "^8.3.0",
39
+ "eslint-plugin-svelte3": "^3.2.1",
40
+ "prettier": "^2.4.1",
41
+ "prettier-plugin-svelte": "^2.4.0",
42
+ "svelte": "^3.44.0",
43
+ "svelte-check": "^2.2.6",
44
+ "svelte-preprocess": "^4.9.4",
45
+ "svelte2tsx": "^0.4.12",
46
+ "tslib": "^2.3.1",
47
+ "typescript": "^4.4.3"
48
+ },
49
+ "peerDependencies": {
50
+ "aws-amplify": "^4.2.2"
51
+ },
52
+ "dependencies": {
53
+ "@aws-amplify/ui": "^3.0.5",
54
+ "@rollup/plugin-replace": "^3.0.0",
55
+ "nanoid": "^3.1.30",
56
+ "qrcode": "^1.5.0",
57
+ "svelte2tsx": "^0.4.12",
58
+ "xstate": "^4.26.1"
59
+ }
60
+ }
@@ -0,0 +1 @@
1
+ @import '@aws-amplify/ui/styles.css';