@getauthui/core 0.1.0 → 0.1.2
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 +15 -15
- package/dist/{authui-user-button-3yi-kvES.js → authui-user-button-C64OcOdr.js} +893 -474
- package/dist/authui.cdn.js +227 -215
- package/dist/authui.cdn.mjs +6724 -3340
- package/dist/authui.js +46 -34
- package/dist/components/authui-account.d.ts +102 -0
- package/dist/components/authui-account.d.ts.map +1 -0
- package/dist/components/authui-button.d.ts +21 -0
- package/dist/components/authui-button.d.ts.map +1 -0
- package/dist/components/authui-config.d.ts +40 -0
- package/dist/components/authui-config.d.ts.map +1 -0
- package/dist/components/authui-modal.d.ts +38 -0
- package/dist/components/authui-modal.d.ts.map +1 -0
- package/dist/components/authui-show.d.ts +33 -0
- package/dist/components/authui-show.d.ts.map +1 -0
- package/dist/components/authui-sign-in.d.ts +83 -0
- package/dist/components/authui-sign-in.d.ts.map +1 -0
- package/dist/components/authui-user-button.d.ts +22 -0
- package/dist/components/authui-user-button.d.ts.map +1 -0
- package/dist/components/element.d.ts +32 -0
- package/dist/components/element.d.ts.map +1 -0
- package/dist/components/sign-in.styles.d.ts +2 -0
- package/dist/components/sign-in.styles.d.ts.map +1 -0
- package/dist/errors.d.ts +48 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/i18n.d.ts +8 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/icons.d.ts +38 -0
- package/dist/icons.d.ts.map +1 -0
- package/dist/index.d.ts +62 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/modal-controller.d.ts +7 -0
- package/dist/modal-controller.d.ts.map +1 -0
- package/dist/preview.d.ts +107 -0
- package/dist/preview.d.ts.map +1 -0
- package/dist/react/index.d.ts +53 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react.js +21 -25
- package/dist/store.d.ts +105 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/styles/base.d.ts +7 -0
- package/dist/styles/base.d.ts.map +1 -0
- package/dist/styles/tokens.d.ts +7 -0
- package/dist/styles/tokens.d.ts.map +1 -0
- package/dist/theme.d.ts +21 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/types.d.ts +233 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +4 -4
- package/dist/authui.d.ts +0 -743
- package/dist/react.d.ts +0 -395
package/dist/authui.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { a as t, c as
|
|
2
|
-
import { A as
|
|
1
|
+
import { a as t, c as r, o } from "./authui-user-button-C64OcOdr.js";
|
|
2
|
+
import { A as m, b as E, d as w, e as v, f as b, g as x, h as C, i as M, j as B, E as O, P, k as j, l as k, p as y, t as L } from "./authui-user-button-C64OcOdr.js";
|
|
3
|
+
import * as U from "appwrite";
|
|
3
4
|
function u(n) {
|
|
4
|
-
return t.configure(n),
|
|
5
|
+
return t.configure(n), I;
|
|
5
6
|
}
|
|
6
|
-
function
|
|
7
|
-
|
|
7
|
+
function i(n) {
|
|
8
|
+
o(n);
|
|
8
9
|
}
|
|
9
|
-
function
|
|
10
|
-
|
|
10
|
+
function s() {
|
|
11
|
+
r();
|
|
11
12
|
}
|
|
12
|
-
function
|
|
13
|
+
function a() {
|
|
13
14
|
return t.signOut();
|
|
14
15
|
}
|
|
15
16
|
function c() {
|
|
@@ -21,46 +22,57 @@ function f() {
|
|
|
21
22
|
function g() {
|
|
22
23
|
return t.getClient();
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
+
function A() {
|
|
26
|
+
return t.getAccount();
|
|
27
|
+
}
|
|
28
|
+
function h() {
|
|
29
|
+
return t.previewSignIn();
|
|
30
|
+
}
|
|
31
|
+
function p(n, e) {
|
|
25
32
|
return t.on(n, e);
|
|
26
33
|
}
|
|
27
|
-
const
|
|
34
|
+
const I = {
|
|
28
35
|
init: u,
|
|
29
|
-
open:
|
|
30
|
-
close:
|
|
31
|
-
signOut:
|
|
36
|
+
open: i,
|
|
37
|
+
close: s,
|
|
38
|
+
signOut: a,
|
|
32
39
|
getUser: c,
|
|
33
40
|
getState: f,
|
|
34
41
|
getClient: g,
|
|
35
|
-
|
|
42
|
+
getAccount: A,
|
|
43
|
+
on: p,
|
|
44
|
+
previewSignIn: h,
|
|
36
45
|
store: t
|
|
37
46
|
};
|
|
38
47
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
C as
|
|
47
|
-
M as
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
m as AuthStore,
|
|
49
|
+
I as AuthUI,
|
|
50
|
+
E as AuthUIAccount,
|
|
51
|
+
w as AuthUIButton,
|
|
52
|
+
v as AuthUIConfigElement,
|
|
53
|
+
b as AuthUIElement,
|
|
54
|
+
x as AuthUIModal,
|
|
55
|
+
C as AuthUIShow,
|
|
56
|
+
M as AuthUISignIn,
|
|
57
|
+
B as AuthUIUserButton,
|
|
58
|
+
O as ErrorTypes,
|
|
59
|
+
P as PreviewAccount,
|
|
60
|
+
U as appwrite,
|
|
51
61
|
t as authStore,
|
|
52
|
-
|
|
53
|
-
|
|
62
|
+
s as close,
|
|
63
|
+
r as closeModal,
|
|
54
64
|
j as defaultStrings,
|
|
55
65
|
k as describeError,
|
|
66
|
+
A as getAccount,
|
|
56
67
|
g as getClient,
|
|
57
68
|
f as getState,
|
|
58
69
|
c as getUser,
|
|
59
70
|
u as init,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
71
|
+
p as on,
|
|
72
|
+
i as open,
|
|
73
|
+
o as openModal,
|
|
74
|
+
h as previewSignIn,
|
|
75
|
+
y as providerLabel,
|
|
76
|
+
a as signOut,
|
|
77
|
+
L as toAuthUIError
|
|
66
78
|
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit';
|
|
2
|
+
import { AuthUIElement } from './element.js';
|
|
3
|
+
type Tab = "profile" | "security" | "sessions" | "connections" | "activity";
|
|
4
|
+
/**
|
|
5
|
+
* Self-service account management: profile, password, MFA (authenticator app and
|
|
6
|
+
* recovery codes), sessions, connected OAuth identities, security log and account deletion.
|
|
7
|
+
*/
|
|
8
|
+
export declare class AuthUIAccount extends AuthUIElement {
|
|
9
|
+
static styles: import('lit').CSSResult[];
|
|
10
|
+
/** Set by <authui-modal>; hides the card chrome. */
|
|
11
|
+
embedded: boolean;
|
|
12
|
+
tab: Tab;
|
|
13
|
+
private active;
|
|
14
|
+
private busy;
|
|
15
|
+
private notice;
|
|
16
|
+
private errors;
|
|
17
|
+
private nameInput;
|
|
18
|
+
private emailInput;
|
|
19
|
+
private emailPassword;
|
|
20
|
+
private phoneInput;
|
|
21
|
+
private phonePassword;
|
|
22
|
+
private phoneCode;
|
|
23
|
+
private phoneCodeSent;
|
|
24
|
+
private guestName;
|
|
25
|
+
private oldPassword;
|
|
26
|
+
private newPassword;
|
|
27
|
+
private newPasswordConfirm;
|
|
28
|
+
private authenticator;
|
|
29
|
+
private authenticatorCode;
|
|
30
|
+
private factors;
|
|
31
|
+
private recoveryCodes;
|
|
32
|
+
private stepUp;
|
|
33
|
+
private stepUpCode;
|
|
34
|
+
private copied;
|
|
35
|
+
private sessions;
|
|
36
|
+
private identities;
|
|
37
|
+
private logs;
|
|
38
|
+
private logsSupported;
|
|
39
|
+
private confirmDelete;
|
|
40
|
+
connectedCallback(): void;
|
|
41
|
+
protected willUpdate(changed: Map<string, unknown>): void;
|
|
42
|
+
/** Lazily load data for the active tab once a user is available. */
|
|
43
|
+
private ensureLoaded;
|
|
44
|
+
private hydrate;
|
|
45
|
+
private get user();
|
|
46
|
+
private get isGuest();
|
|
47
|
+
private select;
|
|
48
|
+
/** Run an action with a busy key, surfacing errors under that key. Handles MFA step-up. */
|
|
49
|
+
private run;
|
|
50
|
+
private loadSessions;
|
|
51
|
+
private loadIdentities;
|
|
52
|
+
private loadLogs;
|
|
53
|
+
private factorsLoading;
|
|
54
|
+
private loadFactors;
|
|
55
|
+
private onUpdateName;
|
|
56
|
+
private onUpdateEmail;
|
|
57
|
+
private onUpdatePhone;
|
|
58
|
+
private onConvertGuest;
|
|
59
|
+
private onSendVerification;
|
|
60
|
+
private onSendPhoneVerification;
|
|
61
|
+
private onConfirmPhoneVerification;
|
|
62
|
+
private onChangePassword;
|
|
63
|
+
private onToggleMfa;
|
|
64
|
+
private onAddAuthenticator;
|
|
65
|
+
private onVerifyAuthenticator;
|
|
66
|
+
private onRemoveAuthenticator;
|
|
67
|
+
private onRecoveryCodes;
|
|
68
|
+
private onRegenerateRecoveryCodes;
|
|
69
|
+
private onCopyCodes;
|
|
70
|
+
private onStepUpFactor;
|
|
71
|
+
private onStepUpVerify;
|
|
72
|
+
private onDeleteSession;
|
|
73
|
+
private onSignOutAll;
|
|
74
|
+
private onDeleteIdentity;
|
|
75
|
+
private onDeleteAccount;
|
|
76
|
+
private bind;
|
|
77
|
+
protected render(): TemplateResult<1>;
|
|
78
|
+
private renderIdentity;
|
|
79
|
+
private renderTab;
|
|
80
|
+
private error;
|
|
81
|
+
private spinner;
|
|
82
|
+
private card;
|
|
83
|
+
private verifiedBadge;
|
|
84
|
+
private renderProfile;
|
|
85
|
+
private renderDanger;
|
|
86
|
+
private renderSecurity;
|
|
87
|
+
private renderMfaCard;
|
|
88
|
+
private renderRecoveryCard;
|
|
89
|
+
/** Inline MFA challenge shown when Appwrite demands a recent factor for a protected action. */
|
|
90
|
+
private renderStepUp;
|
|
91
|
+
private deviceIcon;
|
|
92
|
+
private renderSessions;
|
|
93
|
+
private renderConnections;
|
|
94
|
+
private renderActivity;
|
|
95
|
+
}
|
|
96
|
+
declare global {
|
|
97
|
+
interface HTMLElementTagNameMap {
|
|
98
|
+
"authui-account": AuthUIAccount;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
export {};
|
|
102
|
+
//# sourceMappingURL=authui-account.d.ts.map
|
|
@@ -0,0 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AO;IAIf,OAAO,CAAC,IAAI;IAiBZ,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,aAAa;IA2OrB,OAAO,CAAC,YAAY;IAiCpB,OAAO,CAAC,cAAc;IA+EtB,OAAO,CAAC,aAAa;IAiGrB,OAAO,CAAC,kBAAkB;IAyC1B,+FAA+F;IAC/F,OAAO,CAAC,YAAY;IAoFpB,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,cAAc;IA8DtB,OAAO,CAAC,iBAAiB;IAuDzB,OAAO,CAAC,cAAc;CA2BvB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,aAAa,CAAC;KACjC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AuthUIElement } from './element.js';
|
|
2
|
+
import { AuthUIView } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* A button that opens the Auth UI modal.
|
|
5
|
+
*
|
|
6
|
+
* <authui-button>Sign in</authui-button>
|
|
7
|
+
* <authui-button view="sign-up" variant="outline">Create account</authui-button>
|
|
8
|
+
*/
|
|
9
|
+
export declare class AuthUIButton extends AuthUIElement {
|
|
10
|
+
static styles: import('lit').CSSResult[];
|
|
11
|
+
view: AuthUIView;
|
|
12
|
+
variant: "primary" | "brand" | "outline" | "secondary" | "ghost" | "link";
|
|
13
|
+
size: "sm" | "md" | "lg";
|
|
14
|
+
protected render(): import('lit').TemplateResult<1>;
|
|
15
|
+
}
|
|
16
|
+
declare global {
|
|
17
|
+
interface HTMLElementTagNameMap {
|
|
18
|
+
"authui-button": AuthUIButton;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=authui-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authui-button.d.ts","sourceRoot":"","sources":["../../src/components/authui-button.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;GAKG;AACH,qBACa,YAAa,SAAQ,aAAa;IAC7C,MAAM,CAAC,MAAM,4BAUX;IAE0B,IAAI,EAAE,UAAU,CAAa;IAC7B,OAAO,EACjC,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,CAAa;IACnD,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAQ;IAE5D,SAAS,CAAC,MAAM;CAYjB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,YAAY,CAAC;KAC/B;CACF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { AuthUIConfig } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Declarative configuration. Drop it anywhere in the page:
|
|
5
|
+
*
|
|
6
|
+
* <authui-config endpoint="https://cloud.appwrite.io/v1" project="my-project"
|
|
7
|
+
* methods="email-password magic-url anonymous oauth:google oauth:github"></authui-config>
|
|
8
|
+
*/
|
|
9
|
+
export declare class AuthUIConfigElement extends LitElement {
|
|
10
|
+
static styles: import('lit').CSSResult;
|
|
11
|
+
endpoint: string;
|
|
12
|
+
project: string;
|
|
13
|
+
redirectUrl: string;
|
|
14
|
+
successUrl: string;
|
|
15
|
+
/** Space separated list, e.g. "email-password magic-url email-otp phone anonymous oauth:google". */
|
|
16
|
+
methods: string;
|
|
17
|
+
signUp: string;
|
|
18
|
+
requireName: string;
|
|
19
|
+
mfa: string;
|
|
20
|
+
securityPhrase: string;
|
|
21
|
+
name: string;
|
|
22
|
+
logo: string;
|
|
23
|
+
theme: string;
|
|
24
|
+
radius: string;
|
|
25
|
+
primary: string;
|
|
26
|
+
primaryForeground: string;
|
|
27
|
+
termsUrl: string;
|
|
28
|
+
privacyUrl: string;
|
|
29
|
+
preview: string;
|
|
30
|
+
connectedCallback(): void;
|
|
31
|
+
protected updated(): void;
|
|
32
|
+
private configure;
|
|
33
|
+
toConfig(): AuthUIConfig;
|
|
34
|
+
}
|
|
35
|
+
declare global {
|
|
36
|
+
interface HTMLElementTagNameMap {
|
|
37
|
+
"authui-config": AuthUIConfigElement;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=authui-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authui-config.d.ts","sourceRoot":"","sources":["../../src/components/authui-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAO,MAAM,KAAK,CAAC;AAEtC,OAAO,KAAK,EACV,YAAY,EAKb,MAAM,aAAa,CAAC;AAErB;;;;;GAKG;AACH,qBACa,mBAAoB,SAAQ,UAAU;IACjD,MAAM,CAAC,MAAM,0BAIX;IAE0B,QAAQ,SAAM;IACd,OAAO,SAAM;IACc,WAAW,SAAM;IAClB,UAAU,SAAM;IACtE,oGAAoG;IACxE,OAAO,SAAoB;IACL,MAAM,SAAU;IACX,WAAW,SAAU;IAChD,GAAG,SAAU;IACiB,cAAc,SAAU;IACtD,IAAI,SAAM;IACV,IAAI,SAAM;IACV,KAAK,SAAU;IACf,MAAM,SAAM;IACZ,OAAO,SAAM;IACoB,iBAAiB,SAAM;IAChC,QAAQ,SAAM;IACZ,UAAU,SAAM;IAC1C,OAAO,SAAM;IAEzC,iBAAiB,IAAI,IAAI;IAKzB,SAAS,CAAC,OAAO,IAAI,IAAI;IAIzB,OAAO,CAAC,SAAS;IAQjB,QAAQ,IAAI,YAAY;CAqCzB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,mBAAmB,CAAC;KACtC;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { AuthUIElement } from './element.js';
|
|
2
|
+
import { AuthUIView } from '../types.js';
|
|
3
|
+
export interface AuthUIOpenDetail {
|
|
4
|
+
view?: AuthUIView;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Dialog host for the sign-in and account screens. Opens on `AuthUI.open()`, on
|
|
8
|
+
* `<authui-button>` clicks, and automatically when a redirect needs to finish
|
|
9
|
+
* (password reset link, failed OAuth attempt).
|
|
10
|
+
*/
|
|
11
|
+
export declare class AuthUIModal extends AuthUIElement {
|
|
12
|
+
static styles: import('lit').CSSResult[];
|
|
13
|
+
/** Whether the dialog is open. Reflects to an attribute. */
|
|
14
|
+
open: boolean;
|
|
15
|
+
/** Which screen to show. */
|
|
16
|
+
view: AuthUIView;
|
|
17
|
+
/** Close automatically after a successful sign in. Default: true. */
|
|
18
|
+
closeOnSuccess: boolean;
|
|
19
|
+
private handledPending;
|
|
20
|
+
private dialog?;
|
|
21
|
+
connectedCallback(): void;
|
|
22
|
+
disconnectedCallback(): void;
|
|
23
|
+
private onOpenEvent;
|
|
24
|
+
private onCloseEvent;
|
|
25
|
+
show(view?: AuthUIView): void;
|
|
26
|
+
hide(): void;
|
|
27
|
+
protected updated(changed: Map<string, unknown>): void;
|
|
28
|
+
private onSuccess;
|
|
29
|
+
private onInnerOpen;
|
|
30
|
+
private onBackdrop;
|
|
31
|
+
protected render(): import('lit').TemplateResult<1>;
|
|
32
|
+
}
|
|
33
|
+
declare global {
|
|
34
|
+
interface HTMLElementTagNameMap {
|
|
35
|
+
"authui-modal": AuthUIModal;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=authui-modal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authui-modal.d.ts","sourceRoot":"","sources":["../../src/components/authui-modal.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,qBAAqB,CAAC;AAC7B,OAAO,qBAAqB,CAAC;AAE7B,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAED;;;;GAIG;AACH,qBACa,WAAY,SAAQ,aAAa;IAC5C,MAAM,CAAC,MAAM,4BA6DX;IAEF,4DAA4D;IAChB,IAAI,UAAS;IACzD,4BAA4B;IACA,IAAI,EAAE,UAAU,CAAa;IACzD,qEAAqE;IACT,cAAc,UAAQ;IAEzE,OAAO,CAAC,cAAc,CAAiB;IAC/B,OAAO,CAAC,MAAM,CAAC,CAAoB;IAEpD,iBAAiB,IAAI,IAAI;IAMzB,oBAAoB,IAAI,IAAI;IAM5B,OAAO,CAAC,WAAW,CAGjB;IAEF,OAAO,CAAC,YAAY,CAAqB;IAEzC,IAAI,CAAC,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI;IAM7B,IAAI,IAAI,IAAI;IAIZ,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAmBtD,OAAO,CAAC,SAAS,CAGf;IAEF,OAAO,CAAC,WAAW,CAGjB;IAEF,OAAO,CAAC,UAAU,CAEhB;IAEF,SAAS,CAAC,MAAM;CAqCjB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;KAC7B;CACF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { LitElement, nothing } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Renders its children only while the auth status matches.
|
|
4
|
+
*
|
|
5
|
+
* <authui-show when="signed-in">…</authui-show>
|
|
6
|
+
* <authui-show when="signed-out">…</authui-show>
|
|
7
|
+
* <authui-show unless="signed-in">…</authui-show>
|
|
8
|
+
* <authui-show when="signed-out, mfa-required">…</authui-show>
|
|
9
|
+
*
|
|
10
|
+
* Values: `signed-in`, `signed-out`, `mfa-required`, `loading`. Both attributes
|
|
11
|
+
* accept a comma separated list. Children stay hidden while the initial status
|
|
12
|
+
* is `loading` unless `when="loading"` asks for it.
|
|
13
|
+
*/
|
|
14
|
+
export declare class AuthUIShow extends LitElement {
|
|
15
|
+
/** Show children when the status is one of these. */
|
|
16
|
+
when: string;
|
|
17
|
+
/** Hide children when the status is one of these. */
|
|
18
|
+
unless: string;
|
|
19
|
+
private status;
|
|
20
|
+
private unsubscribe;
|
|
21
|
+
connectedCallback(): void;
|
|
22
|
+
disconnectedCallback(): void;
|
|
23
|
+
/** Whether the current status satisfies `when` and `unless`. */
|
|
24
|
+
get visible(): boolean;
|
|
25
|
+
protected updated(): void;
|
|
26
|
+
protected render(): import('lit').TemplateResult<1> | typeof nothing;
|
|
27
|
+
}
|
|
28
|
+
declare global {
|
|
29
|
+
interface HTMLElementTagNameMap {
|
|
30
|
+
"authui-show": AuthUIShow;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=authui-show.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authui-show.d.ts","sourceRoot":"","sources":["../../src/components/authui-show.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,OAAO,EAAE,MAAM,KAAK,CAAC;AAwBhD;;;;;;;;;;;GAWG;AACH,qBACa,UAAW,SAAQ,UAAU;IACxC,qDAAqD;IACzB,IAAI,SAAM;IACtC,qDAAqD;IACzB,MAAM,SAAM;IAE/B,OAAO,CAAC,MAAM,CAA6C;IACpE,OAAO,CAAC,WAAW,CAA6B;IAEhD,iBAAiB,IAAI,IAAI;IAMzB,oBAAoB,IAAI,IAAI;IAM5B,gEAAgE;IAChE,IAAI,OAAO,IAAI,OAAO,CAOrB;IAED,SAAS,CAAC,OAAO,IAAI,IAAI;IAOzB,SAAS,CAAC,MAAM;CAGjB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit';
|
|
2
|
+
import { AuthUIElement } from './element.js';
|
|
3
|
+
import { AuthUIView } from '../types.js';
|
|
4
|
+
type Step = Exclude<AuthUIView, "account">;
|
|
5
|
+
/**
|
|
6
|
+
* The complete sign-in experience: OAuth, email + password, sign up, passwordless
|
|
7
|
+
* (magic URL, email OTP, SMS), guest sessions, password recovery and MFA challenges.
|
|
8
|
+
* Works standalone in the page or inside <authui-modal>.
|
|
9
|
+
*/
|
|
10
|
+
export declare class AuthUISignIn extends AuthUIElement {
|
|
11
|
+
static styles: import('lit').CSSResult[];
|
|
12
|
+
/** Initial screen. */
|
|
13
|
+
view: Step;
|
|
14
|
+
/** Set by <authui-modal>; hides the card chrome. */
|
|
15
|
+
embedded: boolean;
|
|
16
|
+
private step;
|
|
17
|
+
private busy;
|
|
18
|
+
private error;
|
|
19
|
+
private notice;
|
|
20
|
+
private showPassword;
|
|
21
|
+
private token;
|
|
22
|
+
private challenge;
|
|
23
|
+
private recovery;
|
|
24
|
+
private firstInput?;
|
|
25
|
+
private email;
|
|
26
|
+
private password;
|
|
27
|
+
private passwordConfirm;
|
|
28
|
+
private name;
|
|
29
|
+
private phone;
|
|
30
|
+
private code;
|
|
31
|
+
connectedCallback(): void;
|
|
32
|
+
protected willUpdate(changed: Map<string, unknown>): void;
|
|
33
|
+
protected updated(changed: Map<string, unknown>): void;
|
|
34
|
+
/** React to store transitions: MFA pending, redirect results, sign in. */
|
|
35
|
+
private syncFromStore;
|
|
36
|
+
/** Navigate between screens and reset transient state. */
|
|
37
|
+
go(step: Step): void;
|
|
38
|
+
private run;
|
|
39
|
+
private onSignIn;
|
|
40
|
+
private onSignUp;
|
|
41
|
+
private onGuest;
|
|
42
|
+
private onOAuth;
|
|
43
|
+
private onForgot;
|
|
44
|
+
private onReset;
|
|
45
|
+
private onMagicUrl;
|
|
46
|
+
private onEmailOtp;
|
|
47
|
+
private onPhoneOtp;
|
|
48
|
+
private onVerifyCode;
|
|
49
|
+
private onChooseFactor;
|
|
50
|
+
private onVerifyFactor;
|
|
51
|
+
private onCancelMfa;
|
|
52
|
+
private onSignOut;
|
|
53
|
+
private bind;
|
|
54
|
+
protected render(): TemplateResult<1>;
|
|
55
|
+
private renderHeader;
|
|
56
|
+
private renderError;
|
|
57
|
+
private submitButton;
|
|
58
|
+
private passwordField;
|
|
59
|
+
private emailField;
|
|
60
|
+
private codeField;
|
|
61
|
+
private legal;
|
|
62
|
+
private backLink;
|
|
63
|
+
private renderStep;
|
|
64
|
+
private renderSignedIn;
|
|
65
|
+
private renderProviders;
|
|
66
|
+
private renderSignIn;
|
|
67
|
+
private renderSignUp;
|
|
68
|
+
private renderForgot;
|
|
69
|
+
private renderReset;
|
|
70
|
+
private phraseBox;
|
|
71
|
+
private renderMagicUrl;
|
|
72
|
+
private renderCodeEntry;
|
|
73
|
+
private renderEmailOtp;
|
|
74
|
+
private renderPhone;
|
|
75
|
+
private renderMfa;
|
|
76
|
+
}
|
|
77
|
+
declare global {
|
|
78
|
+
interface HTMLElementTagNameMap {
|
|
79
|
+
"authui-sign-in": AuthUISignIn;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export {};
|
|
83
|
+
//# sourceMappingURL=authui-sign-in.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authui-sign-in.d.ts","sourceRoot":"","sources":["../../src/components/authui-sign-in.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAGzD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAM7C,OAAO,KAAK,EAAE,UAAU,EAAqB,MAAM,aAAa,CAAC;AAEjE,KAAK,IAAI,GAAG,OAAO,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;AAS3C;;;;GAIG;AACH,qBACa,YAAa,SAAQ,aAAa;IAC7C,MAAM,CAAC,MAAM,4BAA2C;IAExD,sBAAsB;IACM,IAAI,EAAE,IAAI,CAAa;IACnD,oDAAoD;IACvB,QAA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SAAS,CAEf;IAEF,OAAO,CAAC,IAAI;IAQZ,SAAS,CAAC,MAAM;IAyBhB,OAAO,CAAC,YAAY;IA2CpB,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,aAAa;IAkDrB,OAAO,CAAC,UAAU;IAkBlB,OAAO,CAAC,SAAS;IAkBjB,OAAO,CAAC,KAAK;IAWb,OAAO,CAAC,QAAQ;IAQhB,OAAO,CAAC,UAAU;IAgClB,OAAO,CAAC,cAAc;IAqCtB,OAAO,CAAC,eAAe;IAyBvB,OAAO,CAAC,YAAY;IA4EpB,OAAO,CAAC,YAAY;IAqCpB,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,WAAW;IAsBnB,OAAO,CAAC,SAAS;IAWjB,OAAO,CAAC,cAAc;IAoBtB,OAAO,CAAC,eAAe;IAsBvB,OAAO,CAAC,cAAc;IAYtB,OAAO,CAAC,WAAW;IAyBnB,OAAO,CAAC,SAAS;CA8FlB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,YAAY,CAAC;KAChC;CACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AuthUIElement } from './element.js';
|
|
2
|
+
/**
|
|
3
|
+
* Avatar with a menu: shows a sign-in button while signed out, and the user's
|
|
4
|
+
* avatar with "Manage account" and "Sign out" while signed in.
|
|
5
|
+
*/
|
|
6
|
+
export declare class AuthUIUserButton extends AuthUIElement {
|
|
7
|
+
static styles: import('lit').CSSResult[];
|
|
8
|
+
/** Avatar image URL; falls back to initials. */
|
|
9
|
+
src: string;
|
|
10
|
+
private menuOpen;
|
|
11
|
+
connectedCallback(): void;
|
|
12
|
+
disconnectedCallback(): void;
|
|
13
|
+
private onDocumentClick;
|
|
14
|
+
private onKeydown;
|
|
15
|
+
protected render(): import('lit').TemplateResult<1>;
|
|
16
|
+
}
|
|
17
|
+
declare global {
|
|
18
|
+
interface HTMLElementTagNameMap {
|
|
19
|
+
"authui-user-button": AuthUIUserButton;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=authui-user-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authui-user-button.d.ts","sourceRoot":"","sources":["../../src/components/authui-user-button.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAK7C;;;GAGG;AACH,qBACa,gBAAiB,SAAQ,aAAa;IACjD,MAAM,CAAC,MAAM,4BA+EX;IAEF,gDAAgD;IACpB,GAAG,SAAM;IAE5B,OAAO,CAAC,QAAQ,CAAS;IAElC,iBAAiB,IAAI,IAAI;IAOzB,oBAAoB,IAAI,IAAI;IAO5B,OAAO,CAAC,eAAe,CAErB;IAEF,OAAO,CAAC,SAAS,CAEf;IAEF,SAAS,CAAC,MAAM;CAsDjB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,oBAAoB,EAAE,gBAAgB,CAAC;KACxC;CACF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { AuthUIState, AuthUIStrings } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Base class for every Auth UI element: subscribes to the store, resolves theme
|
|
5
|
+
* and branding onto the host, and exposes `t()` for strings.
|
|
6
|
+
*/
|
|
7
|
+
export declare class AuthUIElement extends LitElement {
|
|
8
|
+
static styles: import('lit').CSSResult[];
|
|
9
|
+
protected auth: AuthUIState;
|
|
10
|
+
private unsubscribeStore;
|
|
11
|
+
private unsubscribeTheme;
|
|
12
|
+
/**
|
|
13
|
+
* Keyboard events fired inside the component stop at the host element, so page-level
|
|
14
|
+
* shortcuts (a game listening for WASD on `document`, a docs site toggling the theme on
|
|
15
|
+
* "d") never see keystrokes meant for our inputs. The default action is untouched, so
|
|
16
|
+
* typing, Enter to submit and Escape to close the dialog keep working.
|
|
17
|
+
*/
|
|
18
|
+
private static readonly KEY_EVENTS;
|
|
19
|
+
private stopKeys;
|
|
20
|
+
connectedCallback(): void;
|
|
21
|
+
disconnectedCallback(): void;
|
|
22
|
+
protected get strings(): AuthUIStrings;
|
|
23
|
+
/** Translate a string key with optional `{placeholders}`. */
|
|
24
|
+
protected t(key: keyof AuthUIStrings, values?: Record<string, string | number>): string;
|
|
25
|
+
protected get config(): import('../types.js').AuthUIConfig | null;
|
|
26
|
+
protected get productName(): string;
|
|
27
|
+
/** Push theme and branding from config onto the host element. */
|
|
28
|
+
protected applyBranding(): void;
|
|
29
|
+
/** Emit a composed custom event from this element. */
|
|
30
|
+
protected fire<T>(name: string, detail?: T): void;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=element.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../src/components/element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAOjC,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE9D;;;GAGG;AACH,qBAAa,aAAc,SAAQ,UAAU;IAC3C,MAAM,CAAC,MAAM,4BAAkB;IAEtB,SAAS,CAAC,IAAI,EAAE,WAAW,CAAwB;IAE5D,OAAO,CAAC,gBAAgB,CAA6B;IACrD,OAAO,CAAC,gBAAgB,CAA6B;IAErD;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAA6C;IAC/E,OAAO,CAAC,QAAQ,CAAqC;IAErD,iBAAiB,IAAI,IAAI;IAYzB,oBAAoB,IAAI,IAAI;IAS5B,SAAS,KAAK,OAAO,IAAI,aAAa,CAErC;IAED,6DAA6D;IAC7D,SAAS,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,aAAa,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM;IAIvF,SAAS,KAAK,MAAM,8CAEnB;IAED,SAAS,KAAK,WAAW,IAAI,MAAM,CAElC;IAED,iEAAiE;IACjE,SAAS,CAAC,aAAa,IAAI,IAAI;IAgB/B,sDAAsD;IACtD,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,IAAI;CAGlD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sign-in.styles.d.ts","sourceRoot":"","sources":["../../src/components/sign-in.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,yBAgDxB,CAAC"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { AuthUIStrings } from './types.js';
|
|
2
|
+
export interface AuthUIError {
|
|
3
|
+
message: string;
|
|
4
|
+
type: string;
|
|
5
|
+
code: number;
|
|
6
|
+
}
|
|
7
|
+
/** Appwrite error `type` strings the UI reacts to. */
|
|
8
|
+
export declare const ErrorTypes: {
|
|
9
|
+
readonly moreFactorsRequired: "user_more_factors_required";
|
|
10
|
+
readonly invalidCredentials: "user_invalid_credentials";
|
|
11
|
+
readonly userAlreadyExists: "user_already_exists";
|
|
12
|
+
readonly emailAlreadyExists: "user_email_already_exists";
|
|
13
|
+
readonly phoneAlreadyExists: "user_phone_already_exists";
|
|
14
|
+
readonly userBlocked: "user_blocked";
|
|
15
|
+
readonly rateLimit: "general_rate_limit_exceeded";
|
|
16
|
+
readonly invalidToken: "user_invalid_token";
|
|
17
|
+
readonly invalidCode: "user_invalid_code";
|
|
18
|
+
readonly passwordMismatch: "user_password_mismatch";
|
|
19
|
+
readonly passwordRecentlyUsed: "password_recently_used";
|
|
20
|
+
readonly passwordPersonalData: "password_personal_data";
|
|
21
|
+
readonly passwordWeak: "user_password_weak";
|
|
22
|
+
readonly passwordPwned: "password_pwned";
|
|
23
|
+
readonly challengeRequired: "user_challenge_required";
|
|
24
|
+
readonly recoveryCodesExist: "user_recovery_codes_already_exists";
|
|
25
|
+
readonly recoveryCodesNotFound: "user_recovery_codes_not_found";
|
|
26
|
+
readonly authenticatorNotFound: "user_authenticator_not_found";
|
|
27
|
+
readonly routeNotFound: "general_route_not_found";
|
|
28
|
+
readonly emailAlreadyVerified: "user_email_already_verified";
|
|
29
|
+
readonly sessionNotFound: "user_session_not_found";
|
|
30
|
+
readonly wafChallenged: "waf_request_challenged";
|
|
31
|
+
readonly sessionAlreadyExists: "user_session_already_exists";
|
|
32
|
+
readonly oauthUnauthorized: "user_oauth2_unauthorized";
|
|
33
|
+
readonly oauthBadRequest: "user_oauth2_bad_request";
|
|
34
|
+
readonly unauthorized: "general_unauthorized_scope";
|
|
35
|
+
readonly userUnauthorized: "user_unauthorized";
|
|
36
|
+
readonly authMethodUnsupported: "user_auth_method_unsupported";
|
|
37
|
+
readonly countMaxExceeded: "user_count_exceeded";
|
|
38
|
+
readonly targetAlreadyExists: "user_target_already_exists";
|
|
39
|
+
};
|
|
40
|
+
export declare function toAuthUIError(err: unknown): AuthUIError;
|
|
41
|
+
export declare function isErrorType(err: unknown, type: string): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Pick a friendly message for an error, falling back to Appwrite's own text.
|
|
44
|
+
* Pass `context: "code"` when the user typed a one-time code so an invalid
|
|
45
|
+
* token reads as "wrong code" instead of "expired link".
|
|
46
|
+
*/
|
|
47
|
+
export declare function describeError(err: unknown, s: AuthUIStrings, context?: "link" | "code"): string;
|
|
48
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,sDAAsD;AACtD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+Bb,CAAC;AAEX,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,WAAW,CAUvD;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAE/D;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,OAAO,EACZ,CAAC,EAAE,aAAa,EAChB,OAAO,GAAE,MAAM,GAAG,MAAe,GAChC,MAAM,CAuCR"}
|
package/dist/i18n.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AuthUIStrings } from './types.js';
|
|
2
|
+
export declare const defaultStrings: AuthUIStrings;
|
|
3
|
+
/** Substitute `{placeholders}` in a string. */
|
|
4
|
+
export declare function format(template: string, values?: Record<string, string | number>): string;
|
|
5
|
+
/** Human names for OAuth provider slugs. */
|
|
6
|
+
export declare const providerLabels: Record<string, string>;
|
|
7
|
+
export declare function providerLabel(provider: string): string;
|
|
8
|
+
//# sourceMappingURL=i18n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,eAAO,MAAM,cAAc,EAAE,aA2H5B,CAAC;AAEF,+CAA+C;AAC/C,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAM,GAAG,MAAM,CAI7F;AAED,4CAA4C;AAC5C,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAkDjD,CAAC;AAEF,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEtD"}
|
package/dist/icons.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit';
|
|
2
|
+
export declare const icons: {
|
|
3
|
+
mail: TemplateResult<1>;
|
|
4
|
+
phone: TemplateResult<1>;
|
|
5
|
+
user: TemplateResult<1>;
|
|
6
|
+
userX: TemplateResult<1>;
|
|
7
|
+
lock: TemplateResult<1>;
|
|
8
|
+
key: TemplateResult<1>;
|
|
9
|
+
shield: TemplateResult<1>;
|
|
10
|
+
shieldCheck: TemplateResult<1>;
|
|
11
|
+
smartphone: TemplateResult<1>;
|
|
12
|
+
monitor: TemplateResult<1>;
|
|
13
|
+
globe: TemplateResult<1>;
|
|
14
|
+
logOut: TemplateResult<1>;
|
|
15
|
+
settings: TemplateResult<1>;
|
|
16
|
+
x: TemplateResult<1>;
|
|
17
|
+
check: TemplateResult<1>;
|
|
18
|
+
copy: TemplateResult<1>;
|
|
19
|
+
eye: TemplateResult<1>;
|
|
20
|
+
eyeOff: TemplateResult<1>;
|
|
21
|
+
arrowLeft: TemplateResult<1>;
|
|
22
|
+
alert: TemplateResult<1>;
|
|
23
|
+
info: TemplateResult<1>;
|
|
24
|
+
checkCircle: TemplateResult<1>;
|
|
25
|
+
link: TemplateResult<1>;
|
|
26
|
+
activity: TemplateResult<1>;
|
|
27
|
+
trash: TemplateResult<1>;
|
|
28
|
+
sparkles: TemplateResult<1>;
|
|
29
|
+
refresh: TemplateResult<1>;
|
|
30
|
+
chevronDown: TemplateResult<1>;
|
|
31
|
+
ghost: TemplateResult<1>;
|
|
32
|
+
qr: TemplateResult<1>;
|
|
33
|
+
};
|
|
34
|
+
export declare const brandIcons: Record<string, TemplateResult>;
|
|
35
|
+
export declare function providerIcon(provider: string): TemplateResult;
|
|
36
|
+
/** Circular alert glyph used by notices. */
|
|
37
|
+
export declare function toneIcon(tone: "success" | "error" | "info" | "warning"): TemplateResult;
|
|
38
|
+
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../src/icons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAiBrD,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+EjB,CAAC;AAMF,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAuDrD,CAAC;AAEF,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAE7D;AAED,4CAA4C;AAC5C,wBAAgB,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,cAAc,CAIvF"}
|