Файли
openidea/src/ui/Splitter.tsx
T
Jaw 5217f8570b chore: add knip and remove the dead code it reports (#247)
Adds knip (pnpm knip, knip.ts covering src, scripts, perf and e2e) and runs it in the CI frontend job. Removes what it reported: the unused codemirror and @types/dompurify dependencies, exports and test hooks used nowhere (AppLogo, Tooltip, barrel re-exports, duplicate default exports of lazily loaded settings pages), the unused iterateAll helper, and the zh entry for a deleted notification. rustfmt (used by lint-staged) is ignored as a toolchain binary.

Co-authored-by: jaw52 <[email protected]>
2026-10-29 23:21:56 +08:00

25 рядки
1018 B
TypeScript

/**
* Thin wrappers over react-resizable-panels with IDE styling: 1px hairline
* separators with a wider invisible hit area and an accent hover state.
*/
import { Group, Panel, Separator, type GroupProps, type PanelProps, type SeparatorProps } from "react-resizable-panels";
import clsx from "clsx";
import styles from "./Splitter.module.css";
export function SplitGroup({ className, ...rest }: GroupProps) {
return <Group className={clsx(styles.group, className)} {...rest} />;
}
export function SplitPanel({ className, ...rest }: PanelProps) {
return <Panel className={clsx(styles.panel, className)} {...rest} />;
}
export interface SplitHandleProps extends SeparatorProps {
/** `false`: no visible line (neighbouring panels draw their own borders); only the hit area remains. */
hairline?: boolean;
}
export function SplitHandle({ className, hairline = true, ...rest }: SplitHandleProps) {
return <Separator className={clsx(styles.handle, !hairline && styles.invisible, className)} {...rest} />;
}