idea-react 3.0.0-rc.0 → 3.0.0-rc.2
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 +12 -15
- package/dist/index.d.mts +57 -22
- package/dist/index.d.ts +57 -22
- package/dist/index.js +16 -16
- package/dist/index.mjs +15 -15
- package/package.json +5 -11
- package/source/Base/Accordion.tsx +1 -1
- package/source/Base/Breadcrumb.tsx +15 -3
- package/source/Base/Button.tsx +5 -1
- package/source/Base/Carousel/index.tsx +2 -12
- package/source/Base/Collapse.tsx +17 -2
- package/source/Base/Fade.tsx +15 -0
- package/source/Base/ListGroup.tsx +12 -2
- package/source/Base/Menu.tsx +1 -7
- package/source/Base/Nav.tsx +3 -1
- package/source/Base/NavOverflow/index.tsx +1 -1
- package/source/Base/Navbar.tsx +19 -13
- package/source/Base/Placeholder.tsx +8 -22
- package/source/Base/index.ts +1 -0
- package/source/Content/Figure.tsx +26 -0
- package/source/Content/Tables.tsx +21 -7
- package/source/Content/index.ts +1 -0
- package/source/Extension/Icon.tsx +15 -2
- package/source/Extension/ScrollNav/index.tsx +4 -2
- package/source/Extension/UserRank/index.tsx +6 -5
- package/source/Form/Chip.tsx +5 -17
- package/source/Form/ChipInput.tsx +1 -1
- package/source/Form/Combobox.tsx +3 -7
- package/source/Form/DatePicker.tsx +1 -1
- package/source/Form/Primitives.tsx +0 -8
- package/source/Form/Radio.tsx +13 -3
- package/source/Layout/Grid.tsx +35 -25
- package/source/Layout/Ratio.tsx +29 -0
- package/source/Layout/index.ts +1 -0
- package/source/types.d.ts +4 -0
package/AGENTS.md
CHANGED
|
@@ -142,7 +142,9 @@ export class MyComponent extends ObservedComponent<MyComponentProps> {
|
|
|
142
142
|
- 文档站要用到的 [Bootstrap 官方组件][2] 必须先在 `source/` 封装为通用组件,
|
|
143
143
|
再由文档站引用,不是将其专用组件放进组件库。
|
|
144
144
|
- 文档与示例统一引用封装后的组件,MDX 不直接书写 Bootstrap 组件类名,只有展示原始 HTML(如无 JS 示例)时,代码块才保留类名写法。
|
|
145
|
-
-
|
|
145
|
+
- 复刻上游示例时,优先使用本项目现有组件组合实现对应效果;不以原始 HTML、Bootstrap 类名或上游组件替代已有的本项目组件。
|
|
146
|
+
- 文档站公共布局、组件、模型和样式放在 `document/component/`;仅供单个页面或示例使用的实现与对应路由文件同级存放;以上均不得从组件库导出或混入发布包。
|
|
147
|
+
- 页面基础布局单独提供 Bootstrap 样式链接,由文档布局复用;不得为获取当前路由等信息使用客户端 Hook 将静态页面改为客户端渲染。
|
|
146
148
|
- 静态展示组件保持服务端可渲染;仅把需要浏览器 API 或交互状态的最小组件边界标记为客户端组件,不用 Context、Model 令整个组件树进入客户端渲染。
|
|
147
149
|
- 每个模块自行导出其定义的公共 API;聚合入口可导出模块,但不从定义模块重复转出其它模块的 API。
|
|
148
150
|
- 多个同前缀的文件归入同名文件夹,文件使用 `index.tsx`、`model.ts`、
|
|
@@ -218,8 +220,11 @@ export class MyComponent extends ObservedComponent<MyComponentProps> {
|
|
|
218
220
|
- 从 `unpkg.com` 引入 Bootstrap CSS,严禁使用 Tailwind CSS 及其插件、配置和工具类。
|
|
219
221
|
- 所有组件依赖的第三方 CSS 统一由使用方通过 `<link />` 从 `unpkg.com` 引入;
|
|
220
222
|
组件源码不导入或打包这些样式,文档站在公共布局中统一加载。
|
|
221
|
-
-
|
|
222
|
-
|
|
223
|
+
- 页面专属 CSS 通过 `*.less` 全局导入,或通过 `*.module.less` 导入并使用模块类名;不得使用 `?inline` 等方式导入 CSS 源文再注入 `<style>`。
|
|
224
|
+
- MDX 与 TSX 页面均直接导入页面 CSS/LESS;MDX 编译仅在 RSC 环境通过 `recmaPlugins` 注入 `import.meta.viteRsc.loadCss()`,补齐 RSC 默认仅识别 JS/TS 的样式资源处理。可独立命名的页面样式使用 CSS/LESS modules,覆盖上游全局选择器的样式保留全局 LESS。
|
|
225
|
+
- JSX/MDX 元素没有子节点时使用自闭合标签。
|
|
226
|
+
- 能用 [Bootstrap 6 CSS 工具类][4] 的样式不写自定义 CSS,剩余样式使用 CSS modules;必须保留原始类名的页面专属样式可用 `*.less` 全局导入,且仅由对应页面引用;需要嵌套的模块样式使用 LESS modules。
|
|
227
|
+
- LESS 样式优先将伪类、伪元素、后代选择器及媒体查询嵌套在最近的相关选择器中,避免重复书写父选择器。
|
|
223
228
|
- 可由 CSS 或 Bootstrap 工具类静态表达的布局、状态与堆叠关系优先用 CSS,避免为此引入客户端状态或 Context、Model。
|
|
224
229
|
- 样式模块的类型声明合入已有的 `source/types.d.ts`,不要另建重复声明文件。
|
|
225
230
|
- 文档示例使用文档专用 Demo 组件时,为 `CodeExample` 提供源码路径;仓库内路径相对于仓库根目录且不以 `/` 开头,外部源码可传绝对 URL。
|
|
@@ -228,13 +233,13 @@ export class MyComponent extends ObservedComponent<MyComponentProps> {
|
|
|
228
233
|
- Markdown 正文中的链接采用文末数字引用:正文写 `[text][number]`,文末写 `[number]: URL`;图片链接同样使用引用形式。行末链接(如组件列表项)无需改为文末引用,可保留 `[text](URL)`。
|
|
229
234
|
- 每篇文档的数字引用按首次出现顺序从 1 连续编号;重复链接复用同一编号,修改后同步整理正文与定义,移除未使用定义,不留跳号、重复或悬空引用。
|
|
230
235
|
- 组件目录优先列出上游标准组件,再列扩展组件。
|
|
231
|
-
- 静态站搜索优先采用最简单可用的方案,开发与生产共用 MDX 源码索引器并通过同一 RSS 地址加载,RSS 包含完整纯文本正文供搜索与订阅复用;不依赖编译后的 HTML,不维护手写页面清单,不为索引格式或具体技术额外引入不必要的服务和框架。
|
|
236
|
+
- 静态站搜索优先采用最简单可用的方案,开发与生产共用 MDX/TSX 源码索引器并通过同一 RSS 地址加载,RSS 包含完整纯文本正文供搜索与订阅复用;不依赖编译后的 HTML,不维护手写页面清单,不为索引格式或具体技术额外引入不必要的服务和框架。
|
|
232
237
|
|
|
233
238
|
## 测试与验证
|
|
234
239
|
|
|
235
240
|
- 使用 Node.js 原生 test runner、`node:assert/strict` 和原生 mock,不引入外部测试框架。
|
|
236
241
|
- 不同测试阶段的断言与后续操作之间留空行,区分准备、操作和验证。
|
|
237
|
-
- 通用组件单元测试放在 `test
|
|
242
|
+
- 通用组件单元测试放在 `test/`,按 `source/` 对应模块的子目录结构存放,仅含一个测试文件的组件子目录省略该层,遵循 `ComponentName.test.tsx` 命名;
|
|
238
243
|
不为文档站专用组件和模型编写或保留单元测试。
|
|
239
244
|
- 按改动范围运行相关类型检查、Lint、测试和构建;页面交互与响应式布局通过浏览器验证。
|
|
240
245
|
- 纯 SSG 构建不仅要检查退出码,还要确认实际导出的 HTML 等静态文件及路由,
|
|
@@ -253,19 +258,11 @@ pnpm build -r
|
|
|
253
258
|
- `test` 使用 Node.js 原生 runner,需要 Node.js 22.18+,并做 TypeScript 检查。Lint 与格式检查针对本次修改文件运行。
|
|
254
259
|
- 根目录 `pnpm build` 构建 TypeDoc、旧预览站与组件发布包;现有根构建、发布部署仍使用 `docs/`,不能将其误当作 ViNext 文档工作区的构建或部署。
|
|
255
260
|
- 文档工作区单独构建,只部署 `document/dist/client/`;部署到子目录前配置 `document/next.config.ts` 的 `basePath`,并验证静态资源、搜索索引和结果链接。
|
|
256
|
-
- 开发模式按请求从当前 MDX
|
|
261
|
+
- 开发模式按请求从当前 MDX/TSX 页面生成 RSS 搜索索引;生产模式用同一索引器生成静态 RSS 与 Sitemap,生产搜索需构建后预览静态产物。
|
|
257
262
|
- 浏览器验证包括键盘交互、主题恢复、错误弹窗、失败后重试与不同视口;文档站不依赖 Node.js 或 Worker 运行时。
|
|
258
263
|
|
|
259
|
-
##
|
|
264
|
+
## PR 审核
|
|
260
265
|
|
|
261
|
-
- 仅在用户明确要求发布时更新 `package.json` 版本、创建对应版本标签并推送;推送目标应核实当前分支和远程配置,不照搬固定分支名或推送所有标签。
|
|
262
|
-
- 发布前运行相关验证及根构建,检查产物;组件包发布与文档工作区部署分别处理。
|
|
263
|
-
|
|
264
|
-
## Git 操作
|
|
265
|
-
|
|
266
|
-
- 未经用户明确要求,不创建提交、不推送、不 amend 或改写现有提交。
|
|
267
|
-
- “完成实现”“修复问题”“完成 PR”或“运行测试”均不等于提交或推送授权;
|
|
268
|
-
完成验证后保留未提交改动供用户审阅。
|
|
269
266
|
- 审核意见应通查同类问题,而非只改被评论的单行;将可复用的要求归纳到本文件,不夹带无关功能或修改。
|
|
270
267
|
|
|
271
268
|
[1]: https://getbootstrap.com/
|
package/dist/index.d.mts
CHANGED
|
@@ -142,7 +142,10 @@ type BadgeElementAttributes = (ComponentPropsWithRef<'span'> & {
|
|
|
142
142
|
export type BadgeProps = BadgeStyleProps & BadgeElementAttributes;
|
|
143
143
|
export declare const Badge: PolymorphicComponent<BadgeProps>;
|
|
144
144
|
export declare const Breadcrumb: PolymorphicComponent<import("react").DetailedHTMLProps<import("react").OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>>;
|
|
145
|
-
export
|
|
145
|
+
export type BreadcrumbItemProps = ComponentPropsWithRef<'li'> & {
|
|
146
|
+
active?: boolean;
|
|
147
|
+
};
|
|
148
|
+
export declare const BreadcrumbItem: PolymorphicComponent<BreadcrumbItemProps>;
|
|
146
149
|
export interface BreadcrumbLinkProps extends ComponentPropsWithRef<'a'> {
|
|
147
150
|
active?: boolean;
|
|
148
151
|
}
|
|
@@ -302,6 +305,7 @@ export interface CollapseToggleProps extends HTMLAttributes<HTMLElement>, Pick<B
|
|
|
302
305
|
target: string;
|
|
303
306
|
href?: string;
|
|
304
307
|
type?: 'button' | 'submit' | 'reset';
|
|
308
|
+
navbarToggler?: boolean;
|
|
305
309
|
}
|
|
306
310
|
export declare class CollapseToggle<T extends ElementType | undefined = 'button'> extends Component<PolymorphicClassProps<T, CollapseToggleProps>> {
|
|
307
311
|
readonly props: PolymorphicClassProps<T, CollapseToggleProps>;
|
|
@@ -335,13 +339,20 @@ export interface RowProps extends ComponentPropsWithRef<'div'> {
|
|
|
335
339
|
}
|
|
336
340
|
export declare const Row: PolymorphicComponent<RowProps>;
|
|
337
341
|
export interface ColProps extends ComponentPropsWithRef<'div'> {
|
|
338
|
-
xs?:
|
|
339
|
-
sm?:
|
|
340
|
-
md?:
|
|
341
|
-
lg?:
|
|
342
|
-
xl?:
|
|
343
|
-
'2xl'?:
|
|
344
|
-
}
|
|
342
|
+
xs?: ColBreakpoint;
|
|
343
|
+
sm?: ColBreakpoint;
|
|
344
|
+
md?: ColBreakpoint;
|
|
345
|
+
lg?: ColBreakpoint;
|
|
346
|
+
xl?: ColBreakpoint;
|
|
347
|
+
'2xl'?: ColBreakpoint;
|
|
348
|
+
}
|
|
349
|
+
export type ColOrder = number | 'first' | 'last';
|
|
350
|
+
export interface ColBreakpointOptions {
|
|
351
|
+
span?: BreakpointColSize;
|
|
352
|
+
offset?: number;
|
|
353
|
+
order?: ColOrder;
|
|
354
|
+
}
|
|
355
|
+
export type ColBreakpoint = BreakpointColSize | ColBreakpointOptions;
|
|
345
356
|
export declare const Col: PolymorphicComponent<ColProps>;
|
|
346
357
|
export interface NativeDialogProps extends Omit<DialogHTMLAttributes<HTMLDialogElement>, 'open'> {
|
|
347
358
|
modal?: boolean;
|
|
@@ -418,8 +429,18 @@ export declare class Drawer<T extends ElementType | undefined = 'dialog'> extend
|
|
|
418
429
|
handleClose: () => void;
|
|
419
430
|
render(): import("react").JSX.Element;
|
|
420
431
|
}
|
|
432
|
+
export interface FadeProps {
|
|
433
|
+
className?: string;
|
|
434
|
+
in?: boolean;
|
|
435
|
+
children: ReactElement<{
|
|
436
|
+
className?: string;
|
|
437
|
+
}>;
|
|
438
|
+
}
|
|
439
|
+
export declare const Fade: FC<FadeProps>;
|
|
421
440
|
export type ListGroupHorizontal = boolean | Breakpoint;
|
|
422
441
|
interface ListGroupStyleProps {
|
|
442
|
+
radio?: boolean;
|
|
443
|
+
checkable?: boolean;
|
|
423
444
|
flush?: boolean;
|
|
424
445
|
numbered?: boolean;
|
|
425
446
|
horizontal?: ListGroupHorizontal;
|
|
@@ -581,6 +602,7 @@ export interface NavProps extends ComponentPropsWithRef<'nav'> {
|
|
|
581
602
|
vertical?: boolean;
|
|
582
603
|
fill?: boolean;
|
|
583
604
|
justified?: boolean;
|
|
605
|
+
flush?: boolean;
|
|
584
606
|
cardHeader?: boolean;
|
|
585
607
|
navbar?: boolean;
|
|
586
608
|
}
|
|
@@ -611,6 +633,8 @@ export declare const NavbarNav: PolymorphicComponent<NavbarNavProps>;
|
|
|
611
633
|
export declare const NavbarText: PolymorphicComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>>;
|
|
612
634
|
export interface NavbarTogglerProps extends Omit<ComponentPropsWithRef<'button'>, 'children' | 'type'> {
|
|
613
635
|
expanded?: boolean;
|
|
636
|
+
commandfor?: string;
|
|
637
|
+
command?: string;
|
|
614
638
|
}
|
|
615
639
|
export declare const NavbarToggler: PolymorphicComponent<NavbarTogglerProps>;
|
|
616
640
|
declare class NavOverflowModel {
|
|
@@ -672,10 +696,6 @@ export interface PlaceholderProps extends ComponentPropsWithRef<'span'> {
|
|
|
672
696
|
width?: CSSProperties['width'];
|
|
673
697
|
}
|
|
674
698
|
export declare const Placeholder: PolymorphicComponent<PlaceholderProps>;
|
|
675
|
-
export interface PlaceholderAnimationProps extends ComponentPropsWithRef<'div'> {
|
|
676
|
-
animation?: PlaceholderProps['animation'];
|
|
677
|
-
}
|
|
678
|
-
export declare const PlaceholderAnimation: PolymorphicComponent<PlaceholderAnimationProps>;
|
|
679
699
|
export type PlaceholderButtonProps = ButtonProps;
|
|
680
700
|
export declare const PlaceholderButton: PolymorphicComponent<ButtonProps>;
|
|
681
701
|
export interface PopoverProps extends Omit<OverlayTriggerProps, 'title'> {
|
|
@@ -698,7 +718,7 @@ declare class ScrollSpyModel {
|
|
|
698
718
|
accessor guides: (Record<'top' | 'left' | 'width' | 'height' | 'line', number> & {
|
|
699
719
|
atBottom: boolean;
|
|
700
720
|
}) | undefined;
|
|
701
|
-
setGuides: (guides: ScrollSpyModel["guides"]) => (Record<"line" | "
|
|
721
|
+
setGuides: (guides: ScrollSpyModel["guides"]) => (Record<"line" | "height" | "width" | "left" | "top", number> & {
|
|
702
722
|
atBottom: boolean;
|
|
703
723
|
}) | undefined;
|
|
704
724
|
setActiveId: (id: string) => string;
|
|
@@ -732,7 +752,7 @@ export declare class ScrollSpy<T extends ElementType | undefined = 'div'> extend
|
|
|
732
752
|
componentWillUnmount(): void;
|
|
733
753
|
refresh: () => void;
|
|
734
754
|
handleResize: () => void;
|
|
735
|
-
handleScroll: () => (Record<"line" | "
|
|
755
|
+
handleScroll: () => (Record<"line" | "height" | "width" | "left" | "top", number> & {
|
|
736
756
|
atBottom: boolean;
|
|
737
757
|
}) | undefined;
|
|
738
758
|
private getRootHeight;
|
|
@@ -886,14 +906,23 @@ export interface ImageProps extends ComponentPropsWithRef<'img'> {
|
|
|
886
906
|
roundedCircle?: boolean;
|
|
887
907
|
}
|
|
888
908
|
export declare const Image: PolymorphicComponent<ImageProps>;
|
|
909
|
+
export type FigureProps = ComponentPropsWithRef<'figure'>;
|
|
910
|
+
export declare const Figure: PolymorphicComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
911
|
+
export declare const FigureImage: PolymorphicComponent<ImageProps>;
|
|
912
|
+
export type FigureCaptionProps = ComponentPropsWithRef<'figcaption'>;
|
|
913
|
+
export declare const FigureCaption: PolymorphicComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
889
914
|
export interface TableProps extends ComponentPropsWithRef<'table'> {
|
|
890
915
|
striped?: boolean;
|
|
891
916
|
stripedColumns?: boolean;
|
|
892
917
|
hover?: boolean;
|
|
893
918
|
bordered?: boolean;
|
|
894
919
|
borderless?: boolean;
|
|
920
|
+
card?: boolean;
|
|
895
921
|
small?: boolean;
|
|
896
922
|
responsive?: boolean | Breakpoint;
|
|
923
|
+
stacked?: boolean | Breakpoint;
|
|
924
|
+
verticalAlign?: 'baseline' | 'top' | 'middle' | 'bottom' | 'text-top' | 'text-bottom';
|
|
925
|
+
captionTop?: boolean;
|
|
897
926
|
}
|
|
898
927
|
export declare const Table: PolymorphicComponent<TableProps>;
|
|
899
928
|
export type ClickBoundaryProps = PropsWithChildren<{
|
|
@@ -1077,14 +1106,16 @@ export declare class PageNav<T extends ElementType | undefined = 'nav'> extends
|
|
|
1077
1106
|
renderLink: ({ id, level, text, top }: HeadingMeta) => false | import("react").JSX.Element;
|
|
1078
1107
|
render(): import("react").JSX.Element;
|
|
1079
1108
|
}
|
|
1080
|
-
export type ScrollNavProps = NavProps
|
|
1109
|
+
export type ScrollNavProps = NavProps & {
|
|
1110
|
+
navClassName?: string;
|
|
1111
|
+
};
|
|
1081
1112
|
/**
|
|
1082
1113
|
* A horizontal scrolling navigation bar based on Bootstrap's `nav-scroller` pattern.
|
|
1083
1114
|
* Automatically shows scroll arrow buttons when nav items overflow the container width.
|
|
1084
1115
|
*
|
|
1085
1116
|
* @see {@link https://github.com/twbs/bootstrap/blob/main/site/src/assets/examples/offcanvas-navbar/index.astro#L50-L65}
|
|
1086
1117
|
*/
|
|
1087
|
-
export declare const ScrollNav: PolymorphicComponent<
|
|
1118
|
+
export declare const ScrollNav: PolymorphicComponent<ScrollNavProps>;
|
|
1088
1119
|
export declare function elementToImage(element: HTMLElement, type?: string, quality?: number): Promise<string>;
|
|
1089
1120
|
export type ShareBoxProps = HTMLAttributes<HTMLDivElement> & ShareData;
|
|
1090
1121
|
export declare class ShareBox extends Component<ShareBoxProps> {
|
|
@@ -1177,8 +1208,6 @@ export type FormProps = ComponentPropsWithRef<'form'> & {
|
|
|
1177
1208
|
validated?: boolean;
|
|
1178
1209
|
};
|
|
1179
1210
|
export declare const Form: PolymorphicComponent<FormProps>;
|
|
1180
|
-
export type FormFieldsetProps = ComponentPropsWithRef<'fieldset'>;
|
|
1181
|
-
export declare const FormFieldset: PolymorphicComponent<import("react").DetailedHTMLProps<import("react").FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>>;
|
|
1182
1211
|
export type FormFieldProps = ComponentPropsWithRef<'div'> & {
|
|
1183
1212
|
card?: boolean;
|
|
1184
1213
|
};
|
|
@@ -1222,16 +1251,15 @@ export declare const Checkbox: PolymorphicComponent<Omit<Omit<import("react").De
|
|
|
1222
1251
|
} & {
|
|
1223
1252
|
ref?: Ref<HTMLInputElement>;
|
|
1224
1253
|
}>;
|
|
1225
|
-
export type ChipProps = ComponentPropsWithRef<'
|
|
1254
|
+
export type ChipProps = ComponentPropsWithRef<'span'> & {
|
|
1226
1255
|
active?: boolean;
|
|
1227
1256
|
theme?: ComponentTheme;
|
|
1257
|
+
type?: ComponentPropsWithRef<'button'>['type'];
|
|
1228
1258
|
};
|
|
1229
1259
|
export declare const Chip: PolymorphicComponent<ChipProps>;
|
|
1230
1260
|
export declare const ChipIcon: PolymorphicComponent<IconProps>;
|
|
1231
1261
|
export declare const ChipImage: PolymorphicComponent<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>>;
|
|
1232
1262
|
export declare const ChipDismiss: PolymorphicComponent<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>>;
|
|
1233
|
-
export type ChipTokenProps = ComponentPropsWithRef<'span'> & Pick<ChipProps, 'active' | 'theme'>;
|
|
1234
|
-
export declare const ChipToken: PolymorphicComponent<ChipTokenProps>;
|
|
1235
1263
|
export type ChipInputProps = ComponentPropsWithoutRef<'div'> & FormValidationProps & {
|
|
1236
1264
|
theme?: ComponentTheme;
|
|
1237
1265
|
separator?: string | null;
|
|
@@ -1412,7 +1440,7 @@ export type OTPInputProps = Omit<ComponentPropsWithoutRef<'input'>, 'type' | 'ma
|
|
|
1412
1440
|
onComplete?: (value: string) => unknown;
|
|
1413
1441
|
onValueChange?: (value: string) => unknown;
|
|
1414
1442
|
};
|
|
1415
|
-
export declare const OTPInput: PolymorphicComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "size" | "
|
|
1443
|
+
export declare const OTPInput: PolymorphicComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "size" | "maxLength" | "type"> & FormValidationProps & {
|
|
1416
1444
|
length: number;
|
|
1417
1445
|
type?: "numeric" | "alphanumeric" | "alpha";
|
|
1418
1446
|
mask?: boolean;
|
|
@@ -1446,6 +1474,7 @@ export type RadioProps = Omit<ComponentPropsWithRef<'input'>, 'type' | 'size'> &
|
|
|
1446
1474
|
export declare const Radio: PolymorphicComponent<RadioProps>;
|
|
1447
1475
|
export type FormCheckProps = CheckboxProps & Pick<ComponentPropsWithRef<'input'>, 'ref'> & {
|
|
1448
1476
|
type?: 'checkbox' | 'radio';
|
|
1477
|
+
listGroup?: boolean;
|
|
1449
1478
|
};
|
|
1450
1479
|
export declare const FormCheck: PolymorphicComponent<FormCheckProps>;
|
|
1451
1480
|
export type FormRangeProps = Omit<ComponentPropsWithoutRef<'input'>, 'type'> & FormValidationProps & {
|
|
@@ -1479,4 +1508,10 @@ export declare function animate(name: string): RefCallback<Element>;
|
|
|
1479
1508
|
export type VariantColor = ComponentTheme;
|
|
1480
1509
|
export declare const VariantColors: VariantColor[];
|
|
1481
1510
|
export declare function text2color(raw: string, excludeColors?: VariantColor[]): ComponentTheme;
|
|
1511
|
+
export type AspectRatio = 'auto' | '1x1' | '4x3' | '16x9' | '21x9';
|
|
1512
|
+
export type CustomAspectRatio = `${number} / ${number}`;
|
|
1513
|
+
export type RatioProps = ComponentPropsWithRef<'div'> & {
|
|
1514
|
+
aspectRatio?: AspectRatio | CustomAspectRatio;
|
|
1515
|
+
};
|
|
1516
|
+
export declare const Ratio: PolymorphicComponent<RatioProps>;
|
|
1482
1517
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -142,7 +142,10 @@ type BadgeElementAttributes = (ComponentPropsWithRef<'span'> & {
|
|
|
142
142
|
export type BadgeProps = BadgeStyleProps & BadgeElementAttributes;
|
|
143
143
|
export declare const Badge: PolymorphicComponent<BadgeProps>;
|
|
144
144
|
export declare const Breadcrumb: PolymorphicComponent<import("react").DetailedHTMLProps<import("react").OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>>;
|
|
145
|
-
export
|
|
145
|
+
export type BreadcrumbItemProps = ComponentPropsWithRef<'li'> & {
|
|
146
|
+
active?: boolean;
|
|
147
|
+
};
|
|
148
|
+
export declare const BreadcrumbItem: PolymorphicComponent<BreadcrumbItemProps>;
|
|
146
149
|
export interface BreadcrumbLinkProps extends ComponentPropsWithRef<'a'> {
|
|
147
150
|
active?: boolean;
|
|
148
151
|
}
|
|
@@ -302,6 +305,7 @@ export interface CollapseToggleProps extends HTMLAttributes<HTMLElement>, Pick<B
|
|
|
302
305
|
target: string;
|
|
303
306
|
href?: string;
|
|
304
307
|
type?: 'button' | 'submit' | 'reset';
|
|
308
|
+
navbarToggler?: boolean;
|
|
305
309
|
}
|
|
306
310
|
export declare class CollapseToggle<T extends ElementType | undefined = 'button'> extends Component<PolymorphicClassProps<T, CollapseToggleProps>> {
|
|
307
311
|
readonly props: PolymorphicClassProps<T, CollapseToggleProps>;
|
|
@@ -335,13 +339,20 @@ export interface RowProps extends ComponentPropsWithRef<'div'> {
|
|
|
335
339
|
}
|
|
336
340
|
export declare const Row: PolymorphicComponent<RowProps>;
|
|
337
341
|
export interface ColProps extends ComponentPropsWithRef<'div'> {
|
|
338
|
-
xs?:
|
|
339
|
-
sm?:
|
|
340
|
-
md?:
|
|
341
|
-
lg?:
|
|
342
|
-
xl?:
|
|
343
|
-
'2xl'?:
|
|
344
|
-
}
|
|
342
|
+
xs?: ColBreakpoint;
|
|
343
|
+
sm?: ColBreakpoint;
|
|
344
|
+
md?: ColBreakpoint;
|
|
345
|
+
lg?: ColBreakpoint;
|
|
346
|
+
xl?: ColBreakpoint;
|
|
347
|
+
'2xl'?: ColBreakpoint;
|
|
348
|
+
}
|
|
349
|
+
export type ColOrder = number | 'first' | 'last';
|
|
350
|
+
export interface ColBreakpointOptions {
|
|
351
|
+
span?: BreakpointColSize;
|
|
352
|
+
offset?: number;
|
|
353
|
+
order?: ColOrder;
|
|
354
|
+
}
|
|
355
|
+
export type ColBreakpoint = BreakpointColSize | ColBreakpointOptions;
|
|
345
356
|
export declare const Col: PolymorphicComponent<ColProps>;
|
|
346
357
|
export interface NativeDialogProps extends Omit<DialogHTMLAttributes<HTMLDialogElement>, 'open'> {
|
|
347
358
|
modal?: boolean;
|
|
@@ -418,8 +429,18 @@ export declare class Drawer<T extends ElementType | undefined = 'dialog'> extend
|
|
|
418
429
|
handleClose: () => void;
|
|
419
430
|
render(): import("react").JSX.Element;
|
|
420
431
|
}
|
|
432
|
+
export interface FadeProps {
|
|
433
|
+
className?: string;
|
|
434
|
+
in?: boolean;
|
|
435
|
+
children: ReactElement<{
|
|
436
|
+
className?: string;
|
|
437
|
+
}>;
|
|
438
|
+
}
|
|
439
|
+
export declare const Fade: FC<FadeProps>;
|
|
421
440
|
export type ListGroupHorizontal = boolean | Breakpoint;
|
|
422
441
|
interface ListGroupStyleProps {
|
|
442
|
+
radio?: boolean;
|
|
443
|
+
checkable?: boolean;
|
|
423
444
|
flush?: boolean;
|
|
424
445
|
numbered?: boolean;
|
|
425
446
|
horizontal?: ListGroupHorizontal;
|
|
@@ -581,6 +602,7 @@ export interface NavProps extends ComponentPropsWithRef<'nav'> {
|
|
|
581
602
|
vertical?: boolean;
|
|
582
603
|
fill?: boolean;
|
|
583
604
|
justified?: boolean;
|
|
605
|
+
flush?: boolean;
|
|
584
606
|
cardHeader?: boolean;
|
|
585
607
|
navbar?: boolean;
|
|
586
608
|
}
|
|
@@ -611,6 +633,8 @@ export declare const NavbarNav: PolymorphicComponent<NavbarNavProps>;
|
|
|
611
633
|
export declare const NavbarText: PolymorphicComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>>;
|
|
612
634
|
export interface NavbarTogglerProps extends Omit<ComponentPropsWithRef<'button'>, 'children' | 'type'> {
|
|
613
635
|
expanded?: boolean;
|
|
636
|
+
commandfor?: string;
|
|
637
|
+
command?: string;
|
|
614
638
|
}
|
|
615
639
|
export declare const NavbarToggler: PolymorphicComponent<NavbarTogglerProps>;
|
|
616
640
|
declare class NavOverflowModel {
|
|
@@ -672,10 +696,6 @@ export interface PlaceholderProps extends ComponentPropsWithRef<'span'> {
|
|
|
672
696
|
width?: CSSProperties['width'];
|
|
673
697
|
}
|
|
674
698
|
export declare const Placeholder: PolymorphicComponent<PlaceholderProps>;
|
|
675
|
-
export interface PlaceholderAnimationProps extends ComponentPropsWithRef<'div'> {
|
|
676
|
-
animation?: PlaceholderProps['animation'];
|
|
677
|
-
}
|
|
678
|
-
export declare const PlaceholderAnimation: PolymorphicComponent<PlaceholderAnimationProps>;
|
|
679
699
|
export type PlaceholderButtonProps = ButtonProps;
|
|
680
700
|
export declare const PlaceholderButton: PolymorphicComponent<ButtonProps>;
|
|
681
701
|
export interface PopoverProps extends Omit<OverlayTriggerProps, 'title'> {
|
|
@@ -698,7 +718,7 @@ declare class ScrollSpyModel {
|
|
|
698
718
|
accessor guides: (Record<'top' | 'left' | 'width' | 'height' | 'line', number> & {
|
|
699
719
|
atBottom: boolean;
|
|
700
720
|
}) | undefined;
|
|
701
|
-
setGuides: (guides: ScrollSpyModel["guides"]) => (Record<"line" | "
|
|
721
|
+
setGuides: (guides: ScrollSpyModel["guides"]) => (Record<"line" | "height" | "width" | "left" | "top", number> & {
|
|
702
722
|
atBottom: boolean;
|
|
703
723
|
}) | undefined;
|
|
704
724
|
setActiveId: (id: string) => string;
|
|
@@ -732,7 +752,7 @@ export declare class ScrollSpy<T extends ElementType | undefined = 'div'> extend
|
|
|
732
752
|
componentWillUnmount(): void;
|
|
733
753
|
refresh: () => void;
|
|
734
754
|
handleResize: () => void;
|
|
735
|
-
handleScroll: () => (Record<"line" | "
|
|
755
|
+
handleScroll: () => (Record<"line" | "height" | "width" | "left" | "top", number> & {
|
|
736
756
|
atBottom: boolean;
|
|
737
757
|
}) | undefined;
|
|
738
758
|
private getRootHeight;
|
|
@@ -886,14 +906,23 @@ export interface ImageProps extends ComponentPropsWithRef<'img'> {
|
|
|
886
906
|
roundedCircle?: boolean;
|
|
887
907
|
}
|
|
888
908
|
export declare const Image: PolymorphicComponent<ImageProps>;
|
|
909
|
+
export type FigureProps = ComponentPropsWithRef<'figure'>;
|
|
910
|
+
export declare const Figure: PolymorphicComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
911
|
+
export declare const FigureImage: PolymorphicComponent<ImageProps>;
|
|
912
|
+
export type FigureCaptionProps = ComponentPropsWithRef<'figcaption'>;
|
|
913
|
+
export declare const FigureCaption: PolymorphicComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>>;
|
|
889
914
|
export interface TableProps extends ComponentPropsWithRef<'table'> {
|
|
890
915
|
striped?: boolean;
|
|
891
916
|
stripedColumns?: boolean;
|
|
892
917
|
hover?: boolean;
|
|
893
918
|
bordered?: boolean;
|
|
894
919
|
borderless?: boolean;
|
|
920
|
+
card?: boolean;
|
|
895
921
|
small?: boolean;
|
|
896
922
|
responsive?: boolean | Breakpoint;
|
|
923
|
+
stacked?: boolean | Breakpoint;
|
|
924
|
+
verticalAlign?: 'baseline' | 'top' | 'middle' | 'bottom' | 'text-top' | 'text-bottom';
|
|
925
|
+
captionTop?: boolean;
|
|
897
926
|
}
|
|
898
927
|
export declare const Table: PolymorphicComponent<TableProps>;
|
|
899
928
|
export type ClickBoundaryProps = PropsWithChildren<{
|
|
@@ -1077,14 +1106,16 @@ export declare class PageNav<T extends ElementType | undefined = 'nav'> extends
|
|
|
1077
1106
|
renderLink: ({ id, level, text, top }: HeadingMeta) => false | import("react").JSX.Element;
|
|
1078
1107
|
render(): import("react").JSX.Element;
|
|
1079
1108
|
}
|
|
1080
|
-
export type ScrollNavProps = NavProps
|
|
1109
|
+
export type ScrollNavProps = NavProps & {
|
|
1110
|
+
navClassName?: string;
|
|
1111
|
+
};
|
|
1081
1112
|
/**
|
|
1082
1113
|
* A horizontal scrolling navigation bar based on Bootstrap's `nav-scroller` pattern.
|
|
1083
1114
|
* Automatically shows scroll arrow buttons when nav items overflow the container width.
|
|
1084
1115
|
*
|
|
1085
1116
|
* @see {@link https://github.com/twbs/bootstrap/blob/main/site/src/assets/examples/offcanvas-navbar/index.astro#L50-L65}
|
|
1086
1117
|
*/
|
|
1087
|
-
export declare const ScrollNav: PolymorphicComponent<
|
|
1118
|
+
export declare const ScrollNav: PolymorphicComponent<ScrollNavProps>;
|
|
1088
1119
|
export declare function elementToImage(element: HTMLElement, type?: string, quality?: number): Promise<string>;
|
|
1089
1120
|
export type ShareBoxProps = HTMLAttributes<HTMLDivElement> & ShareData;
|
|
1090
1121
|
export declare class ShareBox extends Component<ShareBoxProps> {
|
|
@@ -1177,8 +1208,6 @@ export type FormProps = ComponentPropsWithRef<'form'> & {
|
|
|
1177
1208
|
validated?: boolean;
|
|
1178
1209
|
};
|
|
1179
1210
|
export declare const Form: PolymorphicComponent<FormProps>;
|
|
1180
|
-
export type FormFieldsetProps = ComponentPropsWithRef<'fieldset'>;
|
|
1181
|
-
export declare const FormFieldset: PolymorphicComponent<import("react").DetailedHTMLProps<import("react").FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>>;
|
|
1182
1211
|
export type FormFieldProps = ComponentPropsWithRef<'div'> & {
|
|
1183
1212
|
card?: boolean;
|
|
1184
1213
|
};
|
|
@@ -1222,16 +1251,15 @@ export declare const Checkbox: PolymorphicComponent<Omit<Omit<import("react").De
|
|
|
1222
1251
|
} & {
|
|
1223
1252
|
ref?: Ref<HTMLInputElement>;
|
|
1224
1253
|
}>;
|
|
1225
|
-
export type ChipProps = ComponentPropsWithRef<'
|
|
1254
|
+
export type ChipProps = ComponentPropsWithRef<'span'> & {
|
|
1226
1255
|
active?: boolean;
|
|
1227
1256
|
theme?: ComponentTheme;
|
|
1257
|
+
type?: ComponentPropsWithRef<'button'>['type'];
|
|
1228
1258
|
};
|
|
1229
1259
|
export declare const Chip: PolymorphicComponent<ChipProps>;
|
|
1230
1260
|
export declare const ChipIcon: PolymorphicComponent<IconProps>;
|
|
1231
1261
|
export declare const ChipImage: PolymorphicComponent<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>>;
|
|
1232
1262
|
export declare const ChipDismiss: PolymorphicComponent<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>>;
|
|
1233
|
-
export type ChipTokenProps = ComponentPropsWithRef<'span'> & Pick<ChipProps, 'active' | 'theme'>;
|
|
1234
|
-
export declare const ChipToken: PolymorphicComponent<ChipTokenProps>;
|
|
1235
1263
|
export type ChipInputProps = ComponentPropsWithoutRef<'div'> & FormValidationProps & {
|
|
1236
1264
|
theme?: ComponentTheme;
|
|
1237
1265
|
separator?: string | null;
|
|
@@ -1412,7 +1440,7 @@ export type OTPInputProps = Omit<ComponentPropsWithoutRef<'input'>, 'type' | 'ma
|
|
|
1412
1440
|
onComplete?: (value: string) => unknown;
|
|
1413
1441
|
onValueChange?: (value: string) => unknown;
|
|
1414
1442
|
};
|
|
1415
|
-
export declare const OTPInput: PolymorphicComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "size" | "
|
|
1443
|
+
export declare const OTPInput: PolymorphicComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "size" | "maxLength" | "type"> & FormValidationProps & {
|
|
1416
1444
|
length: number;
|
|
1417
1445
|
type?: "numeric" | "alphanumeric" | "alpha";
|
|
1418
1446
|
mask?: boolean;
|
|
@@ -1446,6 +1474,7 @@ export type RadioProps = Omit<ComponentPropsWithRef<'input'>, 'type' | 'size'> &
|
|
|
1446
1474
|
export declare const Radio: PolymorphicComponent<RadioProps>;
|
|
1447
1475
|
export type FormCheckProps = CheckboxProps & Pick<ComponentPropsWithRef<'input'>, 'ref'> & {
|
|
1448
1476
|
type?: 'checkbox' | 'radio';
|
|
1477
|
+
listGroup?: boolean;
|
|
1449
1478
|
};
|
|
1450
1479
|
export declare const FormCheck: PolymorphicComponent<FormCheckProps>;
|
|
1451
1480
|
export type FormRangeProps = Omit<ComponentPropsWithoutRef<'input'>, 'type'> & FormValidationProps & {
|
|
@@ -1479,4 +1508,10 @@ export declare function animate(name: string): RefCallback<Element>;
|
|
|
1479
1508
|
export type VariantColor = ComponentTheme;
|
|
1480
1509
|
export declare const VariantColors: VariantColor[];
|
|
1481
1510
|
export declare function text2color(raw: string, excludeColors?: VariantColor[]): ComponentTheme;
|
|
1511
|
+
export type AspectRatio = 'auto' | '1x1' | '4x3' | '16x9' | '21x9';
|
|
1512
|
+
export type CustomAspectRatio = `${number} / ${number}`;
|
|
1513
|
+
export type RatioProps = ComponentPropsWithRef<'div'> & {
|
|
1514
|
+
aspectRatio?: AspectRatio | CustomAspectRatio;
|
|
1515
|
+
};
|
|
1516
|
+
export declare const Ratio: PolymorphicComponent<RatioProps>;
|
|
1482
1517
|
export {};
|