@llmnative/react 0.1.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 (150) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +375 -0
  3. package/bin/cli.js +99 -0
  4. package/dist/index.css +1 -0
  5. package/dist/index.js +838 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/index.mjs +12161 -0
  8. package/dist/index.mjs.map +1 -0
  9. package/dist/types/src/App.d.ts +64 -0
  10. package/dist/types/src/Config.d.ts +65 -0
  11. package/dist/types/src/Global.d.ts +12 -0
  12. package/dist/types/src/Head.d.ts +193 -0
  13. package/dist/types/src/Theme.d.ts +335 -0
  14. package/dist/types/src/auth.d.ts +27 -0
  15. package/dist/types/src/components/Component.d.ts +55 -0
  16. package/dist/types/src/components/FormEnhancer.d.ts +26 -0
  17. package/dist/types/src/components/Template.d.ts +18 -0
  18. package/dist/types/src/components/blocks/Brand.d.ts +14 -0
  19. package/dist/types/src/components/blocks/Breadcrumbs.d.ts +8 -0
  20. package/dist/types/src/components/blocks/Carousel.d.ts +19 -0
  21. package/dist/types/src/components/blocks/Dropdown.d.ts +64 -0
  22. package/dist/types/src/components/blocks/Menu.d.ts +24 -0
  23. package/dist/types/src/components/blocks/Notifications.d.ts +15 -0
  24. package/dist/types/src/components/blocks/Search.d.ts +7 -0
  25. package/dist/types/src/components/index.d.ts +52 -0
  26. package/dist/types/src/components/types.d.ts +11 -0
  27. package/dist/types/src/components/ui/Alert.d.ts +13 -0
  28. package/dist/types/src/components/ui/Badge.d.ts +27 -0
  29. package/dist/types/src/components/ui/Buttons.d.ts +57 -0
  30. package/dist/types/src/components/ui/Card.d.ts +15 -0
  31. package/dist/types/src/components/ui/Code.d.ts +25 -0
  32. package/dist/types/src/components/ui/Gallery.d.ts +55 -0
  33. package/dist/types/src/components/ui/GridSystem.d.ts +21 -0
  34. package/dist/types/src/components/ui/Icon.d.ts +13 -0
  35. package/dist/types/src/components/ui/Image.d.ts +19 -0
  36. package/dist/types/src/components/ui/ImageAvatar.d.ts +16 -0
  37. package/dist/types/src/components/ui/LayoutBuilder.d.ts +19 -0
  38. package/dist/types/src/components/ui/Loader.d.ts +11 -0
  39. package/dist/types/src/components/ui/Modal.d.ts +39 -0
  40. package/dist/types/src/components/ui/Pagination.d.ts +18 -0
  41. package/dist/types/src/components/ui/Percentage.d.ts +19 -0
  42. package/dist/types/src/components/ui/Repeat.d.ts +18 -0
  43. package/dist/types/src/components/ui/Tab.d.ts +20 -0
  44. package/dist/types/src/components/ui/TabDynamic.d.ts +20 -0
  45. package/dist/types/src/components/ui/Table.d.ts +43 -0
  46. package/dist/types/src/components/ui/fields/AssistantAI.d.ts +23 -0
  47. package/dist/types/src/components/ui/fields/Command.d.ts +15 -0
  48. package/dist/types/src/components/ui/fields/Crop.d.ts +27 -0
  49. package/dist/types/src/components/ui/fields/ImageUrl.d.ts +7 -0
  50. package/dist/types/src/components/ui/fields/Input.d.ts +62 -0
  51. package/dist/types/src/components/ui/fields/Prompt.d.ts +31 -0
  52. package/dist/types/src/components/ui/fields/Select.d.ts +38 -0
  53. package/dist/types/src/components/ui/fields/Upload.d.ts +25 -0
  54. package/dist/types/src/components/ui/fields/UploadCSV.d.ts +26 -0
  55. package/dist/types/src/components/ui/useRecordSelection.d.ts +20 -0
  56. package/dist/types/src/components/ui/useStableRecordKey.d.ts +5 -0
  57. package/dist/types/src/components/widgets/Form.d.ts +129 -0
  58. package/dist/types/src/components/widgets/Grid.d.ts +6 -0
  59. package/dist/types/src/components/widgets/ImageEditor.d.ts +14 -0
  60. package/dist/types/src/components/widgets/MarkdownReader.d.ts +14 -0
  61. package/dist/types/src/components/widgets/Prompt.d.ts +31 -0
  62. package/dist/types/src/components/widgets/TabDynamic.d.ts +20 -0
  63. package/dist/types/src/components/widgets/grid-core/GridArray.d.ts +5 -0
  64. package/dist/types/src/components/widgets/grid-core/GridCore.d.ts +5 -0
  65. package/dist/types/src/components/widgets/grid-core/GridDB.d.ts +5 -0
  66. package/dist/types/src/components/widgets/grid-core/GridGalleryView.d.ts +5 -0
  67. package/dist/types/src/components/widgets/grid-core/GridTableView.d.ts +5 -0
  68. package/dist/types/src/components/widgets/grid-core/index.d.ts +7 -0
  69. package/dist/types/src/components/widgets/grid-core/resolveGridPathFromUrl.d.ts +1 -0
  70. package/dist/types/src/components/widgets/grid-core/types.d.ts +227 -0
  71. package/dist/types/src/components/widgets/grid-core/useGridActions.d.ts +49 -0
  72. package/dist/types/src/components/widgets/grid-core/useGridColumns.d.ts +10 -0
  73. package/dist/types/src/components/widgets/grid-core/useGridDBRecords.d.ts +10 -0
  74. package/dist/types/src/components/widgets/grid-core/useGridPreparedRecords.d.ts +10 -0
  75. package/dist/types/src/components/widgets/grid-core/useGridSelection.d.ts +13 -0
  76. package/dist/types/src/components/widgets/grid-core/utils.d.ts +14 -0
  77. package/dist/types/src/conf/Prompt.d.ts +84 -0
  78. package/dist/types/src/constant.d.ts +96 -0
  79. package/dist/types/src/index.d.ts +56 -0
  80. package/dist/types/src/libs/cache.d.ts +9 -0
  81. package/dist/types/src/libs/cn.d.ts +2 -0
  82. package/dist/types/src/libs/converter.d.ts +28 -0
  83. package/dist/types/src/libs/database.d.ts +3 -0
  84. package/dist/types/src/libs/email.d.ts +16 -0
  85. package/dist/types/src/libs/fetch.d.ts +9 -0
  86. package/dist/types/src/libs/imageBuilder.d.ts +112 -0
  87. package/dist/types/src/libs/index.d.ts +14 -0
  88. package/dist/types/src/libs/locale.d.ts +24 -0
  89. package/dist/types/src/libs/log.d.ts +2 -0
  90. package/dist/types/src/libs/order.d.ts +14 -0
  91. package/dist/types/src/libs/path.d.ts +26 -0
  92. package/dist/types/src/libs/sanitizer.d.ts +38 -0
  93. package/dist/types/src/libs/seo.d.ts +8 -0
  94. package/dist/types/src/libs/storage.d.ts +2 -0
  95. package/dist/types/src/libs/utils.d.ts +57 -0
  96. package/dist/types/src/motion.d.ts +38 -0
  97. package/dist/types/src/pages/Blog.d.ts +3 -0
  98. package/dist/types/src/pages/BlogPost.d.ts +16 -0
  99. package/dist/types/src/pages/Helper.d.ts +8 -0
  100. package/dist/types/src/pages/NotFound.d.ts +3 -0
  101. package/dist/types/src/pages/Users.d.ts +3 -0
  102. package/dist/types/src/pages/index.d.ts +3 -0
  103. package/dist/types/src/providers/ProviderConfiguration.d.ts +12 -0
  104. package/dist/types/src/providers/ai/index.d.ts +134 -0
  105. package/dist/types/src/providers/auth/AuthProvider.d.ts +22 -0
  106. package/dist/types/src/providers/auth/AuthProviderContext.d.ts +12 -0
  107. package/dist/types/src/providers/auth/dropbox/DropboxAuthProvider.d.ts +16 -0
  108. package/dist/types/src/providers/auth/google/GoogleAuth.d.ts +44 -0
  109. package/dist/types/src/providers/auth/google/GoogleAuthProvider.d.ts +12 -0
  110. package/dist/types/src/providers/auth/google/apis/auth.d.ts +4 -0
  111. package/dist/types/src/providers/auth/google/auth.d.ts +3 -0
  112. package/dist/types/src/providers/data/DataProvider.d.ts +58 -0
  113. package/dist/types/src/providers/data/DataProviderContext.d.ts +12 -0
  114. package/dist/types/src/providers/data/firebase.d.ts +21 -0
  115. package/dist/types/src/providers/data/mock.d.ts +20 -0
  116. package/dist/types/src/providers/data/supabase.d.ts +19 -0
  117. package/dist/types/src/providers/email/EmailProvider.d.ts +10 -0
  118. package/dist/types/src/providers/email/EmailProviderContext.d.ts +12 -0
  119. package/dist/types/src/providers/email/google/GmailEmailProvider.d.ts +7 -0
  120. package/dist/types/src/providers/email/google/apis/email.d.ts +7 -0
  121. package/dist/types/src/providers/email/google/email.d.ts +13 -0
  122. package/dist/types/src/providers/firebase-init.d.ts +10 -0
  123. package/dist/types/src/providers/icon/IconProvider.d.ts +10 -0
  124. package/dist/types/src/providers/icon/IconProviderContext.d.ts +48 -0
  125. package/dist/types/src/providers/icon/LucideIconProvider.d.ts +5 -0
  126. package/dist/types/src/providers/icon/PhosphorIconProvider.d.ts +10 -0
  127. package/dist/types/src/providers/icon/index.d.ts +6 -0
  128. package/dist/types/src/providers/manifest.d.ts +42 -0
  129. package/dist/types/src/providers/scrape/index.d.ts +10 -0
  130. package/dist/types/src/providers/seo/google/keyword.d.ts +14 -0
  131. package/dist/types/src/providers/seo/google/trend.d.ts +25 -0
  132. package/dist/types/src/providers/storage/StorageProvider.d.ts +7 -0
  133. package/dist/types/src/providers/storage/StorageProviderContext.d.ts +12 -0
  134. package/dist/types/src/providers/storage/dropbox.d.ts +48 -0
  135. package/dist/types/src/providers/storage/firebase.d.ts +13 -0
  136. package/dist/types/src/providers/storage/supabase.d.ts +19 -0
  137. package/dist/types/src/types/Block.d.ts +4 -0
  138. package/dist/types/src/types/FormFields.d.ts +33 -0
  139. package/dist/types/src/types/Layout.d.ts +9 -0
  140. package/dist/types/src/types/Section.d.ts +4 -0
  141. package/dist/types/themes/cyber.d.ts +7 -0
  142. package/dist/types/themes/default.d.ts +7 -0
  143. package/dist/types/themes/flat.d.ts +7 -0
  144. package/package.json +126 -0
  145. package/scripts/cli/create-section.js +65 -0
  146. package/scripts/cli/setup-devtools.js +85 -0
  147. package/scripts/cli/setup-project.js +484 -0
  148. package/themes/cyber.ts +405 -0
  149. package/themes/default.ts +405 -0
  150. package/themes/flat.ts +405 -0
