import type { JSX, ValidComponent } from "@solidjs/web"; import { dynamic } from "@solidjs/web"; import { createEffect, createMemo, createSignal, omit, untrack, } from "solid-js"; import { useBaseUiId } from "../../internals/base-ui-id"; import { createChangeEventDetails, REASONS, } from "../../internals/change-event-details"; import { ACTIVE_COMPOSITE_ITEM } from "../../internals/composite/composite-constants.ts"; import { useCompositeItem } from "../../internals/composite/composite-item.ts"; import { mergeRootProps } from "../../internals/merge-root-props"; import { resolveClassStyle } from "../../internals/resolve-class-style"; import type { BaseUIComponentProps, NativeButtonProps, } from "../../internals/types"; import type { Orientation } from "../../internals/types.ts"; import { useButton } from "../../internals/use-button/use-button"; import { useTabsListContext } from "../tabs-list-context.ts"; import { type TabsTabMetadata, type TabsTabValue, useTabsRootContext, } from "../tabs-root-context.ts"; export interface TabsTabState { /** Whether the tab is disabled (ignored by pointer + keyboard activation). */ disabled: boolean; /** Whether the tab is currently the selected one. */ active: boolean; /** Layout orientation (inherited from the root). */ orientation: Orientation; } export interface TabsTabProps extends NativeButtonProps, // Re-type `value` to the opaque TabsTabValue; don't let the native button // `value` attribute shape bleed through. Omit, "value"> { /** Tag/component to render. Defaults to `"button"`. */ as?: ValidComponent; /** * The value this tab represents. Panels with the matching `value` render * when this tab is active. May be any type — numbers, strings, objects, * functions, symbols. */ value: TabsTabValue; /** * Whether the tab should ignore user interaction. Disabled tabs can still * receive keyboard focus (per WAI-ARIA guidance), but clicks / Space / * Enter are a no-op. * @default false */ disabled?: boolean | undefined; } /** * A single selectable tab button. Renders a `