@xiongtao.xt/tau-plugins 0.0.0-stage → 0.2.0

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.
Files changed (144) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +4 -2
  3. package/package.json +31 -3
  4. package/runtime.js +1 -0
  5. package/types/packages/editor/api.d.ts +10 -0
  6. package/types/packages/editor/contracts.d.ts +3 -0
  7. package/types/packages/editor/src/api/command.d.ts +61 -0
  8. package/types/packages/editor/src/api/copy.d.ts +23 -0
  9. package/types/packages/editor/src/api/drag.d.ts +24 -0
  10. package/types/packages/editor/src/api/extension.d.ts +100 -0
  11. package/types/packages/editor/src/api/index.d.ts +54 -0
  12. package/types/packages/editor/src/api/ingest.d.ts +39 -0
  13. package/types/packages/editor/src/api/legacy.d.ts +10 -0
  14. package/types/packages/editor/src/api/marks.d.ts +35 -0
  15. package/types/packages/editor/src/api/menu.d.ts +37 -0
  16. package/types/packages/editor/src/api/submission.d.ts +38 -0
  17. package/types/packages/editor/src/api/toolbar.d.ts +3 -0
  18. package/types/packages/editor/src/components/AddParagraph/index.d.ts +11 -0
  19. package/types/packages/editor/src/components/BlockDrag/index.d.ts +35 -0
  20. package/types/packages/editor/src/components/ElementMenu/index.d.ts +11 -0
  21. package/types/packages/editor/src/components/FloatingToolbar/index.d.ts +23 -0
  22. package/types/packages/editor/src/components/HoveringToolbar/FloatingSubmenu.d.ts +19 -0
  23. package/types/packages/editor/src/components/HoveringToolbar/context.d.ts +8 -0
  24. package/types/packages/editor/src/components/HoveringToolbar/floatingPosition.d.ts +22 -0
  25. package/types/packages/editor/src/components/InlineChromiumBugFix/index.d.ts +2 -0
  26. package/types/packages/editor/src/components/OverlayBackDismiss/index.d.ts +4 -0
  27. package/types/packages/editor/src/hooks/useIsLastElement.d.ts +3 -0
  28. package/types/packages/editor/src/kit/elementEmpty.d.ts +5 -0
  29. package/types/packages/editor/src/menu/conversion.d.ts +3 -0
  30. package/types/packages/editor/src/model/paragraph.d.ts +5 -0
  31. package/types/packages/editor/src/services/editorNotifier.d.ts +4 -0
  32. package/types/packages/editor/src/services/errorReporter.d.ts +13 -0
  33. package/types/packages/editor/src/services/hooks.d.ts +11 -0
  34. package/types/packages/editor/src/services/notifier.d.ts +46 -0
  35. package/types/packages/editor/src/services/overlayBackDismiss.d.ts +10 -0
  36. package/types/packages/editor/src/services/registry.d.ts +6 -0
  37. package/types/packages/editor/src/services/tokens.d.ts +10 -0
  38. package/types/packages/editor/src/theme/ThemeService.d.ts +24 -0
  39. package/types/packages/editor/src/theme/context.d.ts +26 -0
  40. package/types/packages/editor/src/types/block-panel.d.ts +12 -0
  41. package/types/packages/editor/src/types/custom-element.d.ts +10 -0
  42. package/types/packages/editor/src/types/editor.d.ts +37 -0
  43. package/types/packages/editor/src/types/element/paragraph.d.ts +6 -0
  44. package/types/packages/editor/src/types/hotkeys.d.ts +6 -0
  45. package/types/packages/editor/src/types/hovering-bar.d.ts +8 -0
  46. package/types/packages/editor/src/types/index.d.ts +7 -0
  47. package/types/packages/editor/src/types/text.d.ts +1 -0
  48. package/types/packages/editor/src/types.d.ts +1 -0
  49. package/types/packages/editor/src/ui/CaretRight.d.ts +3 -0
  50. package/types/packages/editor/src/ui/Tooltip.d.ts +7 -0
  51. package/types/packages/editor/src/utils/blockNavigation.d.ts +28 -0
  52. package/types/packages/editor/src/utils/commandTarget.d.ts +4 -0
  53. package/types/packages/editor/src/utils/container.d.ts +3 -0
  54. package/types/packages/editor/src/utils/editor.d.ts +16 -0
  55. package/types/packages/editor/src/utils/element.d.ts +11 -0
  56. package/types/packages/editor/src/utils/insertElement.d.ts +11 -0
  57. package/types/packages/editor/src/utils/nodeOperations.d.ts +19 -0
  58. package/types/packages/editor/src/utils/paragraphShortcut.d.ts +4 -0
  59. package/types/packages/editor/src/utils/path.d.ts +6 -0
  60. package/types/packages/editor/src/utils/plugin.d.ts +4 -0
  61. package/types/packages/editor/src/utils/selectionSnapshot.d.ts +3 -0
  62. package/types/packages/editor/src/utils/zoomPan.d.ts +14 -0
  63. package/types/packages/markdown/src/codec.d.ts +86 -0
  64. package/types/packages/markdown/src/index.d.ts +7 -0
  65. package/types/packages/markdown/src/markdown-helper.d.ts +28 -0
  66. package/types/packages/markdown/src/markdown.d.ts +35 -0
  67. package/types/packages/markdown/src/markdownSerializerRegistry.d.ts +47 -0
  68. package/types/packages/markdown/src/model.d.ts +7 -0
  69. package/types/packages/markdown/src/positionMapper.d.ts +161 -0
  70. package/types/packages/markdown/src/processor.d.ts +27 -0
  71. package/types/packages/markdown/src/textCodec.d.ts +39 -0
  72. package/types/packages/markdown/src/types.d.ts +8 -0
  73. package/types/packages/plugins/src/contract.d.ts +49 -0
  74. package/types/packages/plugins/src/editor.d.ts +37 -0
  75. package/types/packages/plugins/src/index.d.ts +7 -0
  76. package/types/packages/plugins/src/pages.d.ts +23 -0
  77. package/types/packages/plugins/src/settings.d.ts +19 -0
  78. package/types/packages/plugins/src/sidebar.d.ts +29 -0
  79. package/types/packages/shared/service-contract.d.ts +6 -0
  80. package/types/packages/shared/service-registry.d.ts +25 -0
  81. package/types/packages/themes/src/bootstrap.d.ts +26 -0
  82. package/types/packages/themes/src/defineTheme.d.ts +45 -0
  83. package/types/packages/themes/src/index.d.ts +10 -0
  84. package/types/packages/themes/src/register.d.ts +9 -0
  85. package/types/packages/themes/src/themes/ink.theme.d.ts +11 -0
  86. package/types/packages/themes/src/themes/mint.theme.d.ts +11 -0
  87. package/types/packages/themes/src/themes/ocean.theme.d.ts +12 -0
  88. package/types/packages/themes/src/themes/paper.theme.d.ts +16 -0
  89. package/types/packages/themes/src/themes/sakura.theme.d.ts +11 -0
  90. package/types/packages/themes/src/themes/wisteria.theme.d.ts +10 -0
  91. package/types/packages/themes/src/tokenContract.d.ts +30 -0
  92. package/types/packages/ui/src/UiProvider.d.ts +17 -0
  93. package/types/packages/ui/src/cn.d.ts +23 -0
  94. package/types/packages/ui/src/hooks/fadeScrollClass.d.ts +8 -0
  95. package/types/packages/ui/src/hooks/index.d.ts +3 -0
  96. package/types/packages/ui/src/hooks/isEditableTarget.d.ts +2 -0
  97. package/types/packages/ui/src/hooks/lockBodyScroll.d.ts +1 -0
  98. package/types/packages/ui/src/hooks/scrollbarAutoHide.d.ts +9 -0
  99. package/types/packages/ui/src/hooks/useEdgeFade.d.ts +22 -0
  100. package/types/packages/ui/src/index.d.ts +47 -0
  101. package/types/packages/ui/src/patterns/FormRow.d.ts +20 -0
  102. package/types/packages/ui/src/primitives/AnchoredPanel.d.ts +53 -0
  103. package/types/packages/ui/src/primitives/Button.d.ts +31 -0
  104. package/types/packages/ui/src/primitives/Checkbox.d.ts +24 -0
  105. package/types/packages/ui/src/primitives/ConfirmDialog.d.ts +44 -0
  106. package/types/packages/ui/src/primitives/Dialog.d.ts +82 -0
  107. package/types/packages/ui/src/primitives/Drawer.d.ts +87 -0
  108. package/types/packages/ui/src/primitives/EditText.d.ts +32 -0
  109. package/types/packages/ui/src/primitives/ErrorBoundary.d.ts +16 -0
  110. package/types/packages/ui/src/primitives/FadeScroll.d.ts +18 -0
  111. package/types/packages/ui/src/primitives/FileDropZone.d.ts +14 -0
  112. package/types/packages/ui/src/primitives/FilterPill.d.ts +19 -0
  113. package/types/packages/ui/src/primitives/IconButton.d.ts +6 -0
  114. package/types/packages/ui/src/primitives/If.d.ts +6 -0
  115. package/types/packages/ui/src/primitives/ImagePreview.d.ts +16 -0
  116. package/types/packages/ui/src/primitives/Loading.d.ts +18 -0
  117. package/types/packages/ui/src/primitives/LoadingOverlay.d.ts +7 -0
  118. package/types/packages/ui/src/primitives/Menu.d.ts +93 -0
  119. package/types/packages/ui/src/primitives/Notification.d.ts +110 -0
  120. package/types/packages/ui/src/primitives/Panel.d.ts +28 -0
  121. package/types/packages/ui/src/primitives/Popover.d.ts +58 -0
  122. package/types/packages/ui/src/primitives/PortalToBody.d.ts +7 -0
  123. package/types/packages/ui/src/primitives/Radio.d.ts +27 -0
  124. package/types/packages/ui/src/primitives/RadioGroup.d.ts +32 -0
  125. package/types/packages/ui/src/primitives/ResizableAndHideableSidebar.d.ts +40 -0
  126. package/types/packages/ui/src/primitives/ResizeHandle.d.ts +23 -0
  127. package/types/packages/ui/src/primitives/Segmented.d.ts +44 -0
  128. package/types/packages/ui/src/primitives/Select.d.ts +78 -0
  129. package/types/packages/ui/src/primitives/Switch.d.ts +23 -0
  130. package/types/packages/ui/src/primitives/Tabs.d.ts +17 -0
  131. package/types/packages/ui/src/primitives/Tag.d.ts +24 -0
  132. package/types/packages/ui/src/primitives/Toast.d.ts +67 -0
  133. package/types/packages/ui/src/primitives/Tooltip.d.ts +40 -0
  134. package/types/packages/ui/src/primitives/ValueDisplay.d.ts +25 -0
  135. package/types/packages/ui/src/primitives/YearHeatmap.d.ts +15 -0
  136. package/types/packages/ui/src/primitives/anchoredPosition.d.ts +44 -0
  137. package/types/packages/ui/src/primitives/datepicker/DatePicker.d.ts +71 -0
  138. package/types/packages/ui/src/primitives/datepicker/DateRangePicker.d.ts +70 -0
  139. package/types/packages/ui/src/primitives/datepicker/calendarEngine.d.ts +45 -0
  140. package/types/packages/ui/src/primitives/editTextClasses.d.ts +1 -0
  141. package/types/packages/ui/src/primitives/input/Input.d.ts +35 -0
  142. package/types/packages/ui/src/primitives/input/NumberInput.d.ts +25 -0
  143. package/types/packages/ui/src/primitives/input/Textarea.d.ts +14 -0
  144. package/types/packages/ui/src/primitives/mergeRefs.d.ts +6 -0
