@alfadocs/ui-kit-debug 0.63.0 → 0.64.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/dist/_chunks/{ai-prompt-input-C6sCr1Vi.js → ai-prompt-input-Dx8eXoPm.js} +2 -2
  2. package/dist/_chunks/{ai-prompt-input-C6sCr1Vi.js.map → ai-prompt-input-Dx8eXoPm.js.map} +1 -1
  3. package/dist/_chunks/{audio-recorder-D6OVfNiZ.js → audio-recorder-CdXuT9ln.js} +2 -2
  4. package/dist/_chunks/{audio-recorder-D6OVfNiZ.js.map → audio-recorder-CdXuT9ln.js.map} +1 -1
  5. package/dist/_chunks/{bishop-score-B9tvgoIq.js → bishop-score-CzjSx-dm.js} +2 -2
  6. package/dist/_chunks/{bishop-score-B9tvgoIq.js.map → bishop-score-CzjSx-dm.js.map} +1 -1
  7. package/dist/_chunks/{booking-BUV9fspj.js → booking-ChfvWy3P.js} +2 -2
  8. package/dist/_chunks/{booking-BUV9fspj.js.map → booking-ChfvWy3P.js.map} +1 -1
  9. package/dist/_chunks/{care-plan-card-QmNpGggC.js → care-plan-card-DhZNoXs4.js} +2 -2
  10. package/dist/_chunks/{care-plan-card-QmNpGggC.js.map → care-plan-card-DhZNoXs4.js.map} +1 -1
  11. package/dist/_chunks/{care-plan-entry-card-Cnra7vUc.js → care-plan-entry-card-DW70yBOD.js} +2 -2
  12. package/dist/_chunks/{care-plan-entry-card-Cnra7vUc.js.map → care-plan-entry-card-DW70yBOD.js.map} +1 -1
  13. package/dist/_chunks/{editable-currency-cell-renderer-D5C5tCfu.js → editable-currency-cell-renderer-BQgaKFCz.js} +2 -2
  14. package/dist/_chunks/{editable-currency-cell-renderer-D5C5tCfu.js.map → editable-currency-cell-renderer-BQgaKFCz.js.map} +1 -1
  15. package/dist/_chunks/{gestational-age-calculator-AkNFfZYs.js → gestational-age-calculator-D85E8lGN.js} +2 -2
  16. package/dist/_chunks/{gestational-age-calculator-AkNFfZYs.js.map → gestational-age-calculator-D85E8lGN.js.map} +1 -1
  17. package/dist/_chunks/{pregnancy-dating-Dg6dTe1p.js → pregnancy-dating-7NUaAfob.js} +2 -2
  18. package/dist/_chunks/{pregnancy-dating-Dg6dTe1p.js.map → pregnancy-dating-7NUaAfob.js.map} +1 -1
  19. package/dist/_chunks/{select-hsCaJSX3.js → select-CEtRcon5.js} +46 -45
  20. package/dist/_chunks/select-CEtRcon5.js.map +1 -0
  21. package/dist/_chunks/{tabs-BpPYVme_.js → tabs-BIQ0ew1T.js} +2 -2
  22. package/dist/_chunks/{tabs-BpPYVme_.js.map → tabs-BIQ0ew1T.js.map} +1 -1
  23. package/dist/_chunks/tooth-scheme-CiphQaON.js +1257 -0
  24. package/dist/_chunks/tooth-scheme-CiphQaON.js.map +1 -0
  25. package/dist/_chunks/{unit-converter-3sINXO3m.js → unit-converter-BIbXHIQA.js} +2 -2
  26. package/dist/_chunks/{unit-converter-3sINXO3m.js.map → unit-converter-BIbXHIQA.js.map} +1 -1
  27. package/dist/agent-catalog.json +41 -4
  28. package/dist/components/ai-prompt-input/index.js +1 -1
  29. package/dist/components/audio-recorder/index.js +1 -1
  30. package/dist/components/bishop-score/index.js +1 -1
  31. package/dist/components/booking/index.js +1 -1
  32. package/dist/components/care-plan-card/index.js +1 -1
  33. package/dist/components/care-plan-entry-card/index.js +1 -1
  34. package/dist/components/data-table/index.js +1 -1
  35. package/dist/components/gestational-age-calculator/index.js +1 -1
  36. package/dist/components/pregnancy-dating/index.js +1 -1
  37. package/dist/components/select/index.js +1 -1
  38. package/dist/components/select/select.d.ts +8 -0
  39. package/dist/components/select/select.d.ts.map +1 -1
  40. package/dist/components/tabs/index.js +1 -1
  41. package/dist/components/tooth-scheme/index.d.ts +2 -2
  42. package/dist/components/tooth-scheme/index.d.ts.map +1 -1
  43. package/dist/components/tooth-scheme/index.js +22 -15
  44. package/dist/components/tooth-scheme/tooth-data.d.ts +79 -18
  45. package/dist/components/tooth-scheme/tooth-data.d.ts.map +1 -1
  46. package/dist/components/tooth-scheme/tooth-scheme.agent.d.ts +2 -0
  47. package/dist/components/tooth-scheme/tooth-scheme.agent.d.ts.map +1 -1
  48. package/dist/components/tooth-scheme/tooth-scheme.d.ts +48 -1
  49. package/dist/components/tooth-scheme/tooth-scheme.d.ts.map +1 -1
  50. package/dist/components/unit-converter/index.js +1 -1
  51. package/dist/i18n/locales/ar.d.ts +17 -0
  52. package/dist/i18n/locales/ar.d.ts.map +1 -1
  53. package/dist/i18n/locales/ar.js +18 -1
  54. package/dist/i18n/locales/ar.js.map +1 -1
  55. package/dist/i18n/locales/de.d.ts +17 -0
  56. package/dist/i18n/locales/de.d.ts.map +1 -1
  57. package/dist/i18n/locales/de.js +18 -1
  58. package/dist/i18n/locales/de.js.map +1 -1
  59. package/dist/i18n/locales/el.d.ts +17 -0
  60. package/dist/i18n/locales/el.d.ts.map +1 -1
  61. package/dist/i18n/locales/el.js +18 -1
  62. package/dist/i18n/locales/el.js.map +1 -1
  63. package/dist/i18n/locales/en.d.ts +17 -0
  64. package/dist/i18n/locales/en.d.ts.map +1 -1
  65. package/dist/i18n/locales/en.js +18 -1
  66. package/dist/i18n/locales/en.js.map +1 -1
  67. package/dist/i18n/locales/es.d.ts +17 -0
  68. package/dist/i18n/locales/es.d.ts.map +1 -1
  69. package/dist/i18n/locales/es.js +18 -1
  70. package/dist/i18n/locales/es.js.map +1 -1
  71. package/dist/i18n/locales/fr.d.ts +17 -0
  72. package/dist/i18n/locales/fr.d.ts.map +1 -1
  73. package/dist/i18n/locales/fr.js +18 -1
  74. package/dist/i18n/locales/fr.js.map +1 -1
  75. package/dist/i18n/locales/hi.d.ts +17 -0
  76. package/dist/i18n/locales/hi.d.ts.map +1 -1
  77. package/dist/i18n/locales/hi.js +18 -1
  78. package/dist/i18n/locales/hi.js.map +1 -1
  79. package/dist/i18n/locales/it.d.ts +17 -0
  80. package/dist/i18n/locales/it.d.ts.map +1 -1
  81. package/dist/i18n/locales/it.js +18 -1
  82. package/dist/i18n/locales/it.js.map +1 -1
  83. package/dist/i18n/locales/ja.d.ts +17 -0
  84. package/dist/i18n/locales/ja.d.ts.map +1 -1
  85. package/dist/i18n/locales/ja.js +18 -1
  86. package/dist/i18n/locales/ja.js.map +1 -1
  87. package/dist/i18n/locales/nl.d.ts +17 -0
  88. package/dist/i18n/locales/nl.d.ts.map +1 -1
  89. package/dist/i18n/locales/nl.js +18 -1
  90. package/dist/i18n/locales/nl.js.map +1 -1
  91. package/dist/i18n/locales/pl.d.ts +17 -0
  92. package/dist/i18n/locales/pl.d.ts.map +1 -1
  93. package/dist/i18n/locales/pl.js +18 -1
  94. package/dist/i18n/locales/pl.js.map +1 -1
  95. package/dist/i18n/locales/pt.d.ts +17 -0
  96. package/dist/i18n/locales/pt.d.ts.map +1 -1
  97. package/dist/i18n/locales/pt.js +18 -1
  98. package/dist/i18n/locales/pt.js.map +1 -1
  99. package/dist/i18n/locales/ro.d.ts +17 -0
  100. package/dist/i18n/locales/ro.d.ts.map +1 -1
  101. package/dist/i18n/locales/ro.js +18 -1
  102. package/dist/i18n/locales/ro.js.map +1 -1
  103. package/dist/i18n/locales/ru.d.ts +17 -0
  104. package/dist/i18n/locales/ru.d.ts.map +1 -1
  105. package/dist/i18n/locales/ru.js +18 -1
  106. package/dist/i18n/locales/ru.js.map +1 -1
  107. package/dist/i18n/locales/sq.d.ts +17 -0
  108. package/dist/i18n/locales/sq.d.ts.map +1 -1
  109. package/dist/i18n/locales/sq.js +18 -1
  110. package/dist/i18n/locales/sq.js.map +1 -1
  111. package/dist/i18n/locales/sv.d.ts +17 -0
  112. package/dist/i18n/locales/sv.d.ts.map +1 -1
  113. package/dist/i18n/locales/sv.js +18 -1
  114. package/dist/i18n/locales/sv.js.map +1 -1
  115. package/dist/i18n/locales/tr.d.ts +17 -0
  116. package/dist/i18n/locales/tr.d.ts.map +1 -1
  117. package/dist/i18n/locales/tr.js +18 -1
  118. package/dist/i18n/locales/tr.js.map +1 -1
  119. package/dist/i18n/locales/zh.d.ts +17 -0
  120. package/dist/i18n/locales/zh.d.ts.map +1 -1
  121. package/dist/i18n/locales/zh.js +18 -1
  122. package/dist/i18n/locales/zh.js.map +1 -1
  123. package/dist/index.js +180 -173
  124. package/dist/locales/ar.json +18 -1
  125. package/dist/locales/de.json +18 -1
  126. package/dist/locales/el.json +18 -1
  127. package/dist/locales/en.json +18 -1
  128. package/dist/locales/es.json +18 -1
  129. package/dist/locales/fr.json +18 -1
  130. package/dist/locales/hi.json +18 -1
  131. package/dist/locales/it.json +18 -1
  132. package/dist/locales/ja.json +18 -1
  133. package/dist/locales/nl.json +18 -1
  134. package/dist/locales/pl.json +18 -1
  135. package/dist/locales/pt.json +18 -1
  136. package/dist/locales/ro.json +18 -1
  137. package/dist/locales/ru.json +18 -1
  138. package/dist/locales/sq.json +18 -1
  139. package/dist/locales/sv.json +18 -1
  140. package/dist/locales/tr.json +18 -1
  141. package/dist/locales/zh.json +18 -1
  142. package/dist/tokens.css +1 -1
  143. package/package.json +1 -1
  144. package/dist/_chunks/select-hsCaJSX3.js.map +0 -1
  145. package/dist/_chunks/tooth-scheme-CxlsLjfN.js +0 -753
  146. package/dist/_chunks/tooth-scheme-CxlsLjfN.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select-CEtRcon5.js","sources":["../../src/components/select/select.agent.ts","../../src/components/select/select.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — Select. */\n/* */\n/* See `src/docs/26-agent-readiness.mdx` for the contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { SelectHandle } from './select';\n\nexport const selectAgent: AgentAdapter<SelectHandle> = {\n id: 'select',\n capabilities: ['select_single', 'open', 'close'],\n state: {\n value: {\n type: 'string',\n descriptionKey: 'ui.agent.select.state.value',\n description:\n 'Currently selected option value, or empty string when none.',\n read: (handle) => handle.getValue(),\n },\n isOpen: {\n type: 'boolean',\n descriptionKey: 'ui.agent.select.state.isOpen',\n description: 'Whether the option list is open.',\n read: (handle) => handle.isOpen(),\n },\n },\n actions: {\n set_value: {\n safety: 'write',\n argsType: '{ value: string }',\n descriptionKey: 'ui.agent.select.actions.setValue',\n description: 'Select the option with the given value.',\n invoke: (handle, args: { value: string }) => {\n handle.setValue(args.value);\n },\n },\n clear: {\n safety: 'destructive',\n descriptionKey: 'ui.agent.select.actions.clear',\n description: 'Clear the current selection.',\n invoke: (handle) => {\n handle.clear();\n },\n },\n open: {\n safety: 'read',\n descriptionKey: 'ui.agent.select.actions.open',\n description: 'Open the option list.',\n invoke: (handle) => {\n handle.open();\n },\n },\n close: {\n safety: 'read',\n descriptionKey: 'ui.agent.select.actions.close',\n description: 'Close the option list.',\n invoke: (handle) => {\n handle.close();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'select',\n description: 'Marks the Select trigger.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n item: {\n attr: 'data-option-id',\n description:\n 'Stable opaque option value emitted on each rendered option.',\n },\n },\n};\n","import {\n forwardRef,\n useContext,\n useMemo,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type MutableRefObject,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react';\nimport { useAgentRegistration } from '../../agent';\nimport { selectAgent } from './select.agent';\n\n/** Agent-readiness curated handle for Select. */\nexport interface SelectHandle {\n getValue: () => string;\n setValue: (value: string) => void;\n clear: () => void;\n open: () => void;\n close: () => void;\n isOpen: () => boolean;\n}\nimport * as RadixSelect from '@radix-ui/react-select';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Check, ChevronDown, ChevronUp, X } from 'lucide-react';\nimport {\n FormFieldContext,\n useFormField,\n} from '../form-field/form-field-context';\nimport type { OptionShape } from '../_shared/option';\nimport { groupOptions } from '../_shared/group-options';\nimport { useDirection } from '../_shared/use-direction';\n\nconst selectTriggerVariants = cva(\n [\n 'ds:group ds:inline-flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)] ds:w-full',\n 'ds:rounded-[var(--radius-sm)] ds:border ds:border-border ds:bg-input',\n 'ds:shadow-[var(--shadow-input)]',\n 'ds:text-foreground ds:placeholder:text-muted-foreground',\n 'ds:data-[placeholder]:text-muted-foreground',\n 'ds:transition-[colors,box-shadow] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n 'ds:disabled:cursor-not-allowed ds:disabled:opacity-50',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:h-8 ds:ps-3 ds:pe-3 ds:text-[length:var(--font-size-sm)]',\n md: 'ds:h-[var(--min-target-size)] ds:ps-3 ds:pe-3 ds:text-[length:var(--font-size-base)]',\n lg: 'ds:h-12 ds:ps-4 ds:pe-4 ds:text-[length:var(--font-size-lg)]',\n },\n tone: {\n default: '',\n error: 'ds:border-destructive ds:focus-visible:outline-destructive',\n },\n },\n defaultVariants: {\n size: 'md',\n tone: 'default',\n },\n },\n);\n\nconst selectContentVariants = cva(\n [\n 'ds:z-[var(--z-dropdown)] ds:overflow-hidden',\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-border ds:bg-background ds:text-foreground',\n 'ds:shadow-[var(--shadow-lg)]',\n 'ds:animate-in ds:fade-in ds:zoom-in-95',\n 'ds:data-[state=closed]:animate-out ds:data-[state=closed]:fade-out',\n 'ds:data-[state=closed]:zoom-out-95',\n 'ds:data-[side=bottom]:slide-in-from-top-2',\n 'ds:data-[side=top]:slide-in-from-bottom-2',\n 'ds:motion-reduce:animate-none',\n ].join(' '),\n);\n\nconst selectItemVariants = cva(\n [\n 'ds:relative ds:flex ds:cursor-pointer ds:items-center',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:text-foreground ds:outline-none ds:select-none',\n 'ds:data-[highlighted]:bg-muted ds:data-[highlighted]:text-foreground',\n 'ds:data-[disabled]:pointer-events-none ds:data-[disabled]:opacity-50',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:min-h-8 ds:ps-8 ds:pe-3 ds:text-[length:var(--font-size-sm)]',\n md: 'ds:min-h-[var(--min-target-size)] ds:ps-8 ds:pe-3 ds:text-[length:var(--font-size-base)]',\n lg: 'ds:min-h-12 ds:ps-10 ds:pe-4 ds:text-[length:var(--font-size-lg)]',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nconst selectLabelClasses = [\n 'ds:ps-8 ds:pe-3 ds:py-1.5',\n 'type-eyebrow ds:text-muted-foreground',\n 'ds:sticky ds:top-0 ds:bg-background',\n].join(' ');\n\nconst iconSizeByItemSize = {\n sm: 'ds:size-3.5',\n md: 'ds:size-4',\n lg: 'ds:size-5',\n} as const;\n\nconst itemIndicatorStartByItemSize = {\n sm: 'ds:start-2',\n md: 'ds:start-2',\n lg: 'ds:start-3',\n} as const;\n\nfunction composeRefs<T>(\n ...refs: Array<Ref<T> | undefined | null>\n): (node: T | null) => void {\n return (node: T | null) => {\n for (const r of refs) {\n if (!r) continue;\n if (typeof r === 'function') {\n r(node);\n } else {\n (r as MutableRefObject<T | null>).current = node;\n }\n }\n };\n}\n\n// ---------------------------------------------------------------------------\n// Compound sub-components — thin `forwardRef` wrappers over Radix parts.\n// ---------------------------------------------------------------------------\n\ntype SelectRootProps = ComponentPropsWithoutRef<typeof RadixSelect.Root>;\n\nconst SelectRoot = (props: SelectRootProps) => <RadixSelect.Root {...props} />;\nSelectRoot.displayName = 'Select.Root';\n\ntype SelectTriggerElement = ElementRef<typeof RadixSelect.Trigger>;\ntype SelectTriggerProps = ComponentPropsWithoutRef<typeof RadixSelect.Trigger> &\n VariantProps<typeof selectTriggerVariants>;\n\nconst SelectTrigger = forwardRef<SelectTriggerElement, SelectTriggerProps>(\n ({ size, tone, className, children, ...props }, ref) => (\n <RadixSelect.Trigger\n ref={ref}\n className={selectTriggerVariants({ size, tone, className })}\n {...props}\n >\n {children}\n </RadixSelect.Trigger>\n ),\n);\nSelectTrigger.displayName = 'Select.Trigger';\n\ntype SelectValueProps = ComponentPropsWithoutRef<typeof RadixSelect.Value>;\n\nconst SelectValue = forwardRef<\n ElementRef<typeof RadixSelect.Value>,\n SelectValueProps\n>((props, ref) => <RadixSelect.Value ref={ref} {...props} />);\nSelectValue.displayName = 'Select.Value';\n\ntype SelectContentProps = ComponentPropsWithoutRef<\n typeof RadixSelect.Content\n> & {\n container?: HTMLElement | null;\n};\n\nconst SelectContent = forwardRef<\n ElementRef<typeof RadixSelect.Content>,\n SelectContentProps\n>(\n (\n {\n className,\n children,\n position = 'popper',\n sideOffset = 4,\n container,\n ...props\n },\n ref,\n ) => (\n <RadixSelect.Portal container={container ?? undefined}>\n <RadixSelect.Content\n ref={ref}\n position={position}\n sideOffset={sideOffset}\n data-component=\"select-content\"\n className={selectContentVariants({ className })}\n {...props}\n >\n <RadixSelect.ScrollUpButton className=\"ds:flex ds:items-center ds:justify-center ds:h-6 ds:bg-background ds:cursor-default\">\n <ChevronUp aria-hidden=\"true\" className=\"ds:size-4\" />\n </RadixSelect.ScrollUpButton>\n {children}\n <RadixSelect.ScrollDownButton className=\"ds:flex ds:items-center ds:justify-center ds:h-6 ds:bg-background ds:cursor-default\">\n <ChevronDown aria-hidden=\"true\" className=\"ds:size-4\" />\n </RadixSelect.ScrollDownButton>\n </RadixSelect.Content>\n </RadixSelect.Portal>\n ),\n);\nSelectContent.displayName = 'Select.Content';\n\ntype SelectViewportProps = ComponentPropsWithoutRef<\n typeof RadixSelect.Viewport\n>;\n\nconst SelectViewport = forwardRef<\n ElementRef<typeof RadixSelect.Viewport>,\n SelectViewportProps\n>(({ className, ...props }, ref) => (\n <RadixSelect.Viewport\n ref={ref}\n className={['ds:p-1', className].filter(Boolean).join(' ')}\n {...props}\n />\n));\nSelectViewport.displayName = 'Select.Viewport';\n\ntype SelectItemProps = ComponentPropsWithoutRef<typeof RadixSelect.Item> &\n VariantProps<typeof selectItemVariants>;\n\nconst SelectItem = forwardRef<\n ElementRef<typeof RadixSelect.Item>,\n SelectItemProps\n>(({ size = 'md', className, children, ...props }, ref) => {\n const indicatorStart = itemIndicatorStartByItemSize[size ?? 'md'];\n const iconSize = iconSizeByItemSize[size ?? 'md'];\n return (\n <RadixSelect.Item\n ref={ref}\n className={selectItemVariants({ size, className })}\n {...props}\n >\n <span\n className={`ds:absolute ${indicatorStart} ds:inline-flex ds:items-center ds:justify-center`}\n aria-hidden=\"true\"\n >\n <RadixSelect.ItemIndicator>\n <Check className={iconSize} />\n </RadixSelect.ItemIndicator>\n </span>\n <RadixSelect.ItemText>{children}</RadixSelect.ItemText>\n </RadixSelect.Item>\n );\n});\nSelectItem.displayName = 'Select.Item';\n\ntype SelectItemTextProps = ComponentPropsWithoutRef<\n typeof RadixSelect.ItemText\n>;\n\nconst SelectItemText = forwardRef<\n ElementRef<typeof RadixSelect.ItemText>,\n SelectItemTextProps\n>((props, ref) => <RadixSelect.ItemText ref={ref} {...props} />);\nSelectItemText.displayName = 'Select.ItemText';\n\ntype SelectGroupProps = ComponentPropsWithoutRef<typeof RadixSelect.Group>;\n\nconst SelectGroup = forwardRef<\n ElementRef<typeof RadixSelect.Group>,\n SelectGroupProps\n>((props, ref) => <RadixSelect.Group ref={ref} {...props} />);\nSelectGroup.displayName = 'Select.Group';\n\ntype SelectLabelProps = ComponentPropsWithoutRef<typeof RadixSelect.Label>;\n\nconst SelectLabel = forwardRef<\n ElementRef<typeof RadixSelect.Label>,\n SelectLabelProps\n>(({ className, ...props }, ref) => (\n <RadixSelect.Label\n ref={ref}\n className={[selectLabelClasses, className].filter(Boolean).join(' ')}\n {...props}\n />\n));\nSelectLabel.displayName = 'Select.Label';\n\ntype SelectSeparatorProps = ComponentPropsWithoutRef<\n typeof RadixSelect.Separator\n>;\n\nconst SelectSeparator = forwardRef<\n ElementRef<typeof RadixSelect.Separator>,\n SelectSeparatorProps\n>(({ className, ...props }, ref) => (\n <RadixSelect.Separator\n ref={ref}\n className={['ds:my-1 ds:h-px ds:bg-border', className]\n .filter(Boolean)\n .join(' ')}\n {...props}\n />\n));\nSelectSeparator.displayName = 'Select.Separator';\n\n// ---------------------------------------------------------------------------\n// Convenience form — `<Select options={[{value, label, group?}]} />`.\n// ---------------------------------------------------------------------------\n\nexport type SelectOption<T extends string = string> = OptionShape<T>;\n\nexport interface SelectProps<T extends string = string> {\n options: SelectOption<T>[];\n value?: T | '';\n defaultValue?: T;\n onValueChange?: (value: T | '') => void;\n placeholder?: string;\n clearable?: boolean;\n disabled?: boolean;\n required?: boolean;\n name?: string;\n id?: string;\n size?: 'sm' | 'md' | 'lg';\n tone?: 'default' | 'error';\n 'aria-label'?: string;\n className?: string;\n /**\n * Portal target for the listbox. Defaults to `document.body`. Set this to a\n * parent overlay's content element (e.g. a Popover) when the Select is nested\n * inside one, so the listbox shares that stacking context and renders above\n * it instead of behind it (the global z-scale puts `--z-dropdown` below\n * `--z-popover`).\n */\n container?: HTMLElement | null;\n}\n\nconst SelectImpl = forwardRef<HTMLButtonElement, SelectProps>(function Select(\n {\n options,\n value,\n defaultValue,\n onValueChange,\n placeholder,\n clearable = false,\n disabled,\n required,\n name,\n id,\n size = 'md',\n tone = 'default',\n className,\n container,\n 'aria-label': ariaLabel,\n },\n ref,\n) {\n const { t } = useTranslation();\n const ctx = useFormField();\n const inFormField = useContext(FormFieldContext) !== null;\n\n const [internalValue, setInternalValue] = useState<string>(\n value ?? defaultValue ?? '',\n );\n const isControlled = value !== undefined;\n const currentValue = isControlled ? value : internalValue;\n\n const [openState, setOpenState] = useState<boolean>(false);\n const currentValueRef = useRef<string>(currentValue);\n currentValueRef.current = currentValue;\n\n const triggerId = id ?? (inFormField ? ctx.id : undefined);\n const effectiveDisabled =\n (inFormField ? ctx.disabled : false) || Boolean(disabled);\n const effectiveRequired =\n (inFormField ? ctx.required : false) || Boolean(required);\n const effectiveInvalid = inFormField ? ctx.invalid : false;\n const effectiveTone = effectiveInvalid ? 'error' : tone;\n const describedBy =\n inFormField && ctx.describedBy ? ctx.describedBy : undefined;\n\n const triggerRef = useRef<HTMLButtonElement>(null);\n const composedTriggerRef = composeRefs(ref, triggerRef);\n const dir = useDirection(triggerRef);\n\n const emitValue = onValueChange as ((value: string) => void) | undefined;\n\n const handleValueChange = (next: string) => {\n if (!isControlled) setInternalValue(next);\n emitValue?.(next);\n };\n\n const handleClear: React.MouseEventHandler<HTMLButtonElement> = (event) => {\n event.preventDefault();\n event.stopPropagation();\n if (!isControlled) setInternalValue('');\n emitValue?.('');\n triggerRef.current?.focus();\n };\n\n const resolvedPlaceholder =\n placeholder ?? t('inputs.select.placeholder', 'Select…');\n\n const showClear = clearable && !!currentValue && !effectiveDisabled;\n\n const groups = groupOptions(options);\n\n const agentHandle = useMemo<SelectHandle>(\n () => ({\n getValue: () => currentValueRef.current,\n setValue: (next) => {\n if (!isControlled) setInternalValue(next);\n emitValue?.(next);\n },\n clear: () => {\n if (!isControlled) setInternalValue('');\n emitValue?.('');\n },\n open: () => setOpenState(true),\n close: () => setOpenState(false),\n isOpen: () => openState,\n }),\n [emitValue, isControlled, openState],\n );\n useAgentRegistration(selectAgent, agentHandle, id);\n\n return (\n <RadixSelect.Root\n value={currentValue === '' ? undefined : currentValue}\n onValueChange={handleValueChange}\n open={openState}\n onOpenChange={setOpenState}\n disabled={effectiveDisabled}\n required={effectiveRequired}\n name={name}\n dir={dir}\n >\n <RadixSelect.Trigger\n ref={composedTriggerRef}\n id={triggerId}\n aria-label={\n ariaLabel ?? (!inFormField ? resolvedPlaceholder : undefined)\n }\n aria-labelledby={\n !ariaLabel && inFormField ? `${ctx.id}-label` : undefined\n }\n aria-describedby={describedBy}\n aria-invalid={effectiveInvalid || undefined}\n data-component=\"select\"\n data-component-id={id}\n className={selectTriggerVariants({\n size,\n tone: effectiveTone,\n className,\n })}\n >\n <RadixSelect.Value placeholder={resolvedPlaceholder} />\n <span className=\"ds:ms-auto ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n {showClear ? (\n <button\n type=\"button\"\n aria-label={t('inputs.select.clear', 'Clear selection')}\n onClick={handleClear}\n onPointerDown={(event) => event.stopPropagation()}\n onKeyDown={(event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.stopPropagation();\n }\n }}\n className={[\n 'ds:inline-flex ds:items-center ds:justify-center ds:rounded-[var(--radius-sm)]',\n 'ds:text-muted-foreground ds:hover:text-foreground',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:size-4',\n ].join(' ')}\n >\n <X aria-hidden=\"true\" className=\"ds:size-3.5\" />\n </button>\n ) : null}\n <RadixSelect.Icon asChild>\n <ChevronDown\n aria-hidden=\"true\"\n className={[\n 'ds:size-4 ds:shrink-0 ds:text-muted-foreground',\n 'ds:transition-transform ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:group-data-[state=open]:rotate-180',\n ].join(' ')}\n />\n </RadixSelect.Icon>\n </span>\n </RadixSelect.Trigger>\n <SelectContent container={container}>\n <SelectViewport>\n {options.length === 0 ? (\n <div className=\"ds:ps-8 ds:pe-3 ds:py-2 type-body-sm ds:text-muted-foreground\">\n {t('inputs.select.noOptions', 'No options')}\n </div>\n ) : (\n groups.map(({ group, items }, groupIndex) => {\n const body = items.map((option) => (\n <SelectItem\n key={option.value}\n value={option.value}\n disabled={option.disabled}\n size={size}\n data-option-id={option.value}\n >\n {option.label}\n </SelectItem>\n ));\n if (!group) {\n return (\n <RadixSelect.Group key={`group-${groupIndex}`}>\n {body}\n </RadixSelect.Group>\n );\n }\n return (\n <RadixSelect.Group key={`group-${group}`}>\n <SelectLabel>{group}</SelectLabel>\n {body}\n </RadixSelect.Group>\n );\n })\n )}\n </SelectViewport>\n </SelectContent>\n </RadixSelect.Root>\n );\n});\nSelectImpl.displayName = 'Select';\n\ninterface SelectComponent {\n <T extends string = string>(\n props: SelectProps<T> & { ref?: Ref<HTMLButtonElement> },\n ): ReactElement | null;\n displayName?: string;\n Root: typeof SelectRoot;\n Trigger: typeof SelectTrigger;\n Value: typeof SelectValue;\n Content: typeof SelectContent;\n Viewport: typeof SelectViewport;\n Item: typeof SelectItem;\n ItemText: typeof SelectItemText;\n Group: typeof SelectGroup;\n Label: typeof SelectLabel;\n Separator: typeof SelectSeparator;\n}\n\nconst SelectWithStatics = Object.assign(SelectImpl, {\n Root: SelectRoot,\n Trigger: SelectTrigger,\n Value: SelectValue,\n Content: SelectContent,\n Viewport: SelectViewport,\n Item: SelectItem,\n ItemText: SelectItemText,\n Group: SelectGroup,\n Label: SelectLabel,\n Separator: SelectSeparator,\n}) as unknown as SelectComponent;\n\nexport const Select = SelectWithStatics;\n\nexport {\n SelectRoot,\n SelectTrigger,\n SelectValue,\n SelectContent,\n SelectViewport,\n SelectItem,\n SelectItemText,\n SelectGroup,\n SelectLabel,\n SelectSeparator,\n};\n\nexport { selectTriggerVariants, selectContentVariants, selectItemVariants };\n\nexport type {\n SelectTriggerProps,\n SelectContentProps,\n SelectItemProps,\n SelectLabelProps,\n SelectRootProps,\n};\n\nexport type { ReactNode };\n"],"names":["selectAgent","handle","args","selectTriggerVariants","cva","selectContentVariants","selectItemVariants","selectLabelClasses","iconSizeByItemSize","itemIndicatorStartByItemSize","composeRefs","refs","node","r","SelectRoot","props","jsx","RadixSelect","SelectTrigger","forwardRef","size","tone","className","children","ref","SelectValue","SelectContent","position","sideOffset","container","jsxs","ChevronUp","ChevronDown","SelectViewport","SelectItem","indicatorStart","iconSize","Check","SelectItemText","SelectGroup","SelectLabel","SelectSeparator","SelectImpl","options","value","defaultValue","onValueChange","placeholder","clearable","disabled","required","name","id","ariaLabel","t","useTranslation","ctx","useFormField","inFormField","useContext","FormFieldContext","internalValue","setInternalValue","useState","isControlled","currentValue","openState","setOpenState","currentValueRef","useRef","triggerId","effectiveDisabled","effectiveRequired","effectiveInvalid","effectiveTone","describedBy","triggerRef","composedTriggerRef","dir","useDirection","emitValue","handleValueChange","next","handleClear","event","_a","resolvedPlaceholder","showClear","groups","groupOptions","agentHandle","useMemo","useAgentRegistration","X","group","items","groupIndex","body","option","SelectWithStatics","Select"],"mappings":";;;;;;;;;;;;;AASO,MAAMA,KAA0C;AAAA,EACrD,IAAI;AAAA,EACJ,cAAc,CAAC,iBAAiB,QAAQ,OAAO;AAAA,EAC/C,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,OAAA;AAAA,IAAO;AAAA,EAClC;AAAA,EAEF,SAAS;AAAA,IACP,WAAW;AAAA,MACT,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,QAAQ,CAACA,GAAQC,MAA4B;AAC3C,QAAAD,EAAO,SAASC,EAAK,KAAK;AAAA,MAC5B;AAAA,IAAA;AAAA,IAEF,OAAO;AAAA,MACL,QAAQ;AAAA,MACR,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,QAAQ,CAACD,MAAW;AAClB,QAAAA,EAAO,MAAA;AAAA,MACT;AAAA,IAAA;AAAA,IAEF,MAAM;AAAA,MACJ,QAAQ;AAAA,MACR,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,QAAQ,CAACA,MAAW;AAClB,QAAAA,EAAO,KAAA;AAAA,MACT;AAAA,IAAA;AAAA,IAEF,OAAO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,EAAA,CAC5C,IAEAwE,GAAO,IAAI,CAAC,EAAE,OAAAM,GAAO,OAAAC,EAAA,GAASC,OAAe;AAC3C,gBAAMC,IAAOF,EAAM,IAAI,CAACG,MACtB,gBAAAlF;AAAA,YAACkB;AAAA,YAAA;AAAA,cAEC,OAAOgE,EAAO;AAAA,cACd,UAAUA,EAAO;AAAA,cACjB,MAAA9E;AAAA,cACA,kBAAgB8E,EAAO;AAAA,cAEtB,UAAAA,EAAO;AAAA,YAAA;AAAA,YANHA,EAAO;AAAA,UAAA,CAQf;AACD,iBAAKJ,IAQH,gBAAAhE,EAACb,EAAY,OAAZ,EACC,UAAA;AAAA,YAAA,gBAAAD,EAACwB,KAAa,UAAAsD,EAAA,CAAM;AAAA,YACnBG;AAAA,UAAA,EAAA,GAFqB,SAASH,CAAK,EAGtC,sBATG7E,EAAY,OAAZ,EACE,UAAAgF,EAAA,GADqB,SAASD,EAAU,EAE3C;AAAA,QASN,CAAC,GAEL,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;AACDtD,EAAW,cAAc;AAmBzB,MAAMyD,KAAoB,OAAO,OAAOzD,GAAY;AAAA,EAClD,MAAM5B;AAAA,EACN,SAASI;AAAA,EACT,OAAOO;AAAA,EACP,SAASC;AAAA,EACT,UAAUO;AAAA,EACV,MAAMC;AAAA,EACN,UAAUI;AAAA,EACV,OAAOC;AAAA,EACP,OAAOC;AAAA,EACP,WAAWC;AACb,CAAC,GAEY2D,KAASD;"}
@@ -5,7 +5,7 @@ import * as k from "@radix-ui/react-dropdown-menu";
5
5
  import { a as N, c as q } from "./index-D2ZczOXr.js";
6
6
  import { useTranslation as Z } from "react-i18next";
7
7
  import { c as K } from "./compose-refs-C0k0tdqF.js";
8
- import { S as D } from "./select-hsCaJSX3.js";
8
+ import { S as D } from "./select-CEtRcon5.js";
9
9
  import { X as ee } from "./x-CCcI3eJp.js";
10
10
  import { u as te } from "./use-direction-Dp8h70PP.js";
11
11
  import { u as se } from "./registry-nPAVE19X.js";
@@ -396,4 +396,4 @@ export {
396
396
  F as c,
397
397
  re as t
398
398
  };
399
- //# sourceMappingURL=tabs-BpPYVme_.js.map
399
+ //# sourceMappingURL=tabs-BIQ0ew1T.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tabs-BpPYVme_.js","sources":["../../src/components/tabs/tabs.agent.ts","../../src/components/tabs/tabs.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { TabsHandle } from './tabs';\n\nexport const tabsAgent: AgentAdapter<TabsHandle> = {\n id: 'tabs',\n capabilities: ['select_single', 'navigate'],\n state: {\n activeTab: {\n type: 'string | null',\n description: 'Value of the currently-active tab.',\n read: (handle) => handle.getActiveTab(),\n },\n },\n actions: {\n select_tab: {\n safety: 'read',\n argsType: '{ value: string }',\n description: 'Activate the tab with the given value.',\n invoke: (handle, args: { value: string }) => {\n handle.selectTab(args.value);\n },\n },\n },\n domHooks: {\n root: { attr: 'data-component', value: 'tabs' },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop on Tabs.Root.',\n },\n item: {\n attr: 'data-tab-id',\n description: 'Each Tab.Trigger emits its value as data-tab-id.',\n },\n },\n};\n","import {\n Children,\n createContext,\n forwardRef,\n isValidElement,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n type MutableRefObject,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport * as TabsPrimitive from '@radix-ui/react-tabs';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { cva, cx, type VariantProps } from 'class-variance-authority';\nimport { X, ChevronDown } from 'lucide-react';\nimport { useTranslation } from 'react-i18next';\nimport { useDirection } from '../_shared/use-direction';\nimport { composeRefs } from '../_shared/compose-refs';\nimport { Select, type SelectOption } from '../select/select';\nimport { useAgentRegistration } from '../../agent';\nimport { tabsAgent } from './tabs.agent';\n\n// ---------------------------------------------------------------------------\n// CVA recipes\n// ---------------------------------------------------------------------------\n\nexport const tabsListVariants = cva('ds:relative ds:flex', {\n variants: {\n variant: {\n // Shadcn-style segmented control: light container, white active card\n default:\n 'ds:flex-1 ds:min-w-0 ds:items-center ds:bg-muted/10 ds:rounded-[var(--radius-md)] ds:p-1',\n // Classic underline tabs: bottom border with colored active indicator\n underlined:\n 'ds:flex-1 ds:min-w-0 ds:items-end ds:[border-block-end:1px_solid_var(--border)]',\n // Segmented control: warm secondary container, content-width\n pills:\n 'ds:items-center ds:bg-secondary ds:rounded-[var(--radius-md)] ds:p-1',\n },\n orientation: {\n horizontal: 'ds:flex-row ds:overflow-hidden',\n vertical: 'ds:flex-col',\n },\n },\n defaultVariants: {\n variant: 'default',\n orientation: 'horizontal',\n },\n});\n\nexport const tabsTriggerVariants = cva(\n [\n 'ds:relative ds:inline-flex ds:items-center ds:justify-center ds:whitespace-nowrap ds:border-0',\n 'ds:gap-2 ds:font-medium ds:transition-colors',\n 'ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:cursor-pointer ds:select-none',\n 'ds:disabled:pointer-events-none ds:disabled:opacity-50',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n ].join(' '),\n {\n variants: {\n variant: {\n default: [\n 'ds:rounded-[var(--radius-sm)] ds:bg-transparent ds:text-muted-foreground',\n 'ds:hover:bg-muted/10 ds:hover:text-foreground',\n 'ds:data-[state=active]:bg-background ds:data-[state=active]:text-foreground',\n 'ds:data-[state=active]:shadow-sm',\n ].join(' '),\n underlined: [\n 'ds:bg-transparent ds:text-muted-foreground',\n 'ds:[border-block-end:2px_solid_transparent]',\n 'ds:hover:bg-muted/10 ds:hover:text-foreground',\n 'ds:data-[state=active]:[border-block-end-color:var(--primary)]',\n 'ds:data-[state=active]:text-foreground ds:data-[state=active]:[margin-block-end:-1px]',\n ].join(' '),\n pills: [\n 'ds:rounded-[var(--radius-full)] ds:bg-transparent ds:text-muted-foreground',\n 'ds:hover:bg-muted/20 ds:hover:text-foreground',\n 'ds:data-[state=active]:bg-primary ds:data-[state=active]:text-primary-foreground',\n ].join(' '),\n },\n size: {\n sm: 'ds:h-8 ds:px-[var(--spacing-sm)] ds:text-[length:var(--font-size-sm)]',\n md: 'ds:h-10 ds:px-[var(--spacing-md)] ds:text-[length:var(--font-size-base)]',\n lg: 'ds:h-12 ds:px-[var(--spacing-lg)] ds:text-[length:var(--font-size-lg)]',\n },\n orientation: {\n horizontal: '',\n vertical: 'ds:w-full ds:justify-start',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n orientation: 'horizontal',\n },\n },\n);\n\n// ---------------------------------------------------------------------------\n// Context\n// ---------------------------------------------------------------------------\n\ntype TabsOverflow = 'dropdown' | 'select';\n\ninterface TabsContextValue {\n variant: 'default' | 'underlined' | 'pills';\n size: 'sm' | 'md' | 'lg';\n orientation: 'horizontal' | 'vertical';\n overflow: TabsOverflow;\n value: string;\n setValue: (value: string) => void;\n}\n\nconst TabsContext = createContext<TabsContextValue>({\n variant: 'default',\n size: 'md',\n orientation: 'horizontal',\n overflow: 'dropdown',\n value: '',\n setValue: () => {},\n});\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n// Curated agent-readiness handle — see tabs.agent.ts.\nexport interface TabsHandle {\n getActiveTab: () => string | null;\n selectTab: (value: string) => void;\n}\n\nexport interface TabsRootProps extends Omit<\n ComponentPropsWithoutRef<typeof TabsPrimitive.Root>,\n 'orientation'\n> {\n variant?: 'default' | 'underlined' | 'pills';\n size?: 'sm' | 'md' | 'lg';\n orientation?: 'horizontal' | 'vertical';\n /**\n * Strategy for tabs that don't fit horizontally.\n *\n * - `'dropdown'` (default) — overflowing tabs collapse into a \"More\"\n * `DropdownMenu` rendered next to the visible tab list. Most tabs\n * stay visible inline; the few that don't fit hide behind the menu.\n * Best when there are 5–7 tabs at moderately narrow viewports.\n * - `'select'` — at narrow container widths (under the `@md` breakpoint)\n * the entire tab strip collapses into a single `Select` whose value\n * is the active tab. Best when there are many tabs and the panel is\n * genuinely cramped (mobile, side-panel host). Above `@md`, the\n * inline tab list reappears unchanged.\n *\n * Limitation: the Select mirror builds option labels from each\n * `Tabs.Trigger`'s `children`. Plain string / number children are\n * used verbatim; richer children (icon + text, fragments) fall back\n * to the trigger's `value` so the option remains selectable. Prefer\n * plain-text trigger children when using `overflow=\"select\"`, or use\n * the trigger's `icon` prop for the icon and keep `children` a\n * plain string.\n *\n * @default 'dropdown'\n */\n overflow?: TabsOverflow;\n}\n\nexport interface TabsListProps extends ComponentPropsWithoutRef<\n typeof TabsPrimitive.List\n> {\n 'aria-label'?: string;\n}\n\nexport interface TabsTriggerProps\n extends\n ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>,\n VariantProps<typeof tabsTriggerVariants> {\n icon?: ReactNode;\n badge?: ReactNode;\n dismissible?: boolean;\n onDismiss?: () => void;\n}\n\nexport type TabsContentProps = ComponentPropsWithoutRef<\n typeof TabsPrimitive.Content\n>;\n\n// ---------------------------------------------------------------------------\n// TabsRoot\n// ---------------------------------------------------------------------------\n\nconst TabsRoot = forwardRef<HTMLDivElement, TabsRootProps>(\n (\n {\n variant = 'default',\n size = 'md',\n orientation = 'horizontal',\n overflow = 'dropdown',\n className,\n children,\n value: valueProp,\n defaultValue,\n onValueChange,\n id,\n ...props\n },\n ref,\n ) => {\n const rootRef = useRef<HTMLDivElement>(null);\n const composedRef = composeRefs(ref, rootRef);\n const dir = useDirection(rootRef);\n\n // Track the active tab so the `overflow=\"select\"` mirror can read it\n // without forcing consumers into controlled mode. If `value` is passed\n // we honour it; otherwise we manage internal state seeded from\n // `defaultValue` and notify consumers via `onValueChange`. Net effect\n // is identical to Radix's own controlled / uncontrolled split — we\n // just shadow the value into context so the Select can mirror it.\n const isControlled = valueProp !== undefined;\n const [internalValue, setInternalValue] = useState<string>(\n defaultValue ?? '',\n );\n const value = isControlled ? (valueProp ?? '') : internalValue;\n const setValue = useCallback(\n (next: string) => {\n if (!isControlled) setInternalValue(next);\n onValueChange?.(next);\n },\n [isControlled, onValueChange],\n );\n\n const ctxValue = useMemo(\n () => ({ variant, size, orientation, overflow, value, setValue }),\n [variant, size, orientation, overflow, value, setValue],\n );\n\n // Agent handle — ref mirrors value for fresh reads.\n const valueRef = useRef<string>(value);\n useEffect(() => {\n valueRef.current = value;\n }, [value]);\n\n const agentHandle = useMemo<TabsHandle>(\n () => ({\n getActiveTab: () => valueRef.current || null,\n selectTab: (next) => setValue(next),\n }),\n [setValue],\n );\n useAgentRegistration(tabsAgent, agentHandle, id);\n\n return (\n <TabsContext.Provider value={ctxValue}>\n <TabsPrimitive.Root\n ref={composedRef}\n orientation={orientation}\n dir={dir}\n // We always run Radix in controlled mode against our shadow state\n // (seeded from `defaultValue`) so the `overflow=\"select\"` mirror\n // can read the active value via context without DOM observation.\n value={value}\n onValueChange={setValue}\n id={id}\n data-component=\"tabs\"\n data-component-id={id}\n className={cx(\n 'ds:flex',\n orientation === 'vertical'\n ? 'ds:flex-row ds:gap-[var(--spacing-md)]'\n : 'ds:flex-col',\n className,\n )}\n {...props}\n >\n {children}\n </TabsPrimitive.Root>\n </TabsContext.Provider>\n );\n },\n);\nTabsRoot.displayName = 'Tabs';\n\n// ---------------------------------------------------------------------------\n// TabsList — with overflow detection\n// ---------------------------------------------------------------------------\n\nconst TabsList = forwardRef<HTMLDivElement, TabsListProps>(\n ({ className, children, 'aria-label': ariaLabel, ...props }, ref) => {\n const { variant, size, orientation, overflow, value, setValue } =\n useContext(TabsContext);\n const { t } = useTranslation();\n\n const listRef = useRef<HTMLDivElement>(null);\n const [overflowTabs, setOverflowTabs] = useState<\n { value: string; label: string }[]\n >([]);\n const isHorizontal = orientation === 'horizontal';\n // The `select` overflow strategy renders a Select mirror at narrow\n // container widths and skips the DropdownMenu overflow detector\n // (it's the wrong UX for that case — a select-and-a-dropdown would\n // double up). The dropdown detector only runs when `overflow` is\n // `dropdown` and the strip is horizontal.\n const isDropdownOverflow = overflow === 'dropdown' && isHorizontal;\n\n useEffect(() => {\n if (!isDropdownOverflow) {\n setOverflowTabs([]);\n return;\n }\n const el = listRef.current;\n if (!el) return;\n\n const detectOverflow = () => {\n const containerRight = el.getBoundingClientRect().right;\n const hidden: { value: string; label: string }[] = [];\n el.querySelectorAll<HTMLButtonElement>('[role=\"tab\"]').forEach(\n (tab) => {\n const rect = tab.getBoundingClientRect();\n if (rect.right > containerRight + 2) {\n const value =\n tab.getAttribute('data-value') ?? tab.dataset['value'] ?? '';\n const label = tab.textContent?.trim() ?? value;\n hidden.push({ value, label });\n }\n },\n );\n setOverflowTabs(hidden);\n };\n\n const ro = new ResizeObserver(detectOverflow);\n ro.observe(el);\n detectOverflow();\n return () => ro.disconnect();\n }, [isDropdownOverflow, children]);\n\n const combinedRef = (node: HTMLDivElement | null) => {\n (listRef as MutableRefObject<HTMLDivElement | null>).current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref)\n (ref as MutableRefObject<HTMLDivElement | null>).current = node;\n };\n\n // For `overflow=\"select\"` we mirror the Trigger children as Select\n // options. Triggers may carry icon + text; for the Select label we\n // prefer the trigger's plain-text children — anything else falls\n // back to the trigger's `value` so the option is at least selectable.\n const selectOptions = useMemo<SelectOption<string>[]>(() => {\n if (overflow !== 'select') return [];\n return Children.toArray(children)\n .filter((child): child is ReactElement<TabsTriggerProps> =>\n isValidElement(child),\n )\n .filter(\n (child) =>\n typeof child.props.value === 'string' &&\n child.props.value.length > 0,\n )\n .map((child) => {\n const triggerValue = child.props.value as string;\n const labelChild = child.props.children;\n const label =\n typeof labelChild === 'string'\n ? labelChild\n : typeof labelChild === 'number'\n ? String(labelChild)\n : triggerValue;\n return { value: triggerValue, label };\n });\n }, [children, overflow]);\n\n if (overflow === 'select' && isHorizontal) {\n // Container queries gate the swap: above `@md` (Tailwind v4 default\n // 28rem container width) the inline tab strip renders; below it,\n // the Select takes over. The Tabs.List markup stays mounted in\n // both modes so Radix's roving-tabindex / ARIA wiring is preserved\n // even when the strip is visually hidden — keyboard users who land\n // on the panel via skip-link still get to the active tab.\n return (\n <div className=\"ds:@container/tabs ds:relative ds:w-full\">\n {/* Select mirror — visible at narrow container widths only. */}\n <div className=\"ds:block ds:@md/tabs:hidden\">\n <Select\n options={selectOptions}\n value={value}\n onValueChange={(next) => {\n if (typeof next === 'string' && next.length > 0) setValue(next);\n }}\n size={size}\n aria-label={ariaLabel ?? t('tabs.selectLabel')}\n />\n </div>\n {/* Inline tab strip — visible at wider container widths. */}\n <div className=\"ds:hidden ds:@md/tabs:flex ds:relative ds:items-center\">\n <TabsPrimitive.List\n ref={combinedRef}\n aria-label={ariaLabel}\n className={tabsListVariants({ variant, orientation, className })}\n {...props}\n >\n {children}\n </TabsPrimitive.List>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"ds:relative ds:flex ds:items-center\">\n <TabsPrimitive.List\n ref={combinedRef}\n aria-label={ariaLabel}\n className={tabsListVariants({ variant, orientation, className })}\n {...props}\n >\n {children}\n </TabsPrimitive.List>\n\n {isDropdownOverflow && overflowTabs.length > 0 && (\n <OverflowMenu\n tabs={overflowTabs}\n label={t('tabs.moreTabs')}\n size={size}\n />\n )}\n </div>\n );\n },\n);\nTabsList.displayName = 'TabsList';\n\n// ---------------------------------------------------------------------------\n// OverflowMenu (internal)\n// ---------------------------------------------------------------------------\n\ninterface OverflowMenuProps {\n tabs: { value: string; label: string }[];\n label: string;\n size: 'sm' | 'md' | 'lg';\n}\n\nfunction OverflowMenu({ tabs, label, size }: OverflowMenuProps) {\n const { variant } = useContext(TabsContext);\n\n return (\n <DropdownMenuPrimitive.Root>\n <DropdownMenuPrimitive.Trigger\n className={cx(\n tabsTriggerVariants({ variant, size, orientation: 'horizontal' }),\n 'ds:shrink-0 ds:ms-1',\n )}\n aria-label={label}\n >\n {label}\n <ChevronDown aria-hidden=\"true\" className=\"ds:size-4\" />\n </DropdownMenuPrimitive.Trigger>\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n sideOffset={4}\n className={cx(\n 'ds:z-50 ds:min-w-40 ds:overflow-hidden ds:rounded-[var(--radius-md)]',\n 'ds:border ds:border-border ds:bg-popover ds:p-1 ds:shadow-md',\n 'ds:data-[state=open]:animate-in ds:data-[state=closed]:animate-out',\n 'ds:data-[state=closed]:fade-out-0 ds:data-[state=open]:fade-in-0',\n 'ds:data-[state=closed]:zoom-out-95 ds:data-[state=open]:zoom-in-95',\n )}\n >\n {tabs.map(({ value, label: tabLabel }) => (\n <DropdownMenuPrimitive.Item\n key={value}\n className={cx(\n 'ds:relative ds:flex ds:cursor-pointer ds:select-none ds:items-center',\n 'ds:rounded-[var(--radius-sm)] ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-xs)]',\n 'ds:text-[var(--font-size-sm)] ds:text-foreground ds:outline-none',\n 'ds:hover:bg-muted ds:focus:bg-muted',\n 'ds:data-[disabled]:pointer-events-none ds:data-[disabled]:opacity-50',\n )}\n onSelect={() => {\n const tab = document.querySelector<HTMLButtonElement>(\n `[role=\"tab\"][data-value=\"${CSS.escape(value)}\"]`,\n );\n tab?.click();\n tab?.scrollIntoView({ inline: 'nearest' });\n }}\n >\n {tabLabel}\n </DropdownMenuPrimitive.Item>\n ))}\n </DropdownMenuPrimitive.Content>\n </DropdownMenuPrimitive.Portal>\n </DropdownMenuPrimitive.Root>\n );\n}\n\n// ---------------------------------------------------------------------------\n// TabsTrigger\n// ---------------------------------------------------------------------------\n\nconst TabsTrigger = forwardRef<HTMLButtonElement, TabsTriggerProps>(\n (\n {\n variant: variantProp,\n size: sizeProp,\n orientation: orientationProp,\n icon,\n badge,\n dismissible = false,\n onDismiss,\n className,\n children,\n value,\n onKeyDown,\n ...props\n },\n ref,\n ) => {\n const ctx = useContext(TabsContext);\n const variant = variantProp ?? ctx.variant;\n const size = sizeProp ?? ctx.size;\n const orientation = orientationProp ?? ctx.orientation;\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLButtonElement>) => {\n // APG dismissible-tab pattern: Delete/Backspace while trigger is focused closes the tab.\n // The visual X is pointer-only (aria-hidden) to avoid nested-interactive HTML violation.\n if (dismissible && (e.key === 'Delete' || e.key === 'Backspace')) {\n e.preventDefault();\n onDismiss?.();\n }\n onKeyDown?.(e);\n };\n\n return (\n <TabsPrimitive.Trigger\n ref={ref}\n value={value}\n data-value={value}\n className={tabsTriggerVariants({\n variant,\n size,\n orientation,\n className,\n })}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {icon && (\n <span aria-hidden=\"true\" className=\"ds:shrink-0 ds:size-4\">\n {icon}\n </span>\n )}\n {children}\n {badge && <span className=\"ds:shrink-0\">{badge}</span>}\n {dismissible && (\n // Visual-only dismiss indicator — pointer dismiss fires here; keyboard dismiss fires via Delete/Backspace on the trigger above.\n // No role/tabIndex to avoid nested-interactive (interactive content inside <button> is invalid HTML).\n <span\n aria-hidden=\"true\"\n className={cx(\n 'ds:inline-flex ds:items-center ds:justify-center ds:shrink-0',\n 'ds:size-6 ds:rounded-[var(--radius-sm)]',\n 'ds:hover:bg-muted-foreground/20',\n )}\n onPointerDown={(e) => {\n e.stopPropagation();\n e.preventDefault();\n onDismiss?.();\n }}\n >\n <X className=\"ds:size-3.5\" />\n </span>\n )}\n </TabsPrimitive.Trigger>\n );\n },\n);\nTabsTrigger.displayName = 'TabsTrigger';\n\n// ---------------------------------------------------------------------------\n// TabsContent\n// ---------------------------------------------------------------------------\n\nconst TabsContent = forwardRef<HTMLDivElement, TabsContentProps>(\n ({ className, children, ...props }, ref) => (\n <TabsPrimitive.Content\n ref={ref}\n className={cx(\n 'ds:mt-[var(--spacing-sm)] ds:outline-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n className,\n )}\n {...props}\n >\n {children}\n </TabsPrimitive.Content>\n ),\n);\nTabsContent.displayName = 'TabsContent';\n\n// ---------------------------------------------------------------------------\n// Compound export\n// ---------------------------------------------------------------------------\n\nexport const Tabs = Object.assign(TabsRoot, {\n Root: TabsRoot,\n List: TabsList,\n Trigger: TabsTrigger,\n Content: TabsContent,\n});\n\nexport { TabsList, TabsTrigger, TabsContent };\n"],"names":["tabsAgent","handle","args","tabsListVariants","cva","tabsTriggerVariants","TabsContext","createContext","TabsRoot","forwardRef","variant","size","orientation","overflow","className","children","valueProp","defaultValue","onValueChange","id","props","ref","rootRef","useRef","composedRef","composeRefs","dir","useDirection","isControlled","internalValue","setInternalValue","useState","value","setValue","useCallback","next","ctxValue","useMemo","valueRef","useEffect","agentHandle","useAgentRegistration","jsx","TabsPrimitive","cx","TabsList","ariaLabel","useContext","t","useTranslation","listRef","overflowTabs","setOverflowTabs","isHorizontal","isDropdownOverflow","el","detectOverflow","containerRight","hidden","tab","label","_a","ro","combinedRef","node","selectOptions","Children","child","isValidElement","triggerValue","labelChild","jsxs","Select","OverflowMenu","tabs","DropdownMenuPrimitive","ChevronDown","tabLabel","TabsTrigger","variantProp","sizeProp","orientationProp","icon","badge","dismissible","onDismiss","onKeyDown","ctx","handleKeyDown","e","X","TabsContent","Tabs"],"mappings":";;;;;;;;;;;;AAGO,MAAMA,KAAsC;AAAA,EACjD,IAAI;AAAA,EACJ,cAAc,CAAC,iBAAiB,UAAU;AAAA,EAC1C,OAAO;AAAA,IACL,WAAW;AAAA,MACT,MAAM;AAAA,MACN,aAAa;AAAA,MACb,MAAM,CAACC,MAAWA,EAAO,aAAA;AAAA,IAAa;AAAA,EACxC;AAAA,EAEF,SAAS;AAAA,IACP,YAAY;AAAA,MACV,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,aAAa;AAAA,MACb,QAAQ,CAACA,GAAQC,MAA4B;AAC3C,QAAAD,EAAO,UAAUC,EAAK,KAAK;AAAA,MAC7B;AAAA,IAAA;AAAA,EACF;AAAA,EAEF,UAAU;AAAA,IACR,MAAM,EA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;AAAA,QAC7B;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AACAZ,EAAY,cAAc;AAM1B,MAAMa,IAAclF;AAAA,EAClB,CAAC,EAAE,WAAAK,GAAW,UAAAC,GAAU,GAAGK,EAAA,GAASC,MAClC,gBAAAqB;AAAA,IAACC,EAAc;AAAA,IAAd;AAAA,MACC,KAAAtB;AAAA,MACA,WAAWuB;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA9B;AAAA,MAAA;AAAA,MAED,GAAGM;AAAA,MAEH,UAAAL;AAAA,IAAA;AAAA,EAAA;AAGP;AACA4E,EAAY,cAAc;AAMnB,MAAMC,KAAO,OAAO,OAAOpF,GAAU;AAAA,EAC1C,MAAMA;AAAA,EACN,MAAMqC;AAAA,EACN,SAASiC;AAAA,EACT,SAASa;AACX,CAAC;"}
1
+ {"version":3,"file":"tabs-BIQ0ew1T.js","sources":["../../src/components/tabs/tabs.agent.ts","../../src/components/tabs/tabs.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { TabsHandle } from './tabs';\n\nexport const tabsAgent: AgentAdapter<TabsHandle> = {\n id: 'tabs',\n capabilities: ['select_single', 'navigate'],\n state: {\n activeTab: {\n type: 'string | null',\n description: 'Value of the currently-active tab.',\n read: (handle) => handle.getActiveTab(),\n },\n },\n actions: {\n select_tab: {\n safety: 'read',\n argsType: '{ value: string }',\n description: 'Activate the tab with the given value.',\n invoke: (handle, args: { value: string }) => {\n handle.selectTab(args.value);\n },\n },\n },\n domHooks: {\n root: { attr: 'data-component', value: 'tabs' },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop on Tabs.Root.',\n },\n item: {\n attr: 'data-tab-id',\n description: 'Each Tab.Trigger emits its value as data-tab-id.',\n },\n },\n};\n","import {\n Children,\n createContext,\n forwardRef,\n isValidElement,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n type MutableRefObject,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport * as TabsPrimitive from '@radix-ui/react-tabs';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { cva, cx, type VariantProps } from 'class-variance-authority';\nimport { X, ChevronDown } from 'lucide-react';\nimport { useTranslation } from 'react-i18next';\nimport { useDirection } from '../_shared/use-direction';\nimport { composeRefs } from '../_shared/compose-refs';\nimport { Select, type SelectOption } from '../select/select';\nimport { useAgentRegistration } from '../../agent';\nimport { tabsAgent } from './tabs.agent';\n\n// ---------------------------------------------------------------------------\n// CVA recipes\n// ---------------------------------------------------------------------------\n\nexport const tabsListVariants = cva('ds:relative ds:flex', {\n variants: {\n variant: {\n // Shadcn-style segmented control: light container, white active card\n default:\n 'ds:flex-1 ds:min-w-0 ds:items-center ds:bg-muted/10 ds:rounded-[var(--radius-md)] ds:p-1',\n // Classic underline tabs: bottom border with colored active indicator\n underlined:\n 'ds:flex-1 ds:min-w-0 ds:items-end ds:[border-block-end:1px_solid_var(--border)]',\n // Segmented control: warm secondary container, content-width\n pills:\n 'ds:items-center ds:bg-secondary ds:rounded-[var(--radius-md)] ds:p-1',\n },\n orientation: {\n horizontal: 'ds:flex-row ds:overflow-hidden',\n vertical: 'ds:flex-col',\n },\n },\n defaultVariants: {\n variant: 'default',\n orientation: 'horizontal',\n },\n});\n\nexport const tabsTriggerVariants = cva(\n [\n 'ds:relative ds:inline-flex ds:items-center ds:justify-center ds:whitespace-nowrap ds:border-0',\n 'ds:gap-2 ds:font-medium ds:transition-colors',\n 'ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:cursor-pointer ds:select-none',\n 'ds:disabled:pointer-events-none ds:disabled:opacity-50',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n ].join(' '),\n {\n variants: {\n variant: {\n default: [\n 'ds:rounded-[var(--radius-sm)] ds:bg-transparent ds:text-muted-foreground',\n 'ds:hover:bg-muted/10 ds:hover:text-foreground',\n 'ds:data-[state=active]:bg-background ds:data-[state=active]:text-foreground',\n 'ds:data-[state=active]:shadow-sm',\n ].join(' '),\n underlined: [\n 'ds:bg-transparent ds:text-muted-foreground',\n 'ds:[border-block-end:2px_solid_transparent]',\n 'ds:hover:bg-muted/10 ds:hover:text-foreground',\n 'ds:data-[state=active]:[border-block-end-color:var(--primary)]',\n 'ds:data-[state=active]:text-foreground ds:data-[state=active]:[margin-block-end:-1px]',\n ].join(' '),\n pills: [\n 'ds:rounded-[var(--radius-full)] ds:bg-transparent ds:text-muted-foreground',\n 'ds:hover:bg-muted/20 ds:hover:text-foreground',\n 'ds:data-[state=active]:bg-primary ds:data-[state=active]:text-primary-foreground',\n ].join(' '),\n },\n size: {\n sm: 'ds:h-8 ds:px-[var(--spacing-sm)] ds:text-[length:var(--font-size-sm)]',\n md: 'ds:h-10 ds:px-[var(--spacing-md)] ds:text-[length:var(--font-size-base)]',\n lg: 'ds:h-12 ds:px-[var(--spacing-lg)] ds:text-[length:var(--font-size-lg)]',\n },\n orientation: {\n horizontal: '',\n vertical: 'ds:w-full ds:justify-start',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n orientation: 'horizontal',\n },\n },\n);\n\n// ---------------------------------------------------------------------------\n// Context\n// ---------------------------------------------------------------------------\n\ntype TabsOverflow = 'dropdown' | 'select';\n\ninterface TabsContextValue {\n variant: 'default' | 'underlined' | 'pills';\n size: 'sm' | 'md' | 'lg';\n orientation: 'horizontal' | 'vertical';\n overflow: TabsOverflow;\n value: string;\n setValue: (value: string) => void;\n}\n\nconst TabsContext = createContext<TabsContextValue>({\n variant: 'default',\n size: 'md',\n orientation: 'horizontal',\n overflow: 'dropdown',\n value: '',\n setValue: () => {},\n});\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n// Curated agent-readiness handle — see tabs.agent.ts.\nexport interface TabsHandle {\n getActiveTab: () => string | null;\n selectTab: (value: string) => void;\n}\n\nexport interface TabsRootProps extends Omit<\n ComponentPropsWithoutRef<typeof TabsPrimitive.Root>,\n 'orientation'\n> {\n variant?: 'default' | 'underlined' | 'pills';\n size?: 'sm' | 'md' | 'lg';\n orientation?: 'horizontal' | 'vertical';\n /**\n * Strategy for tabs that don't fit horizontally.\n *\n * - `'dropdown'` (default) — overflowing tabs collapse into a \"More\"\n * `DropdownMenu` rendered next to the visible tab list. Most tabs\n * stay visible inline; the few that don't fit hide behind the menu.\n * Best when there are 5–7 tabs at moderately narrow viewports.\n * - `'select'` — at narrow container widths (under the `@md` breakpoint)\n * the entire tab strip collapses into a single `Select` whose value\n * is the active tab. Best when there are many tabs and the panel is\n * genuinely cramped (mobile, side-panel host). Above `@md`, the\n * inline tab list reappears unchanged.\n *\n * Limitation: the Select mirror builds option labels from each\n * `Tabs.Trigger`'s `children`. Plain string / number children are\n * used verbatim; richer children (icon + text, fragments) fall back\n * to the trigger's `value` so the option remains selectable. Prefer\n * plain-text trigger children when using `overflow=\"select\"`, or use\n * the trigger's `icon` prop for the icon and keep `children` a\n * plain string.\n *\n * @default 'dropdown'\n */\n overflow?: TabsOverflow;\n}\n\nexport interface TabsListProps extends ComponentPropsWithoutRef<\n typeof TabsPrimitive.List\n> {\n 'aria-label'?: string;\n}\n\nexport interface TabsTriggerProps\n extends\n ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>,\n VariantProps<typeof tabsTriggerVariants> {\n icon?: ReactNode;\n badge?: ReactNode;\n dismissible?: boolean;\n onDismiss?: () => void;\n}\n\nexport type TabsContentProps = ComponentPropsWithoutRef<\n typeof TabsPrimitive.Content\n>;\n\n// ---------------------------------------------------------------------------\n// TabsRoot\n// ---------------------------------------------------------------------------\n\nconst TabsRoot = forwardRef<HTMLDivElement, TabsRootProps>(\n (\n {\n variant = 'default',\n size = 'md',\n orientation = 'horizontal',\n overflow = 'dropdown',\n className,\n children,\n value: valueProp,\n defaultValue,\n onValueChange,\n id,\n ...props\n },\n ref,\n ) => {\n const rootRef = useRef<HTMLDivElement>(null);\n const composedRef = composeRefs(ref, rootRef);\n const dir = useDirection(rootRef);\n\n // Track the active tab so the `overflow=\"select\"` mirror can read it\n // without forcing consumers into controlled mode. If `value` is passed\n // we honour it; otherwise we manage internal state seeded from\n // `defaultValue` and notify consumers via `onValueChange`. Net effect\n // is identical to Radix's own controlled / uncontrolled split — we\n // just shadow the value into context so the Select can mirror it.\n const isControlled = valueProp !== undefined;\n const [internalValue, setInternalValue] = useState<string>(\n defaultValue ?? '',\n );\n const value = isControlled ? (valueProp ?? '') : internalValue;\n const setValue = useCallback(\n (next: string) => {\n if (!isControlled) setInternalValue(next);\n onValueChange?.(next);\n },\n [isControlled, onValueChange],\n );\n\n const ctxValue = useMemo(\n () => ({ variant, size, orientation, overflow, value, setValue }),\n [variant, size, orientation, overflow, value, setValue],\n );\n\n // Agent handle — ref mirrors value for fresh reads.\n const valueRef = useRef<string>(value);\n useEffect(() => {\n valueRef.current = value;\n }, [value]);\n\n const agentHandle = useMemo<TabsHandle>(\n () => ({\n getActiveTab: () => valueRef.current || null,\n selectTab: (next) => setValue(next),\n }),\n [setValue],\n );\n useAgentRegistration(tabsAgent, agentHandle, id);\n\n return (\n <TabsContext.Provider value={ctxValue}>\n <TabsPrimitive.Root\n ref={composedRef}\n orientation={orientation}\n dir={dir}\n // We always run Radix in controlled mode against our shadow state\n // (seeded from `defaultValue`) so the `overflow=\"select\"` mirror\n // can read the active value via context without DOM observation.\n value={value}\n onValueChange={setValue}\n id={id}\n data-component=\"tabs\"\n data-component-id={id}\n className={cx(\n 'ds:flex',\n orientation === 'vertical'\n ? 'ds:flex-row ds:gap-[var(--spacing-md)]'\n : 'ds:flex-col',\n className,\n )}\n {...props}\n >\n {children}\n </TabsPrimitive.Root>\n </TabsContext.Provider>\n );\n },\n);\nTabsRoot.displayName = 'Tabs';\n\n// ---------------------------------------------------------------------------\n// TabsList — with overflow detection\n// ---------------------------------------------------------------------------\n\nconst TabsList = forwardRef<HTMLDivElement, TabsListProps>(\n ({ className, children, 'aria-label': ariaLabel, ...props }, ref) => {\n const { variant, size, orientation, overflow, value, setValue } =\n useContext(TabsContext);\n const { t } = useTranslation();\n\n const listRef = useRef<HTMLDivElement>(null);\n const [overflowTabs, setOverflowTabs] = useState<\n { value: string; label: string }[]\n >([]);\n const isHorizontal = orientation === 'horizontal';\n // The `select` overflow strategy renders a Select mirror at narrow\n // container widths and skips the DropdownMenu overflow detector\n // (it's the wrong UX for that case — a select-and-a-dropdown would\n // double up). The dropdown detector only runs when `overflow` is\n // `dropdown` and the strip is horizontal.\n const isDropdownOverflow = overflow === 'dropdown' && isHorizontal;\n\n useEffect(() => {\n if (!isDropdownOverflow) {\n setOverflowTabs([]);\n return;\n }\n const el = listRef.current;\n if (!el) return;\n\n const detectOverflow = () => {\n const containerRight = el.getBoundingClientRect().right;\n const hidden: { value: string; label: string }[] = [];\n el.querySelectorAll<HTMLButtonElement>('[role=\"tab\"]').forEach(\n (tab) => {\n const rect = tab.getBoundingClientRect();\n if (rect.right > containerRight + 2) {\n const value =\n tab.getAttribute('data-value') ?? tab.dataset['value'] ?? '';\n const label = tab.textContent?.trim() ?? value;\n hidden.push({ value, label });\n }\n },\n );\n setOverflowTabs(hidden);\n };\n\n const ro = new ResizeObserver(detectOverflow);\n ro.observe(el);\n detectOverflow();\n return () => ro.disconnect();\n }, [isDropdownOverflow, children]);\n\n const combinedRef = (node: HTMLDivElement | null) => {\n (listRef as MutableRefObject<HTMLDivElement | null>).current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref)\n (ref as MutableRefObject<HTMLDivElement | null>).current = node;\n };\n\n // For `overflow=\"select\"` we mirror the Trigger children as Select\n // options. Triggers may carry icon + text; for the Select label we\n // prefer the trigger's plain-text children — anything else falls\n // back to the trigger's `value` so the option is at least selectable.\n const selectOptions = useMemo<SelectOption<string>[]>(() => {\n if (overflow !== 'select') return [];\n return Children.toArray(children)\n .filter((child): child is ReactElement<TabsTriggerProps> =>\n isValidElement(child),\n )\n .filter(\n (child) =>\n typeof child.props.value === 'string' &&\n child.props.value.length > 0,\n )\n .map((child) => {\n const triggerValue = child.props.value as string;\n const labelChild = child.props.children;\n const label =\n typeof labelChild === 'string'\n ? labelChild\n : typeof labelChild === 'number'\n ? String(labelChild)\n : triggerValue;\n return { value: triggerValue, label };\n });\n }, [children, overflow]);\n\n if (overflow === 'select' && isHorizontal) {\n // Container queries gate the swap: above `@md` (Tailwind v4 default\n // 28rem container width) the inline tab strip renders; below it,\n // the Select takes over. The Tabs.List markup stays mounted in\n // both modes so Radix's roving-tabindex / ARIA wiring is preserved\n // even when the strip is visually hidden — keyboard users who land\n // on the panel via skip-link still get to the active tab.\n return (\n <div className=\"ds:@container/tabs ds:relative ds:w-full\">\n {/* Select mirror — visible at narrow container widths only. */}\n <div className=\"ds:block ds:@md/tabs:hidden\">\n <Select\n options={selectOptions}\n value={value}\n onValueChange={(next) => {\n if (typeof next === 'string' && next.length > 0) setValue(next);\n }}\n size={size}\n aria-label={ariaLabel ?? t('tabs.selectLabel')}\n />\n </div>\n {/* Inline tab strip — visible at wider container widths. */}\n <div className=\"ds:hidden ds:@md/tabs:flex ds:relative ds:items-center\">\n <TabsPrimitive.List\n ref={combinedRef}\n aria-label={ariaLabel}\n className={tabsListVariants({ variant, orientation, className })}\n {...props}\n >\n {children}\n </TabsPrimitive.List>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"ds:relative ds:flex ds:items-center\">\n <TabsPrimitive.List\n ref={combinedRef}\n aria-label={ariaLabel}\n className={tabsListVariants({ variant, orientation, className })}\n {...props}\n >\n {children}\n </TabsPrimitive.List>\n\n {isDropdownOverflow && overflowTabs.length > 0 && (\n <OverflowMenu\n tabs={overflowTabs}\n label={t('tabs.moreTabs')}\n size={size}\n />\n )}\n </div>\n );\n },\n);\nTabsList.displayName = 'TabsList';\n\n// ---------------------------------------------------------------------------\n// OverflowMenu (internal)\n// ---------------------------------------------------------------------------\n\ninterface OverflowMenuProps {\n tabs: { value: string; label: string }[];\n label: string;\n size: 'sm' | 'md' | 'lg';\n}\n\nfunction OverflowMenu({ tabs, label, size }: OverflowMenuProps) {\n const { variant } = useContext(TabsContext);\n\n return (\n <DropdownMenuPrimitive.Root>\n <DropdownMenuPrimitive.Trigger\n className={cx(\n tabsTriggerVariants({ variant, size, orientation: 'horizontal' }),\n 'ds:shrink-0 ds:ms-1',\n )}\n aria-label={label}\n >\n {label}\n <ChevronDown aria-hidden=\"true\" className=\"ds:size-4\" />\n </DropdownMenuPrimitive.Trigger>\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n sideOffset={4}\n className={cx(\n 'ds:z-50 ds:min-w-40 ds:overflow-hidden ds:rounded-[var(--radius-md)]',\n 'ds:border ds:border-border ds:bg-popover ds:p-1 ds:shadow-md',\n 'ds:data-[state=open]:animate-in ds:data-[state=closed]:animate-out',\n 'ds:data-[state=closed]:fade-out-0 ds:data-[state=open]:fade-in-0',\n 'ds:data-[state=closed]:zoom-out-95 ds:data-[state=open]:zoom-in-95',\n )}\n >\n {tabs.map(({ value, label: tabLabel }) => (\n <DropdownMenuPrimitive.Item\n key={value}\n className={cx(\n 'ds:relative ds:flex ds:cursor-pointer ds:select-none ds:items-center',\n 'ds:rounded-[var(--radius-sm)] ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-xs)]',\n 'ds:text-[var(--font-size-sm)] ds:text-foreground ds:outline-none',\n 'ds:hover:bg-muted ds:focus:bg-muted',\n 'ds:data-[disabled]:pointer-events-none ds:data-[disabled]:opacity-50',\n )}\n onSelect={() => {\n const tab = document.querySelector<HTMLButtonElement>(\n `[role=\"tab\"][data-value=\"${CSS.escape(value)}\"]`,\n );\n tab?.click();\n tab?.scrollIntoView({ inline: 'nearest' });\n }}\n >\n {tabLabel}\n </DropdownMenuPrimitive.Item>\n ))}\n </DropdownMenuPrimitive.Content>\n </DropdownMenuPrimitive.Portal>\n </DropdownMenuPrimitive.Root>\n );\n}\n\n// ---------------------------------------------------------------------------\n// TabsTrigger\n// ---------------------------------------------------------------------------\n\nconst TabsTrigger = forwardRef<HTMLButtonElement, TabsTriggerProps>(\n (\n {\n variant: variantProp,\n size: sizeProp,\n orientation: orientationProp,\n icon,\n badge,\n dismissible = false,\n onDismiss,\n className,\n children,\n value,\n onKeyDown,\n ...props\n },\n ref,\n ) => {\n const ctx = useContext(TabsContext);\n const variant = variantProp ?? ctx.variant;\n const size = sizeProp ?? ctx.size;\n const orientation = orientationProp ?? ctx.orientation;\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLButtonElement>) => {\n // APG dismissible-tab pattern: Delete/Backspace while trigger is focused closes the tab.\n // The visual X is pointer-only (aria-hidden) to avoid nested-interactive HTML violation.\n if (dismissible && (e.key === 'Delete' || e.key === 'Backspace')) {\n e.preventDefault();\n onDismiss?.();\n }\n onKeyDown?.(e);\n };\n\n return (\n <TabsPrimitive.Trigger\n ref={ref}\n value={value}\n data-value={value}\n className={tabsTriggerVariants({\n variant,\n size,\n orientation,\n className,\n })}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {icon && (\n <span aria-hidden=\"true\" className=\"ds:shrink-0 ds:size-4\">\n {icon}\n </span>\n )}\n {children}\n {badge && <span className=\"ds:shrink-0\">{badge}</span>}\n {dismissible && (\n // Visual-only dismiss indicator — pointer dismiss fires here; keyboard dismiss fires via Delete/Backspace on the trigger above.\n // No role/tabIndex to avoid nested-interactive (interactive content inside <button> is invalid HTML).\n <span\n aria-hidden=\"true\"\n className={cx(\n 'ds:inline-flex ds:items-center ds:justify-center ds:shrink-0',\n 'ds:size-6 ds:rounded-[var(--radius-sm)]',\n 'ds:hover:bg-muted-foreground/20',\n )}\n onPointerDown={(e) => {\n e.stopPropagation();\n e.preventDefault();\n onDismiss?.();\n }}\n >\n <X className=\"ds:size-3.5\" />\n </span>\n )}\n </TabsPrimitive.Trigger>\n );\n },\n);\nTabsTrigger.displayName = 'TabsTrigger';\n\n// ---------------------------------------------------------------------------\n// TabsContent\n// ---------------------------------------------------------------------------\n\nconst TabsContent = forwardRef<HTMLDivElement, TabsContentProps>(\n ({ className, children, ...props }, ref) => (\n <TabsPrimitive.Content\n ref={ref}\n className={cx(\n 'ds:mt-[var(--spacing-sm)] ds:outline-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n className,\n )}\n {...props}\n >\n {children}\n </TabsPrimitive.Content>\n ),\n);\nTabsContent.displayName = 'TabsContent';\n\n// ---------------------------------------------------------------------------\n// Compound export\n// ---------------------------------------------------------------------------\n\nexport const Tabs = Object.assign(TabsRoot, {\n Root: TabsRoot,\n List: TabsList,\n Trigger: TabsTrigger,\n Content: TabsContent,\n});\n\nexport { TabsList, TabsTrigger, TabsContent };\n"],"names":["tabsAgent","handle","args","tabsListVariants","cva","tabsTriggerVariants","TabsContext","createContext","TabsRoot","forwardRef","variant","size","orientation","overflow","className","children","valueProp","defaultValue","onValueChange","id","props","ref","rootRef","useRef","composedRef","composeRefs","dir","useDirection","isControlled","internalValue","setInternalValue","useState","value","setValue","useCallback","next","ctxValue","useMemo","valueRef","useEffect","agentHandle","useAgentRegistration","jsx","TabsPrimitive","cx","TabsList","ariaLabel","useContext","t","useTranslation","listRef","overflowTabs","setOverflowTabs","isHorizontal","isDropdownOverflow","el","detectOverflow","containerRight","hidden","tab","label","_a","ro","combinedRef","node","selectOptions","Children","child","isValidElement","triggerValue","labelChild","jsxs","Select","OverflowMenu","tabs","DropdownMenuPrimitive","ChevronDown","tabLabel","TabsTrigger","variantProp","sizeProp","orientationProp","icon","badge","dismissible","onDismiss","onKeyDown","ctx","handleKeyDown","e","X","TabsContent","Tabs"],"mappings":";;;;;;;;;;;;AAGO,MAAMA,KAAsC;AAAA,EACjD,IAAI;AAAA,EACJ,cAAc,CAAC,iBAAiB,UAAU;AAAA,EAC1C,OA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