@@ -0,0 +1,64 @@
1
+ import React from 'react';
2
+ import { AppThemeProviderConfig } from "./Theme";
3
+ import { AIConfig, DropboxConfig, FirebaseConfig, ScrapeConfig } from "./Config";
4
+ import type { DataProviderAdapter } from "./providers/data/DataProvider";
5
+ import type { StorageProviderAdapter } from "./providers/storage/StorageProvider";
6
+ import type { AuthProviderAdapter } from "./providers/auth/AuthProvider";
7
+ import type { EmailProviderAdapter } from "./providers/email/EmailProvider";
8
+ import { type AppIconProviderConfig } from "./providers/icon/IconProviderContext";
9
+ import { type ServicesConfig, type GoogleProviderConfig, type SupabaseProviderConfig, type MockProviderConfig } from "./providers/manifest";
10
+ interface MenuItem {
11
+ path: string;
12
+ title?: string;
13
+ icon?: string;
14
+ children?: MenuItem[];
15
+ [key: string]: any;
16
+ }
17
+ interface UseMenuItem extends MenuItem {
18
+ active: boolean;
19
+ onClick?: () => void;
20
+ }
21
+ type MenuConfig = {
22
+ [key: string]: (MenuItem & {
23
+ page?: React.ComponentType;
24
+ layout?: React.ComponentType;
25
+ })[];
26
+ };
27
+ export type AppProvidersConfig = {
28
+ firebase?: FirebaseConfig;
29
+ supabase?: SupabaseProviderConfig;
30
+ google?: GoogleProviderConfig;
31
+ dropbox?: DropboxConfig;
32
+ mock?: MockProviderConfig;
33
+ custom?: {
34
+ data?: Record<string, DataProviderAdapter> | DataProviderAdapter;
35
+ storage?: Record<string, StorageProviderAdapter> | StorageProviderAdapter;
36
+ auth?: Record<string, AuthProviderAdapter> | AuthProviderAdapter;
37
+ email?: Record<string, EmailProviderAdapter> | EmailProviderAdapter;
38
+ };
39
+ services?: ServicesConfig;
40
+ };
41
+ export type AppProps = {
42
+ appName?: string;
43
+ aiConfig?: AIConfig;
44
+ scrapeConfig?: ScrapeConfig;
45
+ tenantsURI?: string;
46
+ proxyURI?: string;
47
+ importPage: (pagesPath: string) => Promise<{
48
+ default: React.ComponentType;
49
+ }>;
50
+ LayoutDefault?: React.ComponentType;
51
+ menuConfig: MenuConfig;
52
+ providers?: AppProvidersConfig;
53
+ /** Icon provider registry config. String shorthand selects the default provider id. */
54
+ iconProvider?: AppIconProviderConfig;
55
+ /** Theme registry config. String shorthand selects the active theme id. */
56
+ themeProvider?: AppThemeProviderConfig;
57
+ children?: React.ReactNode;
58
+ };
59
+ export declare const setStaticMenu: (config: MenuConfig) => void;
60
+ export declare const getStaticMenu: (type: string) => MenuItem[];
61
+ export declare const getContextMenu: () => string[];
62
+ declare function App({ importPage, LayoutDefault, aiConfig, scrapeConfig, tenantsURI, proxyURI, appName, menuConfig, providers, iconProvider, themeProvider, children, }: AppProps): React.JSX.Element;
63
+ export declare const useMenu: (type: string) => UseMenuItem[];
64
+ export default App;
@@ -0,0 +1,65 @@
1
+ import React, { ReactNode } from 'react';
2
+ export type FirebaseConfig = {
3
+ apiKey: string;
4
+ authDomain: string;
5
+ databaseURL: string;
6
+ projectId: string;
7
+ storageBucket: string;
8
+ messagingSenderId: string;
9
+ appId: string;
10
+ measurementId: string;
11
+ };
12
+ export type GoogleOAuth2 = {
13
+ clientId: string;
14
+ scope?: string;
15
+ };
16
+ export type GoogleServiceAccount = {
17
+ type: string;
18
+ project_id: string;
19
+ private_key_id: string;
20
+ private_key: string;
21
+ client_email: string;
22
+ client_id: string;
23
+ auth_uri: string;
24
+ token_uri: string;
25
+ auth_provider_x509_cert_url: string;
26
+ client_x509_cert_url: string;
27
+ };
28
+ export type GoogleConfig = {
29
+ oAuth2: GoogleOAuth2;
30
+ serviceAccount?: GoogleServiceAccount;
31
+ developerToken?: string;
32
+ };
33
+ export type DropboxConfig = {
34
+ clientId: string;
35
+ rootPath: string;
36
+ };
37
+ export type AIConfig = {
38
+ geminiApiKey?: string;
39
+ openaiApiKey?: string;
40
+ deepSeekApiKey?: string;
41
+ anthropicApiKey?: string;
42
+ mistralApiKey?: string;
43
+ };
44
+ export type ScrapeConfig = {
45
+ serpApiKey?: string;
46
+ };
47
+ export type Config = {
48
+ title: string;
49
+ firebase?: FirebaseConfig;
50
+ google?: GoogleConfig;
51
+ dropbox?: DropboxConfig;
52
+ ai?: AIConfig;
53
+ scrape?: ScrapeConfig;
54
+ proxyURI?: string;
55
+ };
56
+ type ConfigChangeHandler = (newConfig: Config, prevConfig: Config | null) => void;
57
+ export declare const onConfigChange: (fn: ConfigChangeHandler) => void;
58
+ export declare const RuntimeProvider: ({ children, defaultConfig, tenantsURI }: {
59
+ children: ReactNode;
60
+ defaultConfig: Config;
61
+ tenantsURI?: string;
62
+ }) => React.JSX.Element;
63
+ export declare const getConfig: () => Config | undefined;
64
+ export declare const TenantMenu: () => React.JSX.Element | null;
65
+ export default TenantMenu;
@@ -0,0 +1,12 @@
1
+ import React, { ReactNode } from 'react';
2
+ type GlobalVars = {
3
+ [key: string]: any;
4
+ };
5
+ export declare const GlobalProvider: ({ children }: {
6
+ children: ReactNode;
7
+ }) => React.JSX.Element;
8
+ export declare const useGlobalVars: <T = any>(namespace: string) => [value: T | null, set: (newVars: T) => void, remove: () => void];
9
+ export declare const getGlobalVars: (namespace?: string | null) => GlobalVars;
10
+ export declare const setGlobalVars: (value: any, namespace: string) => void;
11
+ export declare const removeGlobalVars: (namespace: string) => void;
12
+ export {};
@@ -0,0 +1,193 @@
1
+ import React from 'react';
2
+ export type HeadMetaAttributes = Record<string, string | undefined>;
3
+ export interface PageMetadataState {
4
+ title?: string;
5
+ description?: string;
6
+ meta?: HeadMetaAttributes;
7
+ }
8
+ export interface SocialHeadState {
9
+ openGraph?: OpenGraphHeadState;
10
+ twitter?: TwitterHeadState;
11
+ }
12
+ export interface HeadLinkDescriptor {
13
+ rel: string;
14
+ href?: string;
15
+ as?: string;
16
+ type?: string;
17
+ sizes?: string;
18
+ media?: string;
19
+ hrefLang?: string;
20
+ title?: string;
21
+ crossOrigin?: string;
22
+ [attribute: string]: string | boolean | undefined;
23
+ }
24
+ export interface HeadLinksState {
25
+ canonical?: string;
26
+ links?: HeadLinkDescriptor[];
27
+ }
28
+ export interface DocumentHeadState {
29
+ charset?: string;
30
+ viewport?: string;
31
+ base?: DocumentBaseHead;
32
+ httpEquiv?: DocumentHttpEquivMeta;
33
+ robots?: string;
34
+ googlebot?: string;
35
+ canonical?: string;
36
+ ampHtml?: string;
37
+ sitemap?: string;
38
+ keywords?: string | string[];
39
+ author?: string;
40
+ publisher?: string;
41
+ referrer?: string;
42
+ meta?: DocumentMetaAttributes;
43
+ links?: HeadLinkDescriptor[];
44
+ }
45
+ export interface DocumentBaseHead {
46
+ href?: string;
47
+ target?: '_self' | '_blank' | '_parent' | '_top' | string;
48
+ }
49
+ export type DocumentHttpEquivMeta = HeadMetaAttributes;
50
+ export type DocumentMetaAttributes = HeadMetaAttributes;
51
+ export interface LanguageAlternateLink {
52
+ href: string;
53
+ hrefLang: string;
54
+ media?: string;
55
+ type?: string;
56
+ title?: string;
57
+ }
58
+ export interface LanguageHeadState {
59
+ lang?: string;
60
+ dir?: 'ltr' | 'rtl' | 'auto';
61
+ alternates?: LanguageAlternateLink[];
62
+ }
63
+ export interface PaginationHeadState {
64
+ prev?: string;
65
+ next?: string;
66
+ }
67
+ export interface OpenGraphHeadState extends HeadMetaAttributes {
68
+ title?: string;
69
+ type?: string;
70
+ image?: string;
71
+ url?: string;
72
+ description?: string;
73
+ siteName?: string;
74
+ locale?: string;
75
+ }
76
+ export interface TwitterHeadState extends HeadMetaAttributes {
77
+ card?: 'summary' | 'summary_large_image' | 'app' | 'player' | string;
78
+ site?: string;
79
+ creator?: string;
80
+ title?: string;
81
+ description?: string;
82
+ image?: string;
83
+ }
84
+ export interface HeadScriptAsset {
85
+ src?: string;
86
+ inline?: string;
87
+ type?: string;
88
+ async?: boolean;
89
+ defer?: boolean;
90
+ nonce?: string;
91
+ integrity?: string;
92
+ crossOrigin?: string;
93
+ referrerPolicy?: string;
94
+ id?: string;
95
+ }
96
+ export interface HeadStyleAsset {
97
+ href?: string;
98
+ inline?: string;
99
+ media?: string;
100
+ title?: string;
101
+ type?: string;
102
+ disabled?: boolean;
103
+ integrity?: string;
104
+ crossOrigin?: string;
105
+ id?: string;
106
+ nonce?: string;
107
+ }
108
+ export interface HeadFontAsset {
109
+ href: string;
110
+ preload?: boolean;
111
+ preconnect?: string[];
112
+ dnsPrefetch?: string[];
113
+ crossOrigin?: string;
114
+ as?: string;
115
+ type?: string;
116
+ media?: string;
117
+ }
118
+ export interface AssetsHeadState {
119
+ scripts?: HeadScriptAsset[];
120
+ styles?: HeadStyleAsset[];
121
+ fonts?: HeadFontAsset[];
122
+ }
123
+ export interface PwaHeadState {
124
+ manifest?: string;
125
+ themeColor?: string;
126
+ backgroundColor?: string;
127
+ colorScheme?: 'normal' | 'light' | 'dark' | 'light dark' | 'dark light' | string;
128
+ applicationName?: string;
129
+ mobileWebAppCapable?: boolean;
130
+ appleMobileWebAppCapable?: boolean;
131
+ appleMobileWebAppTitle?: string;
132
+ appleMobileWebAppStatusBarStyle?: 'default' | 'black' | 'black-translucent';
133
+ favicon?: string;
134
+ appleTouchIcon?: string;
135
+ icons?: PwaIconLink[];
136
+ }
137
+ export interface PwaIconLink extends HeadLinkDescriptor {
138
+ rel: 'icon' | 'apple-touch-icon' | 'mask-icon' | string;
139
+ href: string;
140
+ }
141
+ export type SchemaOrgJson = Record<string, unknown>;
142
+ export interface SchemaOrgHeadState {
143
+ jsonLd?: SchemaOrgJson | SchemaOrgJson[];
144
+ }
145
+ export interface HeadProviderProps {
146
+ children: React.ReactNode;
147
+ appName?: string;
148
+ }
149
+ export interface HeadController {
150
+ metadata: PageMetadataState;
151
+ social: SocialHeadState;
152
+ links: HeadLinksState;
153
+ pagination: PaginationHeadState;
154
+ language: LanguageHeadState;
155
+ document: DocumentHeadState;
156
+ assets: AssetsHeadState;
157
+ pwa: PwaHeadState;
158
+ schemaOrg: SchemaOrgHeadState;
159
+ setPageMetadata: (metadata: PageMetadataState) => void;
160
+ clearPageMetadata: () => void;
161
+ setPageMetadataEntry: (id: string, metadata: PageMetadataState) => void;
162
+ clearPageMetadataEntry: (id: string) => void;
163
+ setSocialHead: (social: SocialHeadState) => void;
164
+ clearSocialHead: () => void;
165
+ setHeadLinks: (links: HeadLinksState) => void;
166
+ clearHeadLinks: () => void;
167
+ setPaginationHead: (pagination: PaginationHeadState) => void;
168
+ clearPaginationHead: () => void;
169
+ setLanguageHead: (language: LanguageHeadState) => void;
170
+ clearLanguageHead: () => void;
171
+ setDocumentHead: (document: DocumentHeadState) => void;
172
+ clearDocumentHead: () => void;
173
+ setAssetsHead: (assets: AssetsHeadState) => void;
174
+ clearAssetsHead: () => void;
175
+ setPwaHead: (pwa: PwaHeadState) => void;
176
+ clearPwaHead: () => void;
177
+ setSchemaOrg: (schemaOrg: SchemaOrgHeadState) => void;
178
+ clearSchemaOrg: () => void;
179
+ }
180
+ export declare const DEFAULT_HEAD_APP_NAME = "LLM Native";
181
+ export declare const DEFAULT_DOCUMENT_HEAD: DocumentHeadState;
182
+ export declare const DEFAULT_LANGUAGE_HEAD: LanguageHeadState;
183
+ export declare function HeadProvider({ appName, children }: HeadProviderProps): React.JSX.Element;
184
+ export declare function useHead(metadata?: PageMetadataState): HeadController | null;
185
+ export declare function useSocialHead(social?: SocialHeadState): HeadController | null;
186
+ export declare function useHeadLinks(links?: HeadLinksState): HeadController | null;
187
+ export declare function usePaginationHead(pagination?: PaginationHeadState): HeadController | null;
188
+ export declare function useLanguageHead(language?: LanguageHeadState): HeadController | null;
189
+ export declare function useDocumentHead(document?: DocumentHeadState): HeadController | null;
190
+ export declare function useAssetsHead(assets?: AssetsHeadState): HeadController | null;
191
+ export declare function usePwaHead(pwa?: PwaHeadState): HeadController | null;
192
+ export declare function useSchemaOrgHead(schemaOrg?: SchemaOrgHeadState): HeadController | null;
193
+ export declare function Head(metadata: PageMetadataState): null;
@@ -0,0 +1,335 @@
1
+ import React, { ReactNode } from 'react';
2
+ import type { MotionReference, MotionRegistry } from './motion';
3
+ type UseTheme = Theme;
4
+ interface ThemeProviderProps {
5
+ children: ReactNode;
6
+ config?: AppThemeProviderConfig;
7
+ }
8
+ export type ThemeMode = 'light' | 'dark' | 'system';
9
+ /**
10
+ * Full set of semantic color design tokens, expressed as HSL channel values ("H S% L%").
11
+ * Maps 1-to-1 with the --rf-* CSS custom properties defined in globals.css.
12
+ * Both `colors` (light mode) and `dark` override sets use this shape.
13
+ */
14
+ export interface ColorScale {
15
+ background?: string;
16
+ foreground?: string;
17
+ card?: string;
18
+ cardForeground?: string;
19
+ popover?: string;
20
+ popoverForeground?: string;
21
+ primary?: string;
22
+ primaryForeground?: string;
23
+ secondary?: string;
24
+ secondaryForeground?: string;
25
+ muted?: string;
26
+ mutedForeground?: string;
27
+ accent?: string;
28
+ accentForeground?: string;
29
+ destructive?: string;
30
+ destructiveForeground?: string;
31
+ success?: string;
32
+ successForeground?: string;
33
+ warning?: string;
34
+ warningForeground?: string;
35
+ info?: string;
36
+ infoForeground?: string;
37
+ border?: string;
38
+ input?: string;
39
+ ring?: string;
40
+ }
41
+ export interface MenuTheme {
42
+ wrapClass?: string;
43
+ className?: string;
44
+ headerClass?: string;
45
+ itemClass?: string;
46
+ linkClass?: string;
47
+ iconClass?: string;
48
+ textClass?: string;
49
+ badgeClass?: string;
50
+ arrowClass?: string;
51
+ submenuClass?: string;
52
+ }
53
+ export interface CardTheme {
54
+ wrapClass?: string;
55
+ className?: string;
56
+ headerClass?: string;
57
+ bodyClass?: string;
58
+ footerClass?: string;
59
+ showLoader?: boolean;
60
+ showArrow?: boolean;
61
+ }
62
+ export interface TableTheme {
63
+ wrapClass?: string;
64
+ className?: string;
65
+ headerClass?: string;
66
+ bodyClass?: string;
67
+ footerClass?: string;
68
+ scrollClass?: string;
69
+ selectedClass?: string;
70
+ }
71
+ export interface GalleryTheme {
72
+ wrapClass?: string;
73
+ className?: string;
74
+ scrollClass?: string;
75
+ headerClass?: string;
76
+ bodyClass?: string;
77
+ footerClass?: string;
78
+ selectedClass?: string;
79
+ gutterSize?: 0 | 1 | 2 | 3 | 4 | 5;
80
+ rowCols?: 1 | 2 | 3 | 4 | 6;
81
+ }
82
+ export interface ModalTheme {
83
+ size?: "sm" | "md" | "lg" | "xl" | "fullscreen";
84
+ position?: "center" | "top" | "left" | "right" | "bottom";
85
+ wrapClass?: string;
86
+ className?: string;
87
+ headerClass?: string;
88
+ titleClass?: string;
89
+ subTitleClass?: string;
90
+ bodyClass?: string;
91
+ footerClass?: string;
92
+ iconExpand?: string;
93
+ iconCollapse?: string;
94
+ motion?: {
95
+ center?: MotionReference;
96
+ top?: MotionReference;
97
+ left?: MotionReference;
98
+ right?: MotionReference;
99
+ bottom?: MotionReference;
100
+ backdrop?: MotionReference;
101
+ };
102
+ }
103
+ /**
104
+ * Full typed interface for component theme overrides.
105
+ * Used by app-level themeOverride. All fields are optional so you only declare what you want to change.
106
+ * The `default` theme in themes/default/ provides a full reference implementation of every field.
107
+ */
108
+ export interface ThemeConfig {
109
+ Grid?: {
110
+ Card?: CardTheme;
111
+ Table?: TableTheme;
112
+ Gallery?: GalleryTheme;
113
+ Modal?: ModalTheme & {
114
+ mode?: 'form' | 'empty';
115
+ };
116
+ i18n?: {
117
+ headerAdd?: string;
118
+ headerEdit?: string;
119
+ buttonAdd?: string;
120
+ };
121
+ };
122
+ Table?: TableTheme;
123
+ Gallery?: GalleryTheme;
124
+ Pagination?: {
125
+ wrapClass?: string;
126
+ className?: string;
127
+ stickyClass?: string;
128
+ scrollToTop?: boolean;
129
+ scrollBehavior?: ScrollBehavior;
130
+ maxItems?: number;
131
+ sticky?: boolean;
132
+ align?: string;
133
+ };
134
+ Carousel?: {
135
+ showIndicators?: boolean;
136
+ showControls?: boolean;
137
+ showCaption?: boolean;
138
+ layoutDark?: boolean;
139
+ autoPlay?: any;
140
+ };
141
+ Card?: CardTheme;
142
+ Loader?: {
143
+ wrapClass?: string;
144
+ className?: string;
145
+ icon?: string;
146
+ title?: string;
147
+ description?: string;
148
+ };
149
+ ActionButton?: {
150
+ className?: string;
151
+ badgeClass?: string;
152
+ motion?: {
153
+ press?: MotionReference;
154
+ };
155
+ };
156
+ LoadingButton?: {
157
+ className?: string;
158
+ badgeClass?: string;
159
+ motion?: {
160
+ press?: MotionReference;
161
+ };
162
+ };
163
+ LinkButton?: {
164
+ className?: string;
165
+ };
166
+ Alert?: {
167
+ className?: string;
168
+ };
169
+ Badge?: {
170
+ className?: string;
171
+ };
172
+ Modal?: ModalTheme;
173
+ Dropdown?: {
174
+ wrapClass?: string;
175
+ className?: string;
176
+ buttonClass?: string;
177
+ badgeClass?: string;
178
+ menuClass?: string;
179
+ menuHeaderClass?: string;
180
+ menuItemClass?: string;
181
+ menuDividerClass?: string;
182
+ headerClass?: string;
183
+ footerClass?: string;
184
+ Menu?: MenuTheme;
185
+ motion?: {
186
+ open?: MotionReference;
187
+ close?: MotionReference;
188
+ press?: MotionReference;
189
+ };
190
+ };
191
+ Notifications?: {
192
+ wrapClass?: string;
193
+ Dropdown?: {
194
+ className?: string;
195
+ buttonClass?: string;
196
+ menuClass?: string;
197
+ };
198
+ };
199
+ Select?: {
200
+ wrapClass?: string;
201
+ className?: string;
202
+ };
203
+ Autocomplete?: {
204
+ wrapClass?: string;
205
+ className?: string;
206
+ };
207
+ Form?: {
208
+ wrapClass?: string;
209
+ buttonSaveClass?: string;
210
+ buttonDeleteClass?: string;
211
+ buttonBackClass?: string;
212
+ Card?: {
213
+ headerClass?: string;
214
+ bodyClass?: string;
215
+ footerClass?: string;
216
+ };
217
+ i18n?: {
218
+ headerAdd?: string;
219
+ headerEdit?: string;
220
+ headerNewRecord?: string;
221
+ buttonSave?: string;
222
+ buttonDelete?: string;
223
+ buttonBack?: string;
224
+ noticeRequiredFields?: string;
225
+ };
226
+ };
227
+ Menu?: MenuTheme;
228
+ Brand?: {
229
+ wrapClass?: string;
230
+ className?: string;
231
+ logoClass?: string;
232
+ labelClass?: string;
233
+ };
234
+ SignIn?: {
235
+ className?: string;
236
+ avatarClass?: string;
237
+ };
238
+ Image?: {
239
+ wrapClass?: string;
240
+ className?: string;
241
+ motion?: {
242
+ enter?: MotionReference;
243
+ hover?: MotionReference;
244
+ };
245
+ };
246
+ ImageAvatar?: {
247
+ wrapClass?: string;
248
+ className?: string;
249
+ motion?: {
250
+ enter?: MotionReference;
251
+ hover?: MotionReference;
252
+ };
253
+ };
254
+ Percentage?: {
255
+ wrapClass?: string;
256
+ className?: string;
257
+ };
258
+ Tab?: {
259
+ wrapClass?: string;
260
+ className?: string;
261
+ motion?: {
262
+ enter?: MotionReference;
263
+ };
264
+ };
265
+ Code?: {
266
+ wrapClass?: string;
267
+ className?: string;
268
+ };
269
+ Prompt?: {
270
+ wrapClass?: string;
271
+ className?: string;
272
+ };
273
+ }
274
+ type DeepRequired<T> = {
275
+ [K in keyof T]-?: NonNullable<T[K]> extends (...args: any[]) => any ? NonNullable<T[K]> : NonNullable<T[K]> extends object ? DeepRequired<NonNullable<T[K]>> : NonNullable<T[K]>;
276
+ };
277
+ export type Theme = DeepRequired<ThemeConfig> & {};
278
+ export interface ThemePresetConfig {
279
+ mode?: ThemeMode;
280
+ radius?: number;
281
+ /** CSS font-family string for the sans-serif font, e.g. `"'Inter', sans-serif"`. Maps to `--font-sans`. */
282
+ fontSans?: string;
283
+ /** CSS font-family string for the monospace font, e.g. `"'JetBrains Mono', monospace"`. Maps to `--font-mono`. */
284
+ fontMono?: string;
285
+ /** Full semantic color palette for light mode. Each value is an HSL channel string, e.g. "221.2 83.2% 53.3%". */
286
+ colors?: ColorScale;
287
+ /** Semantic color overrides applied when dark mode is active. Merged on top of `colors`. */
288
+ dark?: ColorScale;
289
+ /** Arbitrary CSS custom properties not covered by ColorScale, e.g. spacing or font tokens. */
290
+ variables?: Record<string, string>;
291
+ }
292
+ export interface ThemeDefinition {
293
+ preset: ThemePresetConfig;
294
+ motion: MotionRegistry;
295
+ components: Theme;
296
+ }
297
+ /** IDs of built-in themes. Extend by adding entries to BUILT_IN_THEMES. */
298
+ export declare const BUILT_IN_THEME_IDS: readonly ["default", "flat", "cyber"];
299
+ export type BuiltInThemeId = (typeof BUILT_IN_THEME_IDS)[number];
300
+ export type AppThemeProviderConfig = BuiltInThemeId | ThemeDefinition | {
301
+ defaultMode?: ThemeMode;
302
+ theme?: string;
303
+ themes?: Record<string, ThemeDefinition>;
304
+ themeOverride?: ThemeConfig;
305
+ };
306
+ export interface ThemeController {
307
+ mode: ThemeMode;
308
+ resolvedMode: 'light' | 'dark';
309
+ theme: string;
310
+ primary: string;
311
+ primaryForeground: string;
312
+ radius: number;
313
+ fontSans: string;
314
+ fontMono: string;
315
+ colors: ColorScale | undefined;
316
+ dark: ColorScale | undefined;
317
+ themes: Record<string, ThemeDefinition>;
318
+ setMode: (mode: ThemeMode) => void;
319
+ toggleMode: () => void;
320
+ applyTheme: (theme: string) => void;
321
+ setPrimary: (primary: string) => void;
322
+ setRadius: (radius: number) => void;
323
+ setFont: (fontSans: string, fontMono?: string) => void;
324
+ setColors: (colors: ColorScale) => void;
325
+ setTokens: (tokens: Partial<ColorScale>) => void;
326
+ }
327
+ export declare const BUILT_IN_THEMES: Record<BuiltInThemeId, ThemeDefinition>;
328
+ export declare const PLACEHOLDER_IMAGE = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgdmlld0JveD0iMCAwIDEwMCAxMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHJlY3Qgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiIGZpbGw9InRyYW5zcGFyZW50Ii8+PGNpcmNsZSBjeD0iNjUiIGN5PSIzNSIgcj0iMTAiIGZpbGw9IiM5Y2EzYWYiLz48cGF0aCBkPSJNMTAsNzUgTDMyLDUwIEw1Miw3MCBMNjgsNTIgTDkwLDcyIEw5MCw4MCBIMTAgWiIgZmlsbD0iIzljYTNhZiIvPjwvc3ZnPg==";
329
+ export declare const PLACEHOLDER_USER = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='50' fill='%23eef2f7'/%3E%3Ccircle cx='50' cy='38' r='16' fill='%2364758b'/%3E%3Cpath d='M22 84c3.8-20 19-31 28-31s24.2 11 28 31c.5 2.8-1.7 5-4.5 5h-47c-2.8 0-5-2.2-4.5-5z' fill='%2364758b'/%3E%3C/svg%3E";
330
+ export declare const PLACEHOLDER_BRAND = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZD0iTTUwIDE1IEw4NSA1MCBMNTAgODUgTDE1IDUwIFoiIGZpbGw9IiNjY2MiIG9wYWNpdHk9IjAuMiIvPjxwYXRoIGQ9Ik01MCAzMCBMNzAgNTAgTDUwIDcwIEwzMCA1MCBaIiBmaWxsPSIjY2NjIi8+PC9zdmc+";
331
+ export declare const ThemeProvider: ({ children, config }: ThemeProviderProps) => React.JSX.Element;
332
+ export declare const useTheme: (_scope?: string) => UseTheme;
333
+ export declare const useMotionRegistry: () => MotionRegistry;
334
+ export declare const useThemeController: () => ThemeController;
335
+ export {};
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import { type IButton } from './components/ui/Buttons';
3
+ import type { AuthIntent } from './providers/auth/AuthProvider';
4
+ export declare const AUTH_REDIRECT_URI = "/__/authorize";
5
+ export declare function redirectToAuthPage({ authServer, clientID, scopes, refreshParamName, }: {
6
+ authServer: string;
7
+ clientID: string;
8
+ scopes?: string[];
9
+ refreshParamName?: string;
10
+ }): void;
11
+ declare const Authorize: () => React.JSX.Element;
12
+ export declare const useAccessToken: (clientID: string, renew?: boolean) => boolean;
13
+ export declare const getAuthSession: (clientID: string) => any;
14
+ export declare const clearAccessToken: (clientID: string) => void;
15
+ export declare const getAccessToken: (clientID: string) => Promise<string | null>;
16
+ export type AuthButtonAspect = 'button' | 'avatar';
17
+ export interface AuthButtonProps extends Omit<IButton, 'onClick'> {
18
+ provider?: string;
19
+ intent?: AuthIntent;
20
+ aspect?: AuthButtonAspect;
21
+ scopes?: string[];
22
+ iconLogout?: string;
23
+ avatarClass?: string;
24
+ options?: Omit<IButton, 'onClick'>;
25
+ }
26
+ export declare const AuthButton: ({ provider, intent, aspect, scopes, iconLogout, avatarClass, options, label, icon, title, className, disabled, ...rest }: AuthButtonProps) => React.JSX.Element;
27
+ export default Authorize;