File tree Expand file tree Collapse file tree 4 files changed +0
-47
lines changed
Expand file tree Collapse file tree 4 files changed +0
-47
lines changed Original file line number Diff line number Diff line change 11<script setup lang="ts">
22import type { IconClass } from ' ~/types'
33
4- /**
5- * Tab — a single tab button. Must be used inside TabList, within a TabRoot.
6- *
7- * Styling is driven by `data-selected` attribute — no conditional class logic.
8- * Extra classes and attrs are passed through to ButtonBase.
9- */
10-
114defineOptions ({ name: ' TabItem' , inheritAttrs: false })
125
136const props = withDefaults (
147 defineProps <{
15- /** Unique value identifying this tab. Must match a TabPanel's value. */
168 value: string
17- /** Optional icon class displayed before the label. */
189 icon? : IconClass
19- /** Optional explicit element id (default: auto-generated from TabRoot idPrefix). */
2010 tabId? : string
21- /** @default " secondary" */
2211 variant? : ' primary' | ' secondary'
23- /** @default " md" */
2412 size? : ' sm' | ' md'
2513 }>(),
2614 {
Original file line number Diff line number Diff line change 11<script setup lang="ts">
2- /**
3- * TabList — wraps Tab children with `role="tablist"` and handles
4- * arrow-key roving focus per WAI-ARIA Tabs pattern.
5- */
6-
72defineOptions ({ name: ' TabList' })
83
94defineProps <{
Original file line number Diff line number Diff line change 11<script setup lang="ts">
2- /**
3- * TabPanel — content panel associated with a Tab.
4- *
5- * Automatically shows/hides based on the selected tab value.
6- * Uses `data-selected` for CSS-driven visibility when needed.
7- */
8-
92defineOptions ({ name: ' TabPanel' })
103
114const props = defineProps <{
12- /** Must match the corresponding Tab's value. */
135 value: string
14- /** Optional explicit element id (default: auto-generated from Tabs idPrefix). */
156 panelId? : string
167}>()
178
Original file line number Diff line number Diff line change 11<script setup lang="ts">
2- /**
3- * Root container for the accessible Tabs compound component.
4- *
5- * Provides shared state to TabList, Tab, and TabPanel children
6- * via provide/inject. Minimal JS — visual states are driven by
7- * `data-selected` attributes on Tab and TabPanel elements.
8- *
9- * @example
10- * <Tabs v-model="activeTab" default-value="overview">
11- * <TabList aria-label="Section navigation">
12- * <Tab value="overview">Overview</Tab>
13- * <Tab value="details">Details</Tab>
14- * </TabList>
15- * <TabPanel value="overview">Overview content</TabPanel>
16- * <TabPanel value="details">Details content</TabPanel>
17- * </Tabs>
18- */
19-
202defineOptions ({ name: ' TabRoot' })
213
224const props = withDefaults (
235 defineProps <{
24- /** Currently active tab value. */
256 modelValue? : string
26- /** Fallback value when modelValue is not provided. */
277 defaultValue? : string
28- /** Optional id prefix for generated tab/panel ids. */
298 idPrefix? : string
309 }>(),
3110 {
You can’t perform that action at this time.
0 commit comments