@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.
Files changed (92) hide show
  1. package/dist/assets/icons/account.icon.d.ts +1 -0
  2. package/dist/assets/icons/burger-menu.icon.d.ts +1 -0
  3. package/dist/assets/icons/close.icon.d.ts +1 -0
  4. package/dist/assets/icons/edit.icon.d.ts +1 -0
  5. package/dist/assets/icons/index.d.ts +7 -0
  6. package/dist/assets/icons/location.icon.d.ts +1 -0
  7. package/dist/assets/icons/personal-info.icon.d.ts +1 -0
  8. package/dist/assets/icons/url.icon.d.ts +1 -0
  9. package/dist/components/frameworks/nextjs.d.ts +19 -0
  10. package/dist/components/frameworks/react.d.ts +24 -0
  11. package/dist/components/frameworks/web-components.d.ts +5 -0
  12. package/dist/components/index.d.ts +3 -0
  13. package/dist/components/renderers/index.d.ts +17 -0
  14. package/dist/components/renderers/renderElement.d.ts +4 -0
  15. package/dist/components/renderers/sb-button-renderer.d.ts +31 -0
  16. package/dist/components/renderers/sb-checkbox-renderer.d.ts +26 -0
  17. package/dist/components/renderers/sb-container-renderer.d.ts +23 -0
  18. package/dist/components/renderers/sb-countdown-renderer.d.ts +24 -0
  19. package/dist/components/renderers/sb-divider-renderer.d.ts +15 -0
  20. package/dist/components/renderers/sb-error-renderer.d.ts +15 -0
  21. package/dist/components/renderers/sb-gap-renderer.d.ts +15 -0
  22. package/dist/components/renderers/sb-html-renderer.d.ts +18 -0
  23. package/dist/components/renderers/sb-image-renderer.d.ts +20 -0
  24. package/dist/components/renderers/sb-input-renderer.d.ts +24 -0
  25. package/dist/components/renderers/sb-label-renderer.d.ts +15 -0
  26. package/dist/components/renderers/sb-logo-renderer.d.ts +20 -0
  27. package/dist/components/renderers/sb-otp-renderer.d.ts +19 -0
  28. package/dist/components/renderers/sb-spinner-renderer.d.ts +15 -0
  29. package/dist/components/renderers/sb-text-renderer.d.ts +15 -0
  30. package/dist/components/renderers/sb-watermark-renderer.d.ts +23 -0
  31. package/dist/components/ui/error/index.d.ts +6 -0
  32. package/dist/components/ui/hint/index.d.ts +6 -0
  33. package/dist/components/ui/index.d.ts +5 -0
  34. package/dist/components/ui/linear-loader/index.d.ts +12 -0
  35. package/dist/components/ui/spinner/index.d.ts +14 -0
  36. package/dist/components/ui/watermark/index.d.ts +9 -0
  37. package/dist/components/widgets/index.d.ts +4 -0
  38. package/dist/components/widgets/sb-preview/sb-preview.d.ts +14 -0
  39. package/dist/components/widgets/sb-signin/sb-signin.d.ts +11 -0
  40. package/dist/components/widgets/sb-signup/sb-signup.d.ts +11 -0
  41. package/dist/components/widgets/sb-user-profile/index.d.ts +2 -0
  42. package/dist/components/widgets/sb-user-profile/profile/account-info.d.ts +38 -0
  43. package/dist/components/widgets/sb-user-profile/profile/classes.d.ts +10 -0
  44. package/dist/components/widgets/sb-user-profile/profile/index.d.ts +5 -0
  45. package/dist/components/widgets/sb-user-profile/profile/location-info.d.ts +25 -0
  46. package/dist/components/widgets/sb-user-profile/profile/personal-info.d.ts +30 -0
  47. package/dist/components/widgets/sb-user-profile/profile/profile.d.ts +26 -0
  48. package/dist/components/widgets/sb-user-profile/profile/urls-info.d.ts +24 -0
  49. package/dist/components/widgets/sb-user-profile/sb-user-profile.d.ts +39 -0
  50. package/dist/components/widgets/sb-user-profile/sidebar/classes.d.ts +9 -0
  51. package/dist/components/widgets/sb-user-profile/sidebar/sidebar.d.ts +22 -0
  52. package/dist/components/wrappers/base-element/base-element.d.ts +11 -0
  53. package/dist/components/wrappers/index.d.ts +6 -0
  54. package/dist/components/wrappers/layout/layout.d.ts +56 -0
  55. package/dist/components/wrappers/layout/validation.d.ts +15 -0
  56. package/dist/components/wrappers/sb-authenticated/sb-authenticated.d.ts +16 -0
  57. package/dist/components/wrappers/sb-provider/sb-provider.d.ts +28 -0
  58. package/dist/components/wrappers/sb-signed-in/sb-signed-in.d.ts +9 -0
  59. package/dist/components/wrappers/sb-signed-out/sb-signed-out.d.ts +9 -0
  60. package/dist/constants/classes.d.ts +22 -0
  61. package/dist/constants/enums.d.ts +16 -0
  62. package/dist/constants/index.d.ts +4 -0
  63. package/dist/constants/regex.d.ts +4 -0
  64. package/dist/constants/styles.d.ts +2 -0
  65. package/dist/context/auth-context.d.ts +6 -0
  66. package/dist/context/customization-context.d.ts +4 -0
  67. package/dist/context/env-context.d.ts +4 -0
  68. package/dist/context/index.d.ts +4 -0
  69. package/dist/context/render-spec.d.ts +4 -0
  70. package/dist/funcs/env.d.ts +3 -0
  71. package/dist/funcs/index.d.ts +1 -0
  72. package/dist/index.d.ts +5 -0
  73. package/dist/index.js +6463 -0
  74. package/dist/index.js.map +1 -0
  75. package/dist/index.mjs +23975 -0
  76. package/dist/index.mjs.map +1 -0
  77. package/dist/styles.css +3649 -0
  78. package/dist/types/common/index.d.ts +15 -0
  79. package/dist/types/components/index.d.ts +1 -0
  80. package/dist/types/components/user-profile.d.ts +39 -0
  81. package/dist/types/core/index.d.ts +11 -0
  82. package/dist/types/index.d.ts +6 -0
  83. package/dist/types/layout/index.d.ts +245 -0
  84. package/dist/types/react/index.d.ts +61 -0
  85. package/dist/types/styles/index.d.ts +67 -0
  86. package/dist/utils/components.d.ts +7 -0
  87. package/dist/utils/html-base64.d.ts +1 -0
  88. package/dist/utils/index.d.ts +5 -0
  89. package/dist/utils/styles.d.ts +23 -0
  90. package/dist/utils/svg-base64.d.ts +2 -0
  91. package/dist/utils/tailwind.d.ts +7 -0
  92. package/package.json +74 -0
