@saasbase-io/core-elements 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/assets/icons/account.icon.d.ts +1 -0
- package/dist/assets/icons/burger-menu.icon.d.ts +1 -0
- package/dist/assets/icons/close.icon.d.ts +1 -0
- package/dist/assets/icons/edit.icon.d.ts +1 -0
- package/dist/assets/icons/index.d.ts +7 -0
- package/dist/assets/icons/location.icon.d.ts +1 -0
- package/dist/assets/icons/personal-info.icon.d.ts +1 -0
- package/dist/assets/icons/url.icon.d.ts +1 -0
- package/dist/components/frameworks/nextjs.d.ts +19 -0
- package/dist/components/frameworks/react.d.ts +24 -0
- package/dist/components/frameworks/web-components.d.ts +5 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/renderers/index.d.ts +17 -0
- package/dist/components/renderers/renderElement.d.ts +4 -0
- package/dist/components/renderers/sb-button-renderer.d.ts +31 -0
- package/dist/components/renderers/sb-checkbox-renderer.d.ts +26 -0
- package/dist/components/renderers/sb-container-renderer.d.ts +23 -0
- package/dist/components/renderers/sb-countdown-renderer.d.ts +24 -0
- package/dist/components/renderers/sb-divider-renderer.d.ts +15 -0
- package/dist/components/renderers/sb-error-renderer.d.ts +15 -0
- package/dist/components/renderers/sb-gap-renderer.d.ts +15 -0
- package/dist/components/renderers/sb-html-renderer.d.ts +18 -0
- package/dist/components/renderers/sb-image-renderer.d.ts +20 -0
- package/dist/components/renderers/sb-input-renderer.d.ts +24 -0
- package/dist/components/renderers/sb-label-renderer.d.ts +15 -0
- package/dist/components/renderers/sb-logo-renderer.d.ts +20 -0
- package/dist/components/renderers/sb-otp-renderer.d.ts +19 -0
- package/dist/components/renderers/sb-spinner-renderer.d.ts +15 -0
- package/dist/components/renderers/sb-text-renderer.d.ts +15 -0
- package/dist/components/renderers/sb-watermark-renderer.d.ts +23 -0
- package/dist/components/ui/error/index.d.ts +6 -0
- package/dist/components/ui/hint/index.d.ts +6 -0
- package/dist/components/ui/index.d.ts +5 -0
- package/dist/components/ui/linear-loader/index.d.ts +12 -0
- package/dist/components/ui/spinner/index.d.ts +14 -0
- package/dist/components/ui/watermark/index.d.ts +9 -0
- package/dist/components/widgets/index.d.ts +4 -0
- package/dist/components/widgets/sb-preview/sb-preview.d.ts +14 -0
- package/dist/components/widgets/sb-signin/sb-signin.d.ts +11 -0
- package/dist/components/widgets/sb-signup/sb-signup.d.ts +11 -0
- package/dist/components/widgets/sb-user-profile/index.d.ts +2 -0
- package/dist/components/widgets/sb-user-profile/profile/account-info.d.ts +38 -0
- package/dist/components/widgets/sb-user-profile/profile/classes.d.ts +10 -0
- package/dist/components/widgets/sb-user-profile/profile/index.d.ts +5 -0
- package/dist/components/widgets/sb-user-profile/profile/location-info.d.ts +25 -0
- package/dist/components/widgets/sb-user-profile/profile/personal-info.d.ts +30 -0
- package/dist/components/widgets/sb-user-profile/profile/profile.d.ts +26 -0
- package/dist/components/widgets/sb-user-profile/profile/urls-info.d.ts +24 -0
- package/dist/components/widgets/sb-user-profile/sb-user-profile.d.ts +39 -0
- package/dist/components/widgets/sb-user-profile/sidebar/classes.d.ts +9 -0
- package/dist/components/widgets/sb-user-profile/sidebar/sidebar.d.ts +22 -0
- package/dist/components/wrappers/base-element/base-element.d.ts +11 -0
- package/dist/components/wrappers/index.d.ts +6 -0
- package/dist/components/wrappers/layout/layout.d.ts +56 -0
- package/dist/components/wrappers/layout/validation.d.ts +15 -0
- package/dist/components/wrappers/sb-authenticated/sb-authenticated.d.ts +16 -0
- package/dist/components/wrappers/sb-provider/sb-provider.d.ts +28 -0
- package/dist/components/wrappers/sb-signed-in/sb-signed-in.d.ts +9 -0
- package/dist/components/wrappers/sb-signed-out/sb-signed-out.d.ts +9 -0
- package/dist/constants/classes.d.ts +22 -0
- package/dist/constants/enums.d.ts +16 -0
- package/dist/constants/index.d.ts +4 -0
- package/dist/constants/regex.d.ts +4 -0
- package/dist/constants/styles.d.ts +2 -0
- package/dist/context/auth-context.d.ts +6 -0
- package/dist/context/customization-context.d.ts +4 -0
- package/dist/context/env-context.d.ts +4 -0
- package/dist/context/index.d.ts +4 -0
- package/dist/context/render-spec.d.ts +4 -0
- package/dist/funcs/env.d.ts +3 -0
- package/dist/funcs/index.d.ts +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +6463 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +23975 -0
- package/dist/index.mjs.map +1 -0
- package/dist/styles.css +3649 -0
- package/dist/types/common/index.d.ts +15 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/user-profile.d.ts +39 -0
- package/dist/types/core/index.d.ts +11 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/layout/index.d.ts +245 -0
- package/dist/types/react/index.d.ts +61 -0
- package/dist/types/styles/index.d.ts +67 -0
- package/dist/utils/components.d.ts +7 -0
- package/dist/utils/html-base64.d.ts +1 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/styles.d.ts +23 -0
- package/dist/utils/svg-base64.d.ts +2 -0
- package/dist/utils/tailwind.d.ts +7 -0
- package/package.json +74 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LitElement, TemplateResult } from '../../../../../node_modules/lit';
|
|
2
|
+
import { ICustomizations, IProfileWidgetCustomization, USER_PROFILE_WIDGETS_LAYOUT } from '../../../../types';
|
|
3
|
+
export interface LocationInfo {
|
|
4
|
+
location: string;
|
|
5
|
+
zoneInfo: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class SbLocationInfo extends LitElement {
|
|
8
|
+
locationInfo: LocationInfo;
|
|
9
|
+
customizations: ICustomizations | null;
|
|
10
|
+
showIcons: boolean;
|
|
11
|
+
layout: USER_PROFILE_WIDGETS_LAYOUT;
|
|
12
|
+
content: IProfileWidgetCustomization | null;
|
|
13
|
+
private isEditing;
|
|
14
|
+
private handleEdit;
|
|
15
|
+
private handleCancel;
|
|
16
|
+
private handleSave;
|
|
17
|
+
createRenderRoot(): this;
|
|
18
|
+
private getButtonStyles;
|
|
19
|
+
private getInputStyles;
|
|
20
|
+
private getLabelStyles;
|
|
21
|
+
private getContainerStyles;
|
|
22
|
+
private renderInput;
|
|
23
|
+
private renderFooter;
|
|
24
|
+
render(): TemplateResult<1>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { LitElement, TemplateResult } from '../../../../../node_modules/lit';
|
|
2
|
+
import { ICustomizations, IProfileWidgetCustomization, USER_PROFILE_WIDGETS_LAYOUT } from '../../../../types';
|
|
3
|
+
export interface PersonalInfo {
|
|
4
|
+
username: string;
|
|
5
|
+
first: string;
|
|
6
|
+
middle: string;
|
|
7
|
+
last: string;
|
|
8
|
+
nickname: string;
|
|
9
|
+
gender: string;
|
|
10
|
+
bio: string;
|
|
11
|
+
}
|
|
12
|
+
export declare class SbPersonalInfo extends LitElement {
|
|
13
|
+
personal: PersonalInfo;
|
|
14
|
+
customizations: ICustomizations | null;
|
|
15
|
+
showIcons: boolean;
|
|
16
|
+
layout: USER_PROFILE_WIDGETS_LAYOUT;
|
|
17
|
+
content: IProfileWidgetCustomization | null;
|
|
18
|
+
private isEditing;
|
|
19
|
+
private handleEdit;
|
|
20
|
+
private handleCancel;
|
|
21
|
+
private handleSave;
|
|
22
|
+
createRenderRoot(): this;
|
|
23
|
+
private getButtonStyles;
|
|
24
|
+
private getInputStyles;
|
|
25
|
+
private getLabelStyles;
|
|
26
|
+
private getContainerStyles;
|
|
27
|
+
private renderInput;
|
|
28
|
+
private renderFooter;
|
|
29
|
+
render(): TemplateResult<1>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { LitElement, TemplateResult } from '../../../../../node_modules/lit';
|
|
2
|
+
import { Account } from './account-info';
|
|
3
|
+
import { PersonalInfo } from './personal-info';
|
|
4
|
+
import { LocationInfo } from './location-info';
|
|
5
|
+
import { URLsInfo } from './urls-info';
|
|
6
|
+
import { USER_PROFILE_WIDGETS_LAYOUT, USER_PROFILE_MODE, USER_PROFILE_ORIENTATION, USER_PROFILE_SIDEBAR_DISPLAY_TYPE, IProfileContentCustomizations, ICustomizations } from '../../../../types';
|
|
7
|
+
export declare class Profile extends LitElement {
|
|
8
|
+
account: Account;
|
|
9
|
+
personal: PersonalInfo;
|
|
10
|
+
location: LocationInfo;
|
|
11
|
+
urls: URLsInfo;
|
|
12
|
+
showAvatarMenu: boolean;
|
|
13
|
+
customizations: ICustomizations | null;
|
|
14
|
+
showIcons: boolean;
|
|
15
|
+
modalIcon?: TemplateResult;
|
|
16
|
+
orientation: USER_PROFILE_ORIENTATION;
|
|
17
|
+
sidebarDisplayType: USER_PROFILE_SIDEBAR_DISPLAY_TYPE;
|
|
18
|
+
mode: USER_PROFILE_MODE;
|
|
19
|
+
widgetsLayout: USER_PROFILE_WIDGETS_LAYOUT;
|
|
20
|
+
toggleAvatarMenu: (e: Event) => void;
|
|
21
|
+
onAvatarChange: () => void;
|
|
22
|
+
onAvatarRemove: () => void;
|
|
23
|
+
content: IProfileContentCustomizations | null;
|
|
24
|
+
createRenderRoot(): this;
|
|
25
|
+
render(): TemplateResult<1>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { LitElement, TemplateResult } from '../../../../../node_modules/lit';
|
|
2
|
+
import { ICustomizations, IProfileWidgetCustomization, USER_PROFILE_WIDGETS_LAYOUT } from '../../../../types';
|
|
3
|
+
export interface URLsInfo {
|
|
4
|
+
website: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class SbUrlsInfo extends LitElement {
|
|
7
|
+
URLsInfo: URLsInfo;
|
|
8
|
+
showIcons: boolean;
|
|
9
|
+
customizations: ICustomizations | null;
|
|
10
|
+
layout: USER_PROFILE_WIDGETS_LAYOUT;
|
|
11
|
+
content: IProfileWidgetCustomization | null;
|
|
12
|
+
private isEditing;
|
|
13
|
+
private handleEdit;
|
|
14
|
+
private handleCancel;
|
|
15
|
+
private handleSave;
|
|
16
|
+
createRenderRoot(): this;
|
|
17
|
+
private getButtonStyles;
|
|
18
|
+
private getInputStyles;
|
|
19
|
+
private getLabelStyles;
|
|
20
|
+
private getContainerStyles;
|
|
21
|
+
private renderInput;
|
|
22
|
+
private renderFooter;
|
|
23
|
+
render(): TemplateResult<1>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { LitElement, nothing } from '../../../../node_modules/lit';
|
|
2
|
+
import { USER_PROFILE_MODE, USER_PROFILE_ORIENTATION, USER_PROFILE_SIDEBAR_DISPLAY_TYPE, USER_PROFILE_WIDGETS_LAYOUT, ICustomizations, IProfileContentCustomizations } from '../../../types';
|
|
3
|
+
export declare class SbUserProfile extends LitElement {
|
|
4
|
+
showAvatarMenu: boolean;
|
|
5
|
+
orientation: USER_PROFILE_ORIENTATION;
|
|
6
|
+
mobileDisplay: USER_PROFILE_SIDEBAR_DISPLAY_TYPE;
|
|
7
|
+
mode: USER_PROFILE_MODE;
|
|
8
|
+
widgetsLayout: USER_PROFILE_WIDGETS_LAYOUT;
|
|
9
|
+
content: IProfileContentCustomizations | null;
|
|
10
|
+
customizations: ICustomizations | null;
|
|
11
|
+
providedCustomizations: ICustomizations | null;
|
|
12
|
+
private isOpen;
|
|
13
|
+
private currentBreakpoint;
|
|
14
|
+
private account;
|
|
15
|
+
private personal;
|
|
16
|
+
private location;
|
|
17
|
+
private urls;
|
|
18
|
+
private defaultTab;
|
|
19
|
+
connectedCallback(): void;
|
|
20
|
+
disconnectedCallback(): void;
|
|
21
|
+
protected firstUpdated(): void;
|
|
22
|
+
private _handleResize;
|
|
23
|
+
private _updateBreakpoint;
|
|
24
|
+
private _handleClose;
|
|
25
|
+
private _toggleAvatarMenu;
|
|
26
|
+
private _handleAvatarChange;
|
|
27
|
+
private _handleAvatarRemove;
|
|
28
|
+
private _handleClickOutside;
|
|
29
|
+
private get effectiveCustomizations();
|
|
30
|
+
private get isModal();
|
|
31
|
+
private get sidebarDisplayType();
|
|
32
|
+
private get containerClasses();
|
|
33
|
+
private get contentClasses();
|
|
34
|
+
private renderCloseButton;
|
|
35
|
+
private renderWatermark;
|
|
36
|
+
private renderProfileContent;
|
|
37
|
+
render(): import('../../../../node_modules/lit-html').TemplateResult<1> | typeof nothing;
|
|
38
|
+
createRenderRoot(): this;
|
|
39
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const BASE_CLASSES = "!sb-bg-background";
|
|
2
|
+
export declare const SIDEBAR_CONTAINER_CLASSES: {
|
|
3
|
+
vertical: string;
|
|
4
|
+
horizontal: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const BURGER_BUTTON_CLASSES = "sb-p-2 sb-mb-4 sb-rounded-lg sb-border-muted sb-bg-background";
|
|
7
|
+
export declare const BURGER_LABEL_CLASSES = "sb-font-medium sb-ml-2 -sb-mt-4 sb-text-[18px] sb-text-foreground";
|
|
8
|
+
export declare const MOBILE_DRAWER_CLASSES = "mobile-sidebar-drawer sb-fixed sb-top-0 sb-left-0 sb-h-full sb-max-w-xs sb-bg-background sb-shadow-lg sb-z-[9999] sb-transform sb-transition-all sb-duration-300 sb-ease-in-out";
|
|
9
|
+
export declare const MOBILE_OVERLAY_CLASSES = "mobile-sidebar-overlay sb-fixed sb-inset-0 sb-bg-black/50 sb-z-[9998] sb-transition-opacity sb-duration-300 sb-ease-in-out";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LitElement, TemplateResult } from '../../../../../node_modules/lit';
|
|
2
|
+
import { ICustomizations, USER_PROFILE_MODE, USER_PROFILE_ORIENTATION, USER_PROFILE_SIDEBAR_DISPLAY_TYPE } from '../../../../types';
|
|
3
|
+
export interface SidebarConfig {
|
|
4
|
+
showIcons: boolean;
|
|
5
|
+
modalIcon?: TemplateResult;
|
|
6
|
+
}
|
|
7
|
+
export declare class SbProfileSidebar extends LitElement {
|
|
8
|
+
orientation: USER_PROFILE_ORIENTATION;
|
|
9
|
+
displayType: USER_PROFILE_SIDEBAR_DISPLAY_TYPE;
|
|
10
|
+
mode: USER_PROFILE_MODE;
|
|
11
|
+
config: SidebarConfig;
|
|
12
|
+
customizations: ICustomizations | null;
|
|
13
|
+
private isMenuOpen;
|
|
14
|
+
createRenderRoot(): this;
|
|
15
|
+
private toggleMenu;
|
|
16
|
+
private handleCloseProfile;
|
|
17
|
+
private renderTabs;
|
|
18
|
+
private renderWatermark;
|
|
19
|
+
private renderBurger;
|
|
20
|
+
private renderMobileDrawer;
|
|
21
|
+
render(): TemplateResult<1>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LitElement } from '../../../../node_modules/lit';
|
|
2
|
+
export declare abstract class BaseElement extends LitElement {
|
|
3
|
+
shadow: boolean;
|
|
4
|
+
constructor();
|
|
5
|
+
protected getAttributesToExclude(): string[];
|
|
6
|
+
protected getFilteredAttributes(): Record<string, string>;
|
|
7
|
+
protected isCustomPropertySet(property: string): boolean;
|
|
8
|
+
protected applyCustomClass(variables: string[], selector: string, className?: string): void;
|
|
9
|
+
protected removeDuplicateContent(): void;
|
|
10
|
+
protected moveLightDomChildrenInto(target: HTMLElement, specificNodes?: Node[]): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './base-element/base-element';
|
|
2
|
+
export * from './layout/layout';
|
|
3
|
+
export * from './sb-provider/sb-provider';
|
|
4
|
+
export * from './sb-signed-out/sb-signed-out';
|
|
5
|
+
export * from './sb-signed-in/sb-signed-in';
|
|
6
|
+
export * from './sb-authenticated/sb-authenticated';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { LitElement } from '../../../../node_modules/lit';
|
|
2
|
+
import { RenderSpec, UIElement, ICustomizations, Button, Style, Html, OTP } from '../../../types';
|
|
3
|
+
export declare class SaasBaseLayout extends LitElement {
|
|
4
|
+
renderSpec: RenderSpec | null;
|
|
5
|
+
customizations: ICustomizations | null;
|
|
6
|
+
formData: Record<string, unknown>;
|
|
7
|
+
errors: Record<string, string[]>;
|
|
8
|
+
private _prevErrors;
|
|
9
|
+
loadingButtons: Record<string, boolean>;
|
|
10
|
+
eventEmitting: boolean;
|
|
11
|
+
theme: "light" | "dark";
|
|
12
|
+
private prevHeight;
|
|
13
|
+
private resizeRAF;
|
|
14
|
+
private isAnimating;
|
|
15
|
+
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
16
|
+
private getTheme;
|
|
17
|
+
updated(changedProperties: Map<string, unknown>): void;
|
|
18
|
+
/**
|
|
19
|
+
* Identify which button has submit=true
|
|
20
|
+
*/
|
|
21
|
+
private _findSubmitButton;
|
|
22
|
+
/**
|
|
23
|
+
* Wraps children of container such that the submit button receives type="submit"
|
|
24
|
+
*/
|
|
25
|
+
private _wrapSubmitButtons;
|
|
26
|
+
render(): import('../../../../node_modules/lit-html').TemplateResult<1>;
|
|
27
|
+
private _onSubmit;
|
|
28
|
+
private _findButtonById;
|
|
29
|
+
private animateHeight;
|
|
30
|
+
private collectDataKeys;
|
|
31
|
+
handleInputChange(key: string, value: unknown): void;
|
|
32
|
+
handleBlur(key: string): void;
|
|
33
|
+
handleFocus(key: string, id?: string): void;
|
|
34
|
+
handleEvent(event: string, element: {
|
|
35
|
+
element_type: "button";
|
|
36
|
+
id: string;
|
|
37
|
+
properties: Button;
|
|
38
|
+
style: Style;
|
|
39
|
+
class: string;
|
|
40
|
+
} | {
|
|
41
|
+
element_type: "html";
|
|
42
|
+
id: string;
|
|
43
|
+
properties: Html;
|
|
44
|
+
style: Style;
|
|
45
|
+
class: string;
|
|
46
|
+
} | {
|
|
47
|
+
element_type: "otp";
|
|
48
|
+
id: string;
|
|
49
|
+
properties: OTP;
|
|
50
|
+
style: Style;
|
|
51
|
+
class: string;
|
|
52
|
+
}): Promise<void>;
|
|
53
|
+
findElementByKey(key: string): UIElement | null;
|
|
54
|
+
isFieldValid(key: string): boolean;
|
|
55
|
+
private validateRule;
|
|
56
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { UIElement } from '../../../types';
|
|
2
|
+
import { SaasBaseLayout } from './layout';
|
|
3
|
+
export declare function collectDataKeys(element: UIElement): Record<string, unknown>;
|
|
4
|
+
export declare function validateField(component: SaasBaseLayout, key: string, eventType: "change" | "blur" | "submit"): void;
|
|
5
|
+
export declare function validateAll(component: SaasBaseLayout, eventType?: "change" | "blur" | "submit"): void;
|
|
6
|
+
export declare function validateRequired(value: unknown, element?: UIElement): boolean;
|
|
7
|
+
export declare function validateMinLength(value: unknown, length?: number): boolean;
|
|
8
|
+
export declare function validateMaxLength(value: unknown, length?: number): boolean;
|
|
9
|
+
export declare function validateMinValue(value: unknown, min?: number | string): boolean;
|
|
10
|
+
export declare function validateMaxValue(value: unknown, max?: number | string): boolean;
|
|
11
|
+
export declare function validateRegex(value: unknown, regex?: string): boolean;
|
|
12
|
+
export declare function validateFieldMatch(value: unknown, fieldValue?: unknown): boolean;
|
|
13
|
+
export declare function validateEmail(value: unknown): boolean;
|
|
14
|
+
export declare function validatePhone(value: unknown): boolean;
|
|
15
|
+
export declare function validateDate(value: unknown): boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LitElement, nothing } from '../../../../node_modules/lit';
|
|
2
|
+
import { AuthState } from '../../../context';
|
|
3
|
+
import { EnvConfig } from '../../../types';
|
|
4
|
+
export declare class SbAuthenticated extends LitElement {
|
|
5
|
+
private _cachedChildren;
|
|
6
|
+
createRenderRoot(): this;
|
|
7
|
+
connectedCallback(): void;
|
|
8
|
+
/**
|
|
9
|
+
* The URL to redirect to if the user is not authenticated.
|
|
10
|
+
* Defaults to environment variable, can be overridden via property.
|
|
11
|
+
*/
|
|
12
|
+
redirectUrl: string;
|
|
13
|
+
env?: EnvConfig;
|
|
14
|
+
auth?: AuthState;
|
|
15
|
+
render(): import('../../../../node_modules/lit-html').TemplateResult<1> | typeof nothing;
|
|
16
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from '../../../../node_modules/lit';
|
|
2
|
+
import { AuthState } from '../../../context';
|
|
3
|
+
import { EnvConfig, ICustomizations, RenderSpec } from '../../../types';
|
|
4
|
+
export declare class SbProvider extends LitElement {
|
|
5
|
+
createRenderRoot(): this;
|
|
6
|
+
/**
|
|
7
|
+
* Customizations
|
|
8
|
+
*/
|
|
9
|
+
customizations: ICustomizations | null;
|
|
10
|
+
providedCustomizations: ICustomizations | null;
|
|
11
|
+
/**
|
|
12
|
+
* ENV now comes from a property instead of getEnvConfig()
|
|
13
|
+
*/
|
|
14
|
+
env: EnvConfig | null;
|
|
15
|
+
/**
|
|
16
|
+
* Auth state
|
|
17
|
+
*/
|
|
18
|
+
auth: AuthState;
|
|
19
|
+
renderSpec: RenderSpec | null;
|
|
20
|
+
/**
|
|
21
|
+
* Enable/disable automatic redirect for authenticated users on auth pages.
|
|
22
|
+
*/
|
|
23
|
+
autoRedirect: boolean;
|
|
24
|
+
connectedCallback(): void;
|
|
25
|
+
updated(changedProperties: PropertyValues): void;
|
|
26
|
+
private handleAuthStateChange;
|
|
27
|
+
private refreshAuthState;
|
|
28
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LitElement, nothing } from '../../../../node_modules/lit';
|
|
2
|
+
import { AuthState } from '../../../context';
|
|
3
|
+
export declare class SignedIn extends LitElement {
|
|
4
|
+
private _cachedChildren;
|
|
5
|
+
createRenderRoot(): this;
|
|
6
|
+
connectedCallback(): void;
|
|
7
|
+
auth?: AuthState;
|
|
8
|
+
render(): import('../../../../node_modules/lit-html').TemplateResult<1> | typeof nothing;
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LitElement, nothing } from '../../../../node_modules/lit';
|
|
2
|
+
import { AuthState } from '../../../context';
|
|
3
|
+
export declare class SignedOut extends LitElement {
|
|
4
|
+
private _cachedChildren;
|
|
5
|
+
createRenderRoot(): this;
|
|
6
|
+
auth?: AuthState;
|
|
7
|
+
connectedCallback(): void;
|
|
8
|
+
render(): import('../../../../node_modules/lit-html').TemplateResult<1> | typeof nothing;
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const inputContainerDefaultClass = "sb-mb-4";
|
|
2
|
+
export declare const checkboxRowDefaultClass = "sb-flex sb-items-center";
|
|
3
|
+
export declare const errorDefaultClass = "sb-text-destructive sb-text-sm sb-mt-1 sb-error-anim";
|
|
4
|
+
export declare const labelInputClass = "sb-font-medium sb-text-sm";
|
|
5
|
+
export declare const labelCheckBoxClass = "sb-font-medium sb-text-sm sb-ml-2 sb-flex";
|
|
6
|
+
export declare const hintDefaultClass = "sb-text-sm sb-text-gray-500 sb-mt-1";
|
|
7
|
+
export declare const dividerDefaultClass = "sb-my-6";
|
|
8
|
+
export declare const dividerLineDefaultClass = "sb-flex-grow sb-border-t";
|
|
9
|
+
export declare const dividerTextDefaultClass = "sb-mx-4";
|
|
10
|
+
export declare const watermarkDefaultClass = "";
|
|
11
|
+
export declare const linearLoaderClass = "sb-relative sb-overflow-hidden sb-w-1/3 sb-h-2 sb-linear-bar";
|
|
12
|
+
export declare const dashboardWidthClass = "sb-min-w-[375px] sb-max-w-[609px] sb-w-[calc(100%-30px)] sm:sb-max-w-[735px] md:sb-w-[calc(100%-32px)] md:sb-max-w-[800px] lg:sb-min-w-[800px]";
|
|
13
|
+
export declare const modalWidthClass = "sb-h-[100%] sb-min-w-[375px] sb-max-w-[609px] sb-w-[calc(100vw-30px)] sm:sb-max-w-[735px] md:sb-w-[calc(100vw-32px)] md:sb-max-w-[800px] lg:sb-min-w-[800px]";
|
|
14
|
+
export declare const modalContainerClass = "sb-fixed sb-inset-0 sb-z-[9999] sb-flex sb-items-center sb-justify-center sb-p-4 sb-overflow-auto";
|
|
15
|
+
export declare const modalLayoutClass = "sb-w-fit sb-flex sb-max-h-[calc(100vh-60px)] sb-bg-background sb-shadow-2xl sb-ring-1 sb-ring-border sb-rounded-xl sb-overflow-hidden";
|
|
16
|
+
export declare const dashboardClass = "sb-justify-self-center sb-rotate-0";
|
|
17
|
+
export declare const pageClasses = "sb-border-0 sb-bg-background !sb-m-0";
|
|
18
|
+
export declare const modalClasses = "sb-border sb-rounded-2xl sb-relative sb-py-6";
|
|
19
|
+
export declare const tabTriggerClass = "!sb-text-left sb-text-foreground sb-font-normal hover:!sb-bg-muted !sb-text-sm sb-rounded-md !sb-shadow-none data-[state=active]:!sb-bg-muted";
|
|
20
|
+
export declare const horizontalTabClass = "!sb-flex !sb-justify-start !sb-flex-nowrap !sb-w-full !rtg-grid-cols-2 !sb-gap-2 sb-mx-6";
|
|
21
|
+
export declare const verticalTabClass = "!sb-w-[160px] sb-gap-4 ";
|
|
22
|
+
export declare const tailwindSafeClasses = "sb-w-screen sm:sb-w-[375px] sb-p-[40px_24px] sm:sb-shadow-[0_4px_4px_rgba(0,0,0,0.25)] sb-bg-background sm:sb-border sm:sb-border-border sm:sb-rounded-[8px] font-geist";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare enum ELEMENT_IDS {
|
|
2
|
+
USER_PROFILE_CARD_HEADER_CONTAINER = "sb-user-profile-card-header-container",
|
|
3
|
+
USER_PROFILE_CONTAINER = "sb-user-profile",
|
|
4
|
+
USER_PROFILE_SIDEBAR = "sb-user-profile-sidebar-tabs",
|
|
5
|
+
USER_PROFILE_SIDEBAR_TABS = "sb-user-profile-sidebar-tabs",
|
|
6
|
+
USER_PROFILE_SIDEBAR_BURGER_MENU = "sb-user-profile-sidebar-burger-menu",
|
|
7
|
+
USER_PROFILE_INPUT_LABEL = "sb-user-profile-input-label",
|
|
8
|
+
USER_PROFILE_INPUT_FIELD = "sb-user-profile-input-field",
|
|
9
|
+
USER_PROFILE_EDIT_FORM = "sb-user-profile-edit-form",
|
|
10
|
+
USER_PROFILE_CARD_CONTAINER = "sb-user-profile-card-container",
|
|
11
|
+
USER_PROFILE_EDITABLE_INPUT_FIELD = "sb-user-profile-editable-input-field",
|
|
12
|
+
USER_PROFILE_DEFAULT_BUTTON = "sb-user-profile-default-button",
|
|
13
|
+
USER_PROFILE_OUTLINE_BUTTON = "sb-user-profile-outline-button",
|
|
14
|
+
USER_PROFILE_OTP = "sb-user-profile-otp",
|
|
15
|
+
USER_PROFILE_EDIT_BUTTON = "sb-user-profile-edit-button"
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './env';
|
package/dist/index.d.ts
ADDED