@lablup/ui-common 0.1.0-alpha.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.
- package/LICENSE +202 -0
- package/NOTICE +10 -0
- package/README.md +145 -0
- package/dist/assets/components/Badge/Badge.css +1 -0
- package/dist/assets/components/BaseCard/BaseCard.css +1 -0
- package/dist/assets/components/Button/Button.css +1 -0
- package/dist/assets/components/DataTable/DataTable.css +1 -0
- package/dist/assets/components/Drawer/Drawer.css +1 -0
- package/dist/assets/components/EmptyState/EmptyState.css +1 -0
- package/dist/assets/components/ErrorState/ErrorState.css +1 -0
- package/dist/assets/components/PageHeader/PageHeader.css +1 -0
- package/dist/assets/components/PageLayout/PageLayout.css +1 -0
- package/dist/assets/components/ProgressBar/ProgressBar.css +1 -0
- package/dist/assets/components/Skeleton/Skeleton.css +1 -0
- package/dist/assets/components/Skeleton/SkeletonCard.css +1 -0
- package/dist/assets/components/Skeleton/SkeletonChart.css +1 -0
- package/dist/assets/components/Skeleton/SkeletonRow.css +1 -0
- package/dist/assets/components/Skeleton/SkeletonText.css +1 -0
- package/dist/assets/components/SmoothHeight/SmoothHeight.css +1 -0
- package/dist/assets/components/StatCard/StatCard.css +1 -0
- package/dist/assets/components/StatusTag/StatusTag.css +1 -0
- package/dist/assets/components/Tabs/Tabs.css +1 -0
- package/dist/assets/components/Tooltip/Tooltip.css +1 -0
- package/dist/components/Badge/Badge.d.ts +7 -0
- package/dist/components/Badge/Badge2.js +19 -0
- package/dist/components/Badge/Badge2.js.map +1 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Badge/index.js +2 -0
- package/dist/components/BaseCard/BaseCard.d.ts +57 -0
- package/dist/components/BaseCard/BaseCard2.js +36 -0
- package/dist/components/BaseCard/BaseCard2.js.map +1 -0
- package/dist/components/BaseCard/index.d.ts +2 -0
- package/dist/components/BaseCard/index.js +2 -0
- package/dist/components/Button/Button.d.ts +54 -0
- package/dist/components/Button/Button2.js +74 -0
- package/dist/components/Button/Button2.js.map +1 -0
- package/dist/components/Button/index.d.ts +5 -0
- package/dist/components/Button/index.js +2 -0
- package/dist/components/DataTable/DataTable.d.ts +133 -0
- package/dist/components/DataTable/DataTable2.js +276 -0
- package/dist/components/DataTable/DataTable2.js.map +1 -0
- package/dist/components/DataTable/index.d.ts +2 -0
- package/dist/components/DataTable/index.js +2 -0
- package/dist/components/Drawer/Drawer.d.ts +25 -0
- package/dist/components/Drawer/Drawer2.js +106 -0
- package/dist/components/Drawer/Drawer2.js.map +1 -0
- package/dist/components/Drawer/index.d.ts +2 -0
- package/dist/components/Drawer/index.js +2 -0
- package/dist/components/EmptyState/EmptyState.d.ts +45 -0
- package/dist/components/EmptyState/EmptyState.example.d.ts +8 -0
- package/dist/components/EmptyState/EmptyState2.js +78 -0
- package/dist/components/EmptyState/EmptyState2.js.map +1 -0
- package/dist/components/EmptyState/illustrations.d.ts +51 -0
- package/dist/components/EmptyState/illustrations.js +571 -0
- package/dist/components/EmptyState/illustrations.js.map +1 -0
- package/dist/components/EmptyState/index.d.ts +5 -0
- package/dist/components/EmptyState/index.js +2 -0
- package/dist/components/ErrorState/ErrorState.d.ts +25 -0
- package/dist/components/ErrorState/ErrorState.example.d.ts +46 -0
- package/dist/components/ErrorState/ErrorState2.js +58 -0
- package/dist/components/ErrorState/ErrorState2.js.map +1 -0
- package/dist/components/ErrorState/index.d.ts +5 -0
- package/dist/components/ErrorState/index.js +2 -0
- package/dist/components/PageHeader/PageHeader.d.ts +18 -0
- package/dist/components/PageHeader/PageHeader2.js +42 -0
- package/dist/components/PageHeader/PageHeader2.js.map +1 -0
- package/dist/components/PageHeader/index.d.ts +2 -0
- package/dist/components/PageHeader/index.js +2 -0
- package/dist/components/PageLayout/PageLayout.d.ts +11 -0
- package/dist/components/PageLayout/PageLayout2.js +19 -0
- package/dist/components/PageLayout/PageLayout2.js.map +1 -0
- package/dist/components/PageLayout/index.d.ts +2 -0
- package/dist/components/PageLayout/index.js +2 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +22 -0
- package/dist/components/ProgressBar/ProgressBar2.js +36 -0
- package/dist/components/ProgressBar/ProgressBar2.js.map +1 -0
- package/dist/components/ProgressBar/index.d.ts +2 -0
- package/dist/components/ProgressBar/index.js +2 -0
- package/dist/components/Skeleton/Skeleton.d.ts +25 -0
- package/dist/components/Skeleton/Skeleton2.js +26 -0
- package/dist/components/Skeleton/Skeleton2.js.map +1 -0
- package/dist/components/Skeleton/SkeletonCard.d.ts +18 -0
- package/dist/components/Skeleton/SkeletonCard2.js +73 -0
- package/dist/components/Skeleton/SkeletonCard2.js.map +1 -0
- package/dist/components/Skeleton/SkeletonChart.d.ts +23 -0
- package/dist/components/Skeleton/SkeletonChart2.js +66 -0
- package/dist/components/Skeleton/SkeletonChart2.js.map +1 -0
- package/dist/components/Skeleton/SkeletonRow.d.ts +22 -0
- package/dist/components/Skeleton/SkeletonRow2.js +47 -0
- package/dist/components/Skeleton/SkeletonRow2.js.map +1 -0
- package/dist/components/Skeleton/SkeletonText.d.ts +20 -0
- package/dist/components/Skeleton/SkeletonText2.js +26 -0
- package/dist/components/Skeleton/SkeletonText2.js.map +1 -0
- package/dist/components/Skeleton/index.d.ts +15 -0
- package/dist/components/Skeleton/index.js +6 -0
- package/dist/components/SmoothHeight/SmoothHeight.d.ts +9 -0
- package/dist/components/SmoothHeight/SmoothHeight2.js +38 -0
- package/dist/components/SmoothHeight/SmoothHeight2.js.map +1 -0
- package/dist/components/SmoothHeight/index.d.ts +2 -0
- package/dist/components/SmoothHeight/index.js +2 -0
- package/dist/components/StatCard/StatCard.d.ts +59 -0
- package/dist/components/StatCard/StatCard2.js +111 -0
- package/dist/components/StatCard/StatCard2.js.map +1 -0
- package/dist/components/StatCard/formatters.d.ts +12 -0
- package/dist/components/StatCard/formatters.js +8 -0
- package/dist/components/StatCard/formatters.js.map +1 -0
- package/dist/components/StatCard/index.d.ts +3 -0
- package/dist/components/StatCard/index.js +3 -0
- package/dist/components/StatusTag/StatusTag.d.ts +38 -0
- package/dist/components/StatusTag/StatusTag2.js +44 -0
- package/dist/components/StatusTag/StatusTag2.js.map +1 -0
- package/dist/components/StatusTag/index.d.ts +2 -0
- package/dist/components/StatusTag/index.js +2 -0
- package/dist/components/Tabs/Tabs.d.ts +107 -0
- package/dist/components/Tabs/Tabs2.js +430 -0
- package/dist/components/Tabs/Tabs2.js.map +1 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Tabs/index.js +3 -0
- package/dist/components/Tabs/tabTags.d.ts +9 -0
- package/dist/components/Tabs/tabTags.js +11 -0
- package/dist/components/Tabs/tabTags.js.map +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +16 -0
- package/dist/components/Tooltip/Tooltip2.js +67 -0
- package/dist/components/Tooltip/Tooltip2.js.map +1 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/components/Tooltip/index.js +2 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/usePrefersReducedMotion.d.ts +12 -0
- package/dist/hooks/usePrefersReducedMotion.js +22 -0
- package/dist/hooks/usePrefersReducedMotion.js.map +1 -0
- package/dist/icons/AlertCircleIcon.d.ts +11 -0
- package/dist/icons/AlertCircleIcon.js +26 -0
- package/dist/icons/AlertCircleIcon.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +24 -0
- package/dist/styles/base.css +169 -0
- package/dist/styles/themes/bliss-dark.css +123 -0
- package/dist/styles/themes/bliss-light.css +123 -0
- package/dist/styles/themes/glass-dark.css +124 -0
- package/dist/styles/themes/glass-light.css +125 -0
- package/dist/styles/themes/orange-dark.css +70 -0
- package/dist/styles/themes/orange-light.css +70 -0
- package/dist/styles/themes/reverie-dark.css +104 -0
- package/dist/styles/themes/reverie-light.css +104 -0
- package/dist/styles/themes/stained-dark.css +80 -0
- package/dist/styles/themes/stained-light.css +80 -0
- package/package.json +87 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusTag2.js","names":[],"sources":["../../../src/components/StatusTag/StatusTag.tsx"],"sourcesContent":["/**\n * StatusTag Component (epic #2730 / issue #2738)\n *\n * Status badge with the canonical color semantics shared by every list /\n * table that has to render lifecycle state. Mirrors the Backend.AI WebUI\n * `SessionStatusTag` color choices so users carry a single mental model\n * across products: blue for transient/preparing, green for healthy\n * running, red for error, neutral for terminated, yellow for stopping.\n *\n * The component intentionally builds on the existing {@link Badge}\n * primitive — it does not duplicate Badge's color tokens. Instead it\n * adds:\n *\n * 1. A canonical `state` enum surface (`running`, `preparing`,\n * `stopping`, `error`, `terminated`, `idle`, `busy`) so callers\n * don't have to map their domain state onto Badge variants by hand.\n * 2. An optional pulsing dot indicator for transient states (preparing,\n * stopping) so the UI visibly communicates \"in motion\" alongside\n * the static color.\n *\n * This is a domain-agnostic primitive — it MUST NOT carry Session,\n * Model, Agent, or Squad-specific knowledge.\n */\n\nimport { memo } from \"react\";\nimport { Badge } from \"../Badge\";\nimport type { BadgeProps } from \"../Badge\";\nimport \"./StatusTag.css\";\n\n/**\n * Canonical lifecycle state surface accepted by {@link StatusTag}.\n *\n * The names are deliberately broad so domain types can map onto them:\n * - SessionState `\"starting\"` → `\"preparing\"`\n * - SessionState `\"running\"` (healthy) → `\"running\"`\n * - SessionState `\"idle\"` → `\"idle\"`\n * - SessionState `\"busy\"` → `\"busy\"`\n * - SessionState `\"stopping\"` → `\"stopping\"`\n * - SessionState `\"terminated\"` → `\"terminated\"`\n * - SessionState `\"error\"` → `\"error\"`\n */\nexport type StatusKind =\n \"running\" | \"preparing\" | \"idle\" | \"busy\" | \"stopping\" | \"terminated\" | \"error\";\n\nexport interface StatusTagProps {\n /** Canonical lifecycle state. Drives color and indicator behavior. */\n state: StatusKind;\n /** Display label. Callers are responsible for i18n at the call site. */\n label: string;\n /** Override the underlying Badge size. Defaults to `\"small\"`. */\n size?: BadgeProps[\"size\"];\n /**\n * When `true`, render a small pulsing dot before the label to\n * communicate that the state is in motion. Defaults to a sensible\n * choice based on `state` (transient states pulse, terminal ones\n * don't).\n */\n pulse?: boolean;\n /** Extra class names appended to the root span. */\n className?: string;\n}\n\n/**\n * Map a {@link StatusKind} onto a {@link BadgeProps.variant}. Centralizes\n * the canonical color mapping so consumers can't drift.\n */\nfunction variantForState(state: StatusKind): BadgeProps[\"variant\"] {\n switch (state) {\n case \"running\":\n return \"success\";\n case \"preparing\":\n return \"info\";\n case \"idle\":\n return \"default\";\n case \"busy\":\n return \"primary\";\n case \"stopping\":\n return \"warning\";\n case \"terminated\":\n return \"default\";\n case \"error\":\n return \"danger\";\n }\n}\n\n/**\n * Default for the dot-pulse indicator. Transient states pulse, terminal\n * ones don't. Callers can override via the `pulse` prop.\n */\nfunction defaultPulseForState(state: StatusKind): boolean {\n return state === \"preparing\" || state === \"stopping\" || state === \"busy\";\n}\n\nfunction StatusTagComponent({\n state,\n label,\n size = \"small\",\n pulse,\n className = \"\",\n}: StatusTagProps) {\n const showPulse = pulse ?? defaultPulseForState(state);\n const composedClassName = [\"status-tag\", `status-tag--${state}`, className]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <Badge variant={variantForState(state)} size={size} className={composedClassName}>\n {showPulse && (\n <span\n className=\"status-tag__indicator\"\n aria-hidden=\"true\"\n data-testid=\"status-tag-indicator\"\n />\n )}\n <span className=\"status-tag__label\">{label}</span>\n </Badge>\n );\n}\n\n/**\n * Memoized to avoid re-rendering rows that didn't change. The component\n * is a pure function of its props.\n */\nexport const StatusTag = memo(StatusTagComponent);\nexport default StatusTag;\n"],"mappings":";;;;;AAkEA,SAAS,EAAgB,GAA0C;CACjE,QAAQ,GAAR;EACE,KAAK,WACH,OAAO;EACT,KAAK,aACH,OAAO;EACT,KAAK,QACH,OAAO;EACT,KAAK,QACH,OAAO;EACT,KAAK,YACH,OAAO;EACT,KAAK,cACH,OAAO;EACT,KAAK,SACH,OAAO;CACX;AACF;AAMA,SAAS,EAAqB,GAA4B;CACxD,OAAO,MAAU,eAAe,MAAU,cAAc,MAAU;AACpE;AAEA,SAAS,EAAmB,EAC1B,UACA,UACA,UAAO,SACP,UACA,eAAY,MACK;CACjB,IAAM,IAAY,KAAS,EAAqB,CAAK,GAC/C,IAAoB;EAAC;EAAc,eAAe;EAAS;CAAS,CAAC,CACxE,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;CAEX,OACE,kBAAC,GAAD;EAAO,SAAS,EAAgB,CAAK;EAAS;EAAM,WAAW;EAA/D,UAAA,CACG,KACC,kBAAC,QAAD;GACE,WAAU;GACV,eAAY;GACZ,eAAY;EACb,CAAA,GAEH,kBAAC,QAAD;GAAM,WAAU;GAAqB,UAAA;EAAY,CAAA,CAC5C;;AAEX;AAMA,IAAa,IAAY,EAAK,CAAkB"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TabTagType, TabTagLabels } from './tabTags';
|
|
3
|
+
export type { TabTagType, TabTagLabels } from './tabTags';
|
|
4
|
+
export { TAG_CONFIG } from './tabTags';
|
|
5
|
+
export interface TabItem {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
content: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Show a "Required" badge next to the tab label.
|
|
11
|
+
* @deprecated Use `tag="required"` instead. Kept for backward compatibility.
|
|
12
|
+
*/
|
|
13
|
+
required?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Guide tag displayed after the tab label as a small badge.
|
|
16
|
+
* When set, takes precedence over the `required` boolean.
|
|
17
|
+
*/
|
|
18
|
+
tag?: TabTagType;
|
|
19
|
+
/**
|
|
20
|
+
* Optional extra trailing node rendered next to the tab label (e.g. a
|
|
21
|
+
* count badge). Distinct from `tag` (which uses a fixed preset). Use this
|
|
22
|
+
* when migrating segmented controls that rendered their own inline count
|
|
23
|
+
* pill alongside the label.
|
|
24
|
+
*/
|
|
25
|
+
labelExtra?: ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Optional leading node rendered before the tab label (e.g. an icon).
|
|
28
|
+
* Useful when migrating segmented controls that prefix the label with
|
|
29
|
+
* an SVG glyph (e.g. ImportExportDialog source toggle: File / Paste / URL).
|
|
30
|
+
*/
|
|
31
|
+
labelPrefix?: ReactNode;
|
|
32
|
+
/** Assign this tab to a group (used with the `groups` prop) */
|
|
33
|
+
groupId?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface TabGroupMeta {
|
|
36
|
+
id: string;
|
|
37
|
+
label: string;
|
|
38
|
+
}
|
|
39
|
+
export type TabOverflowMode = "dropdown" | "menu";
|
|
40
|
+
/**
|
|
41
|
+
* Visual variant of the tab bar.
|
|
42
|
+
*
|
|
43
|
+
* - `"underlined"` (default): pill container with raised active tab and scroll
|
|
44
|
+
* arrows; used for primary page-level navigation that may overflow.
|
|
45
|
+
* - `"segmented"`: gray-background segmented control with raised active tab;
|
|
46
|
+
* intended for short, fixed-arity in-page mode toggles.
|
|
47
|
+
* - `"compact"`: smaller segmented control with reduced padding; used where
|
|
48
|
+
* the tab bar shares a row with other controls (e.g. StatisticsPage).
|
|
49
|
+
*/
|
|
50
|
+
export type TabVariant = "underlined" | "segmented" | "compact";
|
|
51
|
+
export interface TabsProps {
|
|
52
|
+
tabs: TabItem[];
|
|
53
|
+
/** Group definitions for organizing tabs with separators and labels */
|
|
54
|
+
groups?: TabGroupMeta[];
|
|
55
|
+
defaultTab?: string;
|
|
56
|
+
activeTab?: string;
|
|
57
|
+
onTabChange?: (tabId: string) => void;
|
|
58
|
+
className?: string;
|
|
59
|
+
panelClassName?: string;
|
|
60
|
+
ariaLabel?: string;
|
|
61
|
+
/** Show scroll arrows and overflow controls (default: true) */
|
|
62
|
+
showOverflowControls?: boolean;
|
|
63
|
+
/** Show group labels in the tab bar and overflow menu (default: true) */
|
|
64
|
+
showGroupLabels?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Overflow strategy for small screens:
|
|
67
|
+
* - "dropdown": mobile dropdown trigger (< 480px) — default when no groups
|
|
68
|
+
* - "menu": overflow menu button (< 768px) — default when groups are provided
|
|
69
|
+
*/
|
|
70
|
+
overflowMode?: TabOverflowMode;
|
|
71
|
+
/**
|
|
72
|
+
* Visual variant. Defaults to `"underlined"` (the original Tabs look).
|
|
73
|
+
* Use `"segmented"` for iOS-style pill toggles, `"compact"` for a smaller
|
|
74
|
+
* variant suitable for in-header use alongside other controls.
|
|
75
|
+
*/
|
|
76
|
+
variant?: TabVariant;
|
|
77
|
+
/**
|
|
78
|
+
* When using `variant="segmented"` or `"compact"`, make each tab fill the
|
|
79
|
+
* container evenly (flex: 1 per tab). Useful for short, equal-arity mode
|
|
80
|
+
* toggles like the Models page tab bar. Defaults to false.
|
|
81
|
+
*/
|
|
82
|
+
fillContainer?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Render the tab panel (the active tab's `content`) below the tab list.
|
|
85
|
+
* Defaults to true. Set to false when the consumer manages its own panel
|
|
86
|
+
* rendering outside the Tabs component (e.g. pages that interleave panels
|
|
87
|
+
* with other in-header elements).
|
|
88
|
+
*
|
|
89
|
+
* When false, each `TabItem.content` is ignored — the consumer is expected
|
|
90
|
+
* to inspect `activeTab` / `onTabChange` and render its own panel.
|
|
91
|
+
*/
|
|
92
|
+
renderPanel?: boolean;
|
|
93
|
+
/** Accessible label for the overflow-menu trigger button. Default: "More tabs" */
|
|
94
|
+
moreTabsLabel?: string;
|
|
95
|
+
/** Accessible label for the mobile dropdown trigger. Default: "Select tab" */
|
|
96
|
+
selectTabLabel?: string;
|
|
97
|
+
/** Accessible label for the left scroll-arrow button. Default: "Scroll left" */
|
|
98
|
+
scrollLeftLabel?: string;
|
|
99
|
+
/** Accessible label for the right scroll-arrow button. Default: "Scroll right" */
|
|
100
|
+
scrollRightLabel?: string;
|
|
101
|
+
/**
|
|
102
|
+
* English defaults for every guide-tag badge label (required / recommended
|
|
103
|
+
* / beta / experimental). Override individual entries to translate them.
|
|
104
|
+
*/
|
|
105
|
+
tagLabels?: TabTagLabels;
|
|
106
|
+
}
|
|
107
|
+
export declare function Tabs({ tabs, groups, defaultTab, activeTab: controlledTab, onTabChange, className, panelClassName, ariaLabel, showOverflowControls, showGroupLabels, overflowMode: explicitOverflowMode, variant, fillContainer, renderPanel, moreTabsLabel, selectTabLabel, scrollLeftLabel, scrollRightLabel, tagLabels, }: TabsProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
import { Badge as e } from "../Badge/Badge2.js";
|
|
2
|
+
import { TAG_CONFIG as t } from "./tabTags.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { useCallback as n, useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
|
|
5
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/Tabs/Tabs.tsx
|
|
7
|
+
var ee = {
|
|
8
|
+
required: "Required",
|
|
9
|
+
recommended: "Recommended",
|
|
10
|
+
beta: "Beta",
|
|
11
|
+
experimental: "Experimental"
|
|
12
|
+
};
|
|
13
|
+
function u({ tabs: u, groups: d = [], defaultTab: te, activeTab: f, onTabChange: p, className: m = "", panelClassName: h = "", ariaLabel: ne, showOverflowControls: g = !0, showGroupLabels: _ = !0, overflowMode: re, variant: v = "underlined", fillContainer: ie = !1, renderPanel: y = !0, moreTabsLabel: ae = "More tabs", selectTabLabel: oe = "Select tab", scrollLeftLabel: se = "Scroll left", scrollRightLabel: ce = "Scroll right", tagLabels: b = ee }) {
|
|
14
|
+
let x = re ?? (d.length > 0 ? "menu" : "dropdown"), [le, ue] = o(te || u[0]?.id || ""), [de, S] = o(!1), [fe, C] = o(!1), [w, pe] = o(!1), [T, E] = o(!1), [D, O] = o(!1), [me, k] = o(-1), A = a(null), j = a(/* @__PURE__ */ new Map()), M = a(null), N = a(null), P = a(null), F = a([]), I = a(null), L = a(0), R = a(0), z = f ?? le, B = i(() => d.length > 0 ? d.map((e) => ({
|
|
15
|
+
group: e,
|
|
16
|
+
tabs: u.filter((t) => t.groupId === e.id)
|
|
17
|
+
})) : [{
|
|
18
|
+
group: null,
|
|
19
|
+
tabs: u
|
|
20
|
+
}], [d, u]), V = i(() => B.flatMap(({ tabs: e }) => e), [B]), H = n((e) => {
|
|
21
|
+
f || ue(e), p?.(e), O(!1);
|
|
22
|
+
}, [f, p]), U = n((e, t) => {
|
|
23
|
+
let n;
|
|
24
|
+
switch (e.key) {
|
|
25
|
+
case "ArrowRight":
|
|
26
|
+
e.preventDefault(), n = t === u.length - 1 ? 0 : t + 1;
|
|
27
|
+
break;
|
|
28
|
+
case "ArrowLeft":
|
|
29
|
+
e.preventDefault(), n = t === 0 ? u.length - 1 : t - 1;
|
|
30
|
+
break;
|
|
31
|
+
case "Home":
|
|
32
|
+
e.preventDefault(), n = 0;
|
|
33
|
+
break;
|
|
34
|
+
case "End":
|
|
35
|
+
e.preventDefault(), n = u.length - 1;
|
|
36
|
+
break;
|
|
37
|
+
default: return;
|
|
38
|
+
}
|
|
39
|
+
let r = u[n];
|
|
40
|
+
r && (H(r.id), j.current.get(r.id)?.focus());
|
|
41
|
+
}, [u, H]), he = n((e, t) => {
|
|
42
|
+
t ? j.current.set(e, t) : j.current.delete(e);
|
|
43
|
+
}, []), W = n(() => {
|
|
44
|
+
let e = A.current;
|
|
45
|
+
if (!e || !g) {
|
|
46
|
+
S(!1), C(!1);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
let { scrollLeft: t, scrollWidth: n, clientWidth: r } = e;
|
|
50
|
+
S(t > 0), C(t + r < n - 1);
|
|
51
|
+
}, [g]), G = n((e) => {
|
|
52
|
+
let t = A.current;
|
|
53
|
+
if (!t) return;
|
|
54
|
+
let n = t.clientWidth * .75;
|
|
55
|
+
t.scrollBy({
|
|
56
|
+
left: e === "left" ? -n : n,
|
|
57
|
+
behavior: "smooth"
|
|
58
|
+
}), I.current !== null && clearTimeout(I.current), I.current = setTimeout(W, 300);
|
|
59
|
+
}, [W]), K = n(() => {
|
|
60
|
+
if (!A.current || w) return;
|
|
61
|
+
let e = j.current.get(z);
|
|
62
|
+
if (!e) return;
|
|
63
|
+
let t = A.current, n = e.getBoundingClientRect(), r = t.getBoundingClientRect();
|
|
64
|
+
n.left < r.left ? t.scrollLeft -= r.left - n.left + 8 : n.right > r.right && (t.scrollLeft += n.right - r.right + 8);
|
|
65
|
+
}, [z, w]), q = n(() => {
|
|
66
|
+
typeof window > "u" || x !== "dropdown" || pe(window.innerWidth < 480);
|
|
67
|
+
}, [x]), ge = n(() => {
|
|
68
|
+
E((e) => !e);
|
|
69
|
+
}, []), _e = n((e) => {
|
|
70
|
+
e.key === "Escape" && T && (e.preventDefault(), E(!1));
|
|
71
|
+
}, [T]), J = n((e) => {
|
|
72
|
+
e.touches[0] && (L.current = e.touches[0].clientX);
|
|
73
|
+
}, []), Y = n((e) => {
|
|
74
|
+
e.touches[0] && (R.current = e.touches[0].clientX);
|
|
75
|
+
}, []), X = n(() => {
|
|
76
|
+
if (!L.current || !R.current) return;
|
|
77
|
+
let e = L.current - R.current;
|
|
78
|
+
if (Math.abs(e) > 50) {
|
|
79
|
+
let t = u.findIndex((e) => e.id === z), n = u[t + 1], r = u[t - 1];
|
|
80
|
+
e > 0 && n ? H(n.id) : e < 0 && r && H(r.id);
|
|
81
|
+
}
|
|
82
|
+
L.current = 0, R.current = 0;
|
|
83
|
+
}, [
|
|
84
|
+
z,
|
|
85
|
+
u,
|
|
86
|
+
H
|
|
87
|
+
]), ve = n((e) => {
|
|
88
|
+
let t = V.length;
|
|
89
|
+
switch (e.key) {
|
|
90
|
+
case "Escape":
|
|
91
|
+
e.preventDefault(), O(!1), k(-1), P.current?.focus();
|
|
92
|
+
break;
|
|
93
|
+
case "ArrowDown":
|
|
94
|
+
e.preventDefault(), k((e) => {
|
|
95
|
+
let n = e >= t - 1 ? 0 : e + 1;
|
|
96
|
+
return F.current[n]?.focus(), n;
|
|
97
|
+
});
|
|
98
|
+
break;
|
|
99
|
+
case "ArrowUp":
|
|
100
|
+
e.preventDefault(), k((e) => {
|
|
101
|
+
let n = e <= 0 ? t - 1 : e - 1;
|
|
102
|
+
return F.current[n]?.focus(), n;
|
|
103
|
+
});
|
|
104
|
+
break;
|
|
105
|
+
case "Home":
|
|
106
|
+
e.preventDefault(), k(0), F.current[0]?.focus();
|
|
107
|
+
break;
|
|
108
|
+
case "End": e.preventDefault(), k(t - 1), F.current[t - 1]?.focus();
|
|
109
|
+
}
|
|
110
|
+
}, [V.length]), ye = n((e) => {
|
|
111
|
+
e.key === "Escape" && D && (e.preventDefault(), O(!1), k(-1));
|
|
112
|
+
}, [D]);
|
|
113
|
+
r(() => {
|
|
114
|
+
if (!T) return;
|
|
115
|
+
let e = (e) => {
|
|
116
|
+
M.current && !M.current.contains(e.target) && E(!1);
|
|
117
|
+
};
|
|
118
|
+
return document.addEventListener("mousedown", e), () => {
|
|
119
|
+
document.removeEventListener("mousedown", e);
|
|
120
|
+
};
|
|
121
|
+
}, [T]), r(() => {
|
|
122
|
+
if (!D) return;
|
|
123
|
+
let e = (e) => {
|
|
124
|
+
N.current && !N.current.contains(e.target) && (O(!1), k(-1));
|
|
125
|
+
}, t = (e) => {
|
|
126
|
+
e.key === "Escape" && (O(!1), k(-1), P.current?.focus());
|
|
127
|
+
};
|
|
128
|
+
return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
|
|
129
|
+
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
|
|
130
|
+
};
|
|
131
|
+
}, [D]), r(() => {
|
|
132
|
+
if (D && F.current.length > 0) {
|
|
133
|
+
let e = V.findIndex((e) => e.id === z), t = e >= 0 ? e : 0;
|
|
134
|
+
k(t), requestAnimationFrame(() => {
|
|
135
|
+
F.current[t]?.focus();
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
}, [
|
|
139
|
+
D,
|
|
140
|
+
V,
|
|
141
|
+
z
|
|
142
|
+
]), r(() => {
|
|
143
|
+
if (!u.find((e) => e.id === z)) {
|
|
144
|
+
let e = u[0];
|
|
145
|
+
e && H(e.id);
|
|
146
|
+
}
|
|
147
|
+
}, [
|
|
148
|
+
u,
|
|
149
|
+
z,
|
|
150
|
+
H
|
|
151
|
+
]), r(() => {
|
|
152
|
+
q(), W();
|
|
153
|
+
let e = () => {
|
|
154
|
+
q(), W();
|
|
155
|
+
};
|
|
156
|
+
return window.addEventListener("resize", e), () => {
|
|
157
|
+
window.removeEventListener("resize", e);
|
|
158
|
+
};
|
|
159
|
+
}, [q, W]), r(() => {
|
|
160
|
+
K();
|
|
161
|
+
}, [z, K]), r(() => {
|
|
162
|
+
W();
|
|
163
|
+
}, [u, W]), r(() => () => {
|
|
164
|
+
I.current !== null && clearTimeout(I.current);
|
|
165
|
+
}, []);
|
|
166
|
+
let Z = u.find((e) => e.id === z)?.content, be = u.find((e) => e.id === z)?.label, xe = d.length > 0;
|
|
167
|
+
F.current = [];
|
|
168
|
+
let Q = (e) => e.tag ? e.tag : e.required ? "required" : null, Se = (n, r) => {
|
|
169
|
+
let i = n.id === z, a = Q(n), o = a ? t[a] : null, s = a ? b[a] : null;
|
|
170
|
+
return /* @__PURE__ */ l("button", {
|
|
171
|
+
ref: (e) => {
|
|
172
|
+
he(n.id, e);
|
|
173
|
+
},
|
|
174
|
+
role: "tab",
|
|
175
|
+
"aria-selected": i,
|
|
176
|
+
"aria-controls": y ? `tabpanel-${n.id}` : void 0,
|
|
177
|
+
id: `tab-${n.id}`,
|
|
178
|
+
tabIndex: i ? 0 : -1,
|
|
179
|
+
className: `tabs__tab${i ? " tabs__tab--active" : ""}`,
|
|
180
|
+
onClick: () => {
|
|
181
|
+
H(n.id);
|
|
182
|
+
},
|
|
183
|
+
onKeyDown: (e) => {
|
|
184
|
+
U(e, r), (e.key === "ArrowLeft" || e.key === "ArrowRight" || e.key === "Home" || e.key === "End") && e.stopPropagation();
|
|
185
|
+
},
|
|
186
|
+
children: [
|
|
187
|
+
n.labelPrefix,
|
|
188
|
+
/* @__PURE__ */ c("span", {
|
|
189
|
+
className: "tabs__tab-label",
|
|
190
|
+
children: n.label
|
|
191
|
+
}),
|
|
192
|
+
o && /* @__PURE__ */ c(e, {
|
|
193
|
+
variant: o.variant,
|
|
194
|
+
size: "small",
|
|
195
|
+
className: "tabs__tag-badge",
|
|
196
|
+
children: s
|
|
197
|
+
}),
|
|
198
|
+
n.labelExtra
|
|
199
|
+
]
|
|
200
|
+
}, n.id);
|
|
201
|
+
}, Ce = () => xe ? B.map(({ group: e, tabs: t }, n) => /* @__PURE__ */ l("div", {
|
|
202
|
+
className: "tabs__group",
|
|
203
|
+
children: [e && /* @__PURE__ */ l(s, { children: [n > 0 && /* @__PURE__ */ c("div", {
|
|
204
|
+
className: "tabs__separator",
|
|
205
|
+
role: "separator",
|
|
206
|
+
"aria-hidden": "true"
|
|
207
|
+
}), _ && /* @__PURE__ */ c("span", {
|
|
208
|
+
className: "tabs__group-label",
|
|
209
|
+
children: e.label
|
|
210
|
+
})] }), /* @__PURE__ */ c("div", {
|
|
211
|
+
className: "tabs__group-tabs",
|
|
212
|
+
children: t.map((e) => {
|
|
213
|
+
let t = u.findIndex((t) => t.id === e.id);
|
|
214
|
+
return Se(e, t);
|
|
215
|
+
})
|
|
216
|
+
})]
|
|
217
|
+
}, e?.id || "default")) : u.map((e, t) => Se(e, t)), we = () => x !== "menu" || !g ? null : /* @__PURE__ */ l("div", {
|
|
218
|
+
className: "tabs__overflow",
|
|
219
|
+
ref: N,
|
|
220
|
+
children: [/* @__PURE__ */ c("button", {
|
|
221
|
+
ref: P,
|
|
222
|
+
type: "button",
|
|
223
|
+
className: "tabs__overflow-btn",
|
|
224
|
+
onClick: () => {
|
|
225
|
+
O(!D);
|
|
226
|
+
},
|
|
227
|
+
onKeyDown: ye,
|
|
228
|
+
"aria-label": ae,
|
|
229
|
+
"aria-expanded": D,
|
|
230
|
+
"aria-haspopup": "menu",
|
|
231
|
+
children: /* @__PURE__ */ l("svg", {
|
|
232
|
+
width: "20",
|
|
233
|
+
height: "20",
|
|
234
|
+
viewBox: "0 0 24 24",
|
|
235
|
+
fill: "none",
|
|
236
|
+
stroke: "currentColor",
|
|
237
|
+
strokeWidth: "2",
|
|
238
|
+
strokeLinecap: "round",
|
|
239
|
+
strokeLinejoin: "round",
|
|
240
|
+
children: [
|
|
241
|
+
/* @__PURE__ */ c("circle", {
|
|
242
|
+
cx: "12",
|
|
243
|
+
cy: "12",
|
|
244
|
+
r: "1"
|
|
245
|
+
}),
|
|
246
|
+
/* @__PURE__ */ c("circle", {
|
|
247
|
+
cx: "12",
|
|
248
|
+
cy: "5",
|
|
249
|
+
r: "1"
|
|
250
|
+
}),
|
|
251
|
+
/* @__PURE__ */ c("circle", {
|
|
252
|
+
cx: "12",
|
|
253
|
+
cy: "19",
|
|
254
|
+
r: "1"
|
|
255
|
+
})
|
|
256
|
+
]
|
|
257
|
+
})
|
|
258
|
+
}), D && /* @__PURE__ */ c("div", {
|
|
259
|
+
className: "tabs__overflow-menu",
|
|
260
|
+
role: "menu",
|
|
261
|
+
onKeyDown: ve,
|
|
262
|
+
children: B.map(({ group: n, tabs: r }) => /* @__PURE__ */ l("div", {
|
|
263
|
+
className: "tabs__overflow-group",
|
|
264
|
+
children: [n && _ && /* @__PURE__ */ c("div", {
|
|
265
|
+
className: "tabs__overflow-group-label",
|
|
266
|
+
children: n.label
|
|
267
|
+
}), r.map((n) => {
|
|
268
|
+
let r = n.id === z, i = V.findIndex((e) => e.id === n.id), a = Q(n), o = a ? t[a] : null, s = a ? b[a] : null;
|
|
269
|
+
return /* @__PURE__ */ l("button", {
|
|
270
|
+
ref: (e) => {
|
|
271
|
+
e && (F.current[i] = e);
|
|
272
|
+
},
|
|
273
|
+
role: "menuitem",
|
|
274
|
+
tabIndex: me === i ? 0 : -1,
|
|
275
|
+
className: `tabs__overflow-item ${r ? "tabs__overflow-item--active" : ""}`,
|
|
276
|
+
onClick: () => {
|
|
277
|
+
H(n.id);
|
|
278
|
+
},
|
|
279
|
+
children: [
|
|
280
|
+
n.labelPrefix,
|
|
281
|
+
/* @__PURE__ */ c("span", { children: n.label }),
|
|
282
|
+
o && /* @__PURE__ */ c(e, {
|
|
283
|
+
variant: o.variant,
|
|
284
|
+
size: "small",
|
|
285
|
+
children: s
|
|
286
|
+
}),
|
|
287
|
+
n.labelExtra
|
|
288
|
+
]
|
|
289
|
+
}, n.id);
|
|
290
|
+
})]
|
|
291
|
+
}, n?.id || "default"))
|
|
292
|
+
})]
|
|
293
|
+
}), $ = v === "segmented" || v === "compact";
|
|
294
|
+
return x === "dropdown" && w && !$ ? /* @__PURE__ */ l("div", {
|
|
295
|
+
className: `tabs tabs--mobile-dropdown ${m}`,
|
|
296
|
+
children: [/* @__PURE__ */ l("div", {
|
|
297
|
+
className: "tabs__dropdown-container",
|
|
298
|
+
ref: M,
|
|
299
|
+
children: [/* @__PURE__ */ l("button", {
|
|
300
|
+
className: "tabs__dropdown-trigger",
|
|
301
|
+
onClick: ge,
|
|
302
|
+
onKeyDown: _e,
|
|
303
|
+
"aria-expanded": T,
|
|
304
|
+
"aria-haspopup": "listbox",
|
|
305
|
+
"aria-label": ne || oe,
|
|
306
|
+
children: [/* @__PURE__ */ c("span", {
|
|
307
|
+
className: "tabs__dropdown-label",
|
|
308
|
+
children: be
|
|
309
|
+
}), /* @__PURE__ */ c("svg", {
|
|
310
|
+
className: `tabs__dropdown-arrow ${T ? "tabs__dropdown-arrow--open" : ""}`,
|
|
311
|
+
width: "16",
|
|
312
|
+
height: "16",
|
|
313
|
+
viewBox: "0 0 16 16",
|
|
314
|
+
fill: "none",
|
|
315
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
316
|
+
"aria-hidden": "true",
|
|
317
|
+
children: /* @__PURE__ */ c("path", {
|
|
318
|
+
d: "M4 6L8 10L12 6",
|
|
319
|
+
stroke: "currentColor",
|
|
320
|
+
strokeWidth: "2",
|
|
321
|
+
strokeLinecap: "round",
|
|
322
|
+
strokeLinejoin: "round"
|
|
323
|
+
})
|
|
324
|
+
})]
|
|
325
|
+
}), T && /* @__PURE__ */ c("div", {
|
|
326
|
+
className: "tabs__dropdown-menu",
|
|
327
|
+
role: "listbox",
|
|
328
|
+
children: u.map((e) => /* @__PURE__ */ c("button", {
|
|
329
|
+
role: "option",
|
|
330
|
+
"aria-selected": e.id === z,
|
|
331
|
+
className: `tabs__dropdown-item ${e.id === z ? "tabs__dropdown-item--active" : ""}`,
|
|
332
|
+
onClick: () => {
|
|
333
|
+
H(e.id), E(!1);
|
|
334
|
+
},
|
|
335
|
+
children: e.label
|
|
336
|
+
}, e.id))
|
|
337
|
+
})]
|
|
338
|
+
}), y && /* @__PURE__ */ c("div", {
|
|
339
|
+
id: `tabpanel-${z}`,
|
|
340
|
+
role: "tabpanel",
|
|
341
|
+
"aria-labelledby": `tab-${z}`,
|
|
342
|
+
className: `tabs__panel ${h}`.trim(),
|
|
343
|
+
tabIndex: 0,
|
|
344
|
+
onTouchStart: J,
|
|
345
|
+
onTouchMove: Y,
|
|
346
|
+
onTouchEnd: X,
|
|
347
|
+
children: Z
|
|
348
|
+
})]
|
|
349
|
+
}) : /* @__PURE__ */ l("div", {
|
|
350
|
+
className: `tabs ${x === "menu" ? "tabs--overflow-menu" : ""} ${v === "segmented" ? "tabs--variant-segmented" : v === "compact" ? "tabs--variant-compact" : ""} ${$ && ie ? "tabs--fill-container" : ""} ${m}`.replace(/\s+/g, " ").trim(),
|
|
351
|
+
children: [/* @__PURE__ */ l("div", {
|
|
352
|
+
className: "tabs__container",
|
|
353
|
+
children: [
|
|
354
|
+
g && de && /* @__PURE__ */ c("button", {
|
|
355
|
+
className: "tabs__scroll-arrow tabs__scroll-arrow--left",
|
|
356
|
+
onClick: () => {
|
|
357
|
+
G("left");
|
|
358
|
+
},
|
|
359
|
+
"aria-label": se,
|
|
360
|
+
tabIndex: -1,
|
|
361
|
+
children: /* @__PURE__ */ c("svg", {
|
|
362
|
+
width: "20",
|
|
363
|
+
height: "20",
|
|
364
|
+
viewBox: "0 0 20 20",
|
|
365
|
+
fill: "none",
|
|
366
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
367
|
+
"aria-hidden": "true",
|
|
368
|
+
children: /* @__PURE__ */ c("path", {
|
|
369
|
+
d: "M12 15L7 10L12 5",
|
|
370
|
+
stroke: "currentColor",
|
|
371
|
+
strokeWidth: "2",
|
|
372
|
+
strokeLinecap: "round",
|
|
373
|
+
strokeLinejoin: "round"
|
|
374
|
+
})
|
|
375
|
+
})
|
|
376
|
+
}),
|
|
377
|
+
/* @__PURE__ */ c("div", {
|
|
378
|
+
ref: A,
|
|
379
|
+
className: "tabs__list",
|
|
380
|
+
role: "tablist",
|
|
381
|
+
"aria-label": ne,
|
|
382
|
+
onScroll: W,
|
|
383
|
+
onKeyDown: (e) => {
|
|
384
|
+
let t = u.findIndex((e) => e.id === z);
|
|
385
|
+
t < 0 || U(e, t);
|
|
386
|
+
},
|
|
387
|
+
onTouchStart: x === "dropdown" ? J : void 0,
|
|
388
|
+
onTouchMove: x === "dropdown" ? Y : void 0,
|
|
389
|
+
onTouchEnd: x === "dropdown" ? X : void 0,
|
|
390
|
+
children: Ce()
|
|
391
|
+
}),
|
|
392
|
+
g && fe && /* @__PURE__ */ c("button", {
|
|
393
|
+
className: "tabs__scroll-arrow tabs__scroll-arrow--right",
|
|
394
|
+
onClick: () => {
|
|
395
|
+
G("right");
|
|
396
|
+
},
|
|
397
|
+
"aria-label": ce,
|
|
398
|
+
tabIndex: -1,
|
|
399
|
+
children: /* @__PURE__ */ c("svg", {
|
|
400
|
+
width: "20",
|
|
401
|
+
height: "20",
|
|
402
|
+
viewBox: "0 0 20 20",
|
|
403
|
+
fill: "none",
|
|
404
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
405
|
+
"aria-hidden": "true",
|
|
406
|
+
children: /* @__PURE__ */ c("path", {
|
|
407
|
+
d: "M8 5L13 10L8 15",
|
|
408
|
+
stroke: "currentColor",
|
|
409
|
+
strokeWidth: "2",
|
|
410
|
+
strokeLinecap: "round",
|
|
411
|
+
strokeLinejoin: "round"
|
|
412
|
+
})
|
|
413
|
+
})
|
|
414
|
+
}),
|
|
415
|
+
we()
|
|
416
|
+
]
|
|
417
|
+
}), y && /* @__PURE__ */ c("div", {
|
|
418
|
+
id: `tabpanel-${z}`,
|
|
419
|
+
role: "tabpanel",
|
|
420
|
+
"aria-labelledby": `tab-${z}`,
|
|
421
|
+
className: `tabs__panel ${h}`.trim(),
|
|
422
|
+
tabIndex: 0,
|
|
423
|
+
children: Z
|
|
424
|
+
})]
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
//#endregion
|
|
428
|
+
export { t as TAG_CONFIG, u as Tabs };
|
|
429
|
+
|
|
430
|
+
//# sourceMappingURL=Tabs2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs2.js","names":[],"sources":["../../../src/components/Tabs/Tabs.tsx"],"sourcesContent":["/**\n * Tabs Component\n *\n * Unified tab navigation component with optional grouping, guide tag badges,\n * and responsive overflow handling. Follows WCAG 2.1 ARIA tab pattern.\n *\n * Features:\n * - Scroll arrows for overflow\n * - Mobile dropdown mode (overflowMode=\"dropdown\", < 480px)\n * - Overflow menu mode (overflowMode=\"menu\", < 768px)\n * - Tab grouping with separators and labels\n * - Guide tag badge support (required, recommended, beta, experimental)\n * - Touch swipe navigation (dropdown mode)\n * - Auto-scroll to active tab\n * - Full keyboard navigation (Arrow keys, Home, End)\n */\n\nimport {\n useState,\n useCallback,\n useRef,\n useEffect,\n useMemo,\n type ReactNode,\n type KeyboardEvent,\n type TouchEvent,\n} from \"react\";\nimport { Badge } from \"../Badge\";\nimport { type TabTagType, type TabTagLabels, TAG_CONFIG } from \"./tabTags\";\nimport \"./Tabs.css\";\n\n// Re-export for consumers that import from Tabs.tsx directly\nexport type { TabTagType, TabTagLabels } from \"./tabTags\";\nexport { TAG_CONFIG } from \"./tabTags\";\n\n/** English default for every {@link TabTagType} badge label. */\nconst DEFAULT_TAG_LABELS: TabTagLabels = {\n required: \"Required\",\n recommended: \"Recommended\",\n beta: \"Beta\",\n experimental: \"Experimental\",\n};\n\nexport interface TabItem {\n id: string;\n label: string;\n content: ReactNode;\n /**\n * Show a \"Required\" badge next to the tab label.\n * @deprecated Use `tag=\"required\"` instead. Kept for backward compatibility.\n */\n required?: boolean;\n /**\n * Guide tag displayed after the tab label as a small badge.\n * When set, takes precedence over the `required` boolean.\n */\n tag?: TabTagType;\n /**\n * Optional extra trailing node rendered next to the tab label (e.g. a\n * count badge). Distinct from `tag` (which uses a fixed preset). Use this\n * when migrating segmented controls that rendered their own inline count\n * pill alongside the label.\n */\n labelExtra?: ReactNode;\n /**\n * Optional leading node rendered before the tab label (e.g. an icon).\n * Useful when migrating segmented controls that prefix the label with\n * an SVG glyph (e.g. ImportExportDialog source toggle: File / Paste / URL).\n */\n labelPrefix?: ReactNode;\n /** Assign this tab to a group (used with the `groups` prop) */\n groupId?: string;\n}\n\nexport interface TabGroupMeta {\n id: string;\n label: string;\n}\n\nexport type TabOverflowMode = \"dropdown\" | \"menu\";\n\n/**\n * Visual variant of the tab bar.\n *\n * - `\"underlined\"` (default): pill container with raised active tab and scroll\n * arrows; used for primary page-level navigation that may overflow.\n * - `\"segmented\"`: gray-background segmented control with raised active tab;\n * intended for short, fixed-arity in-page mode toggles.\n * - `\"compact\"`: smaller segmented control with reduced padding; used where\n * the tab bar shares a row with other controls (e.g. StatisticsPage).\n */\nexport type TabVariant = \"underlined\" | \"segmented\" | \"compact\";\n\nexport interface TabsProps {\n tabs: TabItem[];\n /** Group definitions for organizing tabs with separators and labels */\n groups?: TabGroupMeta[];\n defaultTab?: string;\n activeTab?: string;\n onTabChange?: (tabId: string) => void;\n className?: string;\n panelClassName?: string;\n ariaLabel?: string;\n /** Show scroll arrows and overflow controls (default: true) */\n showOverflowControls?: boolean;\n /** Show group labels in the tab bar and overflow menu (default: true) */\n showGroupLabels?: boolean;\n /**\n * Overflow strategy for small screens:\n * - \"dropdown\": mobile dropdown trigger (< 480px) — default when no groups\n * - \"menu\": overflow menu button (< 768px) — default when groups are provided\n */\n overflowMode?: TabOverflowMode;\n /**\n * Visual variant. Defaults to `\"underlined\"` (the original Tabs look).\n * Use `\"segmented\"` for iOS-style pill toggles, `\"compact\"` for a smaller\n * variant suitable for in-header use alongside other controls.\n */\n variant?: TabVariant;\n /**\n * When using `variant=\"segmented\"` or `\"compact\"`, make each tab fill the\n * container evenly (flex: 1 per tab). Useful for short, equal-arity mode\n * toggles like the Models page tab bar. Defaults to false.\n */\n fillContainer?: boolean;\n /**\n * Render the tab panel (the active tab's `content`) below the tab list.\n * Defaults to true. Set to false when the consumer manages its own panel\n * rendering outside the Tabs component (e.g. pages that interleave panels\n * with other in-header elements).\n *\n * When false, each `TabItem.content` is ignored — the consumer is expected\n * to inspect `activeTab` / `onTabChange` and render its own panel.\n */\n renderPanel?: boolean;\n /** Accessible label for the overflow-menu trigger button. Default: \"More tabs\" */\n moreTabsLabel?: string;\n /** Accessible label for the mobile dropdown trigger. Default: \"Select tab\" */\n selectTabLabel?: string;\n /** Accessible label for the left scroll-arrow button. Default: \"Scroll left\" */\n scrollLeftLabel?: string;\n /** Accessible label for the right scroll-arrow button. Default: \"Scroll right\" */\n scrollRightLabel?: string;\n /**\n * English defaults for every guide-tag badge label (required / recommended\n * / beta / experimental). Override individual entries to translate them.\n */\n tagLabels?: TabTagLabels;\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function Tabs({\n tabs,\n groups = [],\n defaultTab,\n activeTab: controlledTab,\n onTabChange,\n className = \"\",\n panelClassName = \"\",\n ariaLabel,\n showOverflowControls = true,\n showGroupLabels = true,\n overflowMode: explicitOverflowMode,\n variant = \"underlined\",\n fillContainer = false,\n renderPanel = true,\n moreTabsLabel = \"More tabs\",\n selectTabLabel = \"Select tab\",\n scrollLeftLabel = \"Scroll left\",\n scrollRightLabel = \"Scroll right\",\n tagLabels = DEFAULT_TAG_LABELS,\n}: TabsProps) {\n // Auto-detect overflow mode from groups presence\n const overflowMode =\n explicitOverflowMode ?? (groups.length > 0 ? \"menu\" : \"dropdown\");\n\n // ---- State ----\n const [internalActiveTab, setInternalActiveTab] = useState(\n defaultTab || tabs[0]?.id || \"\",\n );\n const [canScrollLeft, setCanScrollLeft] = useState(false);\n const [canScrollRight, setCanScrollRight] = useState(false);\n\n // Dropdown mode state (overflowMode === \"dropdown\")\n const [isMobileDropdown, setIsMobileDropdown] = useState(false);\n const [isDropdownOpen, setIsDropdownOpen] = useState(false);\n\n // Overflow menu state (overflowMode === \"menu\")\n const [showOverflowMenu, setShowOverflowMenu] = useState(false);\n const [focusedMenuIndex, setFocusedMenuIndex] = useState(-1);\n\n // ---- Refs ----\n const tabListRef = useRef<HTMLDivElement>(null);\n const tabRefs = useRef<Map<string, HTMLButtonElement>>(new Map());\n const dropdownContainerRef = useRef<HTMLDivElement>(null);\n const overflowMenuRef = useRef<HTMLDivElement>(null);\n const overflowButtonRef = useRef<HTMLButtonElement>(null);\n const menuItemRefs = useRef<HTMLButtonElement[]>([]);\n const scrollTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const touchStartX = useRef<number>(0);\n const touchEndX = useRef<number>(0);\n\n // ---- Derived state ----\n const activeTab = controlledTab ?? internalActiveTab;\n\n // Group tabs by groupId\n const groupedTabs = useMemo(() => {\n return groups.length > 0\n ? groups.map((group) => ({\n group,\n tabs: tabs.filter((tab) => tab.groupId === group.id),\n }))\n : [{ group: null as TabGroupMeta | null, tabs }];\n }, [groups, tabs]);\n\n // Flatten menu items for keyboard navigation\n const flattenedMenuTabs = useMemo(() => {\n return groupedTabs.flatMap(({ tabs: groupTabs }) => groupTabs);\n }, [groupedTabs]);\n\n // ---- Handlers ----\n\n const handleTabClick = useCallback(\n (tabId: string) => {\n if (!controlledTab) {\n setInternalActiveTab(tabId);\n }\n onTabChange?.(tabId);\n setShowOverflowMenu(false);\n },\n [controlledTab, onTabChange],\n );\n\n const handleKeyDown = useCallback(\n (\n e: KeyboardEvent<HTMLButtonElement> | KeyboardEvent<HTMLDivElement>,\n currentIndex: number,\n ) => {\n let targetIndex: number;\n\n switch (e.key) {\n case \"ArrowRight\":\n e.preventDefault();\n targetIndex = currentIndex === tabs.length - 1 ? 0 : currentIndex + 1;\n break;\n case \"ArrowLeft\":\n e.preventDefault();\n targetIndex = currentIndex === 0 ? tabs.length - 1 : currentIndex - 1;\n break;\n case \"Home\":\n e.preventDefault();\n targetIndex = 0;\n break;\n case \"End\":\n e.preventDefault();\n targetIndex = tabs.length - 1;\n break;\n default:\n return;\n }\n\n const targetTab = tabs[targetIndex];\n if (targetTab) {\n handleTabClick(targetTab.id);\n tabRefs.current.get(targetTab.id)?.focus();\n }\n },\n [tabs, handleTabClick],\n );\n\n const setTabRef = useCallback((id: string, element: HTMLButtonElement | null) => {\n if (element) {\n tabRefs.current.set(id, element);\n } else {\n tabRefs.current.delete(id);\n }\n }, []);\n\n // ---- Scroll controls ----\n\n const checkScroll = useCallback(() => {\n const container = tabListRef.current;\n if (!container || !showOverflowControls) {\n setCanScrollLeft(false);\n setCanScrollRight(false);\n return;\n }\n\n const { scrollLeft, scrollWidth, clientWidth } = container;\n setCanScrollLeft(scrollLeft > 0);\n setCanScrollRight(scrollLeft + clientWidth < scrollWidth - 1);\n }, [showOverflowControls]);\n\n const scrollTabs = useCallback(\n (direction: \"left\" | \"right\") => {\n const container = tabListRef.current;\n if (!container) return;\n\n const scrollAmount = container.clientWidth * 0.75;\n container.scrollBy({\n left: direction === \"left\" ? -scrollAmount : scrollAmount,\n behavior: \"smooth\",\n });\n\n if (scrollTimeoutRef.current !== null) {\n clearTimeout(scrollTimeoutRef.current);\n }\n scrollTimeoutRef.current = setTimeout(checkScroll, 300);\n },\n [checkScroll],\n );\n\n // ---- Auto-scroll to active tab ----\n\n const scrollToActiveTab = useCallback(() => {\n if (!tabListRef.current || isMobileDropdown) return;\n\n const activeButton = tabRefs.current.get(activeTab);\n if (!activeButton) return;\n\n const container = tabListRef.current;\n const buttonRect = activeButton.getBoundingClientRect();\n const containerRect = container.getBoundingClientRect();\n\n if (buttonRect.left < containerRect.left) {\n container.scrollLeft -= containerRect.left - buttonRect.left + 8;\n } else if (buttonRect.right > containerRect.right) {\n container.scrollLeft += buttonRect.right - containerRect.right + 8;\n }\n }, [activeTab, isMobileDropdown]);\n\n // ---- Mobile dropdown mode ----\n\n const checkMobileMode = useCallback(() => {\n if (typeof window === \"undefined\" || overflowMode !== \"dropdown\") return;\n setIsMobileDropdown(window.innerWidth < 480);\n }, [overflowMode]);\n\n const toggleDropdown = useCallback(() => {\n setIsDropdownOpen((prev) => !prev);\n }, []);\n\n const handleDropdownKeyDown = useCallback(\n (e: KeyboardEvent<HTMLButtonElement>) => {\n if (e.key === \"Escape\" && isDropdownOpen) {\n e.preventDefault();\n setIsDropdownOpen(false);\n }\n },\n [isDropdownOpen],\n );\n\n // ---- Touch swipe (dropdown mode) ----\n\n const handleTouchStart = useCallback((e: TouchEvent<HTMLDivElement>) => {\n if (e.touches[0]) {\n touchStartX.current = e.touches[0].clientX;\n }\n }, []);\n\n const handleTouchMove = useCallback((e: TouchEvent<HTMLDivElement>) => {\n if (e.touches[0]) {\n touchEndX.current = e.touches[0].clientX;\n }\n }, []);\n\n const handleTouchEnd = useCallback(() => {\n if (!touchStartX.current || !touchEndX.current) return;\n\n const diff = touchStartX.current - touchEndX.current;\n const threshold = 50;\n\n if (Math.abs(diff) > threshold) {\n const currentIndex = tabs.findIndex((tab) => tab.id === activeTab);\n const nextTab = tabs[currentIndex + 1];\n const prevTab = tabs[currentIndex - 1];\n\n if (diff > 0 && nextTab) {\n handleTabClick(nextTab.id);\n } else if (diff < 0 && prevTab) {\n handleTabClick(prevTab.id);\n }\n }\n\n touchStartX.current = 0;\n touchEndX.current = 0;\n }, [activeTab, tabs, handleTabClick]);\n\n // ---- Overflow menu (menu mode) ----\n\n const handleOverflowMenuKeyDown = useCallback(\n (e: KeyboardEvent<HTMLDivElement>) => {\n const menuItemCount = flattenedMenuTabs.length;\n\n switch (e.key) {\n case \"Escape\":\n e.preventDefault();\n setShowOverflowMenu(false);\n setFocusedMenuIndex(-1);\n overflowButtonRef.current?.focus();\n break;\n case \"ArrowDown\":\n e.preventDefault();\n setFocusedMenuIndex((prev) => {\n const next = prev >= menuItemCount - 1 ? 0 : prev + 1;\n menuItemRefs.current[next]?.focus();\n return next;\n });\n break;\n case \"ArrowUp\":\n e.preventDefault();\n setFocusedMenuIndex((prev) => {\n const next = prev <= 0 ? menuItemCount - 1 : prev - 1;\n menuItemRefs.current[next]?.focus();\n return next;\n });\n break;\n case \"Home\":\n e.preventDefault();\n setFocusedMenuIndex(0);\n menuItemRefs.current[0]?.focus();\n break;\n case \"End\":\n e.preventDefault();\n setFocusedMenuIndex(menuItemCount - 1);\n menuItemRefs.current[menuItemCount - 1]?.focus();\n break;\n default:\n break;\n }\n },\n [flattenedMenuTabs.length],\n );\n\n const handleOverflowButtonKeyDown = useCallback(\n (e: KeyboardEvent<HTMLButtonElement>) => {\n if (e.key === \"Escape\" && showOverflowMenu) {\n e.preventDefault();\n setShowOverflowMenu(false);\n setFocusedMenuIndex(-1);\n }\n },\n [showOverflowMenu],\n );\n\n // ---- Effects ----\n\n // Close dropdown when clicking outside\n useEffect(() => {\n if (!isDropdownOpen) return;\n\n const handleClickOutside = (event: MouseEvent) => {\n if (\n dropdownContainerRef.current &&\n !dropdownContainerRef.current.contains(event.target as Node)\n ) {\n setIsDropdownOpen(false);\n }\n };\n\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }, [isDropdownOpen]);\n\n // Close overflow menu when clicking outside\n useEffect(() => {\n if (!showOverflowMenu) return undefined;\n\n const handleClickOutside = (event: MouseEvent) => {\n if (\n overflowMenuRef.current &&\n !overflowMenuRef.current.contains(event.target as Node)\n ) {\n setShowOverflowMenu(false);\n setFocusedMenuIndex(-1);\n }\n };\n\n const handleEscapeKey = (event: globalThis.KeyboardEvent) => {\n if (event.key === \"Escape\") {\n setShowOverflowMenu(false);\n setFocusedMenuIndex(-1);\n overflowButtonRef.current?.focus();\n }\n };\n\n document.addEventListener(\"mousedown\", handleClickOutside);\n document.addEventListener(\"keydown\", handleEscapeKey);\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n document.removeEventListener(\"keydown\", handleEscapeKey);\n };\n }, [showOverflowMenu]);\n\n // Focus menu item when overflow menu opens\n useEffect(() => {\n if (showOverflowMenu && menuItemRefs.current.length > 0) {\n const activeIndex = flattenedMenuTabs.findIndex((tab) => tab.id === activeTab);\n const indexToFocus = activeIndex >= 0 ? activeIndex : 0;\n setFocusedMenuIndex(indexToFocus);\n requestAnimationFrame(() => {\n menuItemRefs.current[indexToFocus]?.focus();\n });\n }\n }, [showOverflowMenu, flattenedMenuTabs, activeTab]);\n\n // Ensure active tab is valid\n useEffect(() => {\n if (!tabs.find((tab) => tab.id === activeTab)) {\n const firstTab = tabs[0];\n if (firstTab) {\n handleTabClick(firstTab.id);\n }\n }\n }, [tabs, activeTab, handleTabClick]);\n\n // Check mobile mode and scroll on mount/resize\n useEffect(() => {\n checkMobileMode();\n checkScroll();\n\n const handleResize = () => {\n checkMobileMode();\n checkScroll();\n };\n\n window.addEventListener(\"resize\", handleResize);\n return () => {\n window.removeEventListener(\"resize\", handleResize);\n };\n }, [checkMobileMode, checkScroll]);\n\n // Scroll to active tab when it changes\n useEffect(() => {\n scrollToActiveTab();\n }, [activeTab, scrollToActiveTab]);\n\n // Check scroll when tabs change\n useEffect(() => {\n checkScroll();\n }, [tabs, checkScroll]);\n\n // Cleanup scroll timeout on unmount\n useEffect(() => {\n return () => {\n if (scrollTimeoutRef.current !== null) {\n clearTimeout(scrollTimeoutRef.current);\n }\n };\n }, []);\n\n // ---- Render helpers ----\n\n const activeTabContent = tabs.find((tab) => tab.id === activeTab)?.content;\n const activeTabLabel = tabs.find((tab) => tab.id === activeTab)?.label;\n\n const hasGroups = groups.length > 0;\n\n // Reset menu item refs array each render\n menuItemRefs.current = [];\n\n /** Resolve the effective tag type for a tab (prefers `tag`, falls back to legacy `required`) */\n const resolveTabTag = (tab: TabItem): TabTagType | null => {\n if (tab.tag) return tab.tag;\n\n if (tab.required) return \"required\";\n return null;\n };\n\n /** Render a single tab button */\n const renderTabButton = (tab: TabItem, globalIndex: number) => {\n const isActive = tab.id === activeTab;\n const effectiveTag = resolveTabTag(tab);\n const tagConfig = effectiveTag ? TAG_CONFIG[effectiveTag] : null;\n const tagLabel = effectiveTag ? tagLabels[effectiveTag] : null;\n\n return (\n <button\n key={tab.id}\n ref={(el) => {\n setTabRef(tab.id, el);\n }}\n role=\"tab\"\n aria-selected={isActive}\n aria-controls={renderPanel ? `tabpanel-${tab.id}` : undefined}\n id={`tab-${tab.id}`}\n tabIndex={isActive ? 0 : -1}\n className={`tabs__tab${isActive ? \" tabs__tab--active\" : \"\"}`}\n onClick={() => {\n handleTabClick(tab.id);\n }}\n onKeyDown={(e) => {\n handleKeyDown(e, globalIndex);\n // Prevent the tablist's onKeyDown from also firing (it runs the\n // same Arrow/Home/End logic for synthetic tests / unusual focus\n // setups where focus is on the tablist itself).\n if (\n e.key === \"ArrowLeft\" ||\n e.key === \"ArrowRight\" ||\n e.key === \"Home\" ||\n e.key === \"End\"\n ) {\n e.stopPropagation();\n }\n }}\n >\n {tab.labelPrefix}\n <span className=\"tabs__tab-label\">{tab.label}</span>\n {tagConfig && (\n <Badge variant={tagConfig.variant} size=\"small\" className=\"tabs__tag-badge\">\n {tagLabel}\n </Badge>\n )}\n {tab.labelExtra}\n </button>\n );\n };\n\n /** Render the tab list content (flat or grouped) */\n const renderTabListContent = () => {\n if (hasGroups) {\n return groupedTabs.map(({ group, tabs: groupTabs }, groupIndex) => (\n <div key={group?.id || \"default\"} className=\"tabs__group\">\n {group && (\n <>\n {groupIndex > 0 && (\n <div className=\"tabs__separator\" role=\"separator\" aria-hidden=\"true\" />\n )}\n {showGroupLabels && (\n <span className=\"tabs__group-label\">{group.label}</span>\n )}\n </>\n )}\n <div className=\"tabs__group-tabs\">\n {groupTabs.map((tab) => {\n const globalIndex = tabs.findIndex((t) => t.id === tab.id);\n return renderTabButton(tab, globalIndex);\n })}\n </div>\n </div>\n ));\n }\n\n return tabs.map((tab, index) => renderTabButton(tab, index));\n };\n\n /** Render the overflow menu (menu mode) */\n const renderOverflowMenu = () => {\n if (overflowMode !== \"menu\" || !showOverflowControls) return null;\n\n return (\n <div className=\"tabs__overflow\" ref={overflowMenuRef}>\n <button\n ref={overflowButtonRef}\n type=\"button\"\n className=\"tabs__overflow-btn\"\n onClick={() => {\n setShowOverflowMenu(!showOverflowMenu);\n }}\n onKeyDown={handleOverflowButtonKeyDown}\n aria-label={moreTabsLabel}\n aria-expanded={showOverflowMenu}\n aria-haspopup=\"menu\"\n >\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"1\" />\n <circle cx=\"12\" cy=\"5\" r=\"1\" />\n <circle cx=\"12\" cy=\"19\" r=\"1\" />\n </svg>\n </button>\n\n {showOverflowMenu && (\n <div\n className=\"tabs__overflow-menu\"\n role=\"menu\"\n onKeyDown={handleOverflowMenuKeyDown}\n >\n {groupedTabs.map(({ group, tabs: groupTabs }) => (\n <div key={group?.id || \"default\"} className=\"tabs__overflow-group\">\n {group && showGroupLabels && (\n <div className=\"tabs__overflow-group-label\">{group.label}</div>\n )}\n {groupTabs.map((tab) => {\n const isActive = tab.id === activeTab;\n const flatIndex = flattenedMenuTabs.findIndex((t) => t.id === tab.id);\n const effectiveTag = resolveTabTag(tab);\n const tagConfig = effectiveTag ? TAG_CONFIG[effectiveTag] : null;\n const tagLabel = effectiveTag ? tagLabels[effectiveTag] : null;\n return (\n <button\n key={tab.id}\n ref={(el) => {\n if (el) {\n menuItemRefs.current[flatIndex] = el;\n }\n }}\n role=\"menuitem\"\n tabIndex={focusedMenuIndex === flatIndex ? 0 : -1}\n className={`tabs__overflow-item ${isActive ? \"tabs__overflow-item--active\" : \"\"}`}\n onClick={() => {\n handleTabClick(tab.id);\n }}\n >\n {tab.labelPrefix}\n <span>{tab.label}</span>\n {tagConfig && (\n <Badge variant={tagConfig.variant} size=\"small\">\n {tagLabel}\n </Badge>\n )}\n {tab.labelExtra}\n </button>\n );\n })}\n </div>\n ))}\n </div>\n )}\n </div>\n );\n };\n\n // ---- Variant class helpers ----\n\n // For segmented/compact variants we always want a single horizontal pill —\n // there is no scrollable arrow affordance and the mobile dropdown trigger\n // would visually conflict with the segmented look. Underlined remains the\n // only variant that follows the historical \"scroll + dropdown\" behavior.\n const isSegmentedFamily = variant === \"segmented\" || variant === \"compact\";\n const variantClass =\n variant === \"segmented\"\n ? \"tabs--variant-segmented\"\n : variant === \"compact\"\n ? \"tabs--variant-compact\"\n : \"\";\n const fillContainerClass =\n isSegmentedFamily && fillContainer ? \"tabs--fill-container\" : \"\";\n\n // ---- Mobile dropdown render (overflowMode === \"dropdown\") ----\n\n // Segmented/compact variants always render as a single inline tab bar — we\n // skip the mobile-dropdown branch even when the viewport is narrow so the\n // visual matches the existing per-page \"segmented control\" markup the\n // migration replaces.\n if (overflowMode === \"dropdown\" && isMobileDropdown && !isSegmentedFamily) {\n return (\n <div className={`tabs tabs--mobile-dropdown ${className}`}>\n <div className=\"tabs__dropdown-container\" ref={dropdownContainerRef}>\n <button\n className=\"tabs__dropdown-trigger\"\n onClick={toggleDropdown}\n onKeyDown={handleDropdownKeyDown}\n aria-expanded={isDropdownOpen}\n aria-haspopup=\"listbox\"\n aria-label={ariaLabel || selectTabLabel}\n >\n <span className=\"tabs__dropdown-label\">{activeTabLabel}</span>\n <svg\n className={`tabs__dropdown-arrow ${isDropdownOpen ? \"tabs__dropdown-arrow--open\" : \"\"}`}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M4 6L8 10L12 6\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </button>\n\n {isDropdownOpen && (\n <div className=\"tabs__dropdown-menu\" role=\"listbox\">\n {tabs.map((tab) => (\n <button\n key={tab.id}\n role=\"option\"\n aria-selected={tab.id === activeTab}\n className={`tabs__dropdown-item ${tab.id === activeTab ? \"tabs__dropdown-item--active\" : \"\"}`}\n onClick={() => {\n handleTabClick(tab.id);\n setIsDropdownOpen(false);\n }}\n >\n {tab.label}\n </button>\n ))}\n </div>\n )}\n </div>\n\n {renderPanel && (\n <div\n id={`tabpanel-${activeTab}`}\n role=\"tabpanel\"\n aria-labelledby={`tab-${activeTab}`}\n className={`tabs__panel ${panelClassName}`.trim()}\n tabIndex={0}\n onTouchStart={handleTouchStart}\n onTouchMove={handleTouchMove}\n onTouchEnd={handleTouchEnd}\n >\n {activeTabContent}\n </div>\n )}\n </div>\n );\n }\n\n // ---- Desktop/tablet render ----\n\n const modeClass = overflowMode === \"menu\" ? \"tabs--overflow-menu\" : \"\";\n\n return (\n <div\n className={`tabs ${modeClass} ${variantClass} ${fillContainerClass} ${className}`\n .replace(/\\s+/g, \" \")\n .trim()}\n >\n <div className=\"tabs__container\">\n {/* Scroll left arrow */}\n {showOverflowControls && canScrollLeft && (\n <button\n className=\"tabs__scroll-arrow tabs__scroll-arrow--left\"\n onClick={() => {\n scrollTabs(\"left\");\n }}\n aria-label={scrollLeftLabel}\n tabIndex={-1}\n >\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M12 15L7 10L12 5\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </button>\n )}\n\n <div\n ref={tabListRef}\n className=\"tabs__list\"\n role=\"tablist\"\n aria-label={ariaLabel}\n onScroll={checkScroll}\n onKeyDown={(e) => {\n // Mirror the per-button handler at the tablist level so synthetic\n // tests (and unusual focus setups where the tablist itself owns\n // the keyboard focus) get the same Arrow/Home/End behavior. Tab\n // buttons are still the primary handler; this only fires when\n // the event reaches the tablist without being handled by a tab.\n const currentIndex = tabs.findIndex((tab) => tab.id === activeTab);\n if (currentIndex < 0) return;\n handleKeyDown(e, currentIndex);\n }}\n onTouchStart={overflowMode === \"dropdown\" ? handleTouchStart : undefined}\n onTouchMove={overflowMode === \"dropdown\" ? handleTouchMove : undefined}\n onTouchEnd={overflowMode === \"dropdown\" ? handleTouchEnd : undefined}\n >\n {renderTabListContent()}\n </div>\n\n {/* Scroll right arrow */}\n {showOverflowControls && canScrollRight && (\n <button\n className=\"tabs__scroll-arrow tabs__scroll-arrow--right\"\n onClick={() => {\n scrollTabs(\"right\");\n }}\n aria-label={scrollRightLabel}\n tabIndex={-1}\n >\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M8 5L13 10L8 15\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </button>\n )}\n\n {/* Overflow menu (menu mode) */}\n {renderOverflowMenu()}\n </div>\n\n {renderPanel && (\n <div\n id={`tabpanel-${activeTab}`}\n role=\"tabpanel\"\n aria-labelledby={`tab-${activeTab}`}\n className={`tabs__panel ${panelClassName}`.trim()}\n tabIndex={0}\n >\n {activeTabContent}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;AAoCA,IAAM,KAAmC;CACvC,UAAU;CACV,aAAa;CACb,MAAM;CACN,cAAc;AAChB;AAiHA,SAAgB,EAAK,EACnB,SACA,YAAS,CAAC,GACV,gBACA,WAAW,GACX,gBACA,eAAY,IACZ,oBAAiB,IACjB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