refactor(app): remove unused components
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
.scrim {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 50;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding:
|
||||
calc(var(--spacing-md, 12px) + var(--app-safe-top, 0px))
|
||||
calc(var(--spacing-md, 12px) + var(--app-safe-right, 0px))
|
||||
calc(var(--spacing-md, 12px) + var(--app-safe-bottom, 0px))
|
||||
calc(var(--spacing-md, 12px) + var(--app-safe-left, 0px));
|
||||
}
|
||||
|
||||
.panel {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
max-width: var(--dialog-max-width, 380px);
|
||||
background: var(--color-dialog-background);
|
||||
border: var(--border-light) solid var(--color-dialog-border);
|
||||
border-radius: var(--responsive-card-radius, var(--radius-xl));
|
||||
box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
|
||||
color: var(--color-text-primary);
|
||||
overflow: hidden;
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
"use client";
|
||||
/**
|
||||
* 通用 Dialog 基础组件(headless + 简单样式)
|
||||
*
|
||||
*
|
||||
* username_dialog, pronouns_dialog, subscription_dialog, environment_dialog, auth_other_options_dialog,
|
||||
* facebook_login_dialog, external_browser_dialog)。
|
||||
*
|
||||
* 设计目标:~70 行覆盖所有 9 种 dialog 的通用逻辑(portal, ESC, scroll lock, click-outside),
|
||||
* 调用方只关心内容布局。
|
||||
*
|
||||
* 注意:项目不引入 Radix/shadcn,纯依赖 React + CSS Modules。
|
||||
*/
|
||||
import { type ReactNode } from "react";
|
||||
|
||||
import { ModalPortal } from "./modal-portal";
|
||||
import styles from "./dialog.module.css";
|
||||
|
||||
export interface DialogProps {
|
||||
open: boolean;
|
||||
onClose: () => void;
|
||||
children: ReactNode;
|
||||
/** 内容最大宽度(px)。默认 360。 */
|
||||
maxWidth?: number;
|
||||
/** 蒙层透明度(0-1)。默认 0.5。 */
|
||||
scrimOpacity?: number;
|
||||
/** 禁用点击外部 / ESC 关闭。 */
|
||||
persistent?: boolean;
|
||||
/** ARIA 标签。 */
|
||||
ariaLabel?: string;
|
||||
}
|
||||
|
||||
export function Dialog({
|
||||
open,
|
||||
onClose,
|
||||
children,
|
||||
maxWidth = 360,
|
||||
scrimOpacity = 0.5,
|
||||
persistent = false,
|
||||
ariaLabel,
|
||||
}: DialogProps) {
|
||||
return (
|
||||
<ModalPortal
|
||||
open={open}
|
||||
onClose={onClose}
|
||||
scrimClassName={styles.scrim}
|
||||
panelClassName={styles.panel}
|
||||
panelStyle={{ maxWidth }}
|
||||
scrimOpacity={scrimOpacity}
|
||||
persistent={persistent}
|
||||
ariaLabel={ariaLabel}
|
||||
>
|
||||
{children}
|
||||
</ModalPortal>
|
||||
);
|
||||
}
|
||||
@@ -5,7 +5,6 @@
|
||||
export * from "./app-bottom-nav";
|
||||
export * from "./bottom-sheet";
|
||||
export * from "./checkbox";
|
||||
export * from "./dialog";
|
||||
export * from "./loading-indicator";
|
||||
export * from "./mobile-shell";
|
||||
export * from "./page-loading-fallback";
|
||||
|
||||
Reference in New Issue
Block a user