@@ -0,0 +1,12 @@
1
+ /**
2
+ * 主题「海盐」—— 取自移动端海盐 Ocean(浅色·沉静):盐雾蓝灰纸底 + 石板墨 + 海盐蓝 accent。
3
+ *
4
+ * 浅色(晴):底色 / 墨色 / 品牌蓝沿用移动端取值;桌面对比度门禁更严(02 规范 §2.5),
5
+ * ink-2 与 accent 按 AA 压深,并补齐移动端没有的 sunken / track 档。
6
+ *
7
+ * 深色(夜):移动端无深色版,按同色相推演为「夜海」——深海军蓝底 + 盐白墨 + 海盐蓝提亮。
8
+ * 层级与浅色对称翻转(同暖纸 · 夜的口径):surface 最亮、sunken 最暗;交互态改盐白墨低透明
9
+ * 叠层;阴影加深至黑系。
10
+ */
11
+ declare const _default: import("../defineTheme").ThemeDefinition;
12
+ export default _default;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * 主题「暖纸」—— 首个主题族,一张暖纸的晨与夜。
3
+ *
4
+ * 浅色(晨):取值来自样板间 direction-a-soft.html 的实测调优结果;奶油纸底 + 可可墨 +
5
+ * 陶土橙 accent(与移动端「杏子 Bento」同基因)。融合骨架要求:不提供侧栏专用底色,
6
+ * 侧栏透明融于 bg-page(见 03 指南 · 壳层铁律)。
7
+ *
8
+ * 深色(夜):同一张暖纸在烛光下——深可可纸底 + 奶油墨 + 陶土橙提亮。层级与浅色对称翻转:
9
+ * surface 最亮(卡片浮起)、sunken 最暗(凹陷);交互态改奶油墨低透明叠层(对应浅色的
10
+ * 可可墨叠层);阴影加深至黑系。
11
+ *
12
+ * 对比度按 02 规范 §2.5:ink-1 对 page/surface ≥ 7:1、ink-2 与 accent 文字 ≥ 4.5:1
13
+ * (由 theme-parity.test.ts 的对比度断言守护,深浅两套都校验)。
14
+ */
15
+ declare const _default: import("../defineTheme").ThemeDefinition;
16
+ export default _default;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * 主题「樱花」—— 樱粉纸底 + 梅褐墨 + 莓粉 accent,温柔明亮。
3
+ *
4
+ * 浅色(晴):纸底粉调强度对齐暖纸的暖调;accent 受 AA 所限明度不能高,粉感靠高饱和
5
+ * (62%)撑起,选中 / soft 底透明度也提一档让粉色在界面里可见;danger 偏橙红,与莓粉拉开。
6
+ * 深色(夜樱):夜底带一层梅粉调(可辨但不整页泛粉)+ 樱白墨 + 高饱和莓粉 accent。
7
+ *
8
+ * 对比度按 02 规范 §2.5,深浅两套均由 theme-parity.test.ts 校验。
9
+ */
10
+ declare const _default: import("../defineTheme").ThemeDefinition;
11
+ export default _default;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * 主题「紫藤」—— 淡紫灰纸底 + 暮紫墨 + 紫藤色 accent,柔和文艺。
3
+ *
4
+ * 浅色(晴):纸底带一丝紫调,墨色取暮紫而非纯黑,accent 为中明度紫藤色。
5
+ * 深色(夜紫):深紫夜底 + 藤白墨 + 紫藤提亮;层级口径同暖纸 · 夜。
6
+ *
7
+ * 对比度按 02 规范 §2.5,深浅两套均由 theme-parity.test.ts 校验。
8
+ */
9
+ declare const _default: import("../defineTheme").ThemeDefinition;
10
+ export default _default;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * 语义 token 词汇表 —— 单一事实源。
3
+ *
4
+ * 词汇表同时产出三样东西:
5
+ * 1. TS 类型 SemanticTokens(主题作者必须补齐全部键,漏键编译不过);
6
+ * 2. CSS 变量名(--tau-<word>,themeStore 注入到 html);
7
+ * 3. tokens.css 中 @theme inline 的映射依据(颜色类名 = 词汇名)。
8
+ *
9
+ * 规则(见 docs/redesign/02-UI设计系统规范.md §2):
10
+ * - 组件只允许消费 --tau-*(或经 Tailwind 映射的语义类名 bg-page / text-ink-1…);
11
+ * - palette 原始输入不进组件;尺度(字号/间距/圆角/动效)与主题正交,在 tokens.css :root 定义。
12
+ */
13
+ export declare const tokenContract: {
14
+ readonly surface: readonly ["bg-page", "bg-surface", "bg-surface-hover", "bg-sunken"];
15
+ readonly control: readonly ["bg-track"];
16
+ readonly interaction: readonly ["bg-hover", "bg-press", "bg-selected"];
17
+ readonly ink: readonly ["ink-1", "ink-2", "ink-3", "ink-inverse"];
18
+ readonly line: readonly ["line-1", "line-2"];
19
+ readonly accent: readonly ["accent", "accent-hover", "accent-soft", "accent-text", "focus-ring"];
20
+ readonly status: readonly ["ok", "ok-soft", "warn", "warn-soft", "danger", "danger-soft", "info", "info-soft"];
21
+ readonly tag: readonly ["tag-1", "tag-1-soft", "tag-2", "tag-2-soft", "tag-3", "tag-3-soft", "tag-4", "tag-4-soft", "tag-5", "tag-5-soft"];
22
+ readonly float: readonly ["overlay", "shadow-card", "shadow-lift", "shadow-float", "shadow-paper"];
23
+ };
24
+ /** 全部词汇的平铺联合类型 */
25
+ export type TokenWord = (typeof tokenContract)[keyof typeof tokenContract][number];
26
+ /** 主题必须提供的 token 取值表(全键 Required——漏一个编译不过) */
27
+ export type SemanticTokens = Record<TokenWord, string>;
28
+ /** CSS 变量名约定:--tau-<word>(如 --tau-bg-page)。 */
29
+ export declare function cssVarName(word: string): string;
30
+ export declare const ALL_TOKEN_WORDS: readonly TokenWord[];
@@ -0,0 +1,17 @@
1
+ import { type ReactNode } from "react";
2
+ import { type ThemeMode } from "../../themes/src/index";
3
+ export declare function usePortalContainer(): HTMLElement;
4
+ /** 模态内的浮层留在同一层叠上下文,挂载点避开正文滚动区。 */
5
+ export declare function PortalScope({ children }: {
6
+ children: ReactNode;
7
+ }): import("react/jsx-runtime").JSX.Element;
8
+ /**
9
+ * 局部主题作用域:theme / mode 任一给定即建立作用域(数据块按 主题族 × 明暗 双属性匹配,
10
+ * 缺省的一侧取默认主题族 / 浅色);都不给则继承 <html> 上的全局主题。
11
+ */
12
+ export declare function UiProvider({ children, theme, mode, className, }: {
13
+ children: ReactNode;
14
+ theme?: string;
15
+ mode?: ThemeMode;
16
+ className?: string;
17
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * className 合并 —— clsx 做条件拼接,tailwind-merge 去掉同属性冲突项。
3
+ *
4
+ * 组件基础类与调用方 className 撞同一属性时(size-[30px] vs size-[27px]、
5
+ * items-start vs items-center),Tailwind 生成顺序决定胜负、clsx 的先后顺序无效,
6
+ * 覆盖会被静默吞掉——凡允许 className 覆盖默认样式处(primitives、样板间 kit)都用本函数。
7
+ *
8
+ * 自定义尺度词(text-tau-*、rounded-tau-*、shadow-card…)tailwind-merge 默认不认识,
9
+ * 会把 text-tau-meta 当颜色组而与 text-ink-2 互相残杀(后写赢、字号类被删)。下表把它们
10
+ * 登记进正确的 classGroup;与 tokens.css 的一致性由 __tests__/cn.test.ts 守护,
11
+ * 新增尺度词必须同步登记。
12
+ */
13
+ import { type ClassValue } from "clsx";
14
+ /** 尺度词表(值不含类名前缀:text-tau-meta 记为 tau-meta) */
15
+ export declare const SCALE_WORDS: {
16
+ readonly fontSize: readonly ["tau-hero", "tau-title-lg", "tau-title", "tau-body-lg", "tau-body", "tau-meta", "tau-sm", "tau-micro", "tau-tiny"];
17
+ readonly fontFamily: readonly ["tau", "tau-mono", "tau-hand"];
18
+ readonly radius: readonly ["tau-sm", "tau-md", "tau-lg"];
19
+ readonly shadow: readonly ["card", "lift", "float", "paper"];
20
+ readonly ease: readonly ["tau-out"];
21
+ readonly animate: readonly ["hm-pulse"];
22
+ };
23
+ export declare const cn: (...inputs: ClassValue[]) => string;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 面板内纵向滚动区类名(桌面端 FadeScroll、Drawer 正文共用):edge fade 协议 + 内缩滚动条(4px 细条 + 右侧 6px 透明边 +
3
+ * 轨道上下各 10px,不贴容器边缘)。滚动容器由第三方组件渲染、无法包 <FadeScroll> 时,
4
+ * 直接挂此类名并对容器调用 useEdgeFade。右侧 6px 透明边算在宽度里,调用方右内边距相应减 6px。
5
+ * 不用 .scrollbar-inset:它是未分层 CSS,其 4px 轨道边会压过这里的工具类。
6
+ * 轨道内缩用 margin 而非透明 border:Chromium 的滑块会画进轨道 border,滚到顶/底仍贴边
7
+ */
8
+ export declare const FADE_SCROLL_CLASS: string;
@@ -0,0 +1,3 @@
1
+ export * from "./useEdgeFade";
2
+ export * from "./scrollbarAutoHide";
3
+ export * from "./fadeScrollClass";
@@ -0,0 +1,2 @@
1
+ /** 键盘操作让位输入框、文本域和可编辑节点。 */
2
+ export declare function isEditableTarget(target: EventTarget | null): boolean;
@@ -0,0 +1 @@
1
+ export declare function lockBodyScroll(owner: Document): () => void;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * 滚动条自动隐藏 —— 事件委托驱动,AppShell 初始化一次、全局滚动区生效。
3
+ *
4
+ * 为什么不用纯 CSS(.app *:hover::-webkit-scrollbar-thumb):Chromium 的滚动条
5
+ * 伪元素不随 :hover 常规重算,显形后可能冻结不消失。改为 mouseover/scroll/mouseout
6
+ * 事件给活跃滚动容器切换 scrollbar-live 类(base.css 消费),行为 =
7
+ * hover 或滚动中显形、停止滚动 700ms 且鼠标不在时隐藏、移出窗口立即隐藏。
8
+ */
9
+ export declare function initScrollbarAutoHide(owner?: Document): () => void;
@@ -0,0 +1,22 @@
1
+ export type ScrollState = {
2
+ /** 已滚离顶部(scrollTop > 1,1px 容差吸收 DPI 缩放下的取整残留):顶部渐隐的显示条件 */
3
+ scrolled: boolean;
4
+ /** 还能向下滚动(未滚到底):底部渐隐的显示条件;内容不足一屏时恒为 false */
5
+ canScrollDown: boolean;
6
+ };
7
+ export type EdgeFadeOptions = {
8
+ /** 启用顶部渐隐(默认 true) */
9
+ top?: boolean;
10
+ /** 启用底部渐隐(默认 true)。末尾内容需要完整可见的页面(无底部留白)可传 false 关掉 */
11
+ bottom?: boolean;
12
+ };
13
+ /** 滚动边缘状态:scroll 事件 + ResizeObserver(容器尺寸随窗口缩放/侧栏拖宽变化)+
14
+ MutationObserver(列表数据异步到达撑高内容)三路监听,布尔翻转才 setState。
15
+ useLayoutEffect 内完成首次测量,避免能滚页面首帧渐隐缺失的闪烁。
16
+ 参数是元素而非 RefObject:视图常有 loading 早退分支(容器晚于首帧挂载),
17
+ 配合 callback ref 的 setState 才能在挂载时重新接线 */
18
+ export declare function useScrollState(el: HTMLElement | null): ScrollState;
19
+ /** 滚动边缘渐隐驱动:把 useScrollState 的结果写为容器 CSS 变量
20
+ (--edge-top-on / --edge-bottom-on,0 或 1),配合 .home-scroll 的 mask 渐变收放渐隐带。
21
+ 纯 DOM 写变量,不触发额外渲染 */
22
+ export declare function useEdgeFade(el: HTMLElement | null, options?: EdgeFadeOptions): void;
@@ -0,0 +1,47 @@
1
+ export * from "./cn";
2
+ export { FadeScroll } from "./primitives/FadeScroll";
3
+ export { default as If } from "./primitives/If";
4
+ export { default as ErrorBoundary } from "./primitives/ErrorBoundary";
5
+ export { default as PortalToBody } from "./primitives/PortalToBody";
6
+ export { default as ResizableAndHideableSidebar } from "./primitives/ResizableAndHideableSidebar";
7
+ export { EditText, type EditTextHandle } from "./primitives/EditText";
8
+ export { EDIT_TEXT_PLACEHOLDER } from "./primitives/editTextClasses";
9
+ export * from "./hooks/index";
10
+ export { isEditableTarget } from "./hooks/isEditableTarget";
11
+ export * from "./UiProvider";
12
+ export * from "./primitives/Button";
13
+ export * from "./primitives/IconButton";
14
+ export * from "./primitives/Loading";
15
+ export * from "./primitives/Panel";
16
+ export * from "./primitives/Toast";
17
+ export * from "./primitives/Notification";
18
+ export * from "./primitives/Tooltip";
19
+ export * from "./primitives/Select";
20
+ export * from "./primitives/Menu";
21
+ export * from "./primitives/AnchoredPanel";
22
+ export * from "./primitives/Dialog";
23
+ export * from "./primitives/ConfirmDialog";
24
+ export * from "./primitives/Drawer";
25
+ export * from "./primitives/Popover";
26
+ export * from "./primitives/YearHeatmap";
27
+ export * from "./primitives/input/Input";
28
+ export * from "./primitives/input/Textarea";
29
+ export * from "./primitives/input/NumberInput";
30
+ export * from "./patterns/FormRow";
31
+ export * from "./primitives/Checkbox";
32
+ export * from "./primitives/Switch";
33
+ export * from "./primitives/RadioGroup";
34
+ export * from "./primitives/Radio";
35
+ export * from "./primitives/Segmented";
36
+ export * from "./primitives/FilterPill";
37
+ export * from "./primitives/ResizeHandle";
38
+ export * from "./primitives/Tag";
39
+ export * from "./primitives/ValueDisplay";
40
+ export * from "./primitives/datepicker/DatePicker";
41
+ export * from "./primitives/datepicker/DateRangePicker";
42
+ export * from "./primitives/ImagePreview";
43
+ export * from "./primitives/Tabs";
44
+ export * from "./primitives/FileDropZone";
45
+ export * from "./primitives/LoadingOverlay";
46
+ export { lockBodyScroll } from "./hooks/lockBodyScroll";
47
+ export { mergeRefs } from "./primitives/mergeRefs";
@@ -0,0 +1,20 @@
1
+ /**
2
+ * ⚠️ 占位迁移(未经设计稿评审):本文件是原 primitives/Input.tsx 中 FormField 的
3
+ * 原样搬迁,仅为了让既有消费者(database 的 DatabasePanels、样板间)在 Input
4
+ * 重写后继续编译——「表单字段包装」属于表单范式,正式形态是 ui/patterns 的
5
+ * FormRow(Field 体系,02 §5.1 规划位:label / 描述 / 错误 / touched 策略 /
6
+ * ref 聚焦钩子),待出设计稿后整体重做,届时本导出名与 render-props 契约
7
+ * 均可能变化。在此之前请勿在此基础上加能力。
8
+ */
9
+ import { type ReactNode } from "react";
10
+ export declare function FormField({ label, description, error, required, children, }: {
11
+ label: string;
12
+ description?: string;
13
+ error?: string | null;
14
+ required?: boolean;
15
+ children: (props: {
16
+ id: string;
17
+ "aria-describedby"?: string;
18
+ "aria-invalid"?: boolean;
19
+ }) => ReactNode;
20
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,53 @@
1
+ /**
2
+ * AnchoredPanel 基础件 —— 锚定面板:浮层家族的定位基座(Radix Popper 同构层)。
3
+ *
4
+ * 与 Popover 的分工:AnchoredPanel 只管锚定定位(D-004 引擎)、卡片视觉、portal
5
+ * 与显隐过渡——无开合状态(默认锚点在即显示,open 可由宿主驱动)、不监听外点、
6
+ * 不消费 Esc/Tab、不抢焦点,键盘与焦点事件原样冒泡给宿主仲裁。Popover 组合它并
7
+ * 叠加交互层(trigger 注入、外点/Esc/Tab 仲裁、焦点契约、dialog 语义);卡片与
8
+ * Body/Footer 的视觉形制只有本文件一份。
9
+ *
10
+ * 直接使用的场景:浮层是某个交互会话的一部分、生命周期完全由宿主拥有——如行内
11
+ * 编辑器的选项面板(编辑会话在,面板在;失焦/Esc 由编辑宿主统一判定)。需要独立
12
+ * 开合的浮层用 Popover,勿直接用此件。
13
+ */
14
+ import { type HTMLAttributes, type ReactNode, type Ref } from "react";
15
+ import { type AnchoredPlacement } from "./anchoredPosition";
16
+ /** Body 顶部间距按有无头行分流(头行自带 pb);由带头行的容器(如 Popover)提供 */
17
+ export declare const PanelHasHeaderContext: import("react").Context<boolean | null>;
18
+ export interface AnchoredPanelProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "className"> {
19
+ /** 锚点元素;为空时不渲染(宿主常在 ref 就绪后再挂) */
20
+ anchor: HTMLElement | null;
21
+ /** 12 向全表(引擎 flip/shift 兜底),默认 bottom-start */
22
+ placement?: AnchoredPlacement;
23
+ /** 显隐由宿主驱动;缺省锚点存在即显示(宿主托管用法) */
24
+ open?: boolean;
25
+ /** 8px 菱形箭头(随 flip 换边),默认关 */
26
+ arrow?: boolean;
27
+ /** 透传浮层卡片(宽度控制如 w-[360px],覆盖 min/max 约束) */
28
+ className?: string;
29
+ children: ReactNode;
30
+ /** 卡片 DOM 引用(AnchoredPanel 内部已占用一位做定位,此处合并外部引用) */
31
+ ref?: Ref<HTMLDivElement>;
32
+ }
33
+ export declare function AnchoredPanel({ anchor, placement, open, arrow, className, children, ref: externalRef, ...cardProps }: AnchoredPanelProps): import("react").ReactPortal | null;
34
+ export declare namespace AnchoredPanel {
35
+ var Body: typeof AnchoredPanelBody;
36
+ var Footer: typeof AnchoredPanelFooter;
37
+ }
38
+ export interface AnchoredPanelBodyProps {
39
+ children: ReactNode;
40
+ className?: string;
41
+ }
42
+ /** 正文:独立滚动(上限 min(60vh, 420px))+ 边缘渐隐 + 透明右边框挤位(D-012 手法,
43
+ * 浮层滚动区通用口径);顶部间距按有无头行分流:无头行自足 14px,有头行收敛 10px。
44
+ * 滚动轨道上下让位(track margin;track 透明边框不缩短 thumb 活动区):贴浮层边缘的一端
45
+ * 让出圆角半径,免得 thumb 画进 rounded-tau-lg 的圆角外;头行下方只留 4px */
46
+ declare function AnchoredPanelBody({ children, className }: AnchoredPanelBodyProps): import("react/jsx-runtime").JSX.Element;
47
+ export interface AnchoredPanelFooterProps {
48
+ children: ReactNode;
49
+ className?: string;
50
+ }
51
+ /** 应答区:随需——无操作即无 footer;按钮右对齐(主按钮恒在最右) */
52
+ declare function AnchoredPanelFooter({ children, className }: AnchoredPanelFooterProps): import("react/jsx-runtime").JSX.Element;
53
+ export {};
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Button —— 文字按钮基础件(方案 B「现代产品」形制,mockups/button/,D-013)。
3
+ *
4
+ * 变体六档是一个动作的全部音量,层级纪律靠评审不进 API:
5
+ * - primary:accent 实心 + 微投影,每屏至多一枚;Dialog 应答区主按钮位
6
+ * - secondary:surface 亮底 + line-1 描边(D-007/D-009「浮起物」口径),应答与取消的默认档
7
+ * - soft:accent-soft 平底,工具栏高频次级强调(比 secondary 轻、比 ghost 重)
8
+ * - ghost:无底 hover 淡墨,与 IconButton 同反馈语言
9
+ * - danger / danger-soft:对齐 D-011 危险分级——实心红只给确认位,列表/工具栏一律 soft
10
+ *
11
+ * 行为契约:loading = aria-busy + spinner + 文案切换 + 一并 disabled(指针封锁与
12
+ * Tab 队列退出由原生 disabled 承担);disabled 同理走原生属性;focus-visible 才显
13
+ * 焦点环(鼠标点击不显、Tab 才显);图标仅左位 16px,icon-only 归 IconButton。
14
+ * 反馈是「光」的(换色 / 边框加深 / brightness),无位移。
15
+ */
16
+ import type { ComponentProps } from "react";
17
+ import type { LucideIcon } from "lucide-react";
18
+ export type ButtonVariant = "primary" | "secondary" | "soft" | "ghost" | "danger" | "danger-soft";
19
+ export interface ButtonProps extends ComponentProps<"button"> {
20
+ variant?: ButtonVariant;
21
+ size?: "sm" | "md";
22
+ /** 左位图标(16px stroke 1.75);纯图标按钮走 IconButton,不设 icon-only 档 */
23
+ icon?: LucideIcon;
24
+ /** 满宽(空态 CTA / 窄容器) */
25
+ block?: boolean;
26
+ /** 载入中:spinner + aria-busy + 文案切换 + disabled,点击不触发 */
27
+ loading?: boolean;
28
+ /** loading 时的文案(默认保持 children 不变) */
29
+ loadingText?: string;
30
+ }
31
+ export declare function Button({ variant, size, icon: Icon, block, loading, loadingText, className, type, disabled, onClick, children, ref, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Checkbox —— 勾选基础件(Input 方案 A「经典描边」语言,mockups/checkbox/,2026-09-19 定稿)。
3
+ *
4
+ * 原生 input[type=checkbox] 承载语义(appearance-none 自绘皮):label 点击切换、
5
+ * Space 原生支持、读屏语义白送。「浮起物」:16×16 视觉格 surface + line-1,
6
+ * 选中转 accent 实底 + 反色勾(110ms 淡入,唯一的固定反馈——无动效 prop)。
7
+ *
8
+ * 结构铁律:input / 格子 / 勾图标必须在同一层互为兄弟——Tailwind 的 peer-* 变体
9
+ * 只匹配 peer 的后续兄弟(`~ *`),挂在深层后代上会静默失效(勾选后无任何视觉)。
10
+ * 状态语义(与 Input 裁决同源):
11
+ * - 命中 24×24(input 绝对定位撑满锚格,宪法下限);focus-visible 才显 ring
12
+ * (锚格经 has- 变体响应,因锚是 input 的父级而非兄弟)
13
+ * - hover 描边加深半档(未选中 ink-3/50 / 选中 accent-hover),聚焦时让位
14
+ * - indeterminate 半选(accent 实底 + 横线):DOM 属性驱动,联动逻辑归调用方
15
+ * - 错误态正源 aria-invalid(未选中 danger;选中/半选保持 accent);禁用降透明
16
+ */
17
+ import { type ComponentProps, type ReactNode } from "react";
18
+ export interface CheckboxProps extends Omit<ComponentProps<"input">, "type"> {
19
+ /** 可选:渲染关联 label(点文字切换);不传则裸勾选框 */
20
+ label?: ReactNode;
21
+ /** 半选视觉态(DOM 属性驱动;点击行为仍由调用方决定全选/清空) */
22
+ indeterminate?: boolean;
23
+ }
24
+ export declare function Checkbox({ label, indeterminate, className, disabled, ref, ...props }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * ConfirmDialog —— Dialog 的最薄语义预设:确认类对话一句话接线(D-011)。
3
+ *
4
+ * 信息一处一责:标题讲动作、context 徽标记对象、description 讲事实、impact 念
5
+ * 后果、按钮文案不带数量。danger 两档(D-011 用户裁决):
6
+ * - 轻 danger:实心红主按钮 + 初始焦点落取消(回车不误触),一步确认
7
+ * - 真·不可逆:typeToConfirm 传对象名,输入匹配才解锁确认按钮(每次打开重置)
8
+ *
9
+ * 异步确认两种接法:
10
+ * - 推荐:onConfirm 返回 Promise(async 函数天然满足)——自动进入 loading,
11
+ * resolve 后自动关闭、reject 保持打开(错误留在原地处理);loading 态封锁
12
+ * 一切关闭路径,回执交 Toast(D-003 家族分工)
13
+ * - 受控:loading prop 由调用方管理(多步进度等),完成后自行把 open 置 false。
14
+ * 注意不能在 onConfirm 里才 set loading——props 是渲染快照,同步路径会先按
15
+ * false 立即关闭(样板间首版即踩此竞态,故内建 Promise 感知)
16
+ */
17
+ import { type ReactNode } from "react";
18
+ export interface ConfirmDialogProps {
19
+ open: boolean;
20
+ onOpenChange: (open: boolean) => void;
21
+ title: string;
22
+ /** 操作对象(徽标) */
23
+ context?: string;
24
+ description?: ReactNode;
25
+ /** 影响行(后果量化),danger 主按钮时默认走 danger 色 */
26
+ impact?: string;
27
+ confirmText?: string;
28
+ cancelText?: string;
29
+ /** 主按钮 danger 实心 + 初始焦点落取消(防回车误触) */
30
+ danger?: boolean;
31
+ /** 输入该名称后确认按钮才解锁——只给真·不可逆操作(档位不是装饰) */
32
+ typeToConfirm?: string;
33
+ critical?: boolean;
34
+ /** 确认进行中:封锁关闭路径 + 主按钮 loading;onConfirm 返回 Promise 时自动管理 */
35
+ loading?: boolean;
36
+ loadingText?: string;
37
+ onConfirm?: () => void | Promise<unknown>;
38
+ /** 条件未满足时禁用确认位(如仍在同步),取消照常可用 */
39
+ confirmDisabled?: boolean;
40
+ size?: "sm" | "md" | "lg";
41
+ width?: number;
42
+ className?: string;
43
+ }
44
+ export declare function ConfirmDialog({ open, onOpenChange, title, context, description, impact, confirmText, cancelText, danger, typeToConfirm, critical, loading, loadingText, onConfirm, confirmDisabled, size, width, className, }: ConfirmDialogProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Dialog 基础件 —— 模态决策容器 + ConfirmDialog 语义预设(形制与行为裁决见 D-011)。
3
+ *
4
+ * 形制:体内大标题 + 上下文徽标(context)+ hairline 应答区(主按钮最右,按钮序列
5
+ * 由 footer 提供)+ blur 遮罩;长内容滚动区接 edge fade(对齐壳层 useEdgeFade
6
+ * 协议)。阻断通知不带 icon,文字头部与其它对话同构(D-011)。
7
+ *
8
+ * 行为内建(不做成 props):
9
+ * - 开合动效:遮罩淡入 + 卡片 scale(0.97)+translateY(8px),退场等长后卸载;根上带
10
+ * data-morph(视图转场进行中)时一步到位到终态——转场更新期间 rAF 不触发,入场
11
+ * 动效跑不起来,浏览器要截的是终态。卡片 data-state=open|closed 供形变定位就绪
12
+ * - Esc:仅 open 态在卡片 DOM 消费(stopPropagation)——焦点圈闭保证 Esc 必落
13
+ * 卡片,焦点链即 LIFO,不进 D-003 注册表(同 D-007/D-010 口径,ui 不反向依赖
14
+ * page/);critical 抖动拒绝
15
+ * - 关闭矩阵:dismissible = × + Esc + 遮罩点击;critical = 无 ×、遮罩点击抖动;
16
+ * locked(异步 loading)= 全失效
17
+ * - Tab 圈闭(首尾环绕)· 打开记录触发元素、关闭归还焦点
18
+ * - 初始焦点落卡片内 [data-autofocus] 元素(无则卡片自身);表单场景把
19
+ * data-autofocus 放首输入框,danger 场景放取消按钮
20
+ * - 打开锁定底层滚动;卡片是限高(78vh)的 flex 列,头尾钉住
21
+ *
22
+ * 正文组合(同 MUI DialogContent / Chakra ModalBody):卡片不替内容决定滚动,
23
+ * children 原样排在标题与应答区之间。常规正文包 <DialogBody>——它是滚动区
24
+ * (edge fade + 内缩滚动条 + 标准内边距);放在 DialogBody 之外的内容自然钉住
25
+ * 不随正文滚动(元信息行、标签栏等);工作台型弹窗(双栏树 + 预览等)不用
26
+ * DialogBody,配合 height 定高由内容自行分栏滚动。
27
+ *
28
+ * 自定义头部:`header` 整体替换内建标题行与 ×(工作台型弹窗自带导航头时用),
29
+ * 关闭入口由 header 自行提供;`title` 仍是对话框的无障碍名称。
30
+ *
31
+ * 尺寸档是预设不是牢笼(D-011):sm 380 / md 440(默认)/ lg 560,width 任意值覆盖;
32
+ * 高度默认随内容(上限 78vh),height 定高(仍不超 82vh)。
33
+ * 层级:遮罩容器 z-[340](Toast 200 < Select/Menu 250 < Tooltip 300 之上)。
34
+ */
35
+ import { type KeyboardEvent as ReactKeyboardEvent, type ReactNode, type Ref } from "react";
36
+ export interface DialogProps {
37
+ open: boolean;
38
+ /** 提前挂载内容,待异步初始化完成后再显示并接管焦点。 */
39
+ contentReady?: boolean;
40
+ onOpenChange: (open: boolean) => void;
41
+ /** 退场完成且内容卸载后调用,可在此清理业务草稿。 */
42
+ onAfterClose?: () => void;
43
+ title: string;
44
+ /** 替换内建标题行与 ×;关闭入口由调用方在 header 内提供,title 转为 aria-label */
45
+ header?: ReactNode;
46
+ /** 标题左侧图标(16px、ink-2,随需出现;阻断通知等场景保持纯文字头部) */
47
+ icon?: ReactNode;
48
+ /** 标题下的次级说明行(meta 字号,随需出现) */
49
+ subtitle?: string;
50
+ /** 操作对象(上下文徽标,随需出现;标题保持动作语义) */
51
+ context?: string;
52
+ /** footer 影响行——后果量化贴决策点;impactDanger 走 danger 色 */
53
+ impact?: string;
54
+ impactDanger?: boolean;
55
+ /** critical:无 ×,遮罩/Esc 抖动拒绝——「必须作答」档 */
56
+ critical?: boolean;
57
+ /** 关闭路径全封锁(异步进行中,半途关闭即坏文件) */
58
+ locked?: boolean;
59
+ size?: "sm" | "md" | "lg";
60
+ /** 任意宽度(px)覆盖 size——业务特殊版式不必硬凑档位 */
61
+ width?: number;
62
+ /** 卡片定高(px,不超 82vh)——工作台型弹窗由内容自管滚动时用,避免高度随内容跳动 */
63
+ height?: number;
64
+ /** 应答区按钮序列(主按钮恒在最右;组件自身不渲染按钮) */
65
+ footer?: ReactNode;
66
+ children?: ReactNode;
67
+ /** 卡片 onKeyDown 透传(ConfirmDialog 用它接管 Enter 默认应答) */
68
+ onKeyDown?: (e: ReactKeyboardEvent<HTMLDivElement>) => void;
69
+ className?: string;
70
+ ref?: Ref<HTMLDivElement>;
71
+ }
72
+ export declare function Dialog({ open, contentReady, onOpenChange, onAfterClose, title, header, icon, subtitle, context, impact, impactDanger, critical, locked, size, width, height, footer, children, onKeyDown, className, ref, }: DialogProps): import("react").ReactPortal | null;
73
+ export interface DialogBodyProps {
74
+ children?: ReactNode;
75
+ className?: string;
76
+ }
77
+ /**
78
+ * Dialog 正文滚动区:同 FadeScroll 的内缩滚动条(轨道上下各留 10px,不贴头尾),右侧 6px
79
+ * 透明边、右内边距相应减 6px;只纵向滚动(内容借位负外边距超出时不冒横向滚动条)。
80
+ * 底部留白按有无应答区取:有则贴 hairline 前留 22px,无则滚动区离卡片底 16px。
81
+ */
82
+ export declare function DialogBody({ children, className }: DialogBodyProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Drawer 基础件 —— 右侧抽屉,两种形态共用头部 / 正文 / 开合与内容保留:
3
+ *
4
+ * modal(默认):距视口四边 8px 的浮起卡 + 淡遮罩(不 blur),portal 到 body 级容器。
5
+ * Skill / MCP 服务器 / 站点设置等「看完即走」的详情与配置。
6
+ * - 开合:遮罩淡入 + 卡片自右缘滑入(280ms),退场后卸载
7
+ * - Tab 圈闭 · 打开记录触发元素、卸载归还焦点 · 初始焦点落 [data-autofocus](无则卡片)
8
+ * - 遮罩点击关闭 · 打开锁定底层滚动 · 内部 Select / Menu 继承卡片内的局部 Portal 容器
9
+ *
10
+ * modal={false}:就地渲染在最近的定位祖先里(默认 absolute 距上右下 12px),无遮罩、不抢焦点、
11
+ * 不锁滚动——「边看边改」的伴随面板(待办详情、复习参考资料、白板关联笔记)。
12
+ * - 开合:以右缘为原点微缩 + 淡入(240ms),外框始终在容器内,不被纸的圆角裁掉
13
+ * - 焦点可能在抽屉外(用户回到列表 / 画布),Esc 需调用方另接页面浮层仲裁
14
+ * (桌面端 useOverlayDismiss);焦点在抽屉内时由抽屉自己消费
15
+ *
16
+ * 共同:
17
+ * - 结构:头部(前导图标 · 标题 / 副标题 / 元信息三行 · 右侧操作区 + ×)→ 可选 toolbar →
18
+ * 正文滚动区(FADE_SCROLL_CLASS + edge fade)→ 可选 footer。不传 title 即无头部,× 浮在
19
+ * 右上角;fill 让正文不滚动、无内边距,内容自管布局(自带头部与滚动的复杂面板)
20
+ * - Esc 在抽屉 DOM 消费(stopPropagation);内层 Select / Menu 先消费自己的 Esc
21
+ * (defaultPrevented 让位);visible 渲染期派生,Activity 保活停驻时必然退到不可见不可点
22
+ * - isolateKeyboard:键盘事件在抽屉边界停止冒泡(冒泡阶段,内层编辑器照常收到),
23
+ * 宿主在 document 上监听快捷键时(白板)用它防串键
24
+ * - onWidthChange:左缘出现拖拽调宽手柄,宽度受控、夹在 minWidth / maxWidth 之间
25
+ *
26
+ * 退场期间内容保留:抽屉多由「选中项 | null」驱动,关闭即 null 会让内容在滑出途中消失。
27
+ * 调用方用 useRetainedValue(item) 拿到「最后一次非空值」渲染即可。
28
+ *
29
+ * 尺寸档:sm 440 / md 560(默认)/ lg 720,width 任意值覆盖;不超出视口(modal)/ 容器(非模态)。
30
+ * 层级:modal z-[340],与 Dialog 同层——后打开者在上;非模态 z-10,className 可覆盖。
31
+ */
32
+ import { type ReactNode, type Ref } from "react";
33
+ declare const SIZE_WIDTH: {
34
+ readonly sm: 440;
35
+ readonly md: 560;
36
+ readonly lg: 720;
37
+ };
38
+ export interface DrawerProps {
39
+ open: boolean;
40
+ onOpenChange: (open: boolean) => void;
41
+ /** 退场完成且内容卸载后调用 */
42
+ onAfterClose?: () => void;
43
+ /** false = 非模态伴随面板(见文件头) */
44
+ modal?: boolean;
45
+ /** 标题:字符串或自定义节点(如标题 + 来源标签、可编辑标题);不传则无头部,× 浮在右上角 */
46
+ title?: ReactNode;
47
+ /** 无障碍名;title 不是纯字符串(或没有 title)时必填 */
48
+ label?: string;
49
+ /** 前导视觉(图标 / 头像 / 勾选框),尺寸由调用方决定,与标题首行顶对齐 */
50
+ icon?: ReactNode;
51
+ /** 标题下第二行(meta 字号 ink-3):字符串单行截断;节点由调用方决定截断 / 折行 */
52
+ subtitle?: ReactNode;
53
+ /** 第三行元信息(徽标 + 计数等,sm 字号横排) */
54
+ meta?: ReactNode;
55
+ /** 头部右侧操作区(× 之前):主操作按钮、更多菜单、开关等 */
56
+ actions?: ReactNode;
57
+ /** 头部下方、正文之上的钉住条(分区 Segmented、筛选等),不随正文滚动 */
58
+ toolbar?: ReactNode;
59
+ /** 底部钉住区(hairline 分隔):保存提示、应答按钮等 */
60
+ footer?: ReactNode;
61
+ /** 正文不滚动、无内边距,flex 列由内容自管(自带头部与滚动的复杂面板) */
62
+ fill?: boolean;
63
+ /** 键盘事件不冒泡出抽屉(宿主在 document 上监听快捷键时防串键) */
64
+ isolateKeyboard?: boolean;
65
+ size?: keyof typeof SIZE_WIDTH;
66
+ /** 任意宽度(px)覆盖 size;配合 onWidthChange 即受控宽度 */
67
+ width?: number;
68
+ /** 传入即开启左缘拖拽调宽 */
69
+ onWidthChange?: (width: number) => void;
70
+ minWidth?: number;
71
+ maxWidth?: number;
72
+ /** × 的无障碍名(默认「关闭」) */
73
+ closeLabel?: string;
74
+ /** 正文滚动区附加类(改内边距、字号等) */
75
+ bodyClassName?: string;
76
+ /** 抽屉卡片附加类(非模态常用来改定位:top-0、z-50 等) */
77
+ className?: string;
78
+ children?: ReactNode;
79
+ ref?: Ref<HTMLElement>;
80
+ }
81
+ export declare function Drawer({ open, onOpenChange, onAfterClose, modal, title, label, icon, subtitle, meta, actions, toolbar, footer, fill, isolateKeyboard, size, width, onWidthChange, minWidth, maxWidth, closeLabel, bodyClassName, className, children, ref, }: DrawerProps): import("react/jsx-runtime").JSX.Element | null;
82
+ /**
83
+ * 退场期间保留内容:返回 value;value 为空时返回最后一次非空值。
84
+ * 抽屉由「选中项 | null」驱动时,用它渲染内容,关闭滑出途中不会变空白。
85
+ */
86
+ export declare function useRetainedValue<T>(value: T | null | undefined): T | null;
87
+ export {};
@@ -0,0 +1,32 @@
1
+ import React from "react";
2
+ interface IEditTextProps {
3
+ id?: string;
4
+ className?: string;
5
+ style?: React.CSSProperties;
6
+ defaultValue?: string;
7
+ value?: string;
8
+ placeholder?: string;
9
+ placeholderClassName?: string;
10
+ placeholderStyle?: React.CSSProperties;
11
+ contentEditable?: boolean;
12
+ onChange?: (value: string) => void;
13
+ onPressEnter?: () => void;
14
+ onDeleteEmpty?: () => void;
15
+ defaultFocus?: boolean;
16
+ onBlur?: () => void;
17
+ onKeyDown?: (e: KeyboardEvent) => void;
18
+ isSlateEditor?: boolean;
19
+ }
20
+ export type EditTextHandle = {
21
+ clear: () => void;
22
+ setValue: (value: string) => void;
23
+ focus: () => void;
24
+ isFocus: () => boolean;
25
+ focusEnd: () => void;
26
+ selectAll: () => void;
27
+ blur: () => void;
28
+ getValue: () => string;
29
+ setContentEditable: (editable: boolean) => void;
30
+ };
31
+ export declare const EditText: React.NamedExoticComponent<IEditTextProps & React.RefAttributes<EditTextHandle>>;
32
+ export default EditText;
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ interface IErrorBoundaryProps {
3
+ children: React.ReactNode;
4
+ fallback?: React.ReactNode;
5
+ onError?(error: Error): void;
6
+ key?: React.Key;
7
+ }
8
+ interface IErrorBoundaryState {
9
+ error: string;
10
+ }
11
+ declare class ErrorBoundary extends React.Component<IErrorBoundaryProps, IErrorBoundaryState> {
12
+ constructor(props: IErrorBoundaryProps);
13
+ componentDidCatch(error: Error): void;
14
+ render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null;
15
+ }
16
+ export default ErrorBoundary;