merge: integrate reviewed AlertDialog Drawer with ListBox main
This commit is contained in:
@@ -17,3 +17,5 @@ SLIDER-01 已在 `/private/tmp/heroui-slider-consumer` 完成上述检查,临
|
||||
M30–M32 增加 consume-m30-m32.mjs 和 m30-m32-contract.ts。将它们复制到同一个独立消费工程,执行运行脚本,并将契约文件加入上述两种 tsc 命令。合并后的产物还应同时通过原 NumberField/Slider 消费检查,避免只验证新加组件。
|
||||
|
||||
LISTBOX-01 增加 `consume-list-box.mjs` / `list-box-contract.ts`。同样复制到独立消费者,用两份新 tarball 安装后运行脚本,并在 NodeNext / bundler 两种模式执行契约文件。Root 的泛型 Props 曾在 Parameters 提取后退化,非法模型/模式反例与事件参数推断必须保留。
|
||||
|
||||
M33–M34 使用 consume-m33-m34.mjs / m33-m34-contract.ts;同样复制到独立 tarball 消费工程,分别运行 node 与两种解析模式的 tsc。包括所有公开部件、真正 node SSR、CSS 关键帧与策略/尺寸/方向的正反类型检查。集成验证目录为 /private/tmp/heroui-m33-consumer,不复用其他并行任务的临时产物。
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { createSSRApp, h } from "vue";
|
||||
import { renderToString } from "@vue/server-renderer";
|
||||
import * as library from "@heroui-vue/components";
|
||||
for (const name of [
|
||||
"AlertDialog",
|
||||
"AlertDialogRoot",
|
||||
"AlertDialogTrigger",
|
||||
"AlertDialogBackdrop",
|
||||
"AlertDialogContainer",
|
||||
"AlertDialogDialog",
|
||||
"AlertDialogHeader",
|
||||
"AlertDialogHeading",
|
||||
"AlertDialogBody",
|
||||
"AlertDialogFooter",
|
||||
"AlertDialogIcon",
|
||||
"AlertDialogCloseTrigger",
|
||||
"AlertDialogClose",
|
||||
"Drawer",
|
||||
"DrawerRoot",
|
||||
"DrawerTrigger",
|
||||
"DrawerBackdrop",
|
||||
"DrawerContent",
|
||||
"DrawerDialog",
|
||||
"DrawerHeader",
|
||||
"DrawerHeading",
|
||||
"DrawerBody",
|
||||
"DrawerFooter",
|
||||
"DrawerHandle",
|
||||
"DrawerCloseTrigger",
|
||||
"DrawerClose",
|
||||
])
|
||||
assert(library[name], name);
|
||||
for (const family of ["AlertDialog", "Drawer"]) {
|
||||
const html = await renderToString(
|
||||
createSSRApp({
|
||||
render: () =>
|
||||
h(library[family], {}, () => [
|
||||
h(
|
||||
library[`${family}Trigger`],
|
||||
{ as: "button" },
|
||||
() => `Open ${family}`,
|
||||
),
|
||||
h(library[`${family}Backdrop`], {}, () =>
|
||||
family === "Drawer"
|
||||
? h(library.DrawerContent)
|
||||
: h(library.AlertDialogContainer),
|
||||
),
|
||||
]),
|
||||
}),
|
||||
);
|
||||
assert(html.includes(`Open ${family}`));
|
||||
assert(html.includes('aria-expanded="false"'));
|
||||
}
|
||||
const css = readFileSync(
|
||||
new URL(import.meta.resolve("@heroui-vue/styles/css")),
|
||||
"utf8",
|
||||
);
|
||||
assert(css.includes(".hv-alert-dialog__dialog"));
|
||||
assert(css.includes("hv-drawer-in-from-right"));
|
||||
assert(css.includes("hv-drawer-out-to-bottom"));
|
||||
console.log("M33-M34 tarball ESM exports, node SSR and CSS passed");
|
||||
@@ -0,0 +1,40 @@
|
||||
import {
|
||||
type AlertDialogContainerProps,
|
||||
type AlertDialogIconProps,
|
||||
type AlertDialogBackdropProps,
|
||||
type DrawerContentProps,
|
||||
type DrawerBackdropProps,
|
||||
DrawerHandle,
|
||||
AlertDialog,
|
||||
} from "@heroui-vue/components";
|
||||
const size: AlertDialogContainerProps = { size: "cover", placement: "bottom" };
|
||||
const status: AlertDialogIconProps = { status: "danger" };
|
||||
const backdrop: AlertDialogBackdropProps = {
|
||||
isDismissable: false,
|
||||
isKeyboardDismissDisabled: true,
|
||||
};
|
||||
const drawer: DrawerContentProps = { placement: "left" };
|
||||
const state: DrawerBackdropProps = {
|
||||
open: true,
|
||||
"onUpdate:open": (v: boolean) => {
|
||||
void v;
|
||||
},
|
||||
};
|
||||
// @ts-expect-error placement is constrained
|
||||
const invalidDirection: DrawerContentProps = { placement: "diagonal" };
|
||||
// @ts-expect-error size is constrained
|
||||
const invalidSize: AlertDialogContainerProps = { size: "giant" };
|
||||
// @ts-expect-error dismiss policy must remain Boolean
|
||||
const invalidPolicy: AlertDialogBackdropProps = { isDismissable: "false" };
|
||||
void [
|
||||
size,
|
||||
status,
|
||||
backdrop,
|
||||
drawer,
|
||||
state,
|
||||
invalidDirection,
|
||||
invalidSize,
|
||||
invalidPolicy,
|
||||
DrawerHandle,
|
||||
AlertDialog,
|
||||
];
|
||||
Reference in New Issue
Block a user