@@ -0,0 +1,15 @@
1
+ export type InputType = "hidden" | "text" | "search" | "tel" | "url" | "email" | "password" | "date" | "month" | "week" | "time" | "datetime-local" | "number" | "range" | "color" | "file";
2
+ export interface FieldConfig {
3
+ id: string;
4
+ label: string;
5
+ type: InputType;
6
+ placeholder?: string;
7
+ required?: boolean;
8
+ pattern?: string;
9
+ errorMessage?: string;
10
+ }
11
+ export declare enum TextPositionEnum {
12
+ CENTER = "center",
13
+ LEFT_TO_RIGHT = "left_to_right",
14
+ RIGHT_TO_LEFT = "right_to_left"
15
+ }
@@ -0,0 +1 @@
1
+ export * from './user-profile';
@@ -0,0 +1,39 @@
1
+ import { TemplateResult } from '../../../node_modules/lit-html';
2
+ export declare enum USER_PROFILE_TAB_VALUES {
3
+ PROFILE = "Profile",
4
+ SECURITY = "Security",
5
+ APPEARANCE = "Appearance",
6
+ NOTIFICATION = "Notification"
7
+ }
8
+ export declare enum USER_PROFILE_TAB_LIST {
9
+ PROFILE = "Profile",
10
+ SECURITY = "Security",
11
+ APPEARANCE = "Appearance",
12
+ NOTIFICATION = "Notification"
13
+ }
14
+ export declare enum USER_PROFILE_MODE {
15
+ MODAL = "MODAL",
16
+ PAGE = "PAGE"
17
+ }
18
+ export declare enum USER_PROFILE_SIDEBAR_DISPLAY_TYPE {
19
+ BURGER = "BURGER",
20
+ REGULAR = "REGULAR"
21
+ }
22
+ export declare enum USER_PROFILE_ORIENTATION {
23
+ VERTICAL = "VERTICAL",
24
+ HORIZONTAL = "HORIZONTAL"
25
+ }
26
+ export declare enum USER_PROFILE_WIDGETS_LAYOUT {
27
+ COLUMN = "COLUMN",
28
+ ROW = "ROW"
29
+ }
30
+ export interface IProfileContentCustomizations {
31
+ account?: IProfileWidgetCustomization;
32
+ personalInfo?: IProfileWidgetCustomization;
33
+ locations?: IProfileWidgetCustomization;
34
+ urls?: IProfileWidgetCustomization;
35
+ }
36
+ export interface IProfileWidgetCustomization {
37
+ icon?: HTMLElement | TemplateResult | Element;
38
+ title?: string;
39
+ }
@@ -0,0 +1,11 @@
1
+ export interface EnvConfig {
2
+ domain: string;
3
+ apiKey?: string;
4
+ headers?: Record<string, string>;
5
+ clientId: string;
6
+ clientSecret: string;
7
+ signinUrl: string;
8
+ signupUrl: string;
9
+ signinRedirectUrl?: string;
10
+ locale?: string;
11
+ }
@@ -0,0 +1,6 @@
1
+ export * from './common';
2
+ export * from './layout';
3
+ export * from './styles';
4
+ export * from './core';
5
+ export * from './components';
6
+ export * from './react';
@@ -0,0 +1,245 @@
1
+ import { Style } from '../styles';
2
+ export interface Container {
3
+ type: "flex_column" | "flex_row";
4
+ alignment?: "start" | "center" | "end";
5
+ children: UIElement[];
6
+ }
7
+ export interface ValidationRule {
8
+ type: "required" | "min_length" | "max_length" | "min_value" | "max_value" | "email" | "phone" | "date" | "regex" | "field_match";
9
+ error_message: string;
10
+ length?: number;
11
+ value?: string;
12
+ regex?: string;
13
+ field_match?: string;
14
+ }
15
+ export type ValidationOnEvent = "change" | "blur" | "submit";
16
+ export interface Input {
17
+ type: "number" | "text" | "password" | "email" | "hidden" | "search" | "tel" | "url" | "date" | "month" | "week" | "time" | "datetime-local" | "range" | "color" | "file";
18
+ placeholder?: string;
19
+ autocomplete?: string;
20
+ hint?: string;
21
+ initial_value?: string;
22
+ data_key?: string;
23
+ validation?: {
24
+ rules: ValidationRule[];
25
+ on_event: ValidationOnEvent;
26
+ };
27
+ }
28
+ export interface ImageVariants {
29
+ dark?: string;
30
+ light?: string;
31
+ }
32
+ export interface Image {
33
+ image_url: string;
34
+ link_url?: string;
35
+ }
36
+ export interface Spinner {
37
+ size: number;
38
+ }
39
+ export interface Gap {
40
+ type: "vertical" | "horizontal";
41
+ size: string;
42
+ }
43
+ export interface Label {
44
+ content: string;
45
+ }
46
+ export interface Logo {
47
+ image_url: string;
48
+ }
49
+ export interface Watermark {
50
+ image_url: string;
51
+ label: string;
52
+ }
53
+ export interface Text {
54
+ content: string;
55
+ text_alignment?: "left" | "center" | "right";
56
+ }
57
+ export interface Html {
58
+ content: string;
59
+ }
60
+ export interface Button {
61
+ type: "secondary" | "link" | "default" | "destructive" | "outline" | "ghost";
62
+ text?: string;
63
+ icon_url?: string;
64
+ event: string;
65
+ requires_valid?: string[];
66
+ submit?: boolean;
67
+ }
68
+ export interface Divider {
69
+ text?: string;
70
+ }
71
+ export interface Checkbox {
72
+ label?: string;
73
+ initial_value?: boolean;
74
+ data_key?: string;
75
+ validation?: {
76
+ rules: ValidationRule[];
77
+ on_event: ValidationOnEvent;
78
+ };
79
+ }
80
+ export interface OTP {
81
+ length: number;
82
+ timeout: number;
83
+ variant?: "digits_only" | "with_spacing" | "with_separator" | "simple";
84
+ data_key?: string;
85
+ event?: string;
86
+ resend?: {
87
+ text?: Text;
88
+ button?: Button;
89
+ };
90
+ }
91
+ export interface Error {
92
+ message: string;
93
+ }
94
+ export interface CountdownProperties {
95
+ duration?: number;
96
+ redirect_url?: string;
97
+ content?: string;
98
+ }
99
+ export type DataElement = {
100
+ element_type: "checkbox";
101
+ id: string;
102
+ properties: Checkbox;
103
+ style: Style;
104
+ class: string;
105
+ data_key: string;
106
+ } | {
107
+ element_type: "input";
108
+ id: string;
109
+ properties: Input;
110
+ style: Style;
111
+ class: string;
112
+ data_key: string;
113
+ } | {
114
+ element_type: "otp";
115
+ id: string;
116
+ properties: OTP;
117
+ style: Style;
118
+ class: string;
119
+ data_key: string;
120
+ };
121
+ export type UIElement = {
122
+ element_type: "container";
123
+ id: string;
124
+ properties: Container;
125
+ style: Style;
126
+ class: string;
127
+ hidden?: boolean;
128
+ } | {
129
+ element_type: "label";
130
+ id: string;
131
+ properties: Label;
132
+ style: Style;
133
+ class: string;
134
+ hidden?: boolean;
135
+ } | {
136
+ element_type: "gap";
137
+ id: string;
138
+ properties: Gap;
139
+ style: Style;
140
+ class: string;
141
+ hidden?: boolean;
142
+ } | {
143
+ element_type: "html";
144
+ id: string;
145
+ properties: Html;
146
+ style: Style;
147
+ class: string;
148
+ hidden?: boolean;
149
+ } | {
150
+ element_type: "input";
151
+ id: string;
152
+ properties: Input;
153
+ style: Style;
154
+ class: string;
155
+ data_key?: string;
156
+ hidden?: boolean;
157
+ } | {
158
+ element_type: "image";
159
+ id: string;
160
+ properties: Image;
161
+ style: Style;
162
+ class: string;
163
+ hidden?: boolean;
164
+ } | {
165
+ element_type: "spinner";
166
+ id: string;
167
+ properties: Spinner;
168
+ style: Style;
169
+ class: string;
170
+ hidden?: boolean;
171
+ } | {
172
+ element_type: "logo";
173
+ id: string;
174
+ properties: Logo;
175
+ style: Style;
176
+ class: string;
177
+ hidden?: boolean;
178
+ } | {
179
+ element_type: "text";
180
+ id: string;
181
+ properties: Text;
182
+ style: Style;
183
+ class: string;
184
+ hidden?: boolean;
185
+ } | {
186
+ element_type: "button";
187
+ id: string;
188
+ properties: Button;
189
+ style: Style;
190
+ class: string;
191
+ hidden?: boolean;
192
+ } | {
193
+ element_type: "divider";
194
+ id: string;
195
+ properties: Divider;
196
+ style: Style;
197
+ class: string;
198
+ hidden?: boolean;
199
+ } | {
200
+ element_type: "checkbox";
201
+ id: string;
202
+ properties: Checkbox;
203
+ style: Style;
204
+ class: string;
205
+ data_key?: string;
206
+ hidden?: boolean;
207
+ } | {
208
+ element_type: "otp";
209
+ id: string;
210
+ properties: OTP;
211
+ style: Style;
212
+ class: string;
213
+ data_key?: string;
214
+ hidden?: boolean;
215
+ } | {
216
+ element_type: "error";
217
+ id: string;
218
+ properties: Error;
219
+ style: Style;
220
+ class: string;
221
+ hidden?: boolean;
222
+ } | {
223
+ element_type: "watermark";
224
+ id: string;
225
+ properties: Watermark;
226
+ style: Style;
227
+ class: string;
228
+ hidden?: boolean;
229
+ } | {
230
+ element_type: "countdown";
231
+ id: string;
232
+ properties: CountdownProperties;
233
+ style: Style;
234
+ class: string;
235
+ hidden?: boolean;
236
+ };
237
+ export interface RenderSpec {
238
+ root_container: UIElement;
239
+ }
240
+ export interface EventResponse {
241
+ next_screen: string;
242
+ state: string;
243
+ session_token: string;
244
+ render_spec: RenderSpec;
245
+ }
@@ -0,0 +1,61 @@
1
+ import { ReactNode } from 'react';
2
+ import { ICustomizations } from '../styles';
3
+ import { RenderSpec } from '../layout';
4
+ import { IProfileContentCustomizations, IProfileWidgetCustomization, USER_PROFILE_MODE, USER_PROFILE_ORIENTATION, USER_PROFILE_SIDEBAR_DISPLAY_TYPE, USER_PROFILE_WIDGETS_LAYOUT } from '../components';
5
+ import { Account, LocationInfo, PersonalInfo, URLsInfo } from '../../components';
6
+ type WithChildren = {
7
+ children?: ReactNode;
8
+ };
9
+ type WithCustomizations = {
10
+ customizations?: ICustomizations | null;
11
+ };
12
+ type WithRenderSpec = {
13
+ renderSpec?: RenderSpec | null;
14
+ };
15
+ type WidgetLayout = "ROW" | "COLUMN" | typeof USER_PROFILE_WIDGETS_LAYOUT.ROW | typeof USER_PROFILE_WIDGETS_LAYOUT.COLUMN;
16
+ type CommonWidgetProps = WithChildren & WithCustomizations & {
17
+ showIcons?: boolean;
18
+ Layout?: WidgetLayout;
19
+ content?: IProfileWidgetCustomization | null;
20
+ };
21
+ export interface ProviderProps extends WithChildren, WithCustomizations {
22
+ autoRedirect?: boolean;
23
+ }
24
+ export interface LayoutProps extends WithChildren, WithCustomizations, WithRenderSpec {
25
+ }
26
+ export interface PreviewProps extends WithChildren, WithCustomizations, WithRenderSpec {
27
+ }
28
+ export interface SignInProps extends WithChildren, WithCustomizations {
29
+ }
30
+ export interface SignUpProps extends WithChildren, WithCustomizations {
31
+ }
32
+ export interface UserProfileProps extends WithChildren, WithCustomizations {
33
+ showAvatarMenu?: boolean;
34
+ orientation?: "VERTICAL" | "HORIZONTAL" | typeof USER_PROFILE_ORIENTATION.HORIZONTAL | typeof USER_PROFILE_ORIENTATION.VERTICAL;
35
+ mobileDisplay?: "REGULAR" | "BURGER" | typeof USER_PROFILE_SIDEBAR_DISPLAY_TYPE.REGULAR | typeof USER_PROFILE_SIDEBAR_DISPLAY_TYPE.BURGER;
36
+ mode?: "PAGE" | "MODAL" | typeof USER_PROFILE_MODE.PAGE | typeof USER_PROFILE_MODE.MODAL;
37
+ widgetsLayout?: WidgetLayout;
38
+ content?: IProfileContentCustomizations | null;
39
+ }
40
+ export interface AccountInfoProps extends WithChildren, WithCustomizations {
41
+ account?: Account;
42
+ showAvatarMenu?: boolean;
43
+ toggleAvatarMenu: (e: Event) => void;
44
+ onAvatarChange: () => void;
45
+ onAvatarRemove: () => void;
46
+ showIcons?: boolean;
47
+ content?: IProfileWidgetCustomization | null;
48
+ otpVariant?: "simple" | "with_spacing" | "with_separator" | "digits_only";
49
+ otpLength?: number;
50
+ Layout?: WidgetLayout;
51
+ }
52
+ export interface LocationInfoProps extends CommonWidgetProps {
53
+ locationInfo?: LocationInfo;
54
+ }
55
+ export interface UrlsInfoProps extends CommonWidgetProps {
56
+ URLsInfo?: URLsInfo;
57
+ }
58
+ export interface PersonalInfoProps extends CommonWidgetProps {
59
+ personal?: PersonalInfo;
60
+ }
61
+ export {};
@@ -0,0 +1,67 @@
1
+ export type Breakpoints = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
2
+ export interface Style {
3
+ [prop: string]: string | number | undefined | null | Style;
4
+ }
5
+ export interface ICustomizationOptions {
6
+ class?: string;
7
+ style?: Style;
8
+ rule?: "override" | "merge";
9
+ font?: "font-geist" | "font-inter" | "font-roboto" | "font-open-sans" | "font-lato" | "font-montserrat";
10
+ }
11
+ export interface ICustomizations {
12
+ byType?: {
13
+ loader?: {
14
+ spinner?: ICustomizationOptions;
15
+ linear?: ICustomizationOptions;
16
+ };
17
+ logo?: ICustomizationOptions;
18
+ buttons?: {
19
+ defaultButton?: ICustomizationOptions;
20
+ secondaryButton?: ICustomizationOptions;
21
+ linkButton?: ICustomizationOptions;
22
+ outlineButton?: ICustomizationOptions;
23
+ ghostButton?: ICustomizationOptions;
24
+ destructiveButton?: ICustomizationOptions;
25
+ };
26
+ errors?: {
27
+ inputError?: ICustomizationOptions;
28
+ serviceError?: ICustomizationOptions;
29
+ };
30
+ inputs?: {
31
+ inputContainer?: ICustomizationOptions;
32
+ inputField?: ICustomizationOptions;
33
+ inputHint?: ICustomizationOptions;
34
+ };
35
+ labels?: {
36
+ inputLabel?: ICustomizationOptions;
37
+ checkboxLabel?: ICustomizationOptions;
38
+ };
39
+ divider?: {
40
+ dividerContainer?: ICustomizationOptions;
41
+ dividerLine?: ICustomizationOptions;
42
+ dividerText?: ICustomizationOptions;
43
+ };
44
+ timer?: {
45
+ countdowns?: ICustomizationOptions;
46
+ };
47
+ userProfile?: {
48
+ container?: ICustomizationOptions;
49
+ sidebar?: ICustomizationOptions;
50
+ sidebarTabs?: ICustomizationOptions;
51
+ sidebarBurgerMenu?: ICustomizationOptions;
52
+ userProfileCard?: {
53
+ container?: ICustomizationOptions;
54
+ header?: {
55
+ container?: ICustomizationOptions;
56
+ title?: ICustomizationOptions;
57
+ };
58
+ editForm?: ICustomizationOptions;
59
+ };
60
+ };
61
+ };
62
+ byId?: Record<string, ICustomizationOptions>;
63
+ config?: {
64
+ breakpoints?: Partial<Record<Breakpoints, string>>;
65
+ font?: "font-geist" | "font-inter" | "font-roboto" | "font-open-sans" | "font-lato" | "font-montserrat";
66
+ };
67
+ }
@@ -0,0 +1,7 @@
1
+ import { ICustomizationOptions, ICustomizations, Style } from '../types';
2
+ export declare function mapAlignment(alignment: string): string;
3
+ export declare function mapBtnToCustomizedStyle(variant: "secondary" | "link" | "default" | "destructive" | "outline" | "ghost", customizations: ICustomizations): ICustomizationOptions | undefined;
4
+ export declare function applyCustomizations(defaultClass: string, defaultStyle?: Style, typeCustomization?: ICustomizationOptions, elementId?: string, customizations?: ICustomizations, isRootContainer?: boolean): {
5
+ class: string;
6
+ style: Style;
7
+ };
@@ -0,0 +1 @@
1
+ export declare function base64ToHtml(base64: string): string;
@@ -0,0 +1,5 @@
1
+ export * from './components';
2
+ export * from './styles';
3
+ export * from './tailwind';
4
+ export * from './svg-base64';
5
+ export * from './html-base64';
@@ -0,0 +1,23 @@
1
+ import { Breakpoints, Style } from '../types';
2
+ import { ClassValue } from 'clsx';
3
+ export declare function cn(...inputs: ClassValue[]): string;
4
+ export declare function mapStyles(style: Style): string;
5
+ export declare function changeTheme(theme: "light" | "dark"): void;
6
+ export declare function initTheme(): void;
7
+ export declare function getTheme(): "light" | "dark";
8
+ export declare function resolveImageUrl(url: string, theme: "light" | "dark"): string;
9
+ export declare function splitStyle(style: Style): {
10
+ base: Style;
11
+ responsive: Record<Breakpoints, Style>;
12
+ };
13
+ export declare function mergeBreakpoints(custom?: Partial<Record<Breakpoints, string>>): Record<Breakpoints, string>;
14
+ export declare function injectResponsiveStyles(id: string, responsive: Record<Breakpoints, Style>, customBreakpoints?: Partial<Record<Breakpoints, string>>): void;
15
+ export declare function nextPaint(): Promise<void>;
16
+ /**
17
+ * Updates flex widths of buttons:
18
+ * - Last row normally fixed width
19
+ * - Other rows flex-grow: 1
20
+ * - If last row === first row, last row grows instead
21
+ */
22
+ export declare function updateSocialLoginBtnWidths(container: HTMLElement, buttons: HTMLElement[]): Promise<void>;
23
+ export declare function deepMerge<T extends Record<string, any>, U extends Record<string, any>>(target: T, source: U): T & U;
@@ -0,0 +1,2 @@
1
+ export declare function decodeBase64Svg(icon: string): string | null;
2
+ export declare function resolveIconSource(icon: string): string;
@@ -0,0 +1,7 @@
1
+ import { RenderSpec } from '../types';
2
+ interface JSONEditor {
3
+ get: () => RenderSpec;
4
+ set: (data: RenderSpec) => void;
5
+ }
6
+ export declare function initializeDynamicStyles(jsonEditor: JSONEditor, renderSpec: RenderSpec): void;
7
+ export {};
package/package.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "@saasbase-io/core-elements",
3
+ "version": "1.0.0",
4
+ "license": "MIT",
5
+ "description": "A collection saas based related components",
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.mjs",
8
+ "types": "dist/index.d.ts",
9
+ "type": "module",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.mjs",
14
+ "require": "./dist/index.js"
15
+ },
16
+ "./dist/styles.css": "./dist/styles.css"
17
+ },
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "scripts": {
22
+ "dev": "vite",
23
+ "build": "vite build && npm run build:css",
24
+ "preview": "vite preview",
25
+ "test": "echo 'Add tests here'",
26
+ "lint": "eslint 'src/**/*.{ts,tsx}' --fix",
27
+ "build:demo": "vite build --config vite.demo.config.ts",
28
+ "preview:demo": "vite preview --config vite.demo.config.ts",
29
+ "build:css": "postcss src/styles/tailwind.css -o dist/styles.css"
30
+ },
31
+ "keywords": [
32
+ "lit",
33
+ "web-components",
34
+ "typescript",
35
+ "vite"
36
+ ],
37
+ "author": "team-saas-based",
38
+ "devDependencies": {
39
+ "@types/jsoneditor": "^9.9.5",
40
+ "@types/node": "^24.0.4",
41
+ "@types/react": "^19.0.0",
42
+ "@typescript-eslint/eslint-plugin": "^8.46.2",
43
+ "@typescript-eslint/parser": "^8.46.2",
44
+ "@vitejs/plugin-react": "^4.6.0",
45
+ "autoprefixer": "^10.4.20",
46
+ "eslint": "^9.38.0",
47
+ "globals": "^16.4.0",
48
+ "lit": "^3.3.0",
49
+ "postcss": "^8.4.47",
50
+ "postcss-cli": "^11.0.1",
51
+ "react": "^19.1.1",
52
+ "tailwindcss": "^3.4.1",
53
+ "typescript": "^5.8.3",
54
+ "vite": "^6.3.5",
55
+ "vite-plugin-dts": "^4.5.4"
56
+ },
57
+ "dependencies": {
58
+ "@lit/context": "^1.1.0",
59
+ "@lit/react": "^1.0.8",
60
+ "@lit/reactive-element": "^2.1.0",
61
+ "@revotech-group/revotech-ui-kit": "^0.1.43",
62
+ "@saasbase-io/loginflow-websdk": "^1.9.3",
63
+ "jsoneditor": "^10.2.0",
64
+ "lit-html": "^3.3.0"
65
+ },
66
+ "peerDependencies": {
67
+ "next": ">=13.0.0",
68
+ "react": "^18.2.0 || ^19.0.0",
69
+ "react-dom": "^18.2.0 || ^19.0.0"
70
+ },
71
+ "publishConfig": {
72
+ "access": "public"
73
+ }
74
+ }