feat(desktop): embed BoosAPI Desktop client as a subproject
Vendor the rebranded BoosAPI Desktop client (Tauri + Vue) into metapi as a monorepo subdirectory under desktop/. Source only — node_modules, dist, Cargo target and the upstream .git history are excluded. desktop/ keeps its own independent Cargo workspace (desktop/src-tauri with crates/*); it is not part of the backend boosapi crate, so a `cargo check` at the metapi root still compiles only the backend. Build the desktop app from desktop/src-tauri per desktop/README.md. Note: app icons are still placeholder assets pending the final BoosAPI logo. The updater signing keys live outside the repo and are not included.
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
import { useMemo } from 'react';
|
||||
import { theme } from 'antd';
|
||||
import type { ThemeConfig } from 'antd';
|
||||
|
||||
/**
|
||||
* shadcn/ui-inspired Ant Design theme.
|
||||
* Clean borders, consistent radius, subtle shadows.
|
||||
* Adapts to dark/light via Ant Design's algorithm.
|
||||
*/
|
||||
export function useShadcnTheme(
|
||||
isDark: boolean,
|
||||
primaryColor: string,
|
||||
fontSize: number,
|
||||
borderRadius: number,
|
||||
fontFamily?: string,
|
||||
codeFontFamily?: string,
|
||||
): ThemeConfig {
|
||||
return useMemo<ThemeConfig>(
|
||||
() => {
|
||||
// Derive proportional radii from the base value
|
||||
const radiusSM = Math.max(0, Math.round(borderRadius * 0.6));
|
||||
const radiusXS = Math.max(0, Math.round(borderRadius * 0.2));
|
||||
const radiusLG = Math.max(0, Math.round(borderRadius * 1.4));
|
||||
|
||||
return {
|
||||
algorithm: isDark ? theme.darkAlgorithm : theme.defaultAlgorithm,
|
||||
token: {
|
||||
colorPrimary: primaryColor,
|
||||
colorLink: primaryColor,
|
||||
fontSize,
|
||||
fontWeightStrong: 500,
|
||||
...(fontFamily ? { fontFamily } : {}),
|
||||
...(codeFontFamily ? { fontFamilyCode: codeFontFamily } : {}),
|
||||
|
||||
// Border radius — configurable base with proportional variants
|
||||
borderRadius,
|
||||
borderRadiusXS: radiusXS,
|
||||
borderRadiusSM: radiusSM,
|
||||
borderRadiusLG: radiusLG,
|
||||
|
||||
// Spacing
|
||||
padding: 16,
|
||||
paddingSM: 12,
|
||||
paddingLG: 24,
|
||||
margin: 16,
|
||||
marginSM: 12,
|
||||
marginLG: 24,
|
||||
|
||||
// Shadows — subtle, layered
|
||||
boxShadow:
|
||||
'0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)',
|
||||
boxShadowSecondary:
|
||||
'0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)',
|
||||
},
|
||||
components: {
|
||||
Button: {
|
||||
primaryShadow: 'none',
|
||||
defaultShadow: 'none',
|
||||
dangerShadow: 'none',
|
||||
},
|
||||
Input: {
|
||||
activeShadow: 'none',
|
||||
},
|
||||
Select: {
|
||||
optionSelectedFontWeight: 500,
|
||||
},
|
||||
Modal: {
|
||||
borderRadiusLG: Math.max(radiusLG, 8),
|
||||
},
|
||||
Slider: {
|
||||
handleSize: 8,
|
||||
handleSizeHover: 10,
|
||||
railSize: 4,
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
[isDark, primaryColor, fontSize, borderRadius, fontFamily, codeFontFamily],
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user