feat(combo-box): migrate ComboBox with input-owned focus and filtering

Port the fixed-baseline ComboBox onto the B02a collection protocol: the input
keeps real DOM focus, the list only tracks an active row, and filtering reuses
the owner filter instead of a second collection kernel.

- Five parts: root (field text control, value/input/open models, form value,
  owner wiring), InputGroup (composes the caller's Input into the combobox
  control and anchors the popover), Trigger, Value, Popover.
- Closed-state metadata is planned from the slot tree, so filtering, the initial
  value label and form-value="text" work before the list has mounted.
- Selection text syncs on selection changes only, so allows-custom-value typing
  is not overwritten; read-only and disabled are injected onto the composed
  input because it reads the text-field protocol, not the field context.
- 24 baseline previews, the Chinese doc page, navigation, 19 behaviour tests and
  6 demo/document contracts. Async demo uses a local async source with abort,
  loading and incremental append (documented adaptations).

Not included: independent tarball consumption (B02d).
This commit is contained in:
maoyingjie
2026-10-25 16:59:16 +08:00
parent ff486fb665
commit 46e4df7e85
46 changed files with 4322 additions and 2 deletions
+24
View File
@@ -1676,3 +1676,27 @@ export const errorMessageVariants = tv({
});
export type ErrorMessageVariants = VariantProps<typeof errorMessageVariants>;
export const comboBoxVariants = tv({
defaultVariants: {
fullWidth: false,
},
slots: {
base: "hv-combo-box",
inputGroup: "hv-combo-box__input-group",
popover: "hv-combo-box__popover",
trigger: "hv-combo-box__trigger",
value: "hv-combo-box__value",
},
variants: {
fullWidth: {
false: {},
true: {
base: "hv-combo-box--full-width",
inputGroup: "hv-combo-box__input-group--full-width",
},
},
},
});
export type ComboBoxVariants = VariantProps<typeof comboBoxVariants>;