chore: remove legacy SSR checks and consolidate migration maintenance
This commit is contained in:
+13
-16
@@ -1,24 +1,21 @@
|
||||
# 独立客户端产物验收
|
||||
|
||||
当前仅支持浏览器客户端,暂不支持SSR/水合/Nuxt服务端。除用户明确重新启用外,不开发、不修复、不运行这些专项。旧`consume-*.mjs`中不少脚本混有renderToString/服务端HTML断言,仅保留历史,不整批执行,也不复制为新任务要求。
|
||||
|
||||
## 当前需要验证什么
|
||||
|
||||
公开API/打包变化时,把最终两份tarball安装到工作区外的Vue/Vite工程,不设置源码alias;private样式包用消费者pnpm-workspace.yaml的overrides指向本地styles tarball。
|
||||
|
||||
- 在浏览器消费公开导出及发布CSS,确认核心交互、主题、布局与表单等适用契约。
|
||||
- 用相关`*-contract.ts`验证公共类型的正反例;NodeNext/bundler只是类型解析模式,不是SSR验收。
|
||||
- 不要求Node端渲染、服务端HTML、Teleport服务端或水合测试。
|
||||
|
||||
类型命令(以相关B02契约为例):
|
||||
统一入口,参数只选受影响的契约:
|
||||
|
||||
```sh
|
||||
pnpm exec tsc --noEmit --strict --skipLibCheck --target es2022 --module nodenext --moduleResolution nodenext b02-pickers-contract.ts
|
||||
pnpm exec tsc --noEmit --strict --skipLibCheck --target es2022 --module esnext --moduleResolution bundler b02-pickers-contract.ts
|
||||
node scripts/check-package.mjs b02-pickers
|
||||
node scripts/check-package.mjs calendar date-field select --offline
|
||||
```
|
||||
|
||||
`@ts-expect-error`必须实际生效;unused是类型验收失败,不能删反例。工作区typecheck使用源码alias,不能代替发布类型。
|
||||
入口先构建库/样式,在工作区外新建临时消费者,打包并安装最终tarball,检查所选公共导出/CSS/变体,再运行相应`*-contract.ts`的strict NodeNext/bundler正反例。不会启动服务或执行SSR/水合。NodeNext只是类型解析模式。支持的ID见`client-checks.json`;无效ID会在构建前失败。
|
||||
|
||||
浏览器消费夹具见[b02-consumer-app](b02-consumer-app/README.md)与[b01-consumer-app](b01-consumer-app/README.md);按相关任务使用,不无理由跑所有历史消费者。它们只导入公开包根和发布CSS。
|
||||
一次选择多个受影响ID,共享同次构建/安装;不要为每组件手动复制一套安装流程。默认消费者保留供检查,路径打印在日志中,不是新项目或长期工作目录。`--offline`仅在所需依赖已缓存时使用,安装失败不是验收通过。
|
||||
|
||||
旧SSR用例、脚本、依赖暂留作历史,不构成支持承诺或日常维护义务。依赖@vue/server-renderer仍由部分历史测试文件导入;暂不移除它,不要求为此增加新能力。
|
||||
## 契约与浏览器
|
||||
|
||||
- `client-checks.json`:导出、CSS标记、暂不公开组件的边界;`check-client.mjs`:共用检查和少数变体断言。
|
||||
- `*-contract.ts`:公开Props/事件/插槽类型正反例;`@ts-expect-error`出现unused必须修复,不能删反例。源码typecheck不能替代发布类型。
|
||||
- [B02浏览器夹具](b02-consumer-app/README.md)和[B01浏览器夹具](b01-consumer-app/README.md)保留。选择b02-pickers时,入口会把浏览器文件放入独立消费者;按输出命令显式启动,验可见/点击/焦点等核心路径。未启动时不能声称已验浏览器。
|
||||
- 新公共组件在已有数据与契约上增量扩展,不再新增consume-某批次.mjs脚本或手写另一套消费者流程。
|
||||
|
||||
旧15份consume脚本已移除;客户端导出/CSS/变体检查统一保留,服务端HTML/无document运行等断言不再维护。SSR/水合/Nuxt集成不支持。逐像素自动对比、完整读屏矩阵、真机矩阵暂不投入;基础键盘/可访问性与重点浏览器交互仍验证。
|
||||
|
||||
@@ -1,29 +1,18 @@
|
||||
# B01 独立浏览器消费夹具
|
||||
|
||||
用打包产物(`pnpm pack` 生成的 `@heroui-vue/components` / `@heroui-vue/styles` tarball)在独立 Vue 应用中真实挂载,覆盖:
|
||||
准备最终产物与浏览器文件:
|
||||
|
||||
- `selection`:带 `contain/isolation/overflow:hidden` 祖先的分组级多选长菜单(验证 Portal 脱离裁切、高度上限、真实 `role="menu"` 名称)。
|
||||
- `submenu`:三级子菜单 + 链接型菜单项。
|
||||
- `modal`:Modal 内的 Dropdown(验证层级与关闭顺序、滚动锁释放)。
|
||||
- `standalone`:独立 `Menu` 内联列表(无滚动锁、无浮动定位、不抢焦点)。
|
||||
|
||||
## 使用方式
|
||||
|
||||
```bash
|
||||
# 1. 在库仓库打包
|
||||
pnpm build
|
||||
pnpm --filter @heroui-vue/styles exec pnpm pack --pack-destination /tmp/heroui-b01-consumer
|
||||
pnpm --filter @heroui-vue/components exec pnpm pack --pack-destination /tmp/heroui-b01-consumer
|
||||
|
||||
# 2. 复制本目录到消费工程并安装
|
||||
cp -R tests/package/b01-consumer-app/. /tmp/heroui-b01-consumer/app/
|
||||
cd /tmp/heroui-b01-consumer && pnpm install
|
||||
|
||||
# 3. 打包成静态产物(esbuild 只作为构建工具,运行期仅依赖 tarball)
|
||||
esbuild app/main.js --bundle --format=esm --outfile=app/bundle.js --loader:.css=css
|
||||
|
||||
# 4. 静态服务后打开(`?only=selection|submenu|modal|standalone` 可单例)
|
||||
python3 -m http.server 5199 --bind 127.0.0.1 --directory app
|
||||
```sh
|
||||
node scripts/check-package.mjs b01-menu-dropdown
|
||||
```
|
||||
|
||||
`consume-b01-menu-dropdown.mjs` 只做导出/CSS 存在性检查;真实挂载行为以本夹具的浏览器结果为准。
|
||||
使用输出的独立消费者路径和Vite命令,显式选空闲端口启动;不再单独pack/install或引入esbuild。夹具只消费公开包和发布CSS,不用源码alias。统一入口不自动启动服务。
|
||||
|
||||
重点场景:
|
||||
|
||||
- `?only=selection`:裁切/隔离祖先中的分组多选长菜单,检查Portal、可用高度和真实menu名称。
|
||||
- `?only=submenu`:三级子菜单与链接项。
|
||||
- `?only=modal`:Modal内Dropdown,检查逐层关闭、滚动锁与焦点。
|
||||
- `?only=standalone`:独立内联Menu,不应锁滚动或抢焦点。
|
||||
|
||||
导出/CSS/类型检查由统一入口完成;真实可见、点击和焦点仍按浏览器步骤验,构建通过不代表这些操作通过。
|
||||
|
||||
@@ -3,11 +3,10 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>B01 consumer</title>
|
||||
<link rel="stylesheet" href="./bundle.css" />
|
||||
<link rel="stylesheet" href="./style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="./bundle.js"></script>
|
||||
<script type="module" src="/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
# B02 独立浏览器消费
|
||||
|
||||
将本目录内容复制到工作区外的独立目录。安装最终 pnpm pack 产生的 components/styles 两份 tarball、Vue与Vite;pnpm-workspace.yaml的styles override指向该样式tarball。不能配置指向源码的alias。main.js只从包根/发布CSS导入,使用render函数不依赖Vue模板编译器。
|
||||
|
||||
运行 `pnpm exec vite --host 127.0.0.1 --port 5184 --strictPort`(先确认空闲;也可使用已安装的Vite二进制作为开发工具),打开实际返回URL。
|
||||
先运行`node scripts/check-package.mjs b02-pickers`统一构建、打包、安装和类型验收;它会把本夹具放入独立消费者,打印路径和Vite命令。按输出显式选空闲端口启动,不另外复制安装流程;入口不会自动启动服务。main.js只从包根/发布CSS导入,不用源码alias或Vue模板编译器。
|
||||
|
||||
1. 点ComboBox箭头,面板在视口内/锚点旁,鼠标点狗后关闭、文本狗、焦点留在输入。
|
||||
2. 点Autocomplete,搜索Texas,鼠标选择后单选关闭;点清除后恢复占位,焦点与Tab/外部点击不反跳。
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync } from "node:fs";
|
||||
import * as lib from "@heroui-vue/components";
|
||||
|
||||
const checks = JSON.parse(
|
||||
readFileSync(new URL("./client-checks.json", import.meta.url), "utf8"),
|
||||
);
|
||||
const css = readFileSync(
|
||||
new URL(import.meta.resolve("@heroui-vue/styles/css")),
|
||||
"utf8",
|
||||
);
|
||||
for (const id of process.argv.slice(2)) {
|
||||
const spec = checks[id];
|
||||
assert(spec, `Unknown package contract: ${id}`);
|
||||
for (const name of spec.exports) assert(lib[name], `Missing export ${name}`);
|
||||
for (const token of spec.css)
|
||||
assert(css.includes(token), `Missing CSS ${token}`);
|
||||
for (const name of spec.absent ?? [])
|
||||
assert(!(name in lib), `Private component exposed: ${name}`);
|
||||
if (id === "b02-pickers") {
|
||||
assert(
|
||||
lib
|
||||
.comboBoxVariants({ fullWidth: true })
|
||||
.base()
|
||||
.includes("hv-combo-box--full-width"),
|
||||
);
|
||||
assert(
|
||||
lib
|
||||
.autocompleteVariants({ variant: "secondary" })
|
||||
.base()
|
||||
.includes("hv-autocomplete--secondary"),
|
||||
);
|
||||
}
|
||||
if (id === "list-box") {
|
||||
assert(lib.listboxVariants().includes("hv-list-box"));
|
||||
assert(
|
||||
lib
|
||||
.listboxItemVariants()
|
||||
.indicator()
|
||||
.includes("hv-list-box-item__indicator"),
|
||||
);
|
||||
}
|
||||
if (id === "slider")
|
||||
assert(lib.sliderVariants().thumb().includes("hv-slider__thumb"));
|
||||
if (id === "select")
|
||||
assert(
|
||||
lib
|
||||
.selectVariants({ variant: "secondary" })
|
||||
.base()
|
||||
.includes("hv-select--secondary"),
|
||||
);
|
||||
if (id === "b03-tag-error-message") {
|
||||
assert(/\.hv-tag-group\s*\[data-slot=["']?error-message/.test(css));
|
||||
assert(lib.tagVariants({ size: "sm" }).base().includes("hv-tag--sm"));
|
||||
assert(
|
||||
lib
|
||||
.tagVariants({ variant: "surface" })
|
||||
.base()
|
||||
.includes("hv-tag--surface"),
|
||||
);
|
||||
assert(lib.errorMessageVariants().includes("hv-error-message"));
|
||||
}
|
||||
console.log(`${id}: packed ESM exports and CSS passed (client scope)`);
|
||||
}
|
||||
@@ -0,0 +1,341 @@
|
||||
{
|
||||
"b01-menu-dropdown": {
|
||||
"exports": [
|
||||
"DropdownRoot",
|
||||
"DropdownTrigger",
|
||||
"DropdownPopover",
|
||||
"DropdownMenu",
|
||||
"DropdownItem",
|
||||
"DropdownItemIndicator",
|
||||
"DropdownSubmenuTrigger",
|
||||
"DropdownSubmenuIndicator",
|
||||
"DropdownSection",
|
||||
"Menu",
|
||||
"MenuItem",
|
||||
"MenuItemIndicator",
|
||||
"MenuItemSubmenuIndicator",
|
||||
"MenuSection"
|
||||
],
|
||||
"css": [
|
||||
"hv-menu-item",
|
||||
"hv-menu-item__indicator--submenu",
|
||||
"hv-dropdown__popover",
|
||||
"hv-dropdown__menu",
|
||||
"data-selected"
|
||||
]
|
||||
},
|
||||
"b02-pickers": {
|
||||
"exports": [
|
||||
"ComboBox",
|
||||
"ComboBoxInputGroup",
|
||||
"ComboBoxTrigger",
|
||||
"ComboBoxValue",
|
||||
"ComboBoxPopover",
|
||||
"Autocomplete",
|
||||
"AutocompleteTrigger",
|
||||
"AutocompleteValue",
|
||||
"AutocompleteIndicator",
|
||||
"AutocompleteClearButton",
|
||||
"AutocompletePopover",
|
||||
"AutocompleteFilter",
|
||||
"comboBoxVariants",
|
||||
"autocompleteVariants"
|
||||
],
|
||||
"css": [
|
||||
".hv-combo-box",
|
||||
".hv-combo-box__input-group",
|
||||
".hv-combo-box__trigger",
|
||||
".hv-combo-box__popover",
|
||||
".hv-combo-box__value",
|
||||
".hv-autocomplete",
|
||||
".hv-autocomplete__trigger",
|
||||
".hv-autocomplete__value",
|
||||
".hv-autocomplete__indicator",
|
||||
".hv-autocomplete__clear-button",
|
||||
".hv-autocomplete__popover",
|
||||
".hv-autocomplete--secondary",
|
||||
"hv-combo-box--full-width",
|
||||
"hv-autocomplete--secondary"
|
||||
]
|
||||
},
|
||||
"b03-tag-error-message": {
|
||||
"exports": [
|
||||
"TagGroup",
|
||||
"TagGroupList",
|
||||
"Tag",
|
||||
"TagRemoveButton",
|
||||
"ErrorMessage",
|
||||
"tagVariants",
|
||||
"tagGroupVariants",
|
||||
"errorMessageVariants"
|
||||
],
|
||||
"css": [
|
||||
".hv-tag",
|
||||
".hv-tag--sm",
|
||||
".hv-tag--lg",
|
||||
".hv-tag--surface",
|
||||
".hv-tag__remove-button",
|
||||
".hv-tag-group",
|
||||
".hv-tag-group__list",
|
||||
".hv-error-message",
|
||||
"hv-tag--sm",
|
||||
"hv-tag--surface",
|
||||
"hv-error-message"
|
||||
]
|
||||
},
|
||||
"calendar": {
|
||||
"exports": [
|
||||
"Calendar",
|
||||
"CalendarRoot",
|
||||
"CalendarHeader",
|
||||
"CalendarHeading",
|
||||
"CalendarNavButton",
|
||||
"CalendarGrid",
|
||||
"CalendarGridHeader",
|
||||
"CalendarGridBody",
|
||||
"CalendarHeaderCell",
|
||||
"CalendarCell",
|
||||
"CalendarCellIndicator",
|
||||
"CalendarYearPickerTrigger",
|
||||
"CalendarYearPickerTriggerHeading",
|
||||
"CalendarYearPickerTriggerIndicator",
|
||||
"CalendarYearPickerGrid",
|
||||
"CalendarYearPickerGridBody",
|
||||
"CalendarYearPickerCell"
|
||||
],
|
||||
"css": [
|
||||
".hv-calendar__cell",
|
||||
".hv-calendar--week-view",
|
||||
".hv-calendar--day-view",
|
||||
".hv-calendar-year-picker__year-cell"
|
||||
]
|
||||
},
|
||||
"color-field-protocol": {
|
||||
"exports": [],
|
||||
"css": [
|
||||
".hv-color-field",
|
||||
".hv-color-input-group",
|
||||
".hv-color-input-group__input",
|
||||
".hv-color-input-group--secondary",
|
||||
".hv-color-input-group__prefix",
|
||||
".hv-color-input-group__suffix"
|
||||
],
|
||||
"absent": [
|
||||
"ColorArea",
|
||||
"ColorSlider",
|
||||
"ColorField",
|
||||
"ColorInputGroup",
|
||||
"ColorPicker"
|
||||
]
|
||||
},
|
||||
"color-foundation": {
|
||||
"exports": [],
|
||||
"css": [".hv-color-area", ".hv-color-area__thumb"],
|
||||
"absent": [
|
||||
"ColorArea",
|
||||
"ColorSlider",
|
||||
"ColorField",
|
||||
"ColorInputGroup",
|
||||
"ColorPicker"
|
||||
]
|
||||
},
|
||||
"color-picker-protocol": {
|
||||
"exports": [],
|
||||
"css": [
|
||||
".hv-color-picker",
|
||||
".hv-color-picker__trigger",
|
||||
".hv-color-picker__popover"
|
||||
],
|
||||
"absent": [
|
||||
"ColorArea",
|
||||
"ColorSlider",
|
||||
"ColorField",
|
||||
"ColorInputGroup",
|
||||
"ColorPicker"
|
||||
]
|
||||
},
|
||||
"color-slider-foundation": {
|
||||
"exports": [],
|
||||
"css": [
|
||||
".hv-color-slider",
|
||||
".hv-color-slider__track",
|
||||
".hv-color-slider__thumb",
|
||||
"--track-start-color",
|
||||
"--track-end-color",
|
||||
"--reka-popover-content-available-height",
|
||||
"max-height:inherit",
|
||||
"overscroll-behavior:contain"
|
||||
],
|
||||
"absent": [
|
||||
"ColorArea",
|
||||
"ColorSlider",
|
||||
"ColorField",
|
||||
"ColorInputGroup",
|
||||
"ColorPicker"
|
||||
]
|
||||
},
|
||||
"date-field": {
|
||||
"exports": [
|
||||
"DateField",
|
||||
"DateFieldRoot",
|
||||
"DateFieldGroup",
|
||||
"DateFieldInput",
|
||||
"DateFieldSegment",
|
||||
"DateFieldPrefix",
|
||||
"DateFieldSuffix",
|
||||
"DateFieldInputContainer",
|
||||
"DateInputGroup",
|
||||
"DateInputGroupInput",
|
||||
"DateInputGroupSegment",
|
||||
"DateInputGroupInputContainer",
|
||||
"DateInputGroupPrefix",
|
||||
"DateInputGroupSuffix"
|
||||
],
|
||||
"css": [
|
||||
"hv-date-field",
|
||||
"hv-date-input-group",
|
||||
"hv-date-input-group__segment",
|
||||
"hv-date-input-group--secondary"
|
||||
]
|
||||
},
|
||||
"list-box": {
|
||||
"exports": [
|
||||
"ListBox",
|
||||
"ListBoxItem",
|
||||
"ListBoxItemIndicator",
|
||||
"ListBoxSection",
|
||||
"Header",
|
||||
"Label",
|
||||
"Description",
|
||||
"listboxVariants",
|
||||
"listboxItemVariants"
|
||||
],
|
||||
"css": [
|
||||
"hv-list-box",
|
||||
"hv-list-box-item__indicator",
|
||||
".hv-list-box",
|
||||
".hv-list-box-item",
|
||||
".hv-list-box-section"
|
||||
]
|
||||
},
|
||||
"m30-m32": {
|
||||
"exports": [
|
||||
"InputOTP",
|
||||
"InputOTPGroup",
|
||||
"InputOTPSlot",
|
||||
"Label",
|
||||
"Header",
|
||||
"Pagination",
|
||||
"PaginationContent",
|
||||
"PaginationItem",
|
||||
"PaginationLink"
|
||||
],
|
||||
"css": ["hv-header", "hv-pagination", "hv-input-otp"]
|
||||
},
|
||||
"m33-m34": {
|
||||
"exports": [
|
||||
"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"
|
||||
],
|
||||
"css": [
|
||||
".hv-alert-dialog__dialog",
|
||||
"hv-drawer-in-from-right",
|
||||
"hv-drawer-out-to-bottom"
|
||||
]
|
||||
},
|
||||
"m35-m36": {
|
||||
"exports": [
|
||||
"Toast",
|
||||
"ToastRoot",
|
||||
"ToastProvider",
|
||||
"ToastContent",
|
||||
"ToastIndicator",
|
||||
"ToastTitle",
|
||||
"ToastDescription",
|
||||
"ToastActionButton",
|
||||
"ToastCloseButton",
|
||||
"ToastQueue",
|
||||
"toast",
|
||||
"toastQueue",
|
||||
"createToastFunction",
|
||||
"Table",
|
||||
"TableRoot",
|
||||
"TableContent",
|
||||
"TableHeader",
|
||||
"TableColumn",
|
||||
"TableBody",
|
||||
"TableRow",
|
||||
"TableCell",
|
||||
"TableScrollContainer",
|
||||
"TableFooter",
|
||||
"TableResizableContainer",
|
||||
"TableColumnResizer",
|
||||
"TableLoadMore",
|
||||
"TableLoadMoreItem",
|
||||
"TableLoadMoreContent",
|
||||
"TableCollection",
|
||||
"TableSortableColumnHeader"
|
||||
],
|
||||
"css": [".hv-toast-region", ".hv-table__column-resizer", "data-exiting"]
|
||||
},
|
||||
"select": {
|
||||
"exports": [
|
||||
"Select",
|
||||
"SelectTrigger",
|
||||
"SelectValue",
|
||||
"SelectIndicator",
|
||||
"SelectClearButton",
|
||||
"SelectPopover",
|
||||
"ListBox",
|
||||
"ListBoxItem",
|
||||
"Label",
|
||||
"selectVariants"
|
||||
],
|
||||
"css": [
|
||||
"hv-select--secondary",
|
||||
".hv-select",
|
||||
".hv-select__trigger",
|
||||
".hv-select__value",
|
||||
".hv-select__clear-button",
|
||||
".hv-select__indicator",
|
||||
".hv-select__popover"
|
||||
]
|
||||
},
|
||||
"slider": {
|
||||
"exports": [
|
||||
"Slider",
|
||||
"SliderTrack",
|
||||
"SliderFill",
|
||||
"SliderThumb",
|
||||
"SliderOutput",
|
||||
"SliderMarks",
|
||||
"Label",
|
||||
"sliderVariants"
|
||||
],
|
||||
"css": [".hv-slider__track", "hv-slider__thumb"]
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
/**
|
||||
* Independent ESM/CSS consumption for B01 Menu/Dropdown.
|
||||
* Copy into a fresh consumer that installs packed tarballs (no source alias).
|
||||
*/
|
||||
import { readFileSync } from "node:fs";
|
||||
|
||||
const mod = await import("@heroui-vue/components");
|
||||
const {
|
||||
DropdownRoot,
|
||||
DropdownTrigger,
|
||||
DropdownPopover,
|
||||
DropdownMenu,
|
||||
DropdownItem,
|
||||
DropdownItemIndicator,
|
||||
DropdownSubmenuTrigger,
|
||||
DropdownSubmenuIndicator,
|
||||
DropdownSection,
|
||||
Menu,
|
||||
MenuItem,
|
||||
MenuItemIndicator,
|
||||
MenuItemSubmenuIndicator,
|
||||
MenuSection,
|
||||
} = mod;
|
||||
|
||||
const expected = {
|
||||
DropdownRoot,
|
||||
DropdownTrigger,
|
||||
DropdownPopover,
|
||||
DropdownMenu,
|
||||
DropdownItem,
|
||||
DropdownItemIndicator,
|
||||
DropdownSubmenuTrigger,
|
||||
DropdownSubmenuIndicator,
|
||||
DropdownSection,
|
||||
Menu,
|
||||
MenuItem,
|
||||
MenuItemIndicator,
|
||||
MenuItemSubmenuIndicator,
|
||||
MenuSection,
|
||||
};
|
||||
for (const [name, value] of Object.entries(expected)) {
|
||||
if (!value) {
|
||||
console.error("missing export", name);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
const cssPath = import.meta.resolve("@heroui-vue/styles/css");
|
||||
const css = readFileSync(new URL(cssPath), "utf8");
|
||||
for (const token of [
|
||||
"hv-menu-item",
|
||||
"hv-menu-item__indicator--submenu",
|
||||
"hv-dropdown__popover",
|
||||
"hv-dropdown__menu",
|
||||
"data-selected",
|
||||
]) {
|
||||
if (!css.includes(token)) {
|
||||
console.error("css missing", token);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
console.log("b01 menu/dropdown ESM+CSS consume ok");
|
||||
@@ -1,159 +0,0 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { createSSRApp, h } from "vue";
|
||||
import { renderToString } from "@vue/server-renderer";
|
||||
import * as lib from "@heroui-vue/components";
|
||||
|
||||
for (const name of [
|
||||
"ComboBox",
|
||||
"ComboBoxInputGroup",
|
||||
"ComboBoxTrigger",
|
||||
"ComboBoxValue",
|
||||
"ComboBoxPopover",
|
||||
"Autocomplete",
|
||||
"AutocompleteTrigger",
|
||||
"AutocompleteValue",
|
||||
"AutocompleteIndicator",
|
||||
"AutocompleteClearButton",
|
||||
"AutocompletePopover",
|
||||
"AutocompleteFilter",
|
||||
"comboBoxVariants",
|
||||
"autocompleteVariants",
|
||||
])
|
||||
assert(lib[name], name);
|
||||
|
||||
const items = [
|
||||
{ id: "cat", textValue: "猫" },
|
||||
{ id: "dog", textValue: "狗" },
|
||||
];
|
||||
|
||||
const html = await renderToString(
|
||||
createSSRApp({
|
||||
render: () =>
|
||||
h("main", [
|
||||
h(
|
||||
lib.ComboBox,
|
||||
{ "aria-label": "动物", defaultSelectedKey: "cat", name: "animal" },
|
||||
{
|
||||
default: () => [
|
||||
h(lib.Label, null, () => "动物"),
|
||||
h(lib.ComboBoxInputGroup, null, {
|
||||
default: () => [h(lib.Input, {}), h(lib.ComboBoxTrigger)],
|
||||
}),
|
||||
h(lib.ComboBoxPopover, null, {
|
||||
default: () =>
|
||||
h(lib.ListBox, null, {
|
||||
default: () =>
|
||||
items.map((item) =>
|
||||
h(
|
||||
lib.ListBoxItem,
|
||||
{
|
||||
id: item.id,
|
||||
key: item.id,
|
||||
textValue: item.textValue,
|
||||
},
|
||||
() => item.textValue,
|
||||
),
|
||||
),
|
||||
}),
|
||||
}),
|
||||
],
|
||||
},
|
||||
),
|
||||
h(
|
||||
lib.Autocomplete,
|
||||
{ "aria-label": "州", name: "state", defaultValue: "dog" },
|
||||
{
|
||||
default: () => [
|
||||
h(lib.AutocompleteTrigger, null, {
|
||||
default: () => [
|
||||
h(lib.AutocompleteValue),
|
||||
h(lib.AutocompleteClearButton),
|
||||
h(lib.AutocompleteIndicator),
|
||||
],
|
||||
}),
|
||||
h(lib.AutocompletePopover, null, {
|
||||
default: () =>
|
||||
h(lib.AutocompleteFilter, null, {
|
||||
default: () => [
|
||||
h(
|
||||
lib.SearchField,
|
||||
{ "aria-label": "搜索" },
|
||||
{
|
||||
default: () =>
|
||||
h(lib.SearchFieldGroup, null, {
|
||||
default: () => [h(lib.SearchFieldInput)],
|
||||
}),
|
||||
},
|
||||
),
|
||||
h(lib.ListBox, null, {
|
||||
default: () =>
|
||||
items.map((item) =>
|
||||
h(
|
||||
lib.ListBoxItem,
|
||||
{
|
||||
id: item.id,
|
||||
key: item.id,
|
||||
textValue: item.textValue,
|
||||
},
|
||||
() => item.textValue,
|
||||
),
|
||||
),
|
||||
}),
|
||||
],
|
||||
}),
|
||||
}),
|
||||
],
|
||||
},
|
||||
),
|
||||
]),
|
||||
}),
|
||||
);
|
||||
|
||||
assert(html.includes('data-slot="combo-box"'), "combo-box root");
|
||||
assert(html.includes('role="combobox"'), "combobox input role");
|
||||
assert(html.includes('data-slot="combo-box-trigger"'), "combo box trigger");
|
||||
assert(html.includes('name="animal"'), "combo box form name");
|
||||
assert(html.includes('data-slot="autocomplete"'), "autocomplete root");
|
||||
assert(
|
||||
html.includes('data-slot="autocomplete-trigger"'),
|
||||
"autocomplete trigger",
|
||||
);
|
||||
assert(html.includes('role="button"'), "autocomplete trigger is a button");
|
||||
assert(html.includes('name="state"'), "autocomplete form name");
|
||||
assert(html.includes("猫"), "combo box preselected label");
|
||||
|
||||
const css = readFileSync(
|
||||
"node_modules/@heroui-vue/styles/dist/styles.css",
|
||||
"utf8",
|
||||
);
|
||||
for (const rule of [
|
||||
".hv-combo-box",
|
||||
".hv-combo-box__input-group",
|
||||
".hv-combo-box__trigger",
|
||||
".hv-combo-box__popover",
|
||||
".hv-combo-box__value",
|
||||
".hv-autocomplete",
|
||||
".hv-autocomplete__trigger",
|
||||
".hv-autocomplete__value",
|
||||
".hv-autocomplete__indicator",
|
||||
".hv-autocomplete__clear-button",
|
||||
".hv-autocomplete__popover",
|
||||
".hv-autocomplete--secondary",
|
||||
])
|
||||
assert(css.includes(rule), `missing CSS ${rule}`);
|
||||
|
||||
assert(
|
||||
lib
|
||||
.comboBoxVariants({ fullWidth: true })
|
||||
.base()
|
||||
.includes("hv-combo-box--full-width"),
|
||||
);
|
||||
assert(
|
||||
lib
|
||||
.autocompleteVariants({ variant: "secondary" })
|
||||
.base()
|
||||
.includes("hv-autocomplete--secondary"),
|
||||
);
|
||||
|
||||
console.log("B02 pickers consumption OK");
|
||||
@@ -1,88 +0,0 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { createSSRApp, h } from "vue";
|
||||
import { renderToString } from "@vue/server-renderer";
|
||||
import * as lib from "@heroui-vue/components";
|
||||
|
||||
for (const name of [
|
||||
"TagGroup",
|
||||
"TagGroupList",
|
||||
"Tag",
|
||||
"TagRemoveButton",
|
||||
"ErrorMessage",
|
||||
"tagVariants",
|
||||
"tagGroupVariants",
|
||||
"errorMessageVariants",
|
||||
])
|
||||
assert(lib[name], name);
|
||||
|
||||
const html = await renderToString(
|
||||
createSSRApp({
|
||||
render: () =>
|
||||
h(
|
||||
lib.TagGroup,
|
||||
{
|
||||
"aria-label": "分类",
|
||||
selectionMode: "multiple",
|
||||
modelValue: ["news"],
|
||||
onRemove: () => {},
|
||||
},
|
||||
{
|
||||
default: () => [
|
||||
h(lib.TagGroupList, null, {
|
||||
default: () => [
|
||||
h(lib.Tag, { id: "news" }, { default: () => "资讯" }),
|
||||
h(
|
||||
lib.Tag,
|
||||
{ id: 0, isDisabled: true },
|
||||
{ default: () => "零" },
|
||||
),
|
||||
],
|
||||
}),
|
||||
h(lib.ErrorMessage, null, { default: () => "请至少选择一项" }),
|
||||
],
|
||||
},
|
||||
),
|
||||
}),
|
||||
);
|
||||
|
||||
assert(html.includes('role="grid"'), "grid role on the list");
|
||||
assert(html.includes('aria-label="分类"'), "grid carries the group label");
|
||||
assert(html.includes('aria-multiselectable="true"'), "multiple selection flag");
|
||||
assert(html.includes('role="row"'), "rows for tags");
|
||||
assert(html.includes('aria-selected="true"'), "accepted selection");
|
||||
assert(html.includes('aria-disabled="true"'), "disabled tag");
|
||||
assert(html.includes("Remove tag 资讯"), "composed remove button name");
|
||||
assert(html.includes('data-slot="tag-remove-button"'), "remove button slot");
|
||||
assert(html.includes('data-slot="error-message"'), "error message slot");
|
||||
assert(html.includes('slot="errorMessage"'), "baseline error message marker");
|
||||
|
||||
const css = readFileSync(
|
||||
"node_modules/@heroui-vue/styles/dist/styles.css",
|
||||
"utf8",
|
||||
);
|
||||
for (const rule of [
|
||||
".hv-tag",
|
||||
".hv-tag--sm",
|
||||
".hv-tag--lg",
|
||||
".hv-tag--surface",
|
||||
".hv-tag__remove-button",
|
||||
".hv-tag-group",
|
||||
".hv-tag-group__list",
|
||||
".hv-error-message",
|
||||
])
|
||||
assert(css.includes(rule), `missing CSS rule ${rule}`);
|
||||
// The list padding rule must survive minification for Description/ErrorMessage.
|
||||
assert(
|
||||
/\.hv-tag-group\s*\[data-slot=["']?error-message/.test(css),
|
||||
"missing tag-group error-message padding rule",
|
||||
);
|
||||
|
||||
assert.equal(typeof lib.tagVariants({ size: "sm" }).base, "function");
|
||||
assert(lib.tagVariants({ size: "sm" }).base().includes("hv-tag--sm"));
|
||||
assert(
|
||||
lib.tagVariants({ variant: "surface" }).base().includes("hv-tag--surface"),
|
||||
);
|
||||
assert(lib.errorMessageVariants().includes("hv-error-message"));
|
||||
|
||||
console.log("B03 tag/error-message consumption OK");
|
||||
@@ -1,63 +0,0 @@
|
||||
import assert from "node:assert/strict";
|
||||
import fs from "node:fs";
|
||||
import { createSSRApp, h } from "vue";
|
||||
import { renderToString } from "@vue/server-renderer";
|
||||
import { CalendarDate } from "@internationalized/date";
|
||||
import * as ui from "@heroui-vue/components";
|
||||
const names = [
|
||||
"Calendar",
|
||||
"CalendarRoot",
|
||||
"CalendarHeader",
|
||||
"CalendarHeading",
|
||||
"CalendarNavButton",
|
||||
"CalendarGrid",
|
||||
"CalendarGridHeader",
|
||||
"CalendarGridBody",
|
||||
"CalendarHeaderCell",
|
||||
"CalendarCell",
|
||||
"CalendarCellIndicator",
|
||||
"CalendarYearPickerTrigger",
|
||||
"CalendarYearPickerTriggerHeading",
|
||||
"CalendarYearPickerTriggerIndicator",
|
||||
"CalendarYearPickerGrid",
|
||||
"CalendarYearPickerGridBody",
|
||||
"CalendarYearPickerCell",
|
||||
];
|
||||
for (const name of names) assert.ok(ui[name], name);
|
||||
const html = await renderToString(
|
||||
createSSRApp({
|
||||
render: () =>
|
||||
h(
|
||||
ui.Calendar,
|
||||
{
|
||||
defaultValue: new CalendarDate(2024, 2, 29),
|
||||
defaultFocusedValue: new CalendarDate(2024, 2, 29),
|
||||
locale: "en-US",
|
||||
timeZone: "UTC",
|
||||
},
|
||||
() => [
|
||||
h(ui.CalendarHeading),
|
||||
h(ui.CalendarGrid, () => [
|
||||
h(ui.CalendarGridHeader),
|
||||
h(ui.CalendarGridBody),
|
||||
]),
|
||||
h(ui.CalendarYearPickerGrid, () => h(ui.CalendarYearPickerGridBody)),
|
||||
],
|
||||
),
|
||||
}),
|
||||
);
|
||||
assert.match(html, /2024-02-29/);
|
||||
assert.match(html, /data-selected="true"/);
|
||||
assert.match(html, /February 2024/);
|
||||
const css = fs.readFileSync(
|
||||
import.meta.resolve("@heroui-vue/styles/css").replace("file://", ""),
|
||||
"utf8",
|
||||
);
|
||||
for (const token of [
|
||||
".hv-calendar__cell",
|
||||
".hv-calendar--week-view",
|
||||
".hv-calendar--day-view",
|
||||
".hv-calendar-year-picker__year-cell",
|
||||
])
|
||||
assert.ok(css.includes(token), token);
|
||||
console.log("Calendar independent tarball ESM/Node SSR/CSS passed");
|
||||
@@ -1,21 +0,0 @@
|
||||
import assert from "node:assert/strict";
|
||||
import fs from "node:fs";
|
||||
import * as ui from "@heroui-vue/components";
|
||||
const css = fs.readFileSync(
|
||||
new URL(import.meta.resolve("@heroui-vue/styles/css")),
|
||||
"utf8",
|
||||
);
|
||||
for (const name of [
|
||||
".hv-color-field",
|
||||
".hv-color-input-group",
|
||||
".hv-color-input-group__input",
|
||||
".hv-color-input-group--secondary",
|
||||
".hv-color-input-group__prefix",
|
||||
".hv-color-input-group__suffix",
|
||||
])
|
||||
assert.ok(css.includes(name), name);
|
||||
for (const name of ["ColorField", "ColorInputGroup", "ColorPicker"])
|
||||
assert.equal(name in ui, false);
|
||||
console.log(
|
||||
"Color field protocol styles present; unfinished public contracts stay private.",
|
||||
);
|
||||
@@ -1,18 +0,0 @@
|
||||
import assert from "node:assert/strict";
|
||||
import fs from "node:fs";
|
||||
import * as ui from "@heroui-vue/components";
|
||||
const css = fs.readFileSync(
|
||||
new URL(import.meta.resolve("@heroui-vue/styles/css")),
|
||||
"utf8",
|
||||
);
|
||||
assert.ok(css.includes(".hv-color-area"));
|
||||
assert.ok(css.includes(".hv-color-area__thumb"));
|
||||
assert.ok(css.includes("--color-area-thumb-color"));
|
||||
assert.ok(css.includes("data-dragging"));
|
||||
// The new implementation is deliberately private until public contracts and demos land.
|
||||
assert.equal("ColorArea" in ui, false);
|
||||
assert.equal("ColorPicker" in ui, false);
|
||||
assert.equal("parseColor" in ui, false);
|
||||
console.log(
|
||||
"Color foundation tarball: staged CSS present, no public placeholder exports.",
|
||||
);
|
||||
@@ -1,19 +0,0 @@
|
||||
import assert from "node:assert/strict";
|
||||
import fs from "node:fs";
|
||||
import * as ui from "@heroui-vue/components";
|
||||
const css = fs.readFileSync(
|
||||
new URL(import.meta.resolve("@heroui-vue/styles/css")),
|
||||
"utf8",
|
||||
);
|
||||
for (const name of [
|
||||
".hv-color-picker",
|
||||
".hv-color-picker__trigger",
|
||||
".hv-color-picker__popover",
|
||||
"--tw-enter-scale:.95",
|
||||
])
|
||||
assert.ok(css.includes(name), name);
|
||||
for (const name of ["ColorPicker", "ColorPickerTrigger", "ColorPickerPopover"])
|
||||
assert.equal(name in ui, false);
|
||||
console.log(
|
||||
"Picker protocol CSS present; unfinished public exports remain private.",
|
||||
);
|
||||
@@ -1,23 +0,0 @@
|
||||
import assert from "node:assert/strict";
|
||||
import fs from "node:fs";
|
||||
import * as ui from "@heroui-vue/components";
|
||||
const css = fs.readFileSync(
|
||||
new URL(import.meta.resolve("@heroui-vue/styles/css")),
|
||||
"utf8",
|
||||
);
|
||||
for (const marker of [
|
||||
".hv-color-slider",
|
||||
".hv-color-slider__track",
|
||||
".hv-color-slider__thumb",
|
||||
"--track-start-color",
|
||||
"--track-end-color",
|
||||
"--reka-popover-content-available-height",
|
||||
"max-height:inherit",
|
||||
"overscroll-behavior:contain",
|
||||
])
|
||||
assert.ok(css.includes(marker), marker);
|
||||
for (const name of ["ColorSlider", "ColorField", "ColorPicker"])
|
||||
assert.equal(name in ui, false);
|
||||
console.log(
|
||||
"Color slider foundation CSS and Popover constraints present; private components stay private.",
|
||||
);
|
||||
@@ -1,58 +0,0 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { createSSRApp, h } from "vue";
|
||||
import { renderToString } from "@vue/server-renderer";
|
||||
import { parseZonedDateTime } from "@internationalized/date";
|
||||
import * as c from "@heroui-vue/components";
|
||||
import { readFile } from "node:fs/promises";
|
||||
for (const key of [
|
||||
"DateField",
|
||||
"DateFieldRoot",
|
||||
"DateFieldGroup",
|
||||
"DateFieldInput",
|
||||
"DateFieldSegment",
|
||||
"DateFieldPrefix",
|
||||
"DateFieldSuffix",
|
||||
"DateFieldInputContainer",
|
||||
"DateInputGroup",
|
||||
"DateInputGroupInput",
|
||||
"DateInputGroupSegment",
|
||||
"DateInputGroupInputContainer",
|
||||
"DateInputGroupPrefix",
|
||||
"DateInputGroupSuffix",
|
||||
])
|
||||
assert.ok(c[key], key);
|
||||
const date = parseZonedDateTime(
|
||||
"2024-03-10T01:30:45-08:00[America/Los_Angeles]",
|
||||
);
|
||||
const html = await renderToString(
|
||||
createSSRApp({
|
||||
render: () =>
|
||||
h(
|
||||
c.DateField,
|
||||
{ defaultValue: date, granularity: "minute", name: "date" },
|
||||
() => [
|
||||
h(c.Label, () => "Date"),
|
||||
h(c.DateFieldGroup, () => h(c.DateFieldInput)),
|
||||
h(c.Description, () => "Help"),
|
||||
],
|
||||
),
|
||||
}),
|
||||
);
|
||||
assert.ok(
|
||||
html.includes('value="2024-03-10T01:30:45-08:00[America/Los_Angeles]"'),
|
||||
);
|
||||
assert.equal((html.match(/name="date"/g) || []).length, 1);
|
||||
assert.ok(html.includes("aria-labelledby="));
|
||||
assert.ok(html.includes("aria-describedby="));
|
||||
const css = await readFile(
|
||||
import.meta.resolve("@heroui-vue/styles/css").replace("file://", ""),
|
||||
"utf8",
|
||||
);
|
||||
for (const name of [
|
||||
"hv-date-field",
|
||||
"hv-date-input-group",
|
||||
"hv-date-input-group__segment",
|
||||
"hv-date-input-group--secondary",
|
||||
])
|
||||
assert.ok(css.includes(name), name);
|
||||
console.log("DateField tarball ESM/SSR/CSS: passed");
|
||||
@@ -1,52 +0,0 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { createSSRApp, h } from "vue";
|
||||
import { renderToString } from "@vue/server-renderer";
|
||||
import {
|
||||
ListBox,
|
||||
ListBoxItem,
|
||||
ListBoxItemIndicator,
|
||||
ListBoxSection,
|
||||
Header,
|
||||
Label,
|
||||
Description,
|
||||
listboxVariants,
|
||||
listboxItemVariants,
|
||||
} from "@heroui-vue/components";
|
||||
const html = await renderToString(
|
||||
createSSRApp({
|
||||
render: () =>
|
||||
h(ListBox, { modelValue: [0], "aria-label": "People" }, () => [
|
||||
h(ListBoxSection, {}, () => [
|
||||
h(Header, {}, () => "Team"),
|
||||
h(ListBoxItem, { id: 0 }, () => [
|
||||
h(Label, {}, () => "Bob"),
|
||||
h(Description, {}, () => "Details"),
|
||||
h(ListBoxItemIndicator),
|
||||
]),
|
||||
]),
|
||||
h(ListBoxItem, { id: "0" }, () => "Fred"),
|
||||
]),
|
||||
}),
|
||||
);
|
||||
assert.equal((html.match(/aria-selected="true"/g) ?? []).length, 1);
|
||||
assert(html.includes('role="group"'));
|
||||
assert(html.includes('aria-labelledby="'));
|
||||
assert(html.includes('aria-describedby="'));
|
||||
assert(listboxVariants().includes("hv-list-box"));
|
||||
assert(
|
||||
listboxItemVariants().indicator().includes("hv-list-box-item__indicator"),
|
||||
);
|
||||
const css = readFileSync(
|
||||
new URL(import.meta.resolve("@heroui-vue/styles/css")),
|
||||
"utf8",
|
||||
);
|
||||
for (const name of [
|
||||
".hv-list-box",
|
||||
".hv-list-box-item",
|
||||
".hv-list-box-section",
|
||||
])
|
||||
assert(css.includes(name));
|
||||
console.log(
|
||||
"ListBox independent tarball: ESM, SSR, typed selection, labels and CSS passed.",
|
||||
);
|
||||
@@ -1,49 +0,0 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { createSSRApp, h } from "vue";
|
||||
import { renderToString } from "@vue/server-renderer";
|
||||
import {
|
||||
InputOTP,
|
||||
InputOTPGroup,
|
||||
InputOTPSlot,
|
||||
Label,
|
||||
Header,
|
||||
Pagination,
|
||||
PaginationContent,
|
||||
PaginationItem,
|
||||
PaginationLink,
|
||||
} from "@heroui-vue/components";
|
||||
const html = await renderToString(
|
||||
createSSRApp({
|
||||
render: () =>
|
||||
h("div", [
|
||||
h(Header, {}, () => "Heading"),
|
||||
h(Pagination, {}, () =>
|
||||
h(PaginationContent, {}, () =>
|
||||
h(PaginationItem, {}, () =>
|
||||
h(PaginationLink, { "aria-current": "step" }, () => "1"),
|
||||
),
|
||||
),
|
||||
),
|
||||
h(InputOTP, { maxLength: 2, defaultValue: "12", name: "code" }, () => [
|
||||
h(Label, { id: "consumer-label" }, () => "Security code"),
|
||||
h(InputOTPGroup, {}, () => [
|
||||
h(InputOTPSlot, { index: 0 }),
|
||||
h(InputOTPSlot, { index: 1 }),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
}),
|
||||
);
|
||||
assert(html.includes('data-slot="header"'));
|
||||
assert(html.includes('aria-current="step"'));
|
||||
assert.equal(html.match(/aria-labelledby="consumer-label"/g)?.length, 2);
|
||||
assert(html.includes('value="12"'));
|
||||
assert(html.includes('name="code"'));
|
||||
const css = readFileSync(
|
||||
new URL(import.meta.resolve("@heroui-vue/styles/css")),
|
||||
"utf8",
|
||||
);
|
||||
for (const name of ["hv-header", "hv-pagination", "hv-input-otp"])
|
||||
assert(css.includes(name));
|
||||
console.log("M30–M32 independent tarball ESM/SSR/ARIA/CSS passed.");
|
||||
@@ -1,63 +0,0 @@
|
||||
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");
|
||||
@@ -1,78 +0,0 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { createSSRApp, h } from "vue";
|
||||
import { renderToString } from "@vue/server-renderer";
|
||||
import * as lib from "@heroui-vue/components";
|
||||
for (const name of [
|
||||
"Toast",
|
||||
"ToastRoot",
|
||||
"ToastProvider",
|
||||
"ToastContent",
|
||||
"ToastIndicator",
|
||||
"ToastTitle",
|
||||
"ToastDescription",
|
||||
"ToastActionButton",
|
||||
"ToastCloseButton",
|
||||
"ToastQueue",
|
||||
"toast",
|
||||
"toastQueue",
|
||||
"createToastFunction",
|
||||
"Table",
|
||||
"TableRoot",
|
||||
"TableContent",
|
||||
"TableHeader",
|
||||
"TableColumn",
|
||||
"TableBody",
|
||||
"TableRow",
|
||||
"TableCell",
|
||||
"TableScrollContainer",
|
||||
"TableFooter",
|
||||
"TableResizableContainer",
|
||||
"TableColumnResizer",
|
||||
"TableLoadMore",
|
||||
"TableLoadMoreItem",
|
||||
"TableLoadMoreContent",
|
||||
"TableCollection",
|
||||
"TableSortableColumnHeader",
|
||||
])
|
||||
assert(lib[name], name);
|
||||
assert.equal(lib.toast("server secret"), "");
|
||||
assert.equal(lib.toastQueue.visibleToasts.length, 0);
|
||||
const queue = new lib.ToastQueue();
|
||||
queue.add({ title: "Request-local notification" });
|
||||
const html = await renderToString(
|
||||
createSSRApp({
|
||||
render: () =>
|
||||
h("main", [
|
||||
h(lib.ToastProvider, { queue }),
|
||||
h(lib.Table, () =>
|
||||
h(
|
||||
lib.TableContent,
|
||||
{ selectionMode: "single", selectedKeys: [0] },
|
||||
() => [
|
||||
h(lib.TableHeader, () =>
|
||||
h(lib.TableColumn, { isRowHeader: true }, () => "Name"),
|
||||
),
|
||||
h(lib.TableBody, () =>
|
||||
h(lib.TableRow, { rowKey: 0 }, () =>
|
||||
h(lib.TableCell, () => "Zero"),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
]),
|
||||
}),
|
||||
);
|
||||
assert(html.includes("Request-local notification"));
|
||||
assert(html.includes('scope="row"'));
|
||||
assert(html.includes('aria-selected="true"'));
|
||||
queue.destroy();
|
||||
const css = readFileSync(
|
||||
new URL(import.meta.resolve("@heroui-vue/styles/css")),
|
||||
"utf8",
|
||||
);
|
||||
assert(css.includes(".hv-toast-region"));
|
||||
assert(css.includes(".hv-table__column-resizer"));
|
||||
assert(css.includes("data-exiting"));
|
||||
console.log("M35/M36 tarball exports, actual node SSR and CSS passed");
|
||||
@@ -1,70 +0,0 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { createSSRApp, h } from "vue";
|
||||
import { renderToString } from "@vue/server-renderer";
|
||||
import {
|
||||
Select,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
SelectIndicator,
|
||||
SelectClearButton,
|
||||
SelectPopover,
|
||||
ListBox,
|
||||
ListBoxItem,
|
||||
Label,
|
||||
selectVariants,
|
||||
} from "@heroui-vue/components";
|
||||
const html = await renderToString(
|
||||
createSSRApp({
|
||||
render: () =>
|
||||
h(
|
||||
Select,
|
||||
{
|
||||
defaultValue: [0, "0", ""],
|
||||
selectionMode: "multiple",
|
||||
name: "choices",
|
||||
},
|
||||
() => [
|
||||
h(Label, {}, () => "Choice"),
|
||||
h(SelectTrigger, {}, () => [
|
||||
h(SelectValue),
|
||||
h(SelectClearButton),
|
||||
h(SelectIndicator),
|
||||
]),
|
||||
h(SelectPopover, {}, () =>
|
||||
h(ListBox, {}, () => [
|
||||
h(ListBoxItem, { id: 0, textValue: "Numeric" }, () => "Numeric"),
|
||||
h(ListBoxItem, { id: "0", textValue: "String" }, () => "String"),
|
||||
h(ListBoxItem, { id: "", textValue: "Empty" }, () => "Empty"),
|
||||
]),
|
||||
),
|
||||
],
|
||||
),
|
||||
}),
|
||||
);
|
||||
assert(html.includes("Numeric, String, Empty"));
|
||||
assert(html.includes('name="choices"'));
|
||||
assert.equal((html.match(/data-index="\d" selected/g) ?? []).length, 3);
|
||||
assert(!html.includes('role="listbox"'));
|
||||
assert(html.includes('aria-haspopup="listbox"'));
|
||||
assert(
|
||||
selectVariants({ variant: "secondary" })
|
||||
.base()
|
||||
.includes("hv-select--secondary"),
|
||||
);
|
||||
const css = readFileSync(
|
||||
new URL(import.meta.resolve("@heroui-vue/styles/css")),
|
||||
"utf8",
|
||||
);
|
||||
for (const part of [
|
||||
".hv-select",
|
||||
".hv-select__trigger",
|
||||
".hv-select__value",
|
||||
".hv-select__clear-button",
|
||||
".hv-select__indicator",
|
||||
".hv-select__popover",
|
||||
])
|
||||
assert(css.includes(part));
|
||||
console.log(
|
||||
"Select independent tarball: ESM, SSR labels, raw native values, variants and CSS passed.",
|
||||
);
|
||||
@@ -1,45 +0,0 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { createSSRApp, h } from "vue";
|
||||
import { renderToString } from "@vue/server-renderer";
|
||||
import {
|
||||
Slider,
|
||||
SliderTrack,
|
||||
SliderFill,
|
||||
SliderThumb,
|
||||
SliderOutput,
|
||||
SliderMarks,
|
||||
Label,
|
||||
sliderVariants,
|
||||
} from "@heroui-vue/components";
|
||||
const html = await renderToString(
|
||||
createSSRApp({
|
||||
render: () =>
|
||||
h(Slider, { defaultValue: [20, 80], dir: "rtl" }, () => [
|
||||
h(Label, {}, () => "Price"),
|
||||
h(SliderOutput),
|
||||
h(SliderTrack, {}, () => [
|
||||
h(SliderFill),
|
||||
h(SliderThumb, { name: "min" }),
|
||||
h(SliderThumb, { name: "max", index: 1 }),
|
||||
]),
|
||||
h(SliderMarks),
|
||||
]),
|
||||
}),
|
||||
);
|
||||
assert(html.includes('aria-valuenow="20"'));
|
||||
assert(html.includes('aria-valuenow="80"'));
|
||||
assert(html.includes("right:20%"));
|
||||
assert(html.includes('name="min"'));
|
||||
assert(html.includes('name="max"'));
|
||||
const css = readFileSync(
|
||||
new URL(import.meta.resolve("@heroui-vue/styles/css")),
|
||||
"utf8",
|
||||
);
|
||||
assert(css.includes(".hv-slider__track"));
|
||||
assert(css.includes("prefers-reduced-motion"));
|
||||
assert(!css.includes(".hv-slider__thumb:after:not(:is())"));
|
||||
assert(sliderVariants().thumb().includes("hv-slider__thumb"));
|
||||
console.log(
|
||||
"Independent tarball consumer: ESM, SSR, CSS and six named parts passed.",
|
||||
);
|
||||
Reference in New Issue
Block a user