@indobaseinc/auth-ui-shared 1.0.0
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/dist/index.d.ts +345 -0
- package/dist/index.js +497 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +458 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +46 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
import * as _stitches_core_types_styled_component from '@stitches/core/types/styled-component';
|
|
2
|
+
import { CssComponent } from '@stitches/core/types/styled-component';
|
|
3
|
+
import { Provider, EmailOtpType, MobileOtpType } from '@indobaseinc/auth-js';
|
|
4
|
+
import { IndobaseClient } from '@indobaseinc/indobase-js';
|
|
5
|
+
|
|
6
|
+
interface AnimationTailwindClasses {
|
|
7
|
+
enter?: string;
|
|
8
|
+
enterFrom?: string;
|
|
9
|
+
enterTo?: string;
|
|
10
|
+
leave?: string;
|
|
11
|
+
leaveFrom?: string;
|
|
12
|
+
leaveTo?: string;
|
|
13
|
+
}
|
|
14
|
+
type AuthProviders = Provider;
|
|
15
|
+
interface Localization {
|
|
16
|
+
['en']: I18nVariables;
|
|
17
|
+
}
|
|
18
|
+
declare enum SocialLayouts {
|
|
19
|
+
'horizontal' = 0,
|
|
20
|
+
'vertical' = 1
|
|
21
|
+
}
|
|
22
|
+
type SocialLayout = keyof typeof SocialLayouts;
|
|
23
|
+
type SocialButtonSize = 'tiny' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
24
|
+
type ViewSignIn = 'sign_in';
|
|
25
|
+
type ViewSignUp = 'sign_up';
|
|
26
|
+
type ViewMagicLink = 'magic_link';
|
|
27
|
+
type ViewForgottenPassword = 'forgotten_password';
|
|
28
|
+
type ViewUpdatePassword = 'update_password';
|
|
29
|
+
type ViewVerifyOtp = 'verify_otp';
|
|
30
|
+
type ViewType = ViewSignIn | ViewSignUp | ViewMagicLink | ViewForgottenPassword | ViewUpdatePassword | ViewVerifyOtp;
|
|
31
|
+
interface ViewsMap {
|
|
32
|
+
[key: string]: ViewType;
|
|
33
|
+
}
|
|
34
|
+
interface Theme {
|
|
35
|
+
default: ThemeVariables;
|
|
36
|
+
[key: string]: ThemeVariables;
|
|
37
|
+
}
|
|
38
|
+
type RedirectTo = undefined | string;
|
|
39
|
+
type OtpType = EmailOtpType | MobileOtpType;
|
|
40
|
+
interface BaseAppearance {
|
|
41
|
+
theme?: Theme;
|
|
42
|
+
prependedClassName?: string;
|
|
43
|
+
extend?: boolean;
|
|
44
|
+
variables?: {
|
|
45
|
+
default: ThemeVariables;
|
|
46
|
+
[key: string]: ThemeVariables;
|
|
47
|
+
};
|
|
48
|
+
className?: {
|
|
49
|
+
anchor?: string | CssComponent;
|
|
50
|
+
button?: string | CssComponent;
|
|
51
|
+
container?: string | CssComponent;
|
|
52
|
+
divider?: string | CssComponent;
|
|
53
|
+
input?: string | CssComponent;
|
|
54
|
+
label?: string | CssComponent;
|
|
55
|
+
loader?: string | CssComponent;
|
|
56
|
+
message?: string | CssComponent;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
type ProviderScopes = {
|
|
60
|
+
[key in Partial<Provider>]: string;
|
|
61
|
+
};
|
|
62
|
+
interface BaseAuth {
|
|
63
|
+
supabaseClient: IndobaseClient;
|
|
64
|
+
socialLayout?: SocialLayout;
|
|
65
|
+
providers?: Provider[];
|
|
66
|
+
providerScopes?: Partial<ProviderScopes>;
|
|
67
|
+
queryParams?: {
|
|
68
|
+
[key: string]: string;
|
|
69
|
+
};
|
|
70
|
+
view?: ViewType;
|
|
71
|
+
redirectTo?: RedirectTo;
|
|
72
|
+
onlyThirdPartyProviders?: boolean;
|
|
73
|
+
magicLink?: boolean;
|
|
74
|
+
showLinks?: boolean;
|
|
75
|
+
otpType?: OtpType;
|
|
76
|
+
additionalData?: {
|
|
77
|
+
[key: string]: any;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* This will toggle on the dark variation of the theme
|
|
81
|
+
*/
|
|
82
|
+
dark?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Override the labels and button text
|
|
85
|
+
*/
|
|
86
|
+
localization?: {
|
|
87
|
+
variables?: I18nVariables;
|
|
88
|
+
};
|
|
89
|
+
theme?: 'default' | string;
|
|
90
|
+
passwordLimit?: boolean;
|
|
91
|
+
}
|
|
92
|
+
type I18nVariables = {
|
|
93
|
+
sign_up?: {
|
|
94
|
+
email_label?: string;
|
|
95
|
+
password_label?: string;
|
|
96
|
+
email_input_placeholder?: string;
|
|
97
|
+
password_input_placeholder?: string;
|
|
98
|
+
button_label?: string;
|
|
99
|
+
loading_button_label?: string;
|
|
100
|
+
social_provider_text?: string;
|
|
101
|
+
link_text?: string;
|
|
102
|
+
confirmation_text?: string;
|
|
103
|
+
};
|
|
104
|
+
sign_in?: {
|
|
105
|
+
email_label?: string;
|
|
106
|
+
password_label?: string;
|
|
107
|
+
email_input_placeholder?: string;
|
|
108
|
+
password_input_placeholder?: string;
|
|
109
|
+
button_label?: string;
|
|
110
|
+
loading_button_label?: string;
|
|
111
|
+
social_provider_text?: string;
|
|
112
|
+
link_text?: string;
|
|
113
|
+
};
|
|
114
|
+
magic_link?: {
|
|
115
|
+
email_input_label?: string;
|
|
116
|
+
email_input_placeholder?: string;
|
|
117
|
+
button_label?: string;
|
|
118
|
+
loading_button_label?: string;
|
|
119
|
+
link_text?: string;
|
|
120
|
+
confirmation_text?: string;
|
|
121
|
+
empty_email_address?: string;
|
|
122
|
+
};
|
|
123
|
+
forgotten_password?: {
|
|
124
|
+
email_label?: string;
|
|
125
|
+
password_label?: string;
|
|
126
|
+
email_input_placeholder?: string;
|
|
127
|
+
button_label?: string;
|
|
128
|
+
loading_button_label?: string;
|
|
129
|
+
link_text?: string;
|
|
130
|
+
confirmation_text?: string;
|
|
131
|
+
};
|
|
132
|
+
update_password?: {
|
|
133
|
+
password_label?: string;
|
|
134
|
+
password_input_placeholder?: string;
|
|
135
|
+
button_label?: string;
|
|
136
|
+
loading_button_label?: string;
|
|
137
|
+
confirmation_text?: string;
|
|
138
|
+
};
|
|
139
|
+
verify_otp?: {
|
|
140
|
+
email_input_label?: string;
|
|
141
|
+
email_input_placeholder?: string;
|
|
142
|
+
phone_input_label?: string;
|
|
143
|
+
phone_input_placeholder?: string;
|
|
144
|
+
token_input_label?: string;
|
|
145
|
+
token_input_placeholder?: string;
|
|
146
|
+
button_label?: string;
|
|
147
|
+
loading_button_label?: string;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Create default theme
|
|
153
|
+
*
|
|
154
|
+
* createStitches()
|
|
155
|
+
* https://stitches.dev/docs/api#theme
|
|
156
|
+
*
|
|
157
|
+
* to add a new theme use createTheme({})
|
|
158
|
+
* https://stitches.dev/docs/api#theme
|
|
159
|
+
*/
|
|
160
|
+
|
|
161
|
+
declare const ThemeSupa: Theme;
|
|
162
|
+
declare const ThemeMinimal: Theme;
|
|
163
|
+
|
|
164
|
+
type ThemeVariables = {
|
|
165
|
+
colors?: {
|
|
166
|
+
brand?: string;
|
|
167
|
+
brandAccent?: string;
|
|
168
|
+
brandButtonText?: string;
|
|
169
|
+
defaultButtonBackground?: string;
|
|
170
|
+
defaultButtonBackgroundHover?: string;
|
|
171
|
+
defaultButtonBorder?: string;
|
|
172
|
+
defaultButtonText?: string;
|
|
173
|
+
dividerBackground?: string;
|
|
174
|
+
inputBackground?: string;
|
|
175
|
+
inputBorder?: string;
|
|
176
|
+
inputBorderFocus?: string;
|
|
177
|
+
inputBorderHover?: string;
|
|
178
|
+
inputLabelText?: string;
|
|
179
|
+
inputPlaceholder?: string;
|
|
180
|
+
inputText?: string;
|
|
181
|
+
messageText?: string;
|
|
182
|
+
messageBackground?: string;
|
|
183
|
+
messageBorder?: string;
|
|
184
|
+
messageTextDanger?: string;
|
|
185
|
+
messageBackgroundDanger?: string;
|
|
186
|
+
messageBorderDanger?: string;
|
|
187
|
+
anchorTextColor?: string;
|
|
188
|
+
anchorTextHoverColor?: string;
|
|
189
|
+
};
|
|
190
|
+
space?: {
|
|
191
|
+
spaceSmall?: string;
|
|
192
|
+
spaceMedium?: string;
|
|
193
|
+
spaceLarge?: string;
|
|
194
|
+
labelBottomMargin?: string;
|
|
195
|
+
anchorBottomMargin?: string;
|
|
196
|
+
emailInputSpacing?: string;
|
|
197
|
+
socialAuthSpacing?: string;
|
|
198
|
+
buttonPadding?: string;
|
|
199
|
+
inputPadding?: string;
|
|
200
|
+
};
|
|
201
|
+
fontSizes?: {
|
|
202
|
+
baseBodySize?: string;
|
|
203
|
+
baseInputSize?: string;
|
|
204
|
+
baseLabelSize?: string;
|
|
205
|
+
baseButtonSize?: string;
|
|
206
|
+
};
|
|
207
|
+
fonts?: {
|
|
208
|
+
bodyFontFamily?: string;
|
|
209
|
+
buttonFontFamily?: string;
|
|
210
|
+
inputFontFamily?: string;
|
|
211
|
+
labelFontFamily?: string;
|
|
212
|
+
};
|
|
213
|
+
borderWidths?: {
|
|
214
|
+
buttonBorderWidth?: string;
|
|
215
|
+
inputBorderWidth?: string;
|
|
216
|
+
};
|
|
217
|
+
radii?: {
|
|
218
|
+
borderRadiusButton?: string;
|
|
219
|
+
buttonBorderRadius?: string;
|
|
220
|
+
inputBorderRadius?: string;
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Create default theme
|
|
226
|
+
*
|
|
227
|
+
* createStitches()
|
|
228
|
+
* https://stitches.dev/docs/api#theme
|
|
229
|
+
*
|
|
230
|
+
* to add a new theme use createTheme({})
|
|
231
|
+
* https://stitches.dev/docs/api#theme
|
|
232
|
+
*/
|
|
233
|
+
|
|
234
|
+
declare const supabase: ThemeVariables;
|
|
235
|
+
declare const minimal: ThemeVariables;
|
|
236
|
+
declare const darkThemes: {
|
|
237
|
+
supabase: ThemeVariables;
|
|
238
|
+
minimal: ThemeVariables;
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
declare function generateClassNames(
|
|
242
|
+
/**
|
|
243
|
+
* name of css class name variable
|
|
244
|
+
*/
|
|
245
|
+
classNameKey: 'button' | 'container' | 'anchor' | 'divider' | 'label' | 'input' | 'loader' | 'message',
|
|
246
|
+
/**
|
|
247
|
+
* stiches CSS output
|
|
248
|
+
*/
|
|
249
|
+
defaultStyles: string,
|
|
250
|
+
/**
|
|
251
|
+
* appearance variables
|
|
252
|
+
*/
|
|
253
|
+
appearance?: BaseAppearance): (string | _stitches_core_types_styled_component.CssComponent<"span", {}, {}, {}>)[];
|
|
254
|
+
|
|
255
|
+
declare const VIEWS: ViewsMap;
|
|
256
|
+
declare const PREPENDED_CLASS_NAMES = "supabase-auth-ui";
|
|
257
|
+
/**
|
|
258
|
+
* CSS class names
|
|
259
|
+
* used for generating prepended classes
|
|
260
|
+
*/
|
|
261
|
+
declare const CLASS_NAMES: {
|
|
262
|
+
ROOT: string;
|
|
263
|
+
SIGN_IN: ViewType;
|
|
264
|
+
SIGN_UP: ViewType;
|
|
265
|
+
FORGOTTEN_PASSWORD: ViewType;
|
|
266
|
+
MAGIC_LINK: ViewType;
|
|
267
|
+
UPDATE_PASSWORD: ViewType;
|
|
268
|
+
anchor: string;
|
|
269
|
+
button: string;
|
|
270
|
+
container: string;
|
|
271
|
+
divider: string;
|
|
272
|
+
input: string;
|
|
273
|
+
label: string;
|
|
274
|
+
loader: string;
|
|
275
|
+
message: string;
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
declare function merge(target: any, ...args: any): any;
|
|
279
|
+
declare function template(string: string, data: Record<string, string>): string;
|
|
280
|
+
|
|
281
|
+
var sign_up = {
|
|
282
|
+
email_label: "Email address",
|
|
283
|
+
password_label: "Create a Password",
|
|
284
|
+
email_input_placeholder: "Your email address",
|
|
285
|
+
password_input_placeholder: "Your password",
|
|
286
|
+
button_label: "Sign up",
|
|
287
|
+
loading_button_label: "Signing up ...",
|
|
288
|
+
social_provider_text: "Sign in with {{provider}}",
|
|
289
|
+
link_text: "Don't have an account? Sign up",
|
|
290
|
+
confirmation_text: "Check your email for the confirmation link"
|
|
291
|
+
};
|
|
292
|
+
var sign_in = {
|
|
293
|
+
email_label: "Email address",
|
|
294
|
+
password_label: "Your Password",
|
|
295
|
+
email_input_placeholder: "Your email address",
|
|
296
|
+
password_input_placeholder: "Your password",
|
|
297
|
+
button_label: "Sign in",
|
|
298
|
+
loading_button_label: "Signing in ...",
|
|
299
|
+
social_provider_text: "Sign in with {{provider}}",
|
|
300
|
+
link_text: "Already have an account? Sign in"
|
|
301
|
+
};
|
|
302
|
+
var magic_link = {
|
|
303
|
+
email_input_label: "Email address",
|
|
304
|
+
email_input_placeholder: "Your email address",
|
|
305
|
+
button_label: "Send Magic Link",
|
|
306
|
+
loading_button_label: "Sending Magic Link ...",
|
|
307
|
+
link_text: "Send a magic link email",
|
|
308
|
+
confirmation_text: "Check your email for the magic link"
|
|
309
|
+
};
|
|
310
|
+
var forgotten_password = {
|
|
311
|
+
email_label: "Email address",
|
|
312
|
+
password_label: "Your Password",
|
|
313
|
+
email_input_placeholder: "Your email address",
|
|
314
|
+
button_label: "Send reset password instructions",
|
|
315
|
+
loading_button_label: "Sending reset instructions ...",
|
|
316
|
+
link_text: "Forgot your password?",
|
|
317
|
+
confirmation_text: "Check your email for the password reset link"
|
|
318
|
+
};
|
|
319
|
+
var update_password = {
|
|
320
|
+
password_label: "New password",
|
|
321
|
+
password_input_placeholder: "Your new password",
|
|
322
|
+
button_label: "Update password",
|
|
323
|
+
loading_button_label: "Updating password ...",
|
|
324
|
+
confirmation_text: "Your password has been updated"
|
|
325
|
+
};
|
|
326
|
+
var verify_otp = {
|
|
327
|
+
email_input_label: "Email address",
|
|
328
|
+
email_input_placeholder: "Your email address",
|
|
329
|
+
phone_input_label: "Phone number",
|
|
330
|
+
phone_input_placeholder: "Your phone number",
|
|
331
|
+
token_input_label: "Token",
|
|
332
|
+
token_input_placeholder: "Your Otp token",
|
|
333
|
+
button_label: "Verify token",
|
|
334
|
+
loading_button_label: "Signing in ..."
|
|
335
|
+
};
|
|
336
|
+
var en = {
|
|
337
|
+
sign_up: sign_up,
|
|
338
|
+
sign_in: sign_in,
|
|
339
|
+
magic_link: magic_link,
|
|
340
|
+
forgotten_password: forgotten_password,
|
|
341
|
+
update_password: update_password,
|
|
342
|
+
verify_otp: verify_otp
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
export { AnimationTailwindClasses, AuthProviders, BaseAppearance, BaseAuth, CLASS_NAMES, I18nVariables, Localization, OtpType, PREPENDED_CLASS_NAMES, ProviderScopes, RedirectTo, SocialButtonSize, SocialLayout, SocialLayouts, Theme, ThemeMinimal, ThemeSupa, ThemeVariables, VIEWS, ViewForgottenPassword, ViewMagicLink, ViewSignIn, ViewSignUp, ViewType, ViewUpdatePassword, ViewVerifyOtp, ViewsMap, darkThemes, en, generateClassNames, merge, minimal, supabase, template };
|