feat: migrate Tag, TagGroup and ErrorMessage with collection and focus contracts
Port the fixed HeroUI baseline tag/tag-group/error-message components onto the existing collection selection/registry protocols instead of a second state model. - TagGroup owns selection, disabled scope, removal requests and name/description wiring; TagGroupList renders the role=grid node and Tag renders role=row. - Removal has one path: a press inside the remove subtree is a removal request, so custom remove buttons work without a second event source; focus follows the next neighbour only after the item is actually gone. - ErrorMessage keeps the baseline slot marker and reuses the field part ids without gaining validation or aria-invalid semantics. - Ship the 12 tag-group and 2 error-message previews, both doc pages, navigation, a 35-case behavioural suite and independent tarball consumption checks.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<script setup lang="ts">
|
||||
import { useAttrs } from "vue";
|
||||
import { errorMessageVariants } from "@heroui-vue/styles";
|
||||
import { useFieldPart } from "../field/useFieldPart";
|
||||
|
||||
defineOptions({ name: "ErrorMessage", inheritAttrs: false });
|
||||
// The `slot` attribute mirrors the fixed baseline's RAC Text slot. In Vue it is
|
||||
// a plain DOM attribute (a CSS hook), not a slot assignment.
|
||||
|
||||
const attrs = useAttrs();
|
||||
const { id } = useFieldPart("error", attrs);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<p
|
||||
v-bind="attrs"
|
||||
:id="id"
|
||||
:class="errorMessageVariants()"
|
||||
slot="errorMessage"
|
||||
data-slot="error-message"
|
||||
>
|
||||
<slot />
|
||||
</p>
|
||||
</template>
|
||||
Reference in New Issue
Block a user