merge: integrate public collection picker migration

# Conflicts:
#	AGENTS.md
#	docs/compatibility.md
#	docs/upstream.md
#	docs/verification.md
#	package.json
#	packages/styles/src/index.ts
#	packages/vue/src/index.ts
#	packages/vue/src/types.ts
#	tests/package/README.md
This commit is contained in:
maoyingjie
2026-10-25 20:55:18 +08:00
201 changed files with 25848 additions and 48 deletions
+287
View File
@@ -0,0 +1,287 @@
/* Adapted from HeroUI v3, ce90ea3. Copyright 2025 NextUI Inc.
* See third-party/HEROUI-LICENSE. Modified: hv- class prefix. */
/* Autocomplete styles */
.hv-autocomplete {
@apply flex flex-col gap-1;
}
.hv-autocomplete__trigger {
@apply relative isolate inline-flex min-h-9 rounded-field border bg-field px-3 py-2 text-sm text-field-foreground shadow-field outline-none select-none no-highlight;
/**
* Transitions
* CRITICAL: motion-reduce must be AFTER transition for correct override specificity
*/
transition:
background-color 150ms var(--ease-smooth),
border-color 150ms var(--ease-smooth),
box-shadow 150ms var(--ease-out);
@apply motion-reduce:transition-none;
/* Cursor */
cursor: var(--cursor-interactive);
border-width: var(--border-width-field);
border-color: var(--field-border);
/* Add inline-end padding when indicator is present */
&:has(.hv-autocomplete__indicator) {
@apply pe-7;
}
/* Hover state - exclude when clear button is hovered to prevent double hover effect */
@media (hover: hover) {
&:hover:not(:has(.hv-autocomplete__clear-button:hover)),
&[data-hovered="true"]:not(:has(.hv-autocomplete__clear-button:hover)) {
@apply bg-field-hover;
border-color: var(--field-border-hover);
}
}
/* Focus visible state */
&:focus-visible:not([data-focused]),
&[data-focus-visible="true"] {
@apply status-focused;
border-color: var(--field-border-focus);
background-color: var(--field-focus);
}
/* Focus state */
&:focus,
&[data-focus="true"] {
}
/* Invalid state */
.hv-autocomplete[data-invalid="true"] &,
.hv-autocomplete[aria-invalid="true"] & {
@apply status-invalid-field;
background-color: var(--field-focus);
}
/* Disabled state */
&:disabled,
&[data-disabled="true"],
&[aria-disabled="true"] {
@apply status-disabled;
}
}
/* Variant property definitions */
.hv-autocomplete--primary {
/* Default styles */
}
.hv-autocomplete--secondary .hv-autocomplete__trigger {
@apply shadow-none;
background-color: var(--hv-autocomplete-trigger-bg);
--hv-autocomplete-trigger-bg: var(--default);
--hv-autocomplete-trigger-bg-hover: var(--default-hover);
--hv-autocomplete-trigger-bg-focus: var(--default);
/* Exclude when clear button is hovered to prevent double hover effect */
@media (hover: hover) {
&:hover:not(:has(.hv-autocomplete__clear-button:hover)),
&[data-hovered="true"]:not(:has(.hv-autocomplete__clear-button:hover)) {
background-color: var(--hv-autocomplete-trigger-bg-hover);
}
}
&:focus-visible:not([data-focused]),
&[data-focus-visible="true"] {
background-color: var(--hv-autocomplete-trigger-bg-focus);
}
&:focus,
&[data-focus="true"] {
}
.hv-autocomplete[data-invalid="true"] &,
.hv-autocomplete[aria-invalid="true"] & {
background-color: var(--hv-autocomplete-trigger-bg-focus);
}
}
.hv-autocomplete__value {
@apply flex-1 text-start text-base wrap-break-word text-current sm:text-sm;
&[data-placeholder="true"] {
@apply text-field-placeholder;
}
/* Removes the list-box-item indicator element from the hv-autocomplete value*/
[data-slot="list-box-item-indicator"] {
@apply hidden;
}
}
.hv-autocomplete__indicator {
@apply absolute inset-y-0 end-2 my-auto flex shrink-0 items-center justify-center text-field-placeholder transition duration-150;
/* Cursor */
cursor: var(--cursor-interactive);
&[data-open="true"] {
@apply rotate-180;
}
&[data-slot="autocomplete-default-indicator"] {
@apply size-4;
}
}
/* Similar to popover content styles */
.hv-autocomplete__popover {
@apply flex w-(--trigger-width) max-w-(--trigger-width) origin-(--trigger-anchor-point) scroll-py-1 flex-col overflow-hidden overscroll-contain bg-overlay p-0 pt-2 text-sm outline-none;
border-radius: min(32px, var(--radius-3xl));
box-shadow: var(--overlay-shadow);
&:focus,
&:focus-visible:not([data-focused]),
&[data-focus-visible="true"] {
@apply outline-none;
}
/* Entering animations */
&[data-entering="true"] {
@apply animate-in duration-250 ease-out-fluid fade-in-0 zoom-in-95;
/* Placement-specific translations */
&[data-placement="top"] {
@apply slide-in-from-bottom-1;
}
&[data-placement="bottom"] {
@apply slide-in-from-top-1;
}
&[data-placement="left"] {
@apply slide-in-from-right-1;
}
&[data-placement="right"] {
@apply slide-in-from-left-1;
}
}
/* Exiting animations */
&[data-exiting="true"] {
@apply animate-out duration-100 ease-out-quad zoom-out-95 fade-out;
/* Stays non-interactive while closing, even if the exit animation is interrupted. */
@apply pointer-events-none;
}
&[data-exiting="true"],
&[data-entering="true"] {
@apply transition-[opacity,transform] will-change-[opacity,transform];
}
/* Arrow styling */
& [data-slot="popover-overlay-arrow"] {
fill: var(--overlay);
}
/* Arrow rotation based on placement */
&[data-placement="bottom"] [data-slot="popover-overlay-arrow"] {
rotate: 180deg;
}
&[data-placement="left"] [data-slot="popover-overlay-arrow"] {
rotate: -90deg;
}
&[data-placement="right"] [data-slot="popover-overlay-arrow"] {
rotate: 90deg;
}
/* Listbox styles.
* `min-h-0` + the popover's flex column let the list shrink below 320px when the
* popover itself is constrained (e.g. inside a Modal, or a short viewport). Without
* it the list keeps its full 320px and its overflow is clipped by the popover, making
* the last options unreachable. */
[data-slot="list-box"] {
@apply max-h-[320px] min-h-0 scrollbar overflow-y-auto p-1.5 outline-none;
}
[data-slot="list-box-item"] {
@apply px-2.5;
}
/* Virtualized rows: react-aria's Virtualizer wraps each row in an absolutely-positioned
* [role="presentation"] element whose width equals the scroll container's clientWidth
* (which includes the list-box horizontal padding) while sitting inside the padded content
* box. Without this, rows overflow the right padding and the hover background reaches the
* popover edge. Subtract the horizontal padding (2 × p-1.5 = 12px) to keep rows aligned. */
[role="presentation"] > [data-slot="list-box-item"] {
width: calc(100% - var(--spacing) * 3);
}
/* As the popover closes fast in single-select mode, the default item indicator transition is not even visible - so we disable it only for single-select */
[data-slot="list-box"]:not([aria-multiselectable="true"])
[data-slot="list-box-item-indicator"],
[data-slot="list-box"]:not([aria-multiselectable="true"])
[data-slot="list-box-item-indicator"]
[data-slot="list-box-item-indicator--checkmark"] {
@apply transition-none;
}
/* Search Field styles */
[data-slot="search-field"] {
@apply shrink-0 px-3 py-1 outline-none;
}
/* Empty State */
[data-slot="empty-state"] {
@apply text-center text-sm text-overlay-foreground/60;
}
}
/* Full width modifier */
.hv-autocomplete--full-width {
@apply w-full;
}
.hv-autocomplete__trigger--full-width {
@apply w-full;
}
/* Clear Button styles */
.hv-autocomplete__clear-button {
@apply relative isolate inline-flex h-6 w-6 shrink-0 origin-center items-center justify-center rounded-xl p-1 text-muted select-none no-highlight;
@apply me-0 size-5 shrink-0 self-center bg-transparent;
/* Cursor */
cursor: var(--cursor-interactive);
@apply transform-gpu;
/* Transition only when visible - disappears immediately when cleared */
&:not([data-empty="true"]) {
transition: opacity 150ms var(--ease-smooth);
@apply motion-reduce:transition-none;
}
&[data-empty="true"] {
@apply pointer-events-none opacity-0;
}
[data-slot="autocomplete-clear-button-icon"] {
@apply size-3.5;
}
&:active,
&[data-pressed="true"] {
}
@media (hover: hover) {
&:hover,
&[data-hovered="true"] {
@apply bg-default-hover;
}
}
&:active,
&[data-pressed="true"] {
transform: scale(0.93);
}
}
+188
View File
@@ -0,0 +1,188 @@
/* Adapted from HeroUI v3, ce90ea3. Copyright 2025 NextUI Inc.
* See third-party/HEROUI-LICENSE. Modified: hv- class prefix. */
/* ComboBox styles */
.hv-combo-box {
@apply flex flex-col gap-1;
&[data-invalid="true"],
&[aria-invalid="true"] {
[data-slot="description"] {
@apply hidden;
}
}
[data-slot="label"] {
@apply w-fit;
}
[data-slot="input"] {
@apply min-w-0 flex-1;
/* Add inline-end padding when trigger is present */
&:has(+ .hv-combo-box__trigger) {
@apply pe-7;
}
/* Focus state (input.css only has focus-visible, but hv-combo-box also needs focus) */
&:focus,
&[data-focus] {
@apply status-focused-field;
border-color: var(--field-border-focus);
background-color: var(--field-focus);
}
/* Disabled state */
&:disabled,
&[data-disabled],
&[aria-disabled="true"] {
@apply status-disabled;
}
}
}
.hv-combo-box__input-group {
@apply relative isolate inline-flex items-center;
}
.hv-combo-box__value {
@apply text-sm wrap-break-word text-field-foreground empty:hidden;
&[data-placeholder="true"] {
@apply text-field-placeholder;
}
/* Removes the list-box-item indicator element from the hv-combo-box value */
[data-slot="list-box-item-indicator"] {
@apply hidden;
}
}
.hv-combo-box__trigger {
@apply absolute end-0 top-1/2 flex h-full shrink-0 -translate-y-1/2 cursor-pointer items-center justify-center pe-2 text-field-placeholder transition duration-150 no-highlight;
/* Remove default button styles */
@apply border-none bg-transparent outline-none;
/* Hover state */
@media (hover: hover) {
&:hover,
&[data-hovered="true"] {
@apply text-field-foreground;
}
}
/* Focus visible state */
&:focus-visible:not([data-focused]),
&[data-focus-visible="true"] {
@apply rounded ring-2 ring-focus ring-offset-2 ring-offset-background outline-none;
}
/* Pressed state */
&[data-pressed="true"] {
@apply opacity-70;
}
/* Disabled state */
&:disabled,
&[data-disabled],
&[aria-disabled="true"] {
@apply cursor-not-allowed opacity-50;
}
[data-slot="combo-box-trigger-default-icon"] {
@apply size-4 transition-transform duration-150 motion-reduce:transition-none;
}
/* Rotate icon when trigger is open */
&[data-open="true"] [data-slot="combo-box-trigger-default-icon"] {
@apply rotate-180;
}
}
/* Similar to popover content styles */
.hv-combo-box__popover {
@apply min-w-(--trigger-width) origin-(--trigger-anchor-point) scroll-py-1 scrollbar overflow-y-auto overscroll-contain bg-overlay p-0 text-sm;
border-radius: min(32px, var(--radius-3xl));
box-shadow: var(--overlay-shadow);
/* Focus state */
&:focus-visible:not([data-focused]),
&[data-focus-visible="true"] {
@apply outline-none;
}
/* Entering animations */
&[data-entering="true"] {
@apply animate-in duration-150 ease-smooth fade-in-0 zoom-in-95;
/* Placement-specific translations */
&[data-placement="top"] {
@apply slide-in-from-bottom-1;
}
&[data-placement="bottom"] {
@apply slide-in-from-top-1;
}
&[data-placement="left"] {
@apply slide-in-from-right-1;
}
&[data-placement="right"] {
@apply slide-in-from-left-1;
}
}
/* Exiting animations */
&[data-exiting="true"] {
@apply animate-out duration-100 ease-smooth zoom-out-95 fade-out;
/* Stays non-interactive while closing, even if the exit animation is interrupted. */
@apply pointer-events-none;
}
&[data-exiting="true"],
&[data-entering="true"] {
@apply transition-[opacity,transform] will-change-[opacity,transform];
}
/* Arrow styling */
& [data-slot="popover-overlay-arrow"] {
fill: var(--overlay);
}
/* Arrow rotation based on placement */
&[data-placement="bottom"] [data-slot="popover-overlay-arrow"] {
rotate: 180deg;
}
&[data-placement="left"] [data-slot="popover-overlay-arrow"] {
rotate: -90deg;
}
&[data-placement="right"] [data-slot="popover-overlay-arrow"] {
rotate: 90deg;
}
/* Listbox styles */
[data-slot="list-box"] {
@apply p-1.5 outline-none;
}
[data-slot="list-box-item"] {
@apply px-2.5;
/* As the hv-combo-box is single-select, we don't need to animate the checkmark */
[data-slot="list-box-item-indicator--checkmark"] {
@apply transition-none;
}
}
}
/* Full width modifier */
.hv-combo-box--full-width {
@apply w-full;
}
.hv-combo-box__input-group--full-width {
@apply w-full;
}
+144
View File
@@ -0,0 +1,144 @@
/* Adapted from HeroUI ce90ea3. Copyright 2025 NextUI Inc.
* Apache-2.0; see third-party/HEROUI-LICENSE. hv- namespace and Vue adapters. */
/* ==========================================================================
Base dropdown styles
========================================================================== */
.hv-dropdown {
@apply flex flex-col gap-1;
}
.hv-dropdown__trigger {
@apply inline-block;
/* Custom trigger (not a library Button) gets button-like affordances */
@apply outline-none;
transition:
transform 250ms var(--ease-out-quart),
background-color 150ms var(--ease-smooth),
box-shadow 150ms var(--ease-out);
@apply transform-gpu motion-reduce:transition-none;
cursor: var(--cursor-interactive);
&:focus-visible:not([data-focused]),
&[data-focus-visible="true"] {
@apply status-focused;
}
&:disabled,
&[aria-disabled="true"] {
@apply status-disabled;
}
&[data-pending="true"] {
@apply status-pending;
}
&:active,
&[data-pressed="true"] {
transform: scale(0.97);
}
}
/* Library Button/Avatar keep their own layout when used as a Vue trigger.
The custom-trigger affordances above only need to apply to plain elements,
so the base layout utilities of those components win back. */
.hv-dropdown__trigger.hv-button {
display: inline-flex;
}
.hv-dropdown__trigger.hv-avatar {
display: flex;
}
/* Similar to select popover styles.
Reka publishes the floating origin and the available height as
`--reka-...-content-*` variables on the surface, so the ported animation
origin and the long-menu height cap map onto real values. */
.hv-dropdown__popover {
@apply max-w-[48svw] origin-(--reka-dropdown-menu-content-transform-origin) scroll-py-1 scrollbar overflow-y-auto overscroll-contain bg-overlay p-0 text-sm md:min-w-55;
border-radius: min(32px, var(--radius-3xl));
box-shadow: var(--overlay-shadow);
z-index: var(--z-index-overlay);
max-height: var(--reka-dropdown-menu-content-available-height, none);
&:focus-visible:not([data-focused]),
&[data-focus-visible="true"] {
@apply outline-none;
}
/* Entering animations */
&[data-entering="true"] {
@apply animate-in duration-150 ease-smooth fade-in-0 zoom-in-90;
&[data-side="top"] {
@apply slide-in-from-bottom-1;
}
&[data-side="bottom"] {
@apply slide-in-from-top-1;
}
&[data-side="left"] {
@apply slide-in-from-right-1;
}
&[data-side="right"] {
@apply slide-in-from-left-1;
}
}
/* Exiting animations */
&[data-exiting="true"] {
@apply animate-out duration-100 ease-smooth zoom-out-95 fade-out;
@apply pointer-events-none;
}
&[data-exiting="true"],
&[data-entering="true"] {
@apply transition-[opacity,transform] will-change-[opacity,transform];
}
/* Arrow styling */
& [data-slot="popover-overlay-arrow"] {
fill: var(--overlay);
}
&[data-side="bottom"] [data-slot="popover-overlay-arrow"] {
rotate: 180deg;
}
&[data-side="left"] [data-slot="popover-overlay-arrow"] {
rotate: -90deg;
}
&[data-side="right"] [data-slot="popover-overlay-arrow"] {
rotate: 90deg;
}
/* Menu styles */
[data-slot="dropdown-menu"] {
@apply p-1.5 outline-none;
}
[data-slot="menu-item"] {
@apply px-2.5;
}
}
.hv-dropdown__menu {
@apply relative flex w-full flex-col gap-0.5 overflow-clip p-1;
[data-slot="separator"] {
@apply ms-[3%] w-[94%];
}
}
/* Standalone Menu keeps the base menu semantics but must stay in the normal
flow: the positioning wrapper is neutralised for that surface only. */
[data-reka-popper-content-wrapper]:has(> .hv-dropdown__popover[data-static]) {
position: static !important;
inset: auto !important;
transform: none !important;
min-width: 0 !important;
}
@@ -0,0 +1,15 @@
/* Adapted from HeroUI v3, ce90ea3. Copyright 2025 NextUI Inc.
* See third-party/HEROUI-LICENSE. Modified: hv- class prefix. */
/* Base error message styles */
.hv-error-message {
@apply h-auto text-xs wrap-break-word text-danger;
/**
* Transitions
* CRITICAL: motion-reduce must be AFTER transition for correct override specificity
*/
transition:
opacity 150ms var(--ease-out),
height 350ms var(--ease-smooth);
@apply motion-reduce:transition-none;
}
@@ -3,6 +3,12 @@
Base list-box item styles
========================================================================== */
/* Owner-filtered rows stay mounted (text and selection survive) but leave
display and keyboard navigation. */
.hv-list-box-item[data-filtered="true"] {
display: none;
}
.hv-list-box-item {
@apply relative flex min-h-9 w-full items-center justify-start gap-3 rounded-2xl px-2 py-1.5 outline-none no-highlight;
+143
View File
@@ -0,0 +1,143 @@
/* Adapted from HeroUI ce90ea3. Copyright 2025 NextUI Inc.
* Apache-2.0; see third-party/HEROUI-LICENSE. hv- namespace and Vue adapters. */
/* ==========================================================================
Base menu item styles
========================================================================== */
.hv-menu-item {
@apply relative flex min-h-9 w-full items-center justify-start gap-3 rounded-2xl px-2 py-1.5 outline-none no-highlight;
/**
* Transitions
* CRITICAL: motion-reduce must be AFTER transition for correct override specificity
*/
transition:
transform 250ms var(--ease-out-quart),
box-shadow 150ms var(--ease-out);
@apply motion-reduce:transition-none;
/* Cursor */
cursor: var(--cursor-interactive);
[data-slot="label"] {
@apply pointer-events-none w-fit select-none;
}
[data-slot="description"] {
@apply pointer-events-none text-wrap select-none;
}
[data-slot="submenu-indicator"] svg {
@apply size-3.5;
}
/* Add inline-start padding when indicator is present */
&:has(.hv-menu-item__indicator) {
@apply ps-7;
}
/* Add inline-end padding when indicator is present and has submenu */
&[data-has-submenu="true"]:has(.hv-menu-item__indicator) {
@apply ps-2 pe-7;
}
/* Focus visible state (keyboard focus only). */
&:focus-visible:not([data-focused]),
&[data-focus-visible="true"] {
@apply status-focused;
}
/* Pressed state */
&:active,
&[data-pressed="true"] {
@apply will-change-transform;
transform: scale(0.98);
}
/* Hover state */
@media (hover: hover) {
&:hover,
&[data-hovered="true"] {
@apply bg-default;
}
}
/* Selected state */
&[aria-checked="true"],
&[aria-selected="true"],
&[data-selected="true"] {
[data-slot="menu-item-indicator--checkmark"] {
transition: stroke-dashoffset 100ms linear;
@apply motion-reduce:transition-none;
}
[data-slot="menu-item-indicator--dot"] {
@apply scale-100 opacity-100;
}
}
/* Disabled state.
Reka writes a presence attribute (`data-disabled=""`), not `"true"`. */
&[data-disabled] {
@apply status-disabled;
}
}
/* ==========================================================================
Menu item indicator
========================================================================== */
.hv-menu-item__indicator {
@apply absolute start-2 top-1/2 flex size-4 shrink-0 -translate-y-1/2 items-center justify-center text-muted;
@apply transition duration-250 motion-reduce:transition-none;
/* Position on the inline-end when menu item has submenu */
.hv-menu-item[data-has-submenu="true"] & {
@apply start-auto end-2;
}
/* Checkmark SVG indicator */
[data-slot="menu-item-indicator--checkmark"] {
@apply size-2.5;
.hv-menu-item[data-selection-mode="multiple"] & {
@apply transition-all duration-300 motion-reduce:transition-none;
}
}
/* Dot SVG indicator */
[data-slot="menu-item-indicator--dot"] {
@apply size-2;
.hv-menu-item[data-selection-mode="multiple"] & {
@apply transition-all duration-250 motion-reduce:transition-none;
}
@apply scale-70 opacity-0;
}
}
/* Submenu indicator (chevron-right) */
.hv-menu-item__indicator--submenu {
@apply text-muted;
svg {
@apply size-3;
}
}
/* Default variant */
.hv-menu-item--default {
}
/* Danger variant */
.hv-menu-item--danger {
.hv-menu-item__indicator {
@apply text-danger;
}
[data-slot="label"] {
@apply text-danger;
}
}
@@ -0,0 +1,9 @@
/* Adapted from HeroUI ce90ea3. Copyright 2025 NextUI Inc.
* Apache-2.0; see third-party/HEROUI-LICENSE. hv- namespace and Vue adapters. */
/* ==========================================================================
Base menu section styles
========================================================================== */
.hv-menu-section {
@apply flex flex-col items-start gap-0;
}
+14
View File
@@ -0,0 +1,14 @@
/* Adapted from HeroUI ce90ea3. Copyright 2025 NextUI Inc.
* Apache-2.0; see third-party/HEROUI-LICENSE. hv- namespace and Vue adapters. */
/* ==========================================================================
Base menu styles
========================================================================== */
.hv-menu {
@apply relative flex w-full flex-col gap-1 overflow-clip p-1;
/* This makes the separator take up 94% of the width and be centered */
[data-slot="separator"] {
@apply ms-[3%] w-[94%];
}
}
+17
View File
@@ -0,0 +1,17 @@
/* Adapted from HeroUI v3, ce90ea3. Copyright 2025 NextUI Inc.
* See third-party/HEROUI-LICENSE. Modified: hv- class prefix. */
/* Base styles */
.hv-tag-group {
@apply relative flex flex-col gap-1;
}
.hv-tag-group__list {
@apply relative flex flex-wrap gap-1.5;
}
.hv-tag-group [slot="description"],
.hv-tag-group [data-slot="description"],
.hv-tag-group [slot="errorMessage"],
.hv-tag-group [data-slot="error-message"] {
@apply p-1;
}
+114
View File
@@ -0,0 +1,114 @@
/* Adapted from HeroUI v3, ce90ea3. Copyright 2025 NextUI Inc.
* See third-party/HEROUI-LICENSE. Modified: hv- class prefix; Vue state adapters. */
/* Tag component styles */
.hv-tag {
--optical-offset: 0.031em;
@apply relative inline-flex items-center gap-1 rounded-xl font-medium select-none no-highlight;
/* Default size - matches .hv-tag--md */
@apply px-2 py-1 text-xs;
/**
* Transitions
* CRITICAL: motion-reduce must be AFTER transition for correct override specificity
*/
transition:
color 100ms var(--ease-smooth),
scale 100ms var(--ease-smooth),
opacity 100ms var(--ease-smooth),
background-color 100ms var(--ease-smooth),
box-shadow 100ms var(--ease-out);
@apply origin-center transform-gpu motion-reduce:transition-none;
/* Cursor */
cursor: var(--cursor-interactive);
/* SVG icon styling */
& svg {
@apply pointer-events-none size-3 shrink-0 self-center text-current;
}
}
/* Disabled state */
.hv-tag:is([data-disabled="true"], [aria-disabled="true"]) {
@apply status-disabled;
}
/* Focus visible state (keyboard focus only) */
.hv-tag:is(:focus-visible, [data-focus-visible]) {
@apply status-focused;
}
/* Pressed/Active state */
.hv-tag:is(:active, [data-pressed="true"]) {
}
/* Selected state */
.hv-tag:is([data-selected="true"], [aria-selected="true"]) {
@apply bg-accent-soft text-accent-soft-foreground;
/* Selected + Hover state */
@media (hover: hover) {
&:is(:hover, [data-hovered="true"]) {
@apply bg-accent-soft-hover;
}
}
}
/* Size */
.hv-tag--sm {
@apply px-2 py-0.5 text-xs;
}
.hv-tag--md {
/* No styles as this is the default size */
}
.hv-tag--lg {
@apply rounded-2xl px-2.5 py-1.5 text-sm;
}
/* Variant */
.hv-tag--default {
@apply bg-default text-default-foreground;
/* Hover state (when not selected or disabled) */
@media (hover: hover) {
&:is(:hover, [data-hovered="true"]):not([data-selected="true"]):not(
[data-disabled="true"]
) {
@apply bg-default-hover;
}
}
}
.hv-tag--surface {
@apply bg-surface text-surface-foreground;
/* Hover state (when not selected or disabled) */
@media (hover: hover) {
&:is(:hover, [data-hovered="true"]):not([data-selected="true"]):not(
[data-disabled="true"]
) {
@apply bg-surface-hover;
}
}
}
/* Remove Button */
.hv-tag__remove-button {
/**
* The glyph is 12px, half the minimum target size. A finger tap that misses it lands on the
* tag body, which consumes the press without removing anything, so removing a tag by touch
* takes several attempts. `touch-target` widens the pressable area to 24px. On `--sm` the
* overlay reaches ~2px past the tag box, which the 6px list gap absorbs, so it never
* overlaps a neighbouring tag.
*/
@apply touch-target size-3 text-inherit;
/* SVG icon styling */
& svg {
@apply size-[inherit] shrink-0 self-center text-current;
}
}