idea-react 3.0.0-rc.2 → 3.0.0-rc.4

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/AGENTS.md CHANGED
@@ -150,14 +150,96 @@ export class MyComponent extends ObservedComponent<MyComponentProps> {
150
150
  - 多个同前缀的文件归入同名文件夹,文件使用 `index.tsx`、`model.ts`、
151
151
  `style.module.css` 等短名,并同步调整所有引用。
152
152
 
153
- ## 状态与回调
153
+ ## 复杂组件架构
154
+
155
+ ### 职责与单向流
154
156
 
155
157
  - 遵循 AOP、单一职责与关注点分离,优先复用现有模型和框架组合机制,避免过度抽象。
158
+ - 按实际需要参考 MVC、MVVM、MVP 范式,以 View Model 作为业务统筹中枢,不为套用范式增加无必要的类或抽象层。
159
+ 少量、仅供单个组件使用的状态可以直接写为类组件实例成员,不必独立状态类。
160
+
161
+ | 职责 | 负责 | 不负责 |
162
+ | ------------------- | -------------------------------------------------------------------------- | ---------------------------------------------- |
163
+ | View(组件) | 根据 Props 初始化与同步模型,绘制界面,转发交互和浏览器事件,管理生命周期 | 业务策略、分页或目标选择、异步业务流程 |
164
+ | View Model(Store) | 统筹业务规则、异步流程、数值计算、可观察状态和执行计划,处理完成或中断反馈 | 访问 DOM、测量布局、注册浏览器事件 |
165
+ | DOM 适配器 | 提供数值化布局快照,执行模型状态要求的 DOM 副作用,反馈测量和执行事实 | 反向查询整个模型,替模型决定业务策略或选中状态 |
166
+
167
+ - 业务行为、异步流程和状态集中在内聚的模型类中,不集中到 React hooks 或零散工具函数里;
168
+ 真正无状态、聚焦的数值转换可以使用纯函数。
169
+ - 组件重绘和命令式 DOM 副作用均由模型的可观察状态驱动:`observer` 消费展示状态,
170
+ `reaction` 观察执行计划,CSS 响应渲染后的类名或样式,不建立两套业务控制器。
171
+ 执行器通过明确的回调反馈事实,而不是获取整个 Store 再作决策。
172
+ - 测量与 DOM 执行可以共用一个普通类,以接口和方法区分职责,不为每项职责机械增加文件或类。
173
+ 动画帧可由状态触发的执行器或 CSS 完成,不为逐帧数值强制触发 React 重绘。
174
+
175
+ ```mermaid
176
+ flowchart LR
177
+ Events["用户交互 / Props / 浏览器事件"] --> Model["View Model"]
178
+ Measure["DOM 测量"] -->|数值快照| Model
179
+ Model --> State["可观察状态 / 执行计划"]
180
+ State --> View["View 渲染"]
181
+ State --> Effects["DOM 执行器 / CSS"]
182
+ View -->|挂载 / 布局失效| Measure
183
+ Effects -->|完成 / 中断事实| Model
184
+ Effects -->|布局失效| Measure
185
+ ```
186
+
187
+ 图中的反馈是下一次模型输入,仍遵循“输入 → 模型决策与状态 → 渲染或执行 → 事实反馈”的单向数据或操作流;
188
+ 不是 View 与执行器相互调用业务逻辑的双向控制。
189
+
190
+ ### 测量与生命周期
191
+
192
+ - 测量优先在挂载后、转场前或布局失效时进行并复用快照;必要时先中断动画再重测,避免逐帧交错读写布局。
193
+ - 充分利用类属性初始化状态、恢复 Promise 和订阅 disposer,不将可声明的初始化集中到 `initialize()` 中。
194
+ DOM 测量、事件监听与其它浏览器副作用只在客户端挂载后启动,卸载时释放观察、监听、计时器和动画资源。
195
+ - 替换模型或切换模式时,清理旧副作用并按需恢复选中状态、播放意图等业务状态;
196
+ 无关 Props 更新不重建模型或重置仍有效的订阅与计时器。
197
+ - 异步恢复或执行完成后,核对实例及当前操作是否仍有效,避免已销毁实例重新绑定监听,或旧结果覆盖新状态。
198
+ - 按职责而非文件数量划分结构,优先删除重复决策与转发;模型规则用数值输入验证,真实布局仍按“测试与验证”章节进行浏览器验证。
199
+
200
+ ### 接线示例
201
+
202
+ 以下用现有 Carousel 类展示最小接线:组件先创建 Store、取得挂载后的 DOM,再建立状态观察与事实反馈;
203
+ JSX 通过 `observer` 消费同一个 Store。示例函数只为展示挂载/卸载两阶段,实际组件可直接放入生命周期方法,不必新增绑定层。
204
+
205
+ ```ts
206
+ import { reaction } from 'mobx';
207
+
208
+ import { ScrollCarouselModel } from './source/Base/Carousel/model';
209
+ import { CarouselScroll } from './source/Base/Carousel/scroll';
210
+
211
+ function mountEffects(
212
+ store: ScrollCarouselModel,
213
+ scroller: CarouselScroll,
214
+ root: HTMLElement,
215
+ track: HTMLElement
216
+ ) {
217
+ const stopMotion = reaction(() => store.motion, scroller.apply);
218
+ const onResize = () => {
219
+ store.interrupt();
220
+
221
+ scroller.refresh(true);
222
+ };
223
+
224
+ scroller.mount(root, track, {
225
+ onLayout: store.refresh,
226
+ onScroll: store.syncScroll,
227
+ onComplete: store.complete,
228
+ onResize
229
+ });
230
+ store.mount();
231
+
232
+ return () => {
233
+ stopMotion();
234
+ scroller.dispose();
235
+ store.dispose();
236
+ };
237
+ }
238
+ ```
239
+
240
+ ## 状态与回调
241
+
156
242
  - 仅依赖 props 的展示组件使用函数组件;需要状态、行为或生命周期时使用类组件与 MobX。
157
- - 业务行为、异步流程和状态集中在内聚的模型类中;组件负责展示、生命周期和事件转发,
158
- 不要把这些逻辑集中到 React hooks 或零散工具函数里。
159
- - 少量、仅供单个组件使用的状态直接写为类组件实例成员,不必独立状态类。
160
- - 充分利用类属性初始化状态、恢复 Promise 和订阅 disposer,不将可声明的初始化集中到 `initialize()` 中。浏览器副作用应在客户端挂载后启动,卸载时释放订阅,并防止异步恢复完成后给已销毁实例重新绑定监听。
161
243
  - 使用 MobX stage-3 装饰器(如 `@observable accessor`、`@computed`、`@action`)。
162
244
  - 已有 action 边界(`@action` 或 `action()`)时不要再套 `runInAction()`。异步方法的 `await` 之后不继承 action 边界,后续状态更新应调用独立的 action(`@action` 方法或 `action()` 包装的实例方法),不能直接删除包装后裸写状态。
163
245
  - 仅把调用转发给模型 action 的事件方法不再加 `@action`,action 边界由模型方法负责。
@@ -207,13 +289,18 @@ export class MyComponent extends ObservedComponent<MyComponentProps> {
207
289
  ## 文档站、样式与文案
208
290
 
209
291
  - 文档站使用 ViNext,保留 MDX 支持并以纯 SSG 导出;部署静态文件,不依赖运行时服务器。
292
+ - 文档站编译插件按职责拆分到 `document/plugin/` 的独立模块,共享类型单独定义;`document/vite.config.ts` 只负责导入与配置编排。
293
+ - 通用编译插件不耦合特定框架的 CSS 类名;通用样式通过参数传入,或用标准 `style` 属性表达。
294
+ - 文档中的 `mermaid` 围栏使用 `beautiful-mermaid` 在 MDX 编译期生成 SVG,不引入客户端渲染器或 Headless Browser;保留无障碍说明并用 CSS 变量适配主题。
210
295
  - 文档站页面参考上游设计,但品牌使用 **Idea React**,版本、许可证、安装命令、链接及其它文案
211
296
  均以本项目实际情况为准;保留必要的上游版权和许可证声明。
212
297
  - 同步上游文档时保留正文主题、章节顺序、示例覆盖与必要资源;逐段将说明和示例改写为本项目真实 API,仅删除确实不适用的内容,不将完整指南大幅缩写成 quick start。文档示例只使用本库实际导出的包路径、组件能力和已验证的官方链接。
213
298
  - 文案中的缩写使用全大写形式(如 NPM、CSS)。
299
+ - 通用社区入口统一指向本仓库的 GitHub Discussions;问题上报、Pull Request 与贡献者等专用链接保留其语义。
214
300
  - 修改导航分类或路由命名时,同步更新页面标题、导航、页脚、站点链接和所有引用;确认新路由真实存在,并全局清理旧名称及失效路径。
215
301
  - 页面格式以简洁、可读为准:文档可用 MDX,非文档页(包括首页)在能减少缩进时也可用
216
302
  MDX,不强制非文档页只能使用 TSX 或 MDX。
303
+ - 文档说明优先简短、分点组织;将不同配置项、行为或注意事项分别列出,避免多个主题挤在长段落中。
217
304
  - 跨页面共享的导航栏等结构放在公共布局中,不重复写入单个页面。
218
305
  - 上游来源与版权许可说明集中在网站公共页脚,不在各篇组件文档重复,也不添加指向上游单页源码的链接。
219
306
  - MDX 中的大段静态文本优先使用 Markdown,而非嵌套的 JSX 文本块。
@@ -225,6 +312,7 @@ export class MyComponent extends ObservedComponent<MyComponentProps> {
225
312
  - JSX/MDX 元素没有子节点时使用自闭合标签。
226
313
  - 能用 [Bootstrap 6 CSS 工具类][4] 的样式不写自定义 CSS,剩余样式使用 CSS modules;必须保留原始类名的页面专属样式可用 `*.less` 全局导入,且仅由对应页面引用;需要嵌套的模块样式使用 LESS modules。
227
314
  - LESS 样式优先将伪类、伪元素、后代选择器及媒体查询嵌套在最近的相关选择器中,避免重复书写父选择器。
315
+ - 本库使用 LESS,不使用 SASS,也不提供面向使用者的 LESS 定制接口,新增外观定制能力优先开放 CSS 变量。
228
316
  - 可由 CSS 或 Bootstrap 工具类静态表达的布局、状态与堆叠关系优先用 CSS,避免为此引入客户端状态或 Context、Model。
229
317
  - 样式模块的类型声明合入已有的 `source/types.d.ts`,不要另建重复声明文件。
230
318
  - 文档示例使用文档专用 Demo 组件时,为 `CodeExample` 提供源码路径;仓库内路径相对于仓库根目录且不以 `/` 开头,外部源码可传绝对 URL。
package/ReadMe.md CHANGED
@@ -33,7 +33,7 @@ A **[React][1] advanced components library** based on [TypeScript][2] & [Bootstr
33
33
  9. [Carousel](source/Base/Carousel)
34
34
  10. [Close Button](source/Base/CloseButton.tsx)
35
35
  11. [Collapse](source/Base/Collapse.tsx)
36
- 12. [Native Dialog](source/Base/NativeDialog)
36
+ 12. [Dialog](source/Base/Dialog)
37
37
  13. [Drawer](source/Base/Drawer.tsx)
38
38
  14. [List Group](source/Base/ListGroup.tsx)
39
39
  15. [Menu](source/Base/Menu.tsx)
@@ -59,7 +59,7 @@ A **[React][1] advanced components library** based on [TypeScript][2] & [Bootstr
59
59
 
60
60
  ### Content components
61
61
 
62
- 1. [Images](source/Content/Images.tsx)
62
+ 1. [Images](source/Content/Image.tsx)
63
63
  2. [Tables](source/Content/Tables.tsx)
64
64
 
65
65
  ### Form components
@@ -86,7 +86,7 @@ A **[React][1] advanced components library** based on [TypeScript][2] & [Bootstr
86
86
  1. [Click Boundary](source/Extension/ClickBoundary.tsx)
87
87
  2. [Code Block](source/Extension/CodeBlock.tsx)
88
88
  3. [Countdown](source/Extension/Countdown.tsx)
89
- 4. [Dialog](source/Extension/Dialog.tsx)
89
+ 4. [DialogBox](source/Extension/Dialog.tsx)
90
90
  5. [Markdown View](source/Extension/MarkdownView.tsx)
91
91
  6. [Horizontal Marquee](source/Extension/HorizontalMarquee/)
92
92
  7. [Icon](source/Extension/Icon.tsx)
@@ -125,7 +125,7 @@ Open Map component & model, have been migrated to https://github.com/idea2app/Op
125
125
  ## Usage
126
126
 
127
127
  ```sh
128
- npm install idea-react mobx mobx-react react react-dom react-element-to-jsx-string
128
+ npm install idea-react mobx mobx-react react react-dom react-element-to-jsx-string web-utility
129
129
  ```
130
130
 
131
131
  For the current alpha release, use `idea-react@next` instead of `idea-react`.
@@ -191,63 +191,82 @@ Without `as`, the default markup and props stay unchanged. Class component refs
191
191
  component instance. Behavioral components require compatible root elements; custom roots must forward
192
192
  their DOM props and refs. Components that render fragments or multiple roots do not support `as`.
193
193
 
194
- ### Dialog
194
+ ### DialogBox model
195
195
 
196
196
  ```tsx
197
197
  import { formToJSON } from 'web-utility';
198
- import { Component } from 'react';
199
- import { Button, Form, Modal } from 'react-bootstrap';
200
- import { Dialog, DialogClose } from 'idea-react';
198
+ import { Component, FormEvent } from 'react';
199
+ import {
200
+ Button,
201
+ Dialog,
202
+ DialogBody,
203
+ DialogBox,
204
+ DialogBoxClose,
205
+ DialogFooter,
206
+ DialogHeader,
207
+ DialogTitle,
208
+ Form,
209
+ FormControl,
210
+ FormField,
211
+ FormLabel
212
+ } from 'idea-react';
201
213
 
202
214
  export class ExamplePage extends Component {
203
- inputDialog = new Dialog<Record<'a' | 'b', number>>(({ defer }) => (
204
- <Modal show={!!defer} onHide={() => defer?.reject(new DialogClose())}>
205
- <Modal.Header>Dialog</Modal.Header>
206
- <Modal.Body>
215
+ inputDialog = new DialogBox<{}, Record<'a' | 'b', number>>(({ defer }) => (
216
+ <Dialog open={!!defer} onClose={() => defer?.reject(new DialogBoxClose())}>
217
+ <DialogHeader>
218
+ <DialogTitle>Dialog</DialogTitle>
219
+ </DialogHeader>
220
+ <DialogBody>
207
221
  <Form
222
+ className="d-flex flex-column gap-3"
208
223
  id="input-dialog"
209
- onSubmit={event => {
210
- event.preventDefault();
211
-
212
- defer?.resolve(formToJSON(event.currentTarget));
213
- }}
214
- onReset={() => defer?.reject(new DialogClose())}
224
+ onSubmit={this.handleSubmit}
225
+ onReset={() => defer?.reject(new DialogBoxClose())}
215
226
  >
216
- <Form.Group>
217
- <Form.Label>A</Form.Label>
218
- <Form.Control type="number" name="a" />
219
- </Form.Group>
220
- <Form.Group>
221
- <Form.Label>B</Form.Label>
222
- <Form.Control type="number" name="b" />
223
- </Form.Group>
227
+ <FormField>
228
+ <FormLabel htmlFor="input-dialog-a">A</FormLabel>
229
+ <FormControl id="input-dialog-a" type="number" name="a" />
230
+ </FormField>
231
+ <FormField>
232
+ <FormLabel htmlFor="input-dialog-b">B</FormLabel>
233
+ <FormControl id="input-dialog-b" type="number" name="b" />
234
+ </FormField>
224
235
  </Form>
225
- </Modal.Body>
226
- <Modal.Footer className="d-flex justify-content-end gap-3">
227
- <Button form="input-dialog" type="submit">
236
+ </DialogBody>
237
+ <DialogFooter>
238
+ <Button form="input-dialog" type="submit" variant="solid" theme="primary">
228
239
  √
229
240
  </Button>
230
- <Button form="input-dialog" type="reset" variant="danger">
241
+ <Button form="input-dialog" type="reset" variant="solid" theme="danger">
231
242
  ×
232
243
  </Button>
233
- </Modal.Footer>
234
- </Modal>
244
+ </DialogFooter>
245
+ </Dialog>
235
246
  ));
236
247
 
248
+ handleSubmit = (event: FormEvent<HTMLFormElement>) => {
249
+ event.preventDefault();
250
+
251
+ const data = formToJSON<Record<'a' | 'b', number>>(event.currentTarget);
252
+
253
+ this.inputDialog.defer?.resolve(data);
254
+ };
255
+
237
256
  someLogic = async () => {
238
257
  try {
239
258
  const data = await this.inputDialog.open();
240
259
 
241
260
  alert(JSON.stringify(data, null, 4));
242
261
  } catch (error) {
243
- if (error instanceof DialogClose) console.warn(error.message);
262
+ if (error instanceof DialogBoxClose) console.warn(error.message);
244
263
  }
245
264
  };
246
265
 
247
266
  render() {
248
267
  return (
249
268
  <>
250
- <Button onClick={this.someLogic}>open Dialog</Button>
269
+ <Button onClick={this.someLogic}>Open dialog</Button>
251
270
 
252
271
  <this.inputDialog.Component />
253
272
  </>
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { ButtonHTMLAttributes, CSSProperties, Component, ComponentPropsWithRef, ComponentPropsWithoutRef, DetailedHTMLProps, DialogHTMLAttributes, ElementType, FC, FocusEvent, HTMLAttributes, KeyboardEvent, KeyboardEventHandler, MouseEvent as MouseEvent$1, PropsWithChildren, PropsWithoutRef, PureComponent, ReactElement, ReactNode, Ref, RefCallback, SyntheticEvent, TimeHTMLAttributes, TransitionEvent } from "react";
1
+ import { ButtonHTMLAttributes, CSSProperties, Component, ComponentPropsWithRef, ComponentPropsWithoutRef, DetailedHTMLProps, DialogHTMLAttributes, ElementType, FC, FocusEvent, HTMLAttributes, KeyboardEvent, KeyboardEventHandler, MouseEvent as MouseEvent$1, PointerEvent as PointerEvent$1, PropsWithChildren, PropsWithoutRef, PureComponent, ReactElement, ReactNode, Ref, RefCallback, SyntheticEvent, TimeHTMLAttributes, TransitionEvent, WheelEvent } from "react";
2
2
  import { TimeData, Timestamp } from "web-utility";
3
3
  import { ObservedComponent } from "mobx-react-helper";
4
4
  import { Defer } from "iterable-observer";
@@ -179,42 +179,104 @@ export declare const CardFooter: PolymorphicComponent<import("react").DetailedHT
179
179
  export declare const CardTitle: PolymorphicComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>>;
180
180
  export declare const CardText: PolymorphicComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>>;
181
181
  type CarouselEnds = 'loop' | 'wrap' | 'stop';
182
- declare class CarouselModel {
183
- private count;
184
- private ends;
185
- private interval;
182
+ interface CarouselModelOptions {
183
+ intervals: number[];
184
+ ends: CarouselEnds;
185
+ onChange?: (index: number) => unknown;
186
+ }
187
+ interface CarouselMotion {
188
+ index: number;
189
+ from: number;
190
+ left: number;
191
+ smooth: boolean;
192
+ loop?: -1 | 1;
193
+ }
194
+ interface CarouselLayout {
195
+ positions: number[];
196
+ widths: number[];
197
+ viewport: number;
198
+ maximum: number;
199
+ rtl: boolean;
200
+ items: number;
201
+ peek: number;
202
+ center: boolean;
203
+ variableWidth: boolean;
204
+ reducedMotion: boolean;
205
+ }
206
+ declare abstract class CarouselModel {
207
+ abstract readonly fade: boolean;
208
+ get navigating(): boolean;
209
+ accessor motion: CarouselMotion | undefined;
186
210
  accessor activeIndex: number;
187
211
  accessor playing: boolean;
212
+ accessor indexes: number[];
213
+ get atStart(): boolean;
214
+ get atEnd(): boolean;
215
+ get canPrevious(): boolean;
216
+ get canNext(): boolean;
217
+ get interval(): number;
218
+ protected accessor options: CarouselModelOptions;
219
+ protected layout?: CarouselLayout;
220
+ protected positions: number[];
188
221
  private timer?;
222
+ private stopPlayback?;
189
223
  private accessor hovering;
190
224
  private accessor visible;
191
225
  get cycling(): boolean;
192
- onChange?: (index: number) => unknown;
193
- onNavigate?: (index: number, from: number, direction?: -1 | 1) => unknown;
194
- constructor(count: number, ends: CarouselEnds, interval: (index: number) => number);
226
+ constructor(options: CarouselModelOptions);
227
+ mount(): void;
228
+ restore(previous: CarouselModel): void;
195
229
  setIndex: (index: number, userInitiated?: boolean, direction?: -1 | 1, fromScroll?: boolean) => void;
196
230
  next: (userInitiated?: boolean) => void;
197
231
  previous: (userInitiated?: boolean) => void;
198
- play: () => void;
199
- pause: () => void;
200
- toggle: () => void;
201
- setHovering: (hovering: boolean) => void;
202
- setVisible: (visible: boolean) => void;
203
- update: (count: number, ends: CarouselEnds, interval: (index: number) => number) => void;
204
- dispose: () => void;
232
+ play: () => boolean;
233
+ pause: () => boolean;
234
+ toggle: () => boolean;
235
+ setHovering: (hovering: boolean) => boolean;
236
+ setVisible: (visible: boolean) => boolean;
237
+ update(options: CarouselModelOptions): void;
238
+ refresh: (layout?: CarouselLayout, align?: boolean) => void;
239
+ syncScroll: (left: number) => void;
240
+ complete: (motion: CarouselMotion) => void;
241
+ interrupt: () => undefined;
242
+ dispose(): void;
243
+ protected readIndexes(positions?: number[]): number[];
244
+ protected createMotion?: (index: number, from: number, direction?: -1 | 1) => CarouselMotion | undefined;
245
+ private advance;
205
246
  private schedule;
247
+ private move;
206
248
  private clearTimer;
207
249
  }
250
+ interface CarouselScrollEvents {
251
+ onLayout: (layout: CarouselLayout, align?: boolean) => unknown;
252
+ onScroll: (left: number) => unknown;
253
+ onComplete: (motion: CarouselMotion) => unknown;
254
+ onResize: () => unknown;
255
+ }
208
256
  declare class CarouselScroll {
257
+ private root?;
258
+ private track?;
259
+ private center;
209
260
  private frame?;
210
261
  private clone?;
211
- private track?;
212
- private snap;
213
- get looping(): boolean;
214
- navigate: (track: HTMLElement, left: number, smooth: boolean) => void;
215
- loop: (track: HTMLElement, from: HTMLElement, destination: HTMLElement, forward: boolean) => void;
262
+ private snap?;
263
+ private events?;
264
+ private media?;
265
+ private resizeObserver?;
266
+ private observedSlides;
267
+ get navigating(): boolean;
268
+ mount(root: HTMLElement, track: HTMLElement, events: CarouselScrollEvents, center?: boolean): void;
269
+ refresh: (align?: boolean) => void;
270
+ dispose(): void;
271
+ apply: (motion?: CarouselMotion) => void;
272
+ interrupt: () => void;
273
+ private observeLayout;
274
+ private handleResize;
275
+ private handleScroll;
276
+ private position;
277
+ private navigate;
278
+ private loop;
216
279
  private animate;
217
- dispose: () => void;
218
280
  }
219
281
  export interface CarouselSlideProps extends ComponentPropsWithRef<'div'> {
220
282
  interval?: number;
@@ -249,23 +311,26 @@ export declare class Carousel<T extends ElementType | undefined = 'div'> extends
249
311
  static displayName: string;
250
312
  root: import("react").RefObject<HTMLDivElement | null>;
251
313
  track: import("react").RefObject<HTMLDivElement | null>;
252
- store: CarouselModel;
253
314
  scroller: CarouselScroll;
315
+ accessor store: CarouselModel;
316
+ private stopMotion?;
254
317
  componentDidMount(): void;
255
318
  componentDidUpdate(): void;
256
319
  componentWillUnmount(): void;
257
320
  private getSlides;
258
- private getSlideInterval;
321
+ private get modelOptions();
322
+ private createStore;
259
323
  private updateStore;
260
- handleVisibilityChange: () => void;
324
+ private handleVisibilityChange;
325
+ private handleResize;
326
+ handlePointerDown: (event: PointerEvent$1<HTMLDivElement>) => void;
327
+ handleWheel: (event: WheelEvent<HTMLDivElement>) => void;
261
328
  handleMouseEnter: () => void;
262
- handleMouseLeave: () => void;
329
+ handleMouseLeave: () => boolean;
263
330
  handleFocusCapture: () => void;
264
331
  handleBlurCapture: ({ currentTarget, relatedTarget }: React.FocusEvent<HTMLDivElement>) => void;
265
- handleScroll: () => void;
266
332
  handleKeyDown: (event: KeyboardEvent<HTMLDivElement>) => void;
267
333
  handleClick: (event: MouseEvent$1<HTMLDivElement>) => void;
268
- scrollToActive: (index: number, from: number, direction?: -1 | 1) => void;
269
334
  renderSlide: (slide: ReactNode, index: number) => import("react").JSX.Element;
270
335
  renderControl: (direction: "previous" | "next") => import("react").JSX.Element | null;
271
336
  renderIndicators: () => import("react").JSX.Element | null;
@@ -354,7 +419,7 @@ export interface ColBreakpointOptions {
354
419
  }
355
420
  export type ColBreakpoint = BreakpointColSize | ColBreakpointOptions;
356
421
  export declare const Col: PolymorphicComponent<ColProps>;
357
- export interface NativeDialogProps extends Omit<DialogHTMLAttributes<HTMLDialogElement>, 'open'> {
422
+ export interface DialogProps extends Omit<DialogHTMLAttributes<HTMLDialogElement>, 'open'> {
358
423
  modal?: boolean;
359
424
  dialog?: boolean;
360
425
  theme?: 'light' | 'dark';
@@ -371,10 +436,10 @@ export declare const DialogHeader: PolymorphicComponent<import("react").Detailed
371
436
  export declare const DialogTitle: PolymorphicComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>>;
372
437
  export declare const DialogBody: PolymorphicComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
373
438
  export declare const DialogFooter: PolymorphicComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
374
- export declare class NativeDialog<T extends ElementType | undefined = 'dialog'> extends Component<PolymorphicClassProps<T, NativeDialogProps>> {
375
- readonly props: PolymorphicClassProps<T, NativeDialogProps>;
376
- protected get componentProps(): Readonly<NativeDialogProps & AsProps>;
377
- static scrollLocks: Set<NativeDialog<ElementType>>;
439
+ export declare class Dialog<T extends ElementType | undefined = 'dialog'> extends Component<PolymorphicClassProps<T, DialogProps>> {
440
+ readonly props: PolymorphicClassProps<T, DialogProps>;
441
+ protected get componentProps(): Readonly<DialogProps & AsProps>;
442
+ static scrollLocks: Set<Dialog<ElementType>>;
378
443
  static bodyOverflow: string;
379
444
  element: import("react").RefObject<HTMLDialogElement | null>;
380
445
  returnFocus?: HTMLElement;
@@ -382,7 +447,7 @@ export declare class NativeDialog<T extends ElementType | undefined = 'dialog'>
382
447
  closeTimer?: ReturnType<typeof setTimeout>;
383
448
  get open(): boolean;
384
449
  componentDidMount(): void;
385
- componentDidUpdate({ open, modal, scroll }: NativeDialogProps): void;
450
+ componentDidUpdate({ open, modal, scroll }: DialogProps): void;
386
451
  show: () => void;
387
452
  lockScroll: () => void;
388
453
  unlockScroll: () => void;
@@ -400,7 +465,7 @@ export declare const DrawerHeader: PolymorphicComponent<import("react").Detailed
400
465
  export declare const DrawerTitle: PolymorphicComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>>;
401
466
  export declare const DrawerBody: PolymorphicComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
402
467
  export declare const DrawerFooter: PolymorphicComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
403
- export interface DrawerProps extends Omit<NativeDialogProps, 'dialog' | 'onClose' | 'title' | 'animation' | 'fullscreen'> {
468
+ export interface DrawerProps extends Omit<DialogProps, 'dialog' | 'onClose' | 'title' | 'animation' | 'fullscreen'> {
404
469
  title?: ReactNode;
405
470
  placement?: DrawerPlacement;
406
471
  footer?: ReactNode;
@@ -417,7 +482,7 @@ export declare class Drawer<T extends ElementType | undefined = 'dialog'> extend
417
482
  protected get componentProps(): Readonly<DrawerProps & AsProps>;
418
483
  static displayName: string;
419
484
  accessor expanded: boolean;
420
- dialog: import("react").RefObject<NativeDialog<ElementType> | null>;
485
+ dialog: import("react").RefObject<Dialog<ElementType> | null>;
421
486
  media?: MediaQueryList;
422
487
  dismissed: boolean;
423
488
  componentDidMount(): void;
@@ -975,17 +1040,17 @@ export declare class Countdown<T extends ElementType | undefined = 'ol'> extends
975
1040
  componentWillUnmount(): void;
976
1041
  render(): import("react").JSX.Element;
977
1042
  }
978
- export declare class DialogClose extends Error {
1043
+ export declare class DialogBoxClose extends Error {
979
1044
  constructor(message?: string);
980
1045
  }
981
- export interface DialogProps<T = unknown> {
1046
+ export interface DialogBoxProps<T = unknown> {
982
1047
  defer?: Defer<T>;
983
1048
  }
984
- export declare class Dialog<I extends object = {}, O = unknown> {
1049
+ export declare class DialogBox<I extends object = {}, O = unknown> {
985
1050
  accessor input: I;
986
1051
  accessor defer: Defer<O> | undefined;
987
1052
  Component: FC<I>;
988
- constructor(Factory: FC<I & DialogProps<O>>);
1053
+ constructor(Factory: FC<I & DialogBoxProps<O>>);
989
1054
  open(input?: I): Promise<O>;
990
1055
  }
991
1056
  export type HorizontalMarqueeProps = HTMLAttributes<HTMLDivElement> & Partial<Record<'maxWidth' | 'duration' | 'height', string>>;
@@ -1102,8 +1167,8 @@ export declare class PageNav<T extends ElementType | undefined = 'nav'> extends
1102
1167
  static slugOf(text: string): string;
1103
1168
  initList(): void;
1104
1169
  componentWillUnmount(): void;
1105
- scrollTo: (meta: HeadingMeta) => () => void;
1106
- renderLink: ({ id, level, text, top }: HeadingMeta) => false | import("react").JSX.Element;
1170
+ handleItemClick: ({ currentTarget }: MouseEvent$1<HTMLAnchorElement>) => void;
1171
+ renderLink: ({ id, level, text }: HeadingMeta) => false | import("react").JSX.Element;
1107
1172
  render(): import("react").JSX.Element;
1108
1173
  }
1109
1174
  export type ScrollNavProps = NavProps & {
@@ -1244,7 +1309,7 @@ export type CheckboxProps = Omit<ComponentPropsWithoutRef<'input'>, 'type' | 'si
1244
1309
  theme?: ComponentTheme;
1245
1310
  indeterminate?: boolean;
1246
1311
  };
1247
- export declare const Checkbox: PolymorphicComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "size" | "type"> & FormValidationProps & {
1312
+ export declare const Checkbox: PolymorphicComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "type" | "size"> & FormValidationProps & {
1248
1313
  size?: "sm" | "lg";
1249
1314
  theme?: ComponentTheme;
1250
1315
  indeterminate?: boolean;
@@ -1440,7 +1505,7 @@ export type OTPInputProps = Omit<ComponentPropsWithoutRef<'input'>, 'type' | 'ma
1440
1505
  onComplete?: (value: string) => unknown;
1441
1506
  onValueChange?: (value: string) => unknown;
1442
1507
  };
1443
- export declare const OTPInput: PolymorphicComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "size" | "maxLength" | "type"> & FormValidationProps & {
1508
+ export declare const OTPInput: PolymorphicComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "type" | "size" | "maxLength"> & FormValidationProps & {
1444
1509
  length: number;
1445
1510
  type?: "numeric" | "alphanumeric" | "alpha";
1446
1511
  mask?: boolean;