@xyd-js/themes 0.0.0 → 0.1.1-build.160
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/CHANGELOG.md +1917 -0
- package/LICENSE +21 -0
- package/dist/index.d.ts +116 -0
- package/dist/index.js +669 -0
- package/dist/index.js.map +1 -0
- package/dist/rollup.d.ts +28 -0
- package/dist/rollup.js +139 -0
- package/dist/rollup.js.map +1 -0
- package/package.json +55 -6
- package/postcss.config.cjs +7 -0
- package/scripts/build-css.js +73 -0
- package/src/BaseTheme.tsx +471 -0
- package/src/Theme.tsx +363 -0
- package/src/context.tsx +9 -0
- package/src/copyPresetsPlugin.ts +124 -0
- package/src/index.ts +11 -0
- package/src/rollup.ts +91 -0
- package/src/styles/decorators/atlas-vars.css +32 -0
- package/src/styles/decorators/header-sketch.css +23 -0
- package/src/styles/decorators/page-layout.css +11 -0
- package/src/styles/decorators/page-leftpad.css +46 -0
- package/src/styles/decorators/page-sketch.css +30 -0
- package/src/styles/decorators/sidebar-pad.css +24 -0
- package/src/styles/decorators/sidebar-scroll.css +51 -0
- package/src/styles/index.css +26 -0
- package/src/styles/reset.css +56 -0
- package/src/styles/styles.css +156 -0
- package/src/styles/tokens.css +472 -0
- package/tsconfig.json +51 -0
- package/tsup.config.ts +38 -0
- package/types.d.ts +13 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 xyd
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Theme as Theme$1 } from '@xyd-js/core';
|
|
3
|
+
import { ReactContent } from '@xyd-js/components/content';
|
|
4
|
+
import { Surfaces } from '@xyd-js/framework';
|
|
5
|
+
|
|
6
|
+
declare abstract class Theme {
|
|
7
|
+
constructor();
|
|
8
|
+
private webeditor;
|
|
9
|
+
private navigation;
|
|
10
|
+
private userAppearance;
|
|
11
|
+
protected settings: Theme$1;
|
|
12
|
+
protected theme: CustomTheme<Theme$1>;
|
|
13
|
+
protected readonly reactContent: ReactContent;
|
|
14
|
+
protected readonly surfaces: Surfaces;
|
|
15
|
+
private readonly userPreferences;
|
|
16
|
+
private get originalTheme();
|
|
17
|
+
private get originalWebeditor();
|
|
18
|
+
private get originalNavigation();
|
|
19
|
+
abstract Page({ children }: {
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
}): React.ReactElement;
|
|
22
|
+
abstract Layout({ children }: {
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
}): React.ReactElement;
|
|
25
|
+
abstract reactContentComponents(): {
|
|
26
|
+
[component: string]: (props: any) => React.JSX.Element | null;
|
|
27
|
+
};
|
|
28
|
+
abstract reactFileComponents(): {
|
|
29
|
+
[component: string]: (props: any) => React.JSX.Element | null;
|
|
30
|
+
} | false;
|
|
31
|
+
protected useHideToc(): boolean;
|
|
32
|
+
protected useHideSidebar(): boolean;
|
|
33
|
+
private headerPrepend;
|
|
34
|
+
private headerAppend;
|
|
35
|
+
private update;
|
|
36
|
+
private updateThemePreset;
|
|
37
|
+
private appearanceWebEditor;
|
|
38
|
+
private mergeUserAppearance;
|
|
39
|
+
private resetWebeditor;
|
|
40
|
+
private resetNavigation;
|
|
41
|
+
private insertCenterHeaderTabs;
|
|
42
|
+
}
|
|
43
|
+
type DeepPartial<T> = {
|
|
44
|
+
[P in keyof T]?: T[P] extends object ? T[P] extends Function ? T[P] : T[P] extends Array<infer U> ? Array<DeepPartial<U>> : DeepPartial<T[P]> : T[P];
|
|
45
|
+
};
|
|
46
|
+
type CustomTheme<T> = T & {
|
|
47
|
+
Update: (value: DeepPartial<T>) => void;
|
|
48
|
+
UpdatePreset: (value: string[]) => void;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
declare class BaseTheme extends Theme {
|
|
52
|
+
constructor();
|
|
53
|
+
reactContentComponents(): {
|
|
54
|
+
[component: string]: (props: any) => React.JSX.Element | null;
|
|
55
|
+
};
|
|
56
|
+
reactFileComponents(): {
|
|
57
|
+
[component: string]: (props: any) => React.JSX.Element | null;
|
|
58
|
+
} | false;
|
|
59
|
+
Layout({ children }: {
|
|
60
|
+
children: React.ReactNode;
|
|
61
|
+
}): React.JSX.Element;
|
|
62
|
+
Page({ children }: {
|
|
63
|
+
children: React.ReactNode;
|
|
64
|
+
}): React.JSX.Element;
|
|
65
|
+
protected Navbar(): React.JSX.Element;
|
|
66
|
+
protected Sidebar(): React.JSX.Element;
|
|
67
|
+
protected Content({ children }: {
|
|
68
|
+
children: React.ReactNode;
|
|
69
|
+
}): React.JSX.Element;
|
|
70
|
+
private ContentSecondary;
|
|
71
|
+
protected ContentNav(): React.JSX.Element;
|
|
72
|
+
protected TocTop(): React.JSX.Element;
|
|
73
|
+
protected TocBottom(): React.JSX.Element | null;
|
|
74
|
+
protected PageFooter({ children }: {
|
|
75
|
+
children: React.ReactNode;
|
|
76
|
+
}): React.JSX.Element;
|
|
77
|
+
protected Footer(): React.JSX.Element | null;
|
|
78
|
+
protected Breadcrumbs(): React.JSX.Element | null;
|
|
79
|
+
protected NavLinks(): React.JSX.Element | null;
|
|
80
|
+
protected SubNav(): React.JSX.Element;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Creates a Rollup plugin to copy presets directory from src to dist
|
|
85
|
+
* @param options - Plugin options
|
|
86
|
+
* @param options.srcDir - Source directory (default: 'src/presets')
|
|
87
|
+
* @param options.distDir - Destination directory (default: 'dist/presets')
|
|
88
|
+
* @param options.packageRoot - Package root directory (default: process.cwd())
|
|
89
|
+
* @returns Rollup plugin
|
|
90
|
+
*/
|
|
91
|
+
declare function copyPresetsPlugin(options?: {
|
|
92
|
+
srcDir?: string;
|
|
93
|
+
distDir?: string;
|
|
94
|
+
packageRoot?: string;
|
|
95
|
+
}): {
|
|
96
|
+
name: string;
|
|
97
|
+
writeBundle(): void;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Creates a tsup plugin to copy presets directory
|
|
101
|
+
* @param options - Plugin options
|
|
102
|
+
* @param options.srcDir - Source directory (default: 'src/presets')
|
|
103
|
+
* @param options.distDir - Destination directory (default: 'dist/presets')
|
|
104
|
+
* @param options.packageRoot - Package root directory (default: process.cwd())
|
|
105
|
+
* @returns tsup plugin function
|
|
106
|
+
*/
|
|
107
|
+
declare function tsupCopyPresetsPlugin(options?: {
|
|
108
|
+
srcDir?: string;
|
|
109
|
+
distDir?: string;
|
|
110
|
+
packageRoot?: string;
|
|
111
|
+
}): () => {
|
|
112
|
+
name: string;
|
|
113
|
+
closeBundle(): void;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export { BaseTheme, Theme, copyPresetsPlugin, tsupCopyPresetsPlugin };
|