@abpjs/theme-basic 0.7.6
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/LICENSE +165 -0
- package/README.md +680 -0
- package/dist/components/blocks/sidebars/sidebar-with-collapsible/block.d.ts +1 -0
- package/dist/components/blocks/sidebars/sidebar-with-collapsible/index.d.ts +10 -0
- package/dist/components/blocks/sidebars/sidebar-with-collapsible/language-selector.d.ts +8 -0
- package/dist/components/blocks/sidebars/sidebar-with-collapsible/logo.d.ts +15 -0
- package/dist/components/blocks/sidebars/sidebar-with-collapsible/nav-links.d.ts +12 -0
- package/dist/components/blocks/sidebars/sidebar-with-collapsible/navbar.d.ts +7 -0
- package/dist/components/blocks/sidebars/sidebar-with-collapsible/search-context.d.ts +20 -0
- package/dist/components/blocks/sidebars/sidebar-with-collapsible/search-field.d.ts +1 -0
- package/dist/components/blocks/sidebars/sidebar-with-collapsible/sidebar-link.d.ts +16 -0
- package/dist/components/blocks/sidebars/sidebar-with-collapsible/sidebar.d.ts +26 -0
- package/dist/components/blocks/sidebars/sidebar-with-collapsible/user-profile.d.ts +8 -0
- package/dist/components/change-password/ChangePassword.d.ts +26 -0
- package/dist/components/change-password/index.d.ts +1 -0
- package/dist/components/index.d.ts +7 -0
- package/dist/components/layout/Layout.d.ts +30 -0
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/components/layout-account/LayoutAccount.d.ts +45 -0
- package/dist/components/layout-account/index.d.ts +1 -0
- package/dist/components/layout-application/LayoutApplication.d.ts +60 -0
- package/dist/components/layout-application/index.d.ts +1 -0
- package/dist/components/layout-empty/LayoutEmpty.d.ts +23 -0
- package/dist/components/layout-empty/index.d.ts +1 -0
- package/dist/components/profile/Profile.d.ts +28 -0
- package/dist/components/profile/index.d.ts +1 -0
- package/dist/contexts/branding.context.d.ts +67 -0
- package/dist/contexts/index.d.ts +2 -0
- package/dist/contexts/layout.context.d.ts +60 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +1466 -0
- package/dist/index.mjs +1435 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/layout.d.ts +26 -0
- package/dist/providers/ThemeBasicProvider.d.ts +92 -0
- package/dist/providers/index.d.ts +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './layout';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Layout namespace containing types and interfaces for the theme-basic layout system.
|
|
4
|
+
* Translated from @abp/ng.theme.basic Layout namespace.
|
|
5
|
+
*/
|
|
6
|
+
export declare namespace Layout {
|
|
7
|
+
/**
|
|
8
|
+
* State interface for the layout store.
|
|
9
|
+
* Contains navigation elements that can be added to the layout.
|
|
10
|
+
*/
|
|
11
|
+
interface State {
|
|
12
|
+
navigationElements: NavigationElement[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Navigation element that can be added to the layout's right part.
|
|
16
|
+
* In Angular, this used TemplateRef; in React, we use ReactNode.
|
|
17
|
+
*/
|
|
18
|
+
interface NavigationElement {
|
|
19
|
+
/** Unique name identifier for the navigation element */
|
|
20
|
+
name: string;
|
|
21
|
+
/** React component/element to render */
|
|
22
|
+
element: ReactNode;
|
|
23
|
+
/** Order for sorting (lower values appear first, defaults to 99) */
|
|
24
|
+
order?: number;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { defineConfig, ThemeOverride } from '@abpjs/theme-shared';
|
|
3
|
+
/**
|
|
4
|
+
* Props for ThemeBasicProvider
|
|
5
|
+
*/
|
|
6
|
+
export interface ThemeBasicProviderProps {
|
|
7
|
+
/** Child components to render */
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
/** Whether to render toast notifications automatically */
|
|
10
|
+
renderToasts?: boolean;
|
|
11
|
+
/** Whether to render confirmation dialog automatically */
|
|
12
|
+
renderConfirmation?: boolean;
|
|
13
|
+
/** Custom theme overrides for Chakra UI (use defineConfig from @abpjs/theme-shared) */
|
|
14
|
+
themeOverrides?: ThemeOverride;
|
|
15
|
+
/** Position for toast notifications */
|
|
16
|
+
toastPosition?: 'top' | 'top-right' | 'top-left' | 'bottom' | 'bottom-right' | 'bottom-left';
|
|
17
|
+
/** Enable color mode support (light/dark theme switching) */
|
|
18
|
+
enableColorMode?: boolean;
|
|
19
|
+
/** Default color mode when enableColorMode is true */
|
|
20
|
+
defaultColorMode?: 'light' | 'dark' | 'system';
|
|
21
|
+
/** Custom logo component for the sidebar/navbar */
|
|
22
|
+
logo?: ReactNode;
|
|
23
|
+
/** Icon-only logo for mobile/collapsed views */
|
|
24
|
+
logoIcon?: ReactNode;
|
|
25
|
+
/** Application name (used as fallback if no logo provided) */
|
|
26
|
+
appName?: string;
|
|
27
|
+
/** Link destination when clicking the logo (default: '/') */
|
|
28
|
+
logoLink?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Default theme configuration for theme-basic
|
|
32
|
+
* Uses Chakra v3's defineConfig format with proper light/dark mode support
|
|
33
|
+
*/
|
|
34
|
+
export declare const defaultThemeBasicConfig: import("@chakra-ui/react").SystemConfig;
|
|
35
|
+
/**
|
|
36
|
+
* Root provider for theme-basic.
|
|
37
|
+
* Composes all necessary providers for the basic theme to work.
|
|
38
|
+
*
|
|
39
|
+
* This provider includes:
|
|
40
|
+
* - Chakra UI provider with theme (via ThemeSharedProvider)
|
|
41
|
+
* - ThemeShared provider (toasts, confirmations)
|
|
42
|
+
* - Layout provider (navigation elements state)
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* import { ThemeBasicProvider } from '@abpjs/theme-basic';
|
|
47
|
+
*
|
|
48
|
+
* function App() {
|
|
49
|
+
* return (
|
|
50
|
+
* <ThemeBasicProvider>
|
|
51
|
+
* <Router>
|
|
52
|
+
* <Routes>
|
|
53
|
+
* ...
|
|
54
|
+
* </Routes>
|
|
55
|
+
* </Router>
|
|
56
|
+
* </ThemeBasicProvider>
|
|
57
|
+
* );
|
|
58
|
+
* }
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* @example With custom theme overrides
|
|
62
|
+
* ```tsx
|
|
63
|
+
* import { ThemeBasicProvider, defineConfig } from '@abpjs/theme-basic';
|
|
64
|
+
*
|
|
65
|
+
* const customTheme = defineConfig({
|
|
66
|
+
* theme: {
|
|
67
|
+
* tokens: {
|
|
68
|
+
* colors: {
|
|
69
|
+
* brand: {
|
|
70
|
+
* 500: { value: '#ff6600' },
|
|
71
|
+
* },
|
|
72
|
+
* },
|
|
73
|
+
* },
|
|
74
|
+
* },
|
|
75
|
+
* });
|
|
76
|
+
*
|
|
77
|
+
* function App() {
|
|
78
|
+
* return (
|
|
79
|
+
* <ThemeBasicProvider themeOverrides={customTheme}>
|
|
80
|
+
* <Router>
|
|
81
|
+
* <Routes>
|
|
82
|
+
* ...
|
|
83
|
+
* </Routes>
|
|
84
|
+
* </Router>
|
|
85
|
+
* </ThemeBasicProvider>
|
|
86
|
+
* );
|
|
87
|
+
* }
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
export declare function ThemeBasicProvider({ children, renderToasts, renderConfirmation, themeOverrides, toastPosition, enableColorMode, defaultColorMode, logo, logoIcon, appName, logoLink, }: ThemeBasicProviderProps): React.ReactElement;
|
|
91
|
+
export { defineConfig };
|
|
92
|
+
export default ThemeBasicProvider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ThemeBasicProvider';
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@abpjs/theme-basic",
|
|
3
|
+
"version": "0.7.6",
|
|
4
|
+
"description": "ABP Framework Theme Basic components for React - translated from @abp/ng.theme.basic",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"require": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"react": "^18.2.0",
|
|
21
|
+
"react-dom": "^18.2.0",
|
|
22
|
+
"react-router-dom": ">=6.0.0"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@chakra-ui/react": "^3.2.0",
|
|
26
|
+
"@emotion/react": "^11.11.0",
|
|
27
|
+
"lucide-react": "^0.400.0",
|
|
28
|
+
"react-hook-form": "^7.48.0",
|
|
29
|
+
"react-icons": "^5.0.0",
|
|
30
|
+
"@abpjs/core": "0.7.6",
|
|
31
|
+
"@abpjs/theme-shared": "0.7.6"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@abp/ng.theme.basic": "0.7.6"
|
|
35
|
+
},
|
|
36
|
+
"author": "tekthar.com",
|
|
37
|
+
"license": "LGPL-3.0",
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
40
|
+
},
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "https://github.com/abpjs/abp-react"
|
|
44
|
+
},
|
|
45
|
+
"homepage": "https://docs.abpjs.io/docs/packages/theme-basic/overview",
|
|
46
|
+
"bugs": {
|
|
47
|
+
"url": "https://github.com/abpjs/abp-react/issues"
|
|
48
|
+
},
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "tsup src/index.ts --format cjs,esm --clean && tsc -p tsconfig.build.json",
|
|
51
|
+
"dev": "tsup src/index.ts --format cjs,esm --watch",
|
|
52
|
+
"lint": "eslint src",
|
|
53
|
+
"lint:fix": "eslint src --fix",
|
|
54
|
+
"format": "prettier --write \"src/**/*.{ts,tsx,json,md}\"",
|
|
55
|
+
"format:check": "prettier --check \"src/**/*.{ts,tsx,json,md}\"",
|
|
56
|
+
"type-check": "tsc --noEmit",
|
|
57
|
+
"test": "vitest"
|
|
58
|
+
}
|
|
59
|
+
}
|