feat(autocomplete): migrate Autocomplete with popover-owned filtering

Port the fixed-baseline Autocomplete onto the B02a collection protocol. The
trigger is the single Tab entry; opening moves focus to the search box inside the
popover, which owns filtering, aria-activedescendant and keyboard navigation
while the list only tracks an active row.

- Seven parts: root (field, value/open models, form value, owner wiring),
  trigger (anchor + activation), value (scoped slot with selectedItems and
  selectedText instead of copied item subtrees), indicator, clear button,
  popover (measured trigger width), filter (owns the search text and composes the
  inner SearchFieldInput into the combobox control).
- Filter exposes input-value/update:inputValue/inputChange, matching ComboBox.
- Confirming the active row in multiple mode now toggles it instead of replacing
  the accepted set (ComboBox shared the same bug).
- ComboBox shows the accepted label on the first render via a display value that
  falls back to the selected record, so preselected fields are readable before
  the selection watcher runs (including SSR).
- Popovers measure the anchor with a ResizeObserver because Reka does not publish
  the anchor size; the caller's root class is merged again so the trigger fills
  the field width.
- 24 baseline previews, Chinese doc page, navigation, 17 behaviour tests, 5
  demo/document contracts and an independent tarball consumption script for both
  pickers.

Not included: the full bundler/NodeNext type matrix (B02d).
This commit is contained in:
maoyingjie
2026-10-25 17:20:17 +08:00
parent 46e4df7e85
commit 5e688680e9
53 changed files with 5730 additions and 11 deletions
+187
View File
@@ -0,0 +1,187 @@
import { afterEach, describe, expect, it, vi } from "vitest";
import { mount } from "@vue/test-utils";
import { nextTick, type Component } from "vue";
import { readFileSync } from "node:fs";
const settle = () => new Promise((resolve) => setTimeout(resolve, 6));
const mounted: { unmount: () => void }[] = [];
const previews = [
"default",
"variants",
"full-width",
"with-description",
"required",
"disabled",
"with-disabled-options",
"allows-empty-collection",
"with-sections",
"multiple-select",
"controlled",
"controlled-multiple",
"controlled-open-state",
"asynchronous-filtering",
"custom-indicator",
"custom-value",
"on-surface",
"virtualization",
"user-selection",
"user-selection-multiple",
"location-search",
"tag-group-selection",
"email-recipients",
"custom-styles",
];
afterEach(async () => {
while (mounted.length) mounted.pop()?.unmount();
await nextTick();
await settle();
vi.restoreAllMocks();
document.body.innerHTML = "";
});
describe("Autocomplete docs and demos", () => {
it("keeps the pinned preview order and one demo per preview", () => {
const document = readFileSync(
"apps/docs/components/autocomplete.md",
"utf8",
);
const names = [
...document.matchAll(/<ComponentPreview name="autocomplete-([^"]+)"/g),
].map((match) => match[1]);
expect(names).toEqual(previews);
for (const name of previews) {
const source = readFileSync(
`apps/docs/demos/autocomplete-${name}.vue`,
"utf8",
);
expect(source, name).toContain("<template>");
expect(source, name).not.toContain("className");
expect(source, name).not.toContain("@gravity-ui/icons");
expect(source, name).not.toContain("<path");
}
});
it("documents Vue props instead of React ones", () => {
const document = readFileSync(
"apps/docs/components/autocomplete.md",
"utf8",
);
expect(document).not.toMatch(/\|\s*`className`\s*\|/);
expect(document).toContain("`class`");
expect(document).toContain("Vue class 绑定");
for (const part of [
"AutocompleteTrigger",
"AutocompleteValue",
"AutocompleteIndicator",
"AutocompleteClearButton",
"AutocompletePopover",
"AutocompleteFilter",
])
expect(document, part).toContain(`### ${part}`);
expect(document).not.toContain("[!toc]");
// React object-style part names must not appear as API table entries.
expect(document).not.toMatch(/\|\s*`Autocomplete\.[A-Z]\w*`\s*\|/);
});
it("mounts every demo with a named trigger", async () => {
const modules = import.meta.glob("../apps/docs/demos/autocomplete-*.vue");
expect(Object.keys(modules)).toHaveLength(previews.length);
for (const [path, load] of Object.entries(modules)) {
const demo = (await load()) as { default: Component };
const wrapper = mount(demo.default, { attachTo: document.body });
mounted.push(wrapper);
await nextTick();
const triggers = (wrapper.element as HTMLElement).querySelectorAll(
'[data-slot="autocomplete-trigger"]',
);
expect(triggers.length, path).toBeGreaterThan(0);
for (const element of triggers) {
expect(element.getAttribute("role"), path).toBe("button");
expect(element.getAttribute("aria-expanded"), path).toBe("false");
}
wrapper.unmount();
mounted.pop();
await settle();
document.body.innerHTML = "";
}
});
it("opens and filters inside representative demos", async () => {
for (const name of [
"default",
"multiple-select",
"with-sections",
"custom-styles",
"virtualization",
]) {
const demo = (await import(
`../apps/docs/demos/autocomplete-${name}.vue`
)) as { default: Component };
const wrapper = mount(demo.default, { attachTo: document.body });
mounted.push(wrapper);
await nextTick();
await settle();
const trigger = (
wrapper.element as HTMLElement
).querySelector<HTMLElement>('[data-slot="autocomplete-trigger"]')!;
trigger.dispatchEvent(new MouseEvent("click", { bubbles: true }));
await nextTick();
await settle();
const search = document.querySelector<HTMLInputElement>(
'[data-slot="search-field-input"]',
);
expect(search, name).not.toBeNull();
expect(trigger.getAttribute("aria-expanded"), name).toBe("true");
const id = search!.getAttribute("aria-activedescendant");
expect(id, name).toBeTruthy();
expect(document.getElementById(id!)?.getAttribute("role"), name).toBe(
"option",
);
wrapper.unmount();
mounted.pop();
await settle();
document.body.innerHTML = "";
}
});
it("submits the required and name demos", async () => {
const formDemo =
(await import("../apps/docs/demos/autocomplete-required.vue")) as {
default: Component;
};
const wrapper = mount(formDemo.default, { attachTo: document.body });
mounted.push(wrapper);
await nextTick();
await settle();
const hidden = [
...(wrapper.element as HTMLElement).querySelectorAll<HTMLInputElement>(
'input[type="hidden"][name]',
),
];
expect(hidden.map((input) => input.name).sort()).toEqual([
"country",
"state",
]);
// `Form` renders novalidate and guards submit itself: an empty required
// field must keep the demo's status line empty.
const root = wrapper.element as HTMLElement;
const form = (root.matches("form") ? root : root.querySelector("form"))!;
const submit = (
wrapper.element as HTMLElement
).querySelector<HTMLButtonElement>('button[type="submit"]')!;
submit.click();
await nextTick();
expect(form.getAttribute("novalidate")).not.toBeNull();
expect(
(wrapper.element as HTMLElement)
.querySelector('[role="status"]')
?.textContent?.trim() ?? "",
).toBe("");
wrapper.unmount();
mounted.pop();
});
});
+666
View File
@@ -0,0 +1,666 @@
import { afterEach, describe, expect, it, vi } from "vitest";
import { mount } from "@vue/test-utils";
import { defineComponent, h, nextTick, ref, type Component } from "vue";
import {
Autocomplete,
AutocompleteClearButton,
AutocompleteFilter,
AutocompleteIndicator,
AutocompletePopover,
AutocompleteTrigger,
AutocompleteValue,
Form,
Label,
ListBox,
ListBoxItem,
SearchField,
SearchFieldGroup,
SearchFieldInput,
SearchFieldSearchIcon,
} from "../packages/vue/src";
const settle = () => new Promise((resolve) => setTimeout(resolve, 4));
const mounted: { unmount: () => void }[] = [];
type State = { id: string | number; name: string; disabled?: boolean };
const states: State[] = [
{ id: "california", name: "California" },
{ id: "texas", name: "Texas" },
{ id: "florida", name: "Florida" },
];
function shell(
props: Record<string, unknown>,
options: { states?: State[]; empty?: boolean; description?: boolean } = {},
emits: Record<string, unknown> = {},
) {
const items = options.states ?? states;
return mount(
defineComponent({
setup() {
return () =>
h(
Autocomplete,
{
"aria-label": "州",
placeholder: "选择州/省",
...emits,
...props,
},
{
default: () => [
h(Label, () => "州"),
h(AutocompleteTrigger, null, {
default: () => [
h(AutocompleteValue),
h(AutocompleteClearButton),
h(AutocompleteIndicator),
],
}),
h(AutocompletePopover, null, {
default: () =>
h(AutocompleteFilter, null, {
default: () => [
h(
SearchField,
{ "aria-label": "搜索州名" },
{
default: () =>
h(SearchFieldGroup, null, {
default: () => [
h(SearchFieldSearchIcon),
h(SearchFieldInput, {
placeholder: "搜索州名…",
}),
],
}),
},
),
h(ListBox, null, {
default: () =>
items.map((state) =>
h(
ListBoxItem,
{
id: state.id,
key: state.id,
textValue: state.name,
isDisabled: state.disabled,
},
() => state.name,
),
),
empty: () =>
h("p", { "data-test": "empty" }, "未找到结果"),
}),
],
}),
}),
],
},
);
},
}),
{ attachTo: document.body },
);
}
function track(wrapper: { unmount: () => void }) {
mounted.push(wrapper);
return wrapper;
}
const trigger = () =>
document.querySelector<HTMLElement>('[data-slot="autocomplete-trigger"]')!;
const search = () =>
document.querySelector<HTMLInputElement>('[data-slot="search-field-input"]')!;
const valueText = () =>
document
.querySelector('[data-slot="autocomplete-value"]')
?.textContent?.trim();
const rowTexts = () =>
[...document.querySelectorAll('[role="option"]')]
.filter((row) => !row.hasAttribute("data-filtered"))
.map((row) => row.textContent?.trim());
async function open(wrapper?: { unmount: () => void }) {
void wrapper;
trigger().dispatchEvent(new MouseEvent("click", { bubbles: true }));
await nextTick();
await settle();
}
async function press(key: string, init: KeyboardEventInit = {}) {
search().dispatchEvent(
new KeyboardEvent("keydown", {
key,
bubbles: true,
cancelable: true,
...init,
}),
);
await nextTick();
await settle();
}
async function type(text: string) {
const element = search();
element.value = text;
element.dispatchEvent(new Event("input", { bubbles: true }));
await nextTick();
await settle();
}
afterEach(async () => {
while (mounted.length) mounted.pop()?.unmount();
await nextTick();
await settle();
vi.restoreAllMocks();
document.body.innerHTML = "";
});
describe("Autocomplete trigger", () => {
it("is the single tab entry with placeholder and value semantics", async () => {
track(shell({}));
await nextTick();
await settle();
const element = trigger();
expect(element.getAttribute("role")).toBe("button");
expect(element.getAttribute("tabindex")).toBe("0");
expect(element.getAttribute("aria-haspopup")).toBe("listbox");
expect(element.getAttribute("aria-expanded")).toBe("false");
expect(valueText()).toBe("选择州/省");
expect(
document
.querySelector('[data-slot="autocomplete-clear-button"]')!
.getAttribute("tabindex"),
).toBe("-1");
});
it("opens on click, focuses the search box and filters from there", async () => {
track(shell({}));
await nextTick();
await settle();
await open();
expect(trigger().getAttribute("aria-expanded")).toBe("true");
expect(document.activeElement).toBe(search());
expect(search().getAttribute("role")).toBe("combobox");
const id = search().getAttribute("aria-activedescendant");
expect(document.getElementById(id!)?.getAttribute("role")).toBe("option");
await type("Te");
expect(rowTexts()).toEqual(["Texas"]);
expect(document.activeElement).toBe(search());
const active = search().getAttribute("aria-activedescendant");
expect(document.getElementById(active!)?.textContent?.trim()).toBe("Texas");
});
it("selects with Enter, closes and restores focus to the trigger", async () => {
const onChange = vi.fn();
track(shell({}, {}, { onChange }));
await nextTick();
await settle();
await open();
await type("Te");
await press("Enter");
expect(onChange).toHaveBeenLastCalledWith("texas");
expect(trigger().getAttribute("aria-expanded")).toBe("false");
expect(valueText()).toBe("Texas");
expect(document.activeElement).toBe(trigger());
});
it("closes on Escape and on Tab without selecting", async () => {
const onChange = vi.fn();
track(shell({}, {}, { onChange }));
await nextTick();
await settle();
await open();
await press("Escape");
expect(trigger().getAttribute("aria-expanded")).toBe("false");
expect(document.activeElement).toBe(trigger());
await open();
await press("Tab");
expect(trigger().getAttribute("aria-expanded")).toBe("false");
expect(onChange).not.toHaveBeenCalled();
});
it("does not confirm while an IME composition is active", async () => {
const onChange = vi.fn();
track(shell({}, {}, { onChange }));
await nextTick();
await settle();
await open();
await press("Enter", { isComposing: true });
await press("Enter", { keyCode: 229 });
expect(onChange).not.toHaveBeenCalled();
});
it("clears the selection from the clear button", async () => {
const onChange = vi.fn();
const clear = vi.fn();
track(shell({ defaultValue: "texas" }, {}, { onChange, onClear: clear }));
await nextTick();
await settle();
expect(valueText()).toBe("Texas");
document
.querySelector<HTMLElement>('[data-slot="autocomplete-clear-button"]')!
.dispatchEvent(new MouseEvent("click", { bubbles: true }));
await nextTick();
await settle();
expect(onChange).toHaveBeenLastCalledWith(null);
expect(clear).toHaveBeenCalledTimes(1);
expect(valueText()).toBe("选择州/省");
expect(trigger().getAttribute("aria-expanded")).toBe("false");
});
it("stays closed and non-tabbable while disabled", async () => {
track(shell({ isDisabled: true }));
await nextTick();
await settle();
expect(trigger().getAttribute("tabindex")).toBe("-1");
expect(trigger().getAttribute("aria-disabled")).toBe("true");
await open();
expect(trigger().getAttribute("aria-expanded")).toBe("false");
});
it("skips disabled keys while navigating", async () => {
const onChange = vi.fn();
track(
shell(
{},
{
states: [
{ id: "california", name: "California", disabled: true },
{ id: "texas", name: "Texas" },
],
},
{ onChange },
),
);
await nextTick();
await settle();
await open();
await press("Enter");
expect(onChange).toHaveBeenLastCalledWith("texas");
});
});
describe("Autocomplete state", () => {
it("shows the empty channel when nothing matches", async () => {
track(shell({}));
await nextTick();
await settle();
await open();
await type("zzz");
expect(rowTexts()).toEqual([]);
expect(document.querySelector('[data-test="empty"]')).not.toBeNull();
});
it("opens an empty collection only when allowed", async () => {
track(shell({ allowsEmptyCollection: true }, { states: [] }));
await nextTick();
await settle();
await open();
expect(trigger().getAttribute("aria-expanded")).toBe("true");
expect(document.querySelector('[data-test="empty"]')).not.toBeNull();
});
it("follows a controlled open state", async () => {
const openState = ref(false);
const onOpenChange = vi.fn((value: boolean) => (openState.value = value));
track(
mount(
defineComponent({
setup() {
return () =>
h(
Autocomplete,
{
"aria-label": "州",
isOpen: openState.value,
onOpenChange,
},
{
default: () => [
h(AutocompleteTrigger, null, {
default: () => [h(AutocompleteValue)],
}),
h(AutocompletePopover, null, {
default: () =>
h(AutocompleteFilter, null, {
default: () => [
h(
SearchField,
{ "aria-label": "搜索" },
{
default: () =>
h(SearchFieldGroup, null, {
default: () => [h(SearchFieldInput)],
}),
},
),
h(ListBox, null, {
default: () =>
states.map((state) =>
h(
ListBoxItem,
{
id: state.id,
key: state.id,
textValue: state.name,
},
() => state.name,
),
),
}),
],
}),
}),
],
},
);
},
}),
{ attachTo: document.body },
) as never,
);
await nextTick();
await settle();
await open();
expect(onOpenChange).toHaveBeenCalledWith(true);
// The parent accepted the proposal, so the controlled state is open.
expect(trigger().getAttribute("aria-expanded")).toBe("true");
openState.value = false;
await nextTick();
await settle();
expect(trigger().getAttribute("aria-expanded")).toBe("false");
});
it("keeps the value when the parent rejects the proposal", async () => {
const onChange = vi.fn();
track(shell({ value: null }, {}, { onChange }));
await nextTick();
await settle();
await open();
await press("Enter");
expect(onChange).toHaveBeenCalledWith("california");
expect(valueText()).toBe("选择州/省");
});
it("accumulates multiple selections and renders tags", async () => {
const selected = ref<(string | number)[]>([]);
track(
mount(
defineComponent({
setup() {
return () =>
h(
Autocomplete,
{
"aria-label": "州",
selectionMode: "multiple",
modelValue: selected.value,
"onUpdate:modelValue": (value: unknown) => {
selected.value = (value ?? []) as (string | number)[];
},
},
{
default: () => [
h(AutocompleteTrigger, null, {
default: () => [h(AutocompleteValue)],
}),
h(AutocompletePopover, null, {
default: () =>
h(AutocompleteFilter, null, {
default: () => [
h(
SearchField,
{ "aria-label": "搜索" },
{
default: () =>
h(SearchFieldGroup, null, {
default: () => [h(SearchFieldInput)],
}),
},
),
h(
ListBox,
{ selectionMode: "multiple" },
{
default: () =>
states.map((state) =>
h(
ListBoxItem,
{
id: state.id,
key: state.id,
textValue: state.name,
},
() => state.name,
),
),
},
),
],
}),
}),
],
},
);
},
}),
{ attachTo: document.body },
) as never,
);
await nextTick();
await settle();
await open();
await press("Enter");
await press("ArrowDown");
await press("Enter");
expect(selected.value).toEqual(["california", "texas"]);
// Multi-select keeps the popover open for further picks.
expect(trigger().getAttribute("aria-expanded")).toBe("true");
expect(
[
...document.querySelectorAll('[role="option"][aria-selected="true"]'),
].map((row) => row.textContent?.trim()),
).toEqual(["California", "Texas"]);
});
});
describe("Autocomplete form and validation", () => {
it("submits the selected key through a hidden input", async () => {
const wrapper = mount(
defineComponent({
setup() {
const submitted = ref("");
return () =>
h(
Form,
{
onSubmit: (event: Event) => {
event.preventDefault();
const data = new FormData(
event.currentTarget as HTMLFormElement,
);
submitted.value = String(data.get("state"));
},
},
{
default: () => [
h(
Autocomplete,
{
"aria-label": "州",
name: "state",
defaultValue: "texas",
},
{
default: () => [
h(AutocompleteTrigger, null, {
default: () => [h(AutocompleteValue)],
}),
h(AutocompletePopover, null, {
default: () =>
h(AutocompleteFilter, null, {
default: () => [
h(
SearchField,
{ "aria-label": "搜索" },
{
default: () =>
h(SearchFieldGroup, null, {
default: () => [h(SearchFieldInput)],
}),
},
),
h(ListBox, null, {
default: () =>
states.map((state) =>
h(
ListBoxItem,
{
id: state.id,
key: state.id,
textValue: state.name,
},
() => state.name,
),
),
}),
],
}),
}),
],
},
),
h(
"button",
{ type: "submit", "data-test": "submit" },
"提交",
),
h("p", { "data-test": "result" }, submitted.value),
],
},
);
},
}),
{ attachTo: document.body },
);
mounted.push(wrapper as never);
await nextTick();
await settle();
(
document.querySelector('[data-test="submit"]') as HTMLButtonElement
).click();
await nextTick();
expect(document.querySelector('[data-test="result"]')!.textContent).toBe(
"texas",
);
});
it("blocks native submit when required and empty", async () => {
const wrapper = mount(
defineComponent({
setup() {
return () =>
h(
Form,
{ onSubmit: (event: Event) => event.preventDefault() },
{
default: () => [
h(
Autocomplete,
{
"aria-label": "州",
name: "state",
isRequired: true,
},
{
default: () => [
h(Label, () => "州"),
h(AutocompleteTrigger, null, {
default: () => [h(AutocompleteValue)],
}),
h(AutocompletePopover, null, {
default: () =>
h(AutocompleteFilter, null, {
default: () => [
h(
SearchField,
{ "aria-label": "搜索" },
{
default: () =>
h(SearchFieldGroup, null, {
default: () => [h(SearchFieldInput)],
}),
},
),
h(ListBox, null, {
default: () =>
states.map((state) =>
h(
ListBoxItem,
{
id: state.id,
key: state.id,
textValue: state.name,
},
() => state.name,
),
),
}),
],
}),
}),
],
},
),
h(
"button",
{ type: "submit", "data-test": "submit" },
"提交",
),
],
},
);
},
}),
{ attachTo: document.body },
);
mounted.push(wrapper as never);
await nextTick();
await settle();
const form = document.querySelector("form")!;
expect(form.checkValidity()).toBe(false);
});
});
describe("Autocomplete composition", () => {
it("keeps a caller-provided aria-label on the trigger and search box", async () => {
track(shell({}));
await nextTick();
await settle();
expect(trigger().getAttribute("aria-label")).toBe("州");
await open();
expect(search().getAttribute("aria-label")).toBe("州");
});
it("mounts as a reusable component surface", async () => {
const surface: Component = (
await import("../apps/docs/demos/autocomplete-multiple-select.vue")
).default;
const wrapper = mount(surface, { attachTo: document.body });
track(wrapper as never);
await nextTick();
await settle();
expect(trigger().getAttribute("aria-expanded")).toBe("false");
expect(valueText()).toBe("选择州/省");
});
});
+159
View File
@@ -0,0 +1,159 @@
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");