@fanvue/ui 3.46.0 → 3.48.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.
@@ -6,6 +6,7 @@ import { Button } from "../Button/Button.mjs";
6
6
  import { CloseIcon } from "../Icons/CloseIcon.mjs";
7
7
  import { SearchIcon } from "../Icons/SearchIcon.mjs";
8
8
  import { TranscationArrowIcon } from "../Icons/TranscationArrowIcon.mjs";
9
+ import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from "../Tooltip/Tooltip.mjs";
9
10
  const TableSizeContext = React.createContext("md");
10
11
  function useTableSize() {
11
12
  return React.useContext(TableSizeContext);
@@ -123,6 +124,66 @@ const TableToolbarButton = React.forwardRef(
123
124
  }
124
125
  );
125
126
  TableToolbarButton.displayName = "TableToolbarButton";
127
+ const TableRowButton = React.forwardRef(
128
+ ({ className, variant = "secondary", ...props }, ref) => {
129
+ return /* @__PURE__ */ jsx(
130
+ Button,
131
+ {
132
+ ref,
133
+ size: "24",
134
+ variant,
135
+ className: cn(
136
+ "typography-description-12px-semibold rounded-xs [&_svg]:size-4! [&_svg]:text-icons-secondary",
137
+ className
138
+ ),
139
+ ...props
140
+ }
141
+ );
142
+ }
143
+ );
144
+ TableRowButton.displayName = "TableRowButton";
145
+ const TableTruncatedText = React.forwardRef(
146
+ ({ className, children, maxChars = 25, style, ...props }, ref) => {
147
+ const innerRef = React.useRef(null);
148
+ const [isTruncated, setIsTruncated] = React.useState(false);
149
+ React.useImperativeHandle(ref, () => innerRef.current);
150
+ const measure = React.useCallback(() => {
151
+ const element = innerRef.current;
152
+ if (element) {
153
+ setIsTruncated(element.scrollWidth > element.clientWidth);
154
+ }
155
+ }, []);
156
+ React.useLayoutEffect(measure);
157
+ React.useLayoutEffect(() => {
158
+ const element = innerRef.current;
159
+ if (!element || typeof ResizeObserver === "undefined") {
160
+ return;
161
+ }
162
+ const observer = new ResizeObserver(measure);
163
+ observer.observe(element);
164
+ return () => observer.disconnect();
165
+ }, [measure]);
166
+ const text = /* @__PURE__ */ jsx(
167
+ "span",
168
+ {
169
+ ref: innerRef,
170
+ className: cn("block truncate", className),
171
+ style: { maxWidth: `${maxChars}ch`, ...style },
172
+ tabIndex: isTruncated ? 0 : void 0,
173
+ ...props,
174
+ children
175
+ }
176
+ );
177
+ if (!isTruncated) {
178
+ return text;
179
+ }
180
+ return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
181
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: text }),
182
+ /* @__PURE__ */ jsx(TooltipContent, { className: "max-w-xs whitespace-pre-line", children })
183
+ ] }) });
184
+ }
185
+ );
186
+ TableTruncatedText.displayName = "TableTruncatedText";
126
187
  const TableScrollArea = React.forwardRef(
127
188
  ({ className, children, roundTop: _roundTop, showScrollbar = false, ...props }, ref) => {
128
189
  return /* @__PURE__ */ jsx(
@@ -469,6 +530,7 @@ export {
469
530
  TablePillProgressLayout,
470
531
  TableProgressTrack,
471
532
  TableRow,
533
+ TableRowButton,
472
534
  TableScrollArea,
473
535
  TableSortLabel,
474
536
  TableStackedText,
@@ -476,6 +538,7 @@ export {
476
538
  TableToolbar,
477
539
  TableToolbarAction,
478
540
  TableToolbarButton,
479
- TableToolbarSearch
541
+ TableToolbarSearch,
542
+ TableTruncatedText
480
543
  };
481
544
  //# sourceMappingURL=Table.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Table.mjs","sources":["../../../src/components/Table/Table.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { Button, type ButtonProps } from \"../Button/Button\";\nimport { CloseIcon } from \"../Icons/CloseIcon\";\nimport { SearchIcon } from \"../Icons/SearchIcon\";\nimport { TranscationArrowIcon } from \"../Icons/TranscationArrowIcon\";\n\n/**\n * Row density for body cells.\n *\n * - `\"md\"` (default) → 64px Figma `V2 Table Cell` Default.\n * - `\"condensed\"` → 48px Figma `V2 Table Cell` Condensed.\n * - `\"lg\"` → 80px rows; no longer in Figma, kept for back-compat.\n *\n * `\"default\"` is the v2 numeric-token equivalent of `\"md\"` and is preferred\n * for new code.\n */\nexport type TableSize = \"md\" | \"lg\" | \"condensed\" | \"default\";\n\nexport interface TableCardProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Row density applied to {@link TableCell} descendants. @default \"md\" */\n size?: TableSize;\n}\n\nconst TableSizeContext = React.createContext<TableSize>(\"md\");\n\nfunction useTableSize(): TableSize {\n return React.useContext(TableSizeContext);\n}\n\n/**\n * Surface wrapper for data tables: 12px-radius container with a 0.5px\n * hairline border and no inner padding, so the header, rows and\n * {@link TableCardPagination} footer run edge to edge. Provides the size\n * context for {@link TableCell} descendants. Compose with {@link TableScrollArea}, {@link Table},\n * {@link TableHeader}, {@link TableBody}, {@link TableRow},\n * {@link TableHead}, and {@link TableCell}.\n *\n * @example\n * ```tsx\n * <TableCard>\n * <TableScrollArea>\n * <Table>\n * <TableHeader>\n * <TableRow>\n * <TableHead>Name</TableHead>\n * </TableRow>\n * </TableHeader>\n * <TableBody>\n * <TableRow>\n * <TableCell>Jane Doe</TableCell>\n * </TableRow>\n * </TableBody>\n * </Table>\n * </TableScrollArea>\n * </TableCard>\n * ```\n */\nexport const TableCard = React.forwardRef<HTMLDivElement, TableCardProps>(\n ({ className, size = \"md\", ...props }, ref) => {\n return (\n <TableSizeContext.Provider value={size}>\n <div\n ref={ref}\n className={cn(\n \"isolate flex flex-col overflow-hidden rounded-sm border-[0.5px] border-border-primary\",\n className,\n )}\n {...props}\n />\n </TableSizeContext.Provider>\n );\n },\n);\nTableCard.displayName = \"TableCard\";\n\nexport interface TableToolbarProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Left slot, usually a {@link TableToolbarSearch}. */\n search?: React.ReactNode;\n}\n\n/**\n * 40px action bar above a {@link TableCard}: search on the left, every other\n * control (menus, toggles, buttons) on the right, 24px apart. On phones\n * {@link TableToolbarAction} controls go icon-only so the bar fits.\n *\n * @example\n * ```tsx\n * <TableToolbar search={<TableToolbarSearch value={q} onValueChange={setQ} placeholder=\"Search\" clearLabel=\"Clear search\" />}>\n * <TableToolbarAction icon={<SettingsIcon />}>Filters</TableToolbarAction>\n * <TableToolbarButton>Create</TableToolbarButton>\n * </TableToolbar>\n * ```\n */\nexport const TableToolbar = React.forwardRef<HTMLDivElement, TableToolbarProps>(\n ({ className, search, children, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"flex h-10 w-full min-w-0 items-center gap-4 rounded-sm border-[0.5px] border-border-strong bg-surface-table-row pr-2 pl-4\",\n className,\n )}\n {...props}\n >\n <div className=\"flex min-w-24 flex-1 items-center\">{search}</div>\n {children != null && (\n <div className=\"flex min-w-0 items-center gap-6 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\">\n {children}\n </div>\n )}\n </div>\n );\n },\n);\nTableToolbar.displayName = \"TableToolbar\";\n\nexport interface TableToolbarSearchProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, \"value\" | \"onChange\" | \"type\"> {\n /** Current query. */\n value: string;\n /** Called with the new query, and with `\"\"` when cleared. */\n onValueChange: (value: string) => void;\n /** Accessible name of the clear button. */\n clearLabel: string;\n}\n\n/**\n * Borderless search field for the left slot of {@link TableToolbar}:\n * 16px search icon, 12px text and a clear button once there is a query.\n */\nexport const TableToolbarSearch = React.forwardRef<HTMLInputElement, TableToolbarSearchProps>(\n ({ className, value, onValueChange, clearLabel, placeholder, ...props }, ref) => {\n return (\n <label className={cn(\"flex h-6 w-full min-w-0 cursor-text items-center gap-2\", className)}>\n <SearchIcon size={16} className=\"shrink-0 text-icons-secondary\" aria-hidden />\n <input\n ref={ref}\n type=\"search\"\n value={value}\n onChange={(event) => onValueChange(event.target.value)}\n placeholder={placeholder}\n aria-label={props[\"aria-label\"] ?? placeholder}\n className=\"typography-description-12px-regular min-w-0 flex-1 border-none bg-transparent p-0 text-content-primary outline-none placeholder:text-content-secondary [&::-webkit-search-cancel-button]:hidden\"\n {...props}\n />\n {value !== \"\" && (\n <button\n type=\"button\"\n aria-label={clearLabel}\n onClick={() => onValueChange(\"\")}\n className=\"inline-flex size-4 shrink-0 cursor-pointer items-center justify-center border-none bg-transparent p-0 text-icons-secondary hover:text-icons-primary\"\n >\n <CloseIcon size={16} />\n </button>\n )}\n </label>\n );\n },\n);\nTableToolbarSearch.displayName = \"TableToolbarSearch\";\n\nexport interface TableToolbarActionProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** 16px icon after the label. @default up/down arrows, for a menu trigger showing its current value */\n icon?: React.ReactNode;\n /** Tints the icon with the brand colour while a toggle or filter is on. @default false */\n active?: boolean;\n}\n\n/**\n * Labelled control for {@link TableToolbar}: 12px label followed by a 16px\n * icon. Below the `md` breakpoint only the icon shows, and the label stays as\n * the accessible name, so a full bar still fits a phone. Works as a plain\n * button or as a `DropdownMenuTrigger` child.\n */\nexport const TableToolbarAction = React.forwardRef<HTMLButtonElement, TableToolbarActionProps>(\n ({ className, children, icon, active = false, type = \"button\", ...props }, ref) => {\n return (\n <button\n ref={ref}\n type={type}\n className={cn(\n \"typography-description-12px-regular inline-flex h-6 shrink-0 cursor-pointer items-center gap-2 whitespace-nowrap rounded-xs border-none bg-transparent p-0 text-content-secondary outline-none\",\n \"hover:text-content-primary focus-visible:shadow-focus-ring disabled:cursor-default disabled:opacity-40\",\n className,\n )}\n {...props}\n >\n <span className=\"max-md:sr-only\">{children}</span>\n <span\n aria-hidden\n className={cn(\n \"inline-flex size-4 shrink-0 items-center justify-center [&>svg]:size-4\",\n active ? \"text-brand-primary-default\" : \"text-icons-secondary\",\n )}\n >\n {icon ?? <TranscationArrowIcon size={16} />}\n </span>\n </button>\n );\n },\n);\nTableToolbarAction.displayName = \"TableToolbarAction\";\n\nexport interface TableToolbarButtonProps extends Omit<ButtonProps, \"size\"> {}\n\n/**\n * Call to action for {@link TableToolbar} (e.g. \"Create New\"): a 24px\n * {@link Button} squared to the toolbar's 8px radius with 12px semibold type,\n * so it sits 8px from the bar's edges. Elsewhere use {@link Button}.\n */\nexport const TableToolbarButton = React.forwardRef<HTMLButtonElement, TableToolbarButtonProps>(\n ({ className, ...props }, ref) => {\n return (\n <Button\n ref={ref}\n size=\"24\"\n className={cn(\"typography-description-12px-semibold rounded-xs\", className)}\n {...props}\n />\n );\n },\n);\nTableToolbarButton.displayName = \"TableToolbarButton\";\n\nexport interface TableScrollAreaProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * No longer needed in v2 — {@link TableCard} handles corner rounding via\n * its own `overflow-hidden rounded-3xl`. Accepted for back-compat.\n *\n * @deprecated v2 ignores this prop; safe to remove.\n */\n roundTop?: boolean;\n /**\n * Shows a slim horizontal scrollbar beneath the table when the content\n * overflows (Figma `V2 Scroll Bar`). @default false\n */\n showScrollbar?: boolean;\n}\n\n/**\n * Horizontal scroll container for wide tables. The inner scrollport keeps\n * `border-collapse` styles intact when the table wraps.\n */\nexport const TableScrollArea = React.forwardRef<HTMLDivElement, TableScrollAreaProps>(\n ({ className, children, roundTop: _roundTop, showScrollbar = false, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\"relative w-full min-w-0 overflow-hidden\", className)}\n {...props}\n >\n <div\n className={cn(\n \"overflow-x-auto\",\n showScrollbar &&\n \"pb-3 [scrollbar-color:var(--color-border-strong)_transparent] [scrollbar-width:thin]\",\n )}\n >\n {children}\n </div>\n </div>\n );\n },\n);\nTableScrollArea.displayName = \"TableScrollArea\";\n\nexport interface TableProps extends React.TableHTMLAttributes<HTMLTableElement> {}\n\n/**\n * Semantic `<table>` element. Place inside {@link TableScrollArea}.\n */\nexport const Table = React.forwardRef<HTMLTableElement, TableProps>(\n ({ className, ...props }, ref) => {\n return (\n <table\n ref={ref}\n className={cn(\n \"w-full caption-bottom border-separate border-spacing-0 text-left\",\n className,\n )}\n {...props}\n />\n );\n },\n);\nTable.displayName = \"Table\";\n\nexport interface TableHeaderProps extends React.HTMLAttributes<HTMLTableSectionElement> {}\n\nexport const TableHeader = React.forwardRef<HTMLTableSectionElement, TableHeaderProps>(\n ({ className, ...props }, ref) => {\n return <thead ref={ref} className={cn(className)} {...props} />;\n },\n);\nTableHeader.displayName = \"TableHeader\";\n\nexport interface TableBodyProps extends React.HTMLAttributes<HTMLTableSectionElement> {}\n\n/**\n * `<tbody>` wrapper. Removes the bottom border on cells in the final row to\n * match the Figma `V2 Table Final Row` treatment.\n */\nexport const TableBody = React.forwardRef<HTMLTableSectionElement, TableBodyProps>(\n ({ className, ...props }, ref) => {\n return (\n <tbody ref={ref} className={cn(\"[&_tr:last-child_td]:border-b-0\", className)} {...props} />\n );\n },\n);\nTableBody.displayName = \"TableBody\";\n\nexport interface TableFooterProps extends React.HTMLAttributes<HTMLTableSectionElement> {}\n\nexport const TableFooter = React.forwardRef<HTMLTableSectionElement, TableFooterProps>(\n ({ className, ...props }, ref) => {\n return <tfoot ref={ref} className={cn(className)} {...props} />;\n },\n);\nTableFooter.displayName = \"TableFooter\";\n\nexport interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement> {}\n\n/**\n * Table row. A body row holding a {@link TableMediaThumbnail} or\n * {@link TableMediaTile} grows from 40px to 56px to keep 8px around it.\n */\nexport const TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(\n ({ className, ...props }, ref) => {\n return (\n <tr ref={ref} className={cn(\"[&:has([data-table-media])>td]:h-14\", className)} {...props} />\n );\n },\n);\nTableRow.displayName = \"TableRow\";\n\n/** Column layout preset for {@link TableHead}. */\nexport type TableHeadIntent = \"default\" | \"checkbox\" | \"sort\" | \"leading\";\n\nconst HEAD_INTENT_CLASSES: Record<TableHeadIntent, string> = {\n default: \"text-left\",\n checkbox: \"w-px pr-0 text-left\",\n sort: \"text-right\",\n leading: \"min-w-0 w-2/5 text-left\",\n};\n\nconst CELL_GUTTERS = \"px-5 first:pl-4 last:pr-4\";\n\nexport interface TableHeadProps extends React.ThHTMLAttributes<HTMLTableCellElement> {\n /** Layout preset for common column types. @default \"default\" */\n intent?: TableHeadIntent;\n}\n\n/**\n * Header cell: 32px tall on `surface-table-row`, 12px secondary text and a\n * 0.5px bottom rule. Columns sit at least 40px apart, with 16px against the\n * card edges.\n */\nexport const TableHead = React.forwardRef<HTMLTableCellElement, TableHeadProps>(\n ({ className, intent = \"default\", scope = \"col\", ...props }, ref) => {\n return (\n <th\n ref={ref}\n scope={scope}\n className={cn(\n \"typography-description-12px-regular box-border h-8 whitespace-nowrap border-border-primary border-b-[0.5px] bg-surface-table-row py-0 align-middle font-normal text-content-secondary\",\n CELL_GUTTERS,\n HEAD_INTENT_CLASSES[intent],\n className,\n )}\n {...props}\n />\n );\n },\n);\nTableHead.displayName = \"TableHead\";\n\nconst CELL_MIN_HEIGHT: Record<TableSize, string> = {\n md: \"h-10\",\n default: \"h-10\",\n condensed: \"h-10\",\n lg: \"h-14\",\n};\n\n/** Bottom border and padding preset for body cells (Figma table cell component). */\nexport type TableCellVariant = \"default\" | \"chip\" | \"pillProgress\";\n\nconst CELL_VARIANT_CLASSES: Record<TableCellVariant, string> = {\n default: \"border-b-[0.5px] border-border-primary py-0\",\n chip: \"border-b-[0.5px] border-border-primary py-0\",\n pillProgress: \"border-b-[0.5px] border-border-primary py-1\",\n};\n\n/** Layout / typography preset for {@link TableCell} (orthogonal to {@link TableCellVariant}). */\nexport type TableCellIntent = \"default\" | \"checkbox\" | \"stacked\" | \"multiline\" | \"sideLabel\";\n\nconst CELL_INTENT_CLASSES: Record<TableCellIntent, string> = {\n default: \"\",\n checkbox: \"w-px pr-0 text-left\",\n stacked: \"align-top py-2\",\n multiline: \"max-w-[240px]\",\n sideLabel: \"\",\n};\n\nexport interface TableCellProps extends React.TdHTMLAttributes<HTMLTableCellElement> {\n /** Padding preset for the cell. v2 uses identical padding across variants; values are kept for back-compat. @default \"default\" */\n cellVariant?: TableCellVariant;\n /** Alignment and typography preset for common cell types. @default \"default\" */\n intent?: TableCellIntent;\n /** Keeps the content on one line, for short values (dates, amounts, statuses). @default false */\n nowrap?: boolean;\n}\n\n/**\n * Body cell: 40px rows (56px when the parent {@link TableCard} uses\n * `size=\"lg\"` or the row holds media), 12px type, transparent background and\n * a 0.5px rule that {@link TableBody} drops on the final row. Long text wraps\n * and the row grows; set `nowrap` on short columns to keep them on one line.\n */\nexport const TableCell = React.forwardRef<HTMLTableCellElement, TableCellProps>(\n ({ className, cellVariant = \"default\", intent = \"default\", nowrap = false, ...props }, ref) => {\n const size = useTableSize();\n const typo =\n intent === \"sideLabel\"\n ? \"typography-description-12px-semibold\"\n : \"typography-description-12px-regular\";\n return (\n <td\n ref={ref}\n className={cn(\n typo,\n \"align-middle text-content-primary\",\n nowrap && \"whitespace-nowrap\",\n CELL_GUTTERS,\n CELL_VARIANT_CLASSES[cellVariant],\n CELL_MIN_HEIGHT[size],\n CELL_INTENT_CLASSES[intent],\n className,\n )}\n {...props}\n />\n );\n },\n);\nTableCell.displayName = \"TableCell\";\n\nexport interface TableCellGroupProps extends React.HTMLAttributes<HTMLDivElement> {}\n\n/**\n * Horizontal group for icons, chips, and metadata inside a {@link TableCell}\n * (Figma `gap-[4px]`).\n */\nexport const TableCellGroup = React.forwardRef<HTMLDivElement, TableCellGroupProps>(\n ({ className, ...props }, ref) => {\n return <div ref={ref} className={cn(\"flex items-center gap-1\", className)} {...props} />;\n },\n);\nTableCellGroup.displayName = \"TableCellGroup\";\n\nexport interface TableCellContentProps {\n /** Primary line (semibold body-sm). */\n primary: React.ReactNode;\n /** Optional secondary line (regular body-sm, secondary color). */\n secondary?: React.ReactNode;\n /** Inline node rendered next to the primary line (icon, chip). */\n primaryAdornment?: React.ReactNode;\n /** Inline node rendered next to the secondary line. */\n secondaryAdornment?: React.ReactNode;\n /** Class for the outer wrapper. */\n className?: string;\n}\n\n/**\n * Two-line content slot matching Figma `V2 Table Content` — 12px primary line\n * (semibold) over an optional 12px secondary line (regular, muted), so both\n * fit a 40px row. Use inside {@link TableCell} for the common stacked-text pattern.\n */\nexport function TableCellContent({\n primary,\n secondary,\n primaryAdornment,\n secondaryAdornment,\n className,\n}: TableCellContentProps) {\n return (\n <div className={cn(\"flex flex-col\", className)}>\n <div className=\"flex items-center gap-1\">\n <span className=\"typography-description-12px-semibold text-content-primary\">{primary}</span>\n {primaryAdornment}\n </div>\n {(secondary != null || secondaryAdornment != null) && (\n <div className=\"flex items-center gap-1\">\n {secondary != null && (\n <span className=\"typography-description-12px-regular text-content-secondary\">\n {secondary}\n </span>\n )}\n {secondaryAdornment}\n </div>\n )}\n </div>\n );\n}\nTableCellContent.displayName = \"TableCellContent\";\n\n/** Pixel size of the square {@link TableMediaThumbnail}. */\nexport type TableMediaThumbnailSize = \"48\" | \"40\" | \"32\";\n\nexport interface TableMediaThumbnailProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"children\"> {\n /** Image URL. */\n src: string;\n /** Alt text for the image. @default \"\" */\n alt?: string;\n /** Applies the table's blurred-media treatment. @default false */\n blurred?: boolean;\n /** `center` uses the fixed media column width from the lg spec. @default \"start\" */\n align?: \"start\" | \"center\";\n /** Pixel size of the square thumbnail. At 40 or 48 its row grows to 56px; 32 fits a 40px row. @default \"40\" */\n size?: TableMediaThumbnailSize;\n}\n\n/**\n * Square photo that fills its frame, used inside {@link TableCell} for media\n * columns. At the 40px and 48px sizes its row grows to 56px; the 32px size\n * fits a regular 40px row.\n */\nexport const TableMediaThumbnail = React.forwardRef<HTMLDivElement, TableMediaThumbnailProps>(\n ({ className, src, alt = \"\", blurred, align = \"start\", size = \"40\", ...props }, ref) => {\n const frame = cn(\n \"overflow-hidden bg-neutral-alphas-200\",\n size === \"48\" && \"size-12 rounded-sm\",\n size === \"40\" && \"size-10 rounded-xs\",\n size === \"32\" && \"size-8 rounded-xs\",\n );\n return (\n <div\n ref={ref}\n data-table-media={size === \"32\" ? undefined : \"\"}\n className={cn(\n align === \"center\" && \"flex w-16 shrink-0 justify-center\",\n align === \"start\" && \"inline-flex shrink-0\",\n )}\n >\n <div className={cn(frame, blurred && \"blur-[2px]\", className)} {...props}>\n <img alt={alt} className=\"size-full object-cover\" src={src} />\n </div>\n </div>\n );\n },\n);\nTableMediaThumbnail.displayName = \"TableMediaThumbnail\";\n\nexport interface TableMediaTileProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** Logo or icon centred on the tile, or edge-to-edge media when `fill` is set. */\n children: React.ReactNode;\n /** Lets the child fill the tile edge to edge (e.g. a video preview) with no border or fill. @default false */\n fill?: boolean;\n}\n\n/**\n * 40px tile for a {@link TableCell}: a logo or icon (e.g. a social platform)\n * centred on `surface-table-row` with a 0.5px border, or, with `fill`, custom\n * media that fills it. Its row grows to 56px. For a plain image URL use\n * {@link TableMediaThumbnail}.\n */\nexport const TableMediaTile = React.forwardRef<HTMLSpanElement, TableMediaTileProps>(\n ({ className, fill = false, ...props }, ref) => {\n return (\n <span\n ref={ref}\n data-table-media=\"\"\n className={cn(\n \"inline-flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-xs\",\n fill\n ? \"[&>*]:size-full\"\n : \"border-[0.5px] border-border-primary bg-surface-table-row text-icons-secondary\",\n className,\n )}\n {...props}\n />\n );\n },\n);\nTableMediaTile.displayName = \"TableMediaTile\";\n\nexport interface TableStatusDotProps extends React.HTMLAttributes<HTMLDivElement> {}\n\n/**\n * Small status indicator dot for table cells (Figma status column).\n */\nexport const TableStatusDot = React.forwardRef<HTMLDivElement, TableStatusDotProps>(\n ({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\"size-2 shrink-0 rounded-full bg-info-content\", className)}\n {...props}\n />\n );\n },\n);\nTableStatusDot.displayName = \"TableStatusDot\";\n\nexport interface TableProgressTrackProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Fill width from 0–100. @default 0 */\n value?: number;\n}\n\n/**\n * Thin progress track used with badges in table cells (Figma pill + progress).\n * Renders with `role=\"progressbar\"` and a default `aria-label` of `\"Progress\"`.\n */\nexport const TableProgressTrack = React.forwardRef<HTMLDivElement, TableProgressTrackProps>(\n ({ className, value = 0, \"aria-label\": ariaLabel = \"Progress\", ...props }, ref) => {\n const width = Math.min(100, Math.max(0, value));\n const rounded = Math.round(width);\n return (\n <div\n ref={ref}\n role=\"progressbar\"\n aria-valuenow={rounded}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-label={ariaLabel}\n className={cn(\n \"relative h-1 w-full overflow-hidden rounded-full bg-neutral-alphas-200\",\n className,\n )}\n {...props}\n >\n <div\n className=\"absolute top-0 left-0 h-1 rounded-full bg-buttons-primary-default\"\n style={{ width: `${width}%` }}\n aria-hidden\n />\n </div>\n );\n },\n);\nTableProgressTrack.displayName = \"TableProgressTrack\";\n\nexport interface TablePillProgressLayoutProps extends React.HTMLAttributes<HTMLDivElement> {}\n\n/**\n * Vertical layout for pill label + {@link TableProgressTrack} in a cell.\n */\nexport const TablePillProgressLayout = React.forwardRef<\n HTMLDivElement,\n TablePillProgressLayoutProps\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\"flex min-w-[120px] flex-col items-start gap-2\", className)}\n {...props}\n />\n );\n});\nTablePillProgressLayout.displayName = \"TablePillProgressLayout\";\n\n/** Current sort direction of a {@link TableSortLabel}. `null` means unsorted. */\nexport type TableSortDirection = \"asc\" | \"desc\" | null;\n\nexport interface TableSortLabelProps extends React.HTMLAttributes<HTMLSpanElement> {\n children: React.ReactNode;\n /**\n * Visual indicator of the column's sort state. When set to `\"asc\"` or\n * `\"desc\"`, the label turns primary and the Arrow Sort Up / Down chevrons\n * appear next to it, the active direction highlighted. @default null\n */\n direction?: TableSortDirection;\n}\n\nfunction SortArrows({ direction }: { direction: \"asc\" | \"desc\" }) {\n return (\n <svg\n width={16}\n height={16}\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n aria-hidden=\"true\"\n className=\"shrink-0\"\n >\n <path\n d=\"M5 6L8 3L11 6\"\n strokeWidth={1.2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={direction === \"asc\" ? \"stroke-current\" : \"stroke-icons-tertiary\"}\n />\n <path\n d=\"M11 10L8 13L5 10\"\n strokeWidth={1.2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={direction === \"desc\" ? \"stroke-current\" : \"stroke-icons-tertiary\"}\n />\n </svg>\n );\n}\n\n/**\n * Sortable column label. A sorted column reads primary with the Arrow Sort\n * Up / Down chevrons; an unsorted one keeps the header colour.\n */\nexport const TableSortLabel = React.forwardRef<HTMLSpanElement, TableSortLabelProps>(\n ({ className, children, direction = null, ...props }, ref) => {\n return (\n <span\n ref={ref}\n className={cn(\n \"inline-flex items-center gap-1\",\n direction != null && \"text-content-primary\",\n className,\n )}\n {...props}\n >\n {children}\n {direction != null && <SortArrows direction={direction} />}\n </span>\n );\n },\n);\nTableSortLabel.displayName = \"TableSortLabel\";\n\nexport interface TableStackedTextProps {\n /** Primary line (semibold body). */\n title: React.ReactNode;\n /** Secondary line (caption, muted). */\n subtitle: React.ReactNode;\n}\n\n/**\n * Two-line primary + secondary text block for \"cell + info\" patterns.\n *\n * @deprecated Prefer {@link TableCellContent} which supports adornments and\n * matches the Figma `V2 Table Content` slot.\n */\nexport function TableStackedText({ title, subtitle }: TableStackedTextProps) {\n return <TableCellContent primary={title} secondary={subtitle} />;\n}\n\nTableStackedText.displayName = \"TableStackedText\";\n\nexport interface TableLineClampProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Number of lines before ellipsis. @default 2 */\n lines?: 1 | 2 | 3;\n}\n\n/**\n * Clamps child text to a fixed number of lines inside a {@link TableCell}.\n */\nexport const TableLineClamp = React.forwardRef<HTMLDivElement, TableLineClampProps>(\n ({ className, lines = 2, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n lines === 1 && \"line-clamp-1\",\n lines === 2 && \"line-clamp-2\",\n lines === 3 && \"line-clamp-3\",\n className,\n )}\n {...props}\n />\n );\n },\n);\nTableLineClamp.displayName = \"TableLineClamp\";\n"],"names":[],"mappings":";;;;;;;;AAwBA,MAAM,mBAAmB,MAAM,cAAy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AAA,UACA,aAAa,QAAQ,oBAAC,YAAA,EAAW,UAAA,CAAsB;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAG9D;AACF;AACA,eAAe,cAAc;AAetB,SAAS,iBAAiB,EAAE,OAAO,YAAmC;AAC3E,SAAO,oBAAC,kBAAA,EAAiB,SAAS,OAAO,WAAW,UAAU;AAChE;AAEA,iBAAiB,cAAc;AAUxB,MAAM,iBAAiB,MAAM;AAAA,EAClC,CAAC,EAAE,WAAW,QAAQ,GAAG,GAAG,MAAA,GAAS,QAAQ;AAC3C,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT,UAAU,KAAK;AAAA,UACf,UAAU,KAAK;AAAA,UACf,UAAU,KAAK;AAAA,UACf;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AACA,eAAe,cAAc;"}
1
+ {"version":3,"file":"Table.mjs","sources":["../../../src/components/Table/Table.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { Button, type ButtonProps } from \"../Button/Button\";\nimport { CloseIcon } from \"../Icons/CloseIcon\";\nimport { SearchIcon } from \"../Icons/SearchIcon\";\nimport { TranscationArrowIcon } from \"../Icons/TranscationArrowIcon\";\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from \"../Tooltip/Tooltip\";\n\n/**\n * Row density for body cells.\n *\n * - `\"md\"` (default) → 64px Figma `V2 Table Cell` Default.\n * - `\"condensed\"` → 48px Figma `V2 Table Cell` Condensed.\n * - `\"lg\"` → 80px rows; no longer in Figma, kept for back-compat.\n *\n * `\"default\"` is the v2 numeric-token equivalent of `\"md\"` and is preferred\n * for new code.\n */\nexport type TableSize = \"md\" | \"lg\" | \"condensed\" | \"default\";\n\nexport interface TableCardProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Row density applied to {@link TableCell} descendants. @default \"md\" */\n size?: TableSize;\n}\n\nconst TableSizeContext = React.createContext<TableSize>(\"md\");\n\nfunction useTableSize(): TableSize {\n return React.useContext(TableSizeContext);\n}\n\n/**\n * Surface wrapper for data tables: 12px-radius container with a 0.5px\n * hairline border and no inner padding, so the header, rows and\n * {@link TableCardPagination} footer run edge to edge. Provides the size\n * context for {@link TableCell} descendants. Compose with {@link TableScrollArea}, {@link Table},\n * {@link TableHeader}, {@link TableBody}, {@link TableRow},\n * {@link TableHead}, and {@link TableCell}.\n *\n * @example\n * ```tsx\n * <TableCard>\n * <TableScrollArea>\n * <Table>\n * <TableHeader>\n * <TableRow>\n * <TableHead>Name</TableHead>\n * </TableRow>\n * </TableHeader>\n * <TableBody>\n * <TableRow>\n * <TableCell>Jane Doe</TableCell>\n * </TableRow>\n * </TableBody>\n * </Table>\n * </TableScrollArea>\n * </TableCard>\n * ```\n */\nexport const TableCard = React.forwardRef<HTMLDivElement, TableCardProps>(\n ({ className, size = \"md\", ...props }, ref) => {\n return (\n <TableSizeContext.Provider value={size}>\n <div\n ref={ref}\n className={cn(\n \"isolate flex flex-col overflow-hidden rounded-sm border-[0.5px] border-border-primary\",\n className,\n )}\n {...props}\n />\n </TableSizeContext.Provider>\n );\n },\n);\nTableCard.displayName = \"TableCard\";\n\nexport interface TableToolbarProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Left slot, usually a {@link TableToolbarSearch}. */\n search?: React.ReactNode;\n}\n\n/**\n * 40px action bar above a {@link TableCard}: search on the left, every other\n * control (menus, toggles, buttons) on the right, 24px apart. On phones\n * {@link TableToolbarAction} controls go icon-only so the bar fits.\n *\n * @example\n * ```tsx\n * <TableToolbar search={<TableToolbarSearch value={q} onValueChange={setQ} placeholder=\"Search\" clearLabel=\"Clear search\" />}>\n * <TableToolbarAction icon={<SettingsIcon />}>Filters</TableToolbarAction>\n * <TableToolbarButton>Create</TableToolbarButton>\n * </TableToolbar>\n * ```\n */\nexport const TableToolbar = React.forwardRef<HTMLDivElement, TableToolbarProps>(\n ({ className, search, children, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"flex h-10 w-full min-w-0 items-center gap-4 rounded-sm border-[0.5px] border-border-strong bg-surface-table-row pr-2 pl-4\",\n className,\n )}\n {...props}\n >\n <div className=\"flex min-w-24 flex-1 items-center\">{search}</div>\n {children != null && (\n <div className=\"flex min-w-0 items-center gap-6 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\">\n {children}\n </div>\n )}\n </div>\n );\n },\n);\nTableToolbar.displayName = \"TableToolbar\";\n\nexport interface TableToolbarSearchProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, \"value\" | \"onChange\" | \"type\"> {\n /** Current query. */\n value: string;\n /** Called with the new query, and with `\"\"` when cleared. */\n onValueChange: (value: string) => void;\n /** Accessible name of the clear button. */\n clearLabel: string;\n}\n\n/**\n * Borderless search field for the left slot of {@link TableToolbar}:\n * 16px search icon, 12px text and a clear button once there is a query.\n */\nexport const TableToolbarSearch = React.forwardRef<HTMLInputElement, TableToolbarSearchProps>(\n ({ className, value, onValueChange, clearLabel, placeholder, ...props }, ref) => {\n return (\n <label className={cn(\"flex h-6 w-full min-w-0 cursor-text items-center gap-2\", className)}>\n <SearchIcon size={16} className=\"shrink-0 text-icons-secondary\" aria-hidden />\n <input\n ref={ref}\n type=\"search\"\n value={value}\n onChange={(event) => onValueChange(event.target.value)}\n placeholder={placeholder}\n aria-label={props[\"aria-label\"] ?? placeholder}\n className=\"typography-description-12px-regular min-w-0 flex-1 border-none bg-transparent p-0 text-content-primary outline-none placeholder:text-content-secondary [&::-webkit-search-cancel-button]:hidden\"\n {...props}\n />\n {value !== \"\" && (\n <button\n type=\"button\"\n aria-label={clearLabel}\n onClick={() => onValueChange(\"\")}\n className=\"inline-flex size-4 shrink-0 cursor-pointer items-center justify-center border-none bg-transparent p-0 text-icons-secondary hover:text-icons-primary\"\n >\n <CloseIcon size={16} />\n </button>\n )}\n </label>\n );\n },\n);\nTableToolbarSearch.displayName = \"TableToolbarSearch\";\n\nexport interface TableToolbarActionProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** 16px icon after the label. @default up/down arrows, for a menu trigger showing its current value */\n icon?: React.ReactNode;\n /** Tints the icon with the brand colour while a toggle or filter is on. @default false */\n active?: boolean;\n}\n\n/**\n * Labelled control for {@link TableToolbar}: 12px label followed by a 16px\n * icon. Below the `md` breakpoint only the icon shows, and the label stays as\n * the accessible name, so a full bar still fits a phone. Works as a plain\n * button or as a `DropdownMenuTrigger` child.\n */\nexport const TableToolbarAction = React.forwardRef<HTMLButtonElement, TableToolbarActionProps>(\n ({ className, children, icon, active = false, type = \"button\", ...props }, ref) => {\n return (\n <button\n ref={ref}\n type={type}\n className={cn(\n \"typography-description-12px-regular inline-flex h-6 shrink-0 cursor-pointer items-center gap-2 whitespace-nowrap rounded-xs border-none bg-transparent p-0 text-content-secondary outline-none\",\n \"hover:text-content-primary focus-visible:shadow-focus-ring disabled:cursor-default disabled:opacity-40\",\n className,\n )}\n {...props}\n >\n <span className=\"max-md:sr-only\">{children}</span>\n <span\n aria-hidden\n className={cn(\n \"inline-flex size-4 shrink-0 items-center justify-center [&>svg]:size-4\",\n active ? \"text-brand-primary-default\" : \"text-icons-secondary\",\n )}\n >\n {icon ?? <TranscationArrowIcon size={16} />}\n </span>\n </button>\n );\n },\n);\nTableToolbarAction.displayName = \"TableToolbarAction\";\n\nexport interface TableToolbarButtonProps extends Omit<ButtonProps, \"size\"> {}\n\n/**\n * Call to action for {@link TableToolbar} (e.g. \"Create New\"): a 24px\n * {@link Button} squared to the toolbar's 8px radius with 12px semibold type,\n * so it sits 8px from the bar's edges. Elsewhere use {@link Button}.\n */\nexport const TableToolbarButton = React.forwardRef<HTMLButtonElement, TableToolbarButtonProps>(\n ({ className, ...props }, ref) => {\n return (\n <Button\n ref={ref}\n size=\"24\"\n className={cn(\"typography-description-12px-semibold rounded-xs\", className)}\n {...props}\n />\n );\n },\n);\nTableToolbarButton.displayName = \"TableToolbarButton\";\n\nexport interface TableRowButtonProps extends Omit<ButtonProps, \"size\"> {}\n\n/**\n * Action inside a table row (e.g. \"Copy\", \"View\"): a 24px squared secondary\n * {@link Button} with 12px semibold type, so it fits a 40px row. Pass 16px\n * filled icons; they take the secondary icon colour.\n */\nexport const TableRowButton = React.forwardRef<HTMLButtonElement, TableRowButtonProps>(\n ({ className, variant = \"secondary\", ...props }, ref) => {\n return (\n <Button\n ref={ref}\n size=\"24\"\n variant={variant}\n className={cn(\n \"typography-description-12px-semibold rounded-xs [&_svg]:size-4! [&_svg]:text-icons-secondary\",\n className,\n )}\n {...props}\n />\n );\n },\n);\nTableRowButton.displayName = \"TableRowButton\";\n\nexport interface TableTruncatedTextProps\n extends Omit<React.HTMLAttributes<HTMLSpanElement>, \"children\"> {\n /** Full text; shown whole in a tooltip whenever it does not fit. */\n children: string;\n /** Widest the text may grow, in characters, before it ends in an ellipsis. @default 25 */\n maxChars?: number;\n}\n\n/**\n * One-line text for a {@link TableCell} that ends in an ellipsis once it no\n * longer fits, either past `maxChars` or in a narrower column. The tooltip and\n * the tab stop appear only when the text is actually cut, measured on mount and\n * on every resize, so short text stays plain and out of the tab order. It\n * mounts its own {@link TooltipProvider} so it works in apps without one.\n */\nexport const TableTruncatedText = React.forwardRef<HTMLSpanElement, TableTruncatedTextProps>(\n ({ className, children, maxChars = 25, style, ...props }, ref) => {\n const innerRef = React.useRef<HTMLSpanElement>(null);\n const [isTruncated, setIsTruncated] = React.useState(false);\n React.useImperativeHandle(ref, () => innerRef.current as HTMLSpanElement);\n\n const measure = React.useCallback(() => {\n const element = innerRef.current;\n if (element) {\n setIsTruncated(element.scrollWidth > element.clientWidth);\n }\n }, []);\n\n React.useLayoutEffect(measure);\n\n React.useLayoutEffect(() => {\n const element = innerRef.current;\n if (!element || typeof ResizeObserver === \"undefined\") {\n return;\n }\n const observer = new ResizeObserver(measure);\n observer.observe(element);\n return () => observer.disconnect();\n }, [measure]);\n\n const text = (\n <span\n ref={innerRef}\n className={cn(\"block truncate\", className)}\n style={{ maxWidth: `${maxChars}ch`, ...style }}\n tabIndex={isTruncated ? 0 : undefined}\n {...props}\n >\n {children}\n </span>\n );\n if (!isTruncated) {\n return text;\n }\n return (\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild>{text}</TooltipTrigger>\n <TooltipContent className=\"max-w-xs whitespace-pre-line\">{children}</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n },\n);\nTableTruncatedText.displayName = \"TableTruncatedText\";\n\nexport interface TableScrollAreaProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * No longer needed in v2 — {@link TableCard} handles corner rounding via\n * its own `overflow-hidden rounded-3xl`. Accepted for back-compat.\n *\n * @deprecated v2 ignores this prop; safe to remove.\n */\n roundTop?: boolean;\n /**\n * Shows a slim horizontal scrollbar beneath the table when the content\n * overflows (Figma `V2 Scroll Bar`). @default false\n */\n showScrollbar?: boolean;\n}\n\n/**\n * Horizontal scroll container for wide tables. The inner scrollport keeps\n * `border-collapse` styles intact when the table wraps.\n */\nexport const TableScrollArea = React.forwardRef<HTMLDivElement, TableScrollAreaProps>(\n ({ className, children, roundTop: _roundTop, showScrollbar = false, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\"relative w-full min-w-0 overflow-hidden\", className)}\n {...props}\n >\n <div\n className={cn(\n \"overflow-x-auto\",\n showScrollbar &&\n \"pb-3 [scrollbar-color:var(--color-border-strong)_transparent] [scrollbar-width:thin]\",\n )}\n >\n {children}\n </div>\n </div>\n );\n },\n);\nTableScrollArea.displayName = \"TableScrollArea\";\n\nexport interface TableProps extends React.TableHTMLAttributes<HTMLTableElement> {}\n\n/**\n * Semantic `<table>` element. Place inside {@link TableScrollArea}.\n */\nexport const Table = React.forwardRef<HTMLTableElement, TableProps>(\n ({ className, ...props }, ref) => {\n return (\n <table\n ref={ref}\n className={cn(\n \"w-full caption-bottom border-separate border-spacing-0 text-left\",\n className,\n )}\n {...props}\n />\n );\n },\n);\nTable.displayName = \"Table\";\n\nexport interface TableHeaderProps extends React.HTMLAttributes<HTMLTableSectionElement> {}\n\nexport const TableHeader = React.forwardRef<HTMLTableSectionElement, TableHeaderProps>(\n ({ className, ...props }, ref) => {\n return <thead ref={ref} className={cn(className)} {...props} />;\n },\n);\nTableHeader.displayName = \"TableHeader\";\n\nexport interface TableBodyProps extends React.HTMLAttributes<HTMLTableSectionElement> {}\n\n/**\n * `<tbody>` wrapper. Removes the bottom border on cells in the final row to\n * match the Figma `V2 Table Final Row` treatment.\n */\nexport const TableBody = React.forwardRef<HTMLTableSectionElement, TableBodyProps>(\n ({ className, ...props }, ref) => {\n return (\n <tbody ref={ref} className={cn(\"[&_tr:last-child_td]:border-b-0\", className)} {...props} />\n );\n },\n);\nTableBody.displayName = \"TableBody\";\n\nexport interface TableFooterProps extends React.HTMLAttributes<HTMLTableSectionElement> {}\n\nexport const TableFooter = React.forwardRef<HTMLTableSectionElement, TableFooterProps>(\n ({ className, ...props }, ref) => {\n return <tfoot ref={ref} className={cn(className)} {...props} />;\n },\n);\nTableFooter.displayName = \"TableFooter\";\n\nexport interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement> {}\n\n/**\n * Table row. A body row holding a {@link TableMediaThumbnail} or\n * {@link TableMediaTile} grows from 40px to 56px to keep 8px around it.\n */\nexport const TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(\n ({ className, ...props }, ref) => {\n return (\n <tr ref={ref} className={cn(\"[&:has([data-table-media])>td]:h-14\", className)} {...props} />\n );\n },\n);\nTableRow.displayName = \"TableRow\";\n\n/** Column layout preset for {@link TableHead}. */\nexport type TableHeadIntent = \"default\" | \"checkbox\" | \"sort\" | \"leading\";\n\nconst HEAD_INTENT_CLASSES: Record<TableHeadIntent, string> = {\n default: \"text-left\",\n checkbox: \"w-px pr-0 text-left\",\n sort: \"text-right\",\n leading: \"min-w-0 w-2/5 text-left\",\n};\n\nconst CELL_GUTTERS = \"px-5 first:pl-4 last:pr-4\";\n\nexport interface TableHeadProps extends React.ThHTMLAttributes<HTMLTableCellElement> {\n /** Layout preset for common column types. @default \"default\" */\n intent?: TableHeadIntent;\n}\n\n/**\n * Header cell: 32px tall on `surface-table-row`, 12px secondary text and a\n * 0.5px bottom rule. Columns sit at least 40px apart, with 16px against the\n * card edges.\n */\nexport const TableHead = React.forwardRef<HTMLTableCellElement, TableHeadProps>(\n ({ className, intent = \"default\", scope = \"col\", ...props }, ref) => {\n return (\n <th\n ref={ref}\n scope={scope}\n className={cn(\n \"typography-description-12px-regular box-border h-8 whitespace-nowrap border-border-primary border-b-[0.5px] bg-surface-table-row py-0 align-middle font-normal text-content-secondary\",\n CELL_GUTTERS,\n HEAD_INTENT_CLASSES[intent],\n className,\n )}\n {...props}\n />\n );\n },\n);\nTableHead.displayName = \"TableHead\";\n\nconst CELL_MIN_HEIGHT: Record<TableSize, string> = {\n md: \"h-10\",\n default: \"h-10\",\n condensed: \"h-10\",\n lg: \"h-14\",\n};\n\n/** Bottom border and padding preset for body cells (Figma table cell component). */\nexport type TableCellVariant = \"default\" | \"chip\" | \"pillProgress\";\n\nconst CELL_VARIANT_CLASSES: Record<TableCellVariant, string> = {\n default: \"border-b-[0.5px] border-border-primary py-0\",\n chip: \"border-b-[0.5px] border-border-primary py-0\",\n pillProgress: \"border-b-[0.5px] border-border-primary py-1\",\n};\n\n/** Layout / typography preset for {@link TableCell} (orthogonal to {@link TableCellVariant}). */\nexport type TableCellIntent = \"default\" | \"checkbox\" | \"stacked\" | \"multiline\" | \"sideLabel\";\n\nconst CELL_INTENT_CLASSES: Record<TableCellIntent, string> = {\n default: \"\",\n checkbox: \"w-px pr-0 text-left\",\n stacked: \"align-top py-2\",\n multiline: \"max-w-[240px]\",\n sideLabel: \"\",\n};\n\nexport interface TableCellProps extends React.TdHTMLAttributes<HTMLTableCellElement> {\n /** Padding preset for the cell. v2 uses identical padding across variants; values are kept for back-compat. @default \"default\" */\n cellVariant?: TableCellVariant;\n /** Alignment and typography preset for common cell types. @default \"default\" */\n intent?: TableCellIntent;\n /** Keeps the content on one line, for short values (dates, amounts, statuses). @default false */\n nowrap?: boolean;\n}\n\n/**\n * Body cell: 40px rows (56px when the parent {@link TableCard} uses\n * `size=\"lg\"` or the row holds media), 12px type, transparent background and\n * a 0.5px rule that {@link TableBody} drops on the final row. Long text wraps\n * and the row grows; set `nowrap` on short columns to keep them on one line.\n */\nexport const TableCell = React.forwardRef<HTMLTableCellElement, TableCellProps>(\n ({ className, cellVariant = \"default\", intent = \"default\", nowrap = false, ...props }, ref) => {\n const size = useTableSize();\n const typo =\n intent === \"sideLabel\"\n ? \"typography-description-12px-semibold\"\n : \"typography-description-12px-regular\";\n return (\n <td\n ref={ref}\n className={cn(\n typo,\n \"align-middle text-content-primary\",\n nowrap && \"whitespace-nowrap\",\n CELL_GUTTERS,\n CELL_VARIANT_CLASSES[cellVariant],\n CELL_MIN_HEIGHT[size],\n CELL_INTENT_CLASSES[intent],\n className,\n )}\n {...props}\n />\n );\n },\n);\nTableCell.displayName = \"TableCell\";\n\nexport interface TableCellGroupProps extends React.HTMLAttributes<HTMLDivElement> {}\n\n/**\n * Horizontal group for icons, chips, and metadata inside a {@link TableCell}\n * (Figma `gap-[4px]`).\n */\nexport const TableCellGroup = React.forwardRef<HTMLDivElement, TableCellGroupProps>(\n ({ className, ...props }, ref) => {\n return <div ref={ref} className={cn(\"flex items-center gap-1\", className)} {...props} />;\n },\n);\nTableCellGroup.displayName = \"TableCellGroup\";\n\nexport interface TableCellContentProps {\n /** Primary line (semibold body-sm). */\n primary: React.ReactNode;\n /** Optional secondary line (regular body-sm, secondary color). */\n secondary?: React.ReactNode;\n /** Inline node rendered next to the primary line (icon, chip). */\n primaryAdornment?: React.ReactNode;\n /** Inline node rendered next to the secondary line. */\n secondaryAdornment?: React.ReactNode;\n /** Class for the outer wrapper. */\n className?: string;\n}\n\n/**\n * Two-line content slot matching Figma `V2 Table Content` — 12px primary line\n * (semibold) over an optional 12px secondary line (regular, muted), so both\n * fit a 40px row. Use inside {@link TableCell} for the common stacked-text pattern.\n */\nexport function TableCellContent({\n primary,\n secondary,\n primaryAdornment,\n secondaryAdornment,\n className,\n}: TableCellContentProps) {\n return (\n <div className={cn(\"flex flex-col\", className)}>\n <div className=\"flex items-center gap-1\">\n <span className=\"typography-description-12px-semibold text-content-primary\">{primary}</span>\n {primaryAdornment}\n </div>\n {(secondary != null || secondaryAdornment != null) && (\n <div className=\"flex items-center gap-1\">\n {secondary != null && (\n <span className=\"typography-description-12px-regular text-content-secondary\">\n {secondary}\n </span>\n )}\n {secondaryAdornment}\n </div>\n )}\n </div>\n );\n}\nTableCellContent.displayName = \"TableCellContent\";\n\n/** Pixel size of the square {@link TableMediaThumbnail}. */\nexport type TableMediaThumbnailSize = \"48\" | \"40\" | \"32\";\n\nexport interface TableMediaThumbnailProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"children\"> {\n /** Image URL. */\n src: string;\n /** Alt text for the image. @default \"\" */\n alt?: string;\n /** Applies the table's blurred-media treatment. @default false */\n blurred?: boolean;\n /** `center` uses the fixed media column width from the lg spec. @default \"start\" */\n align?: \"start\" | \"center\";\n /** Pixel size of the square thumbnail. At 40 or 48 its row grows to 56px; 32 fits a 40px row. @default \"40\" */\n size?: TableMediaThumbnailSize;\n}\n\n/**\n * Square photo that fills its frame, used inside {@link TableCell} for media\n * columns. At the 40px and 48px sizes its row grows to 56px; the 32px size\n * fits a regular 40px row.\n */\nexport const TableMediaThumbnail = React.forwardRef<HTMLDivElement, TableMediaThumbnailProps>(\n ({ className, src, alt = \"\", blurred, align = \"start\", size = \"40\", ...props }, ref) => {\n const frame = cn(\n \"overflow-hidden bg-neutral-alphas-200\",\n size === \"48\" && \"size-12 rounded-sm\",\n size === \"40\" && \"size-10 rounded-xs\",\n size === \"32\" && \"size-8 rounded-xs\",\n );\n return (\n <div\n ref={ref}\n data-table-media={size === \"32\" ? undefined : \"\"}\n className={cn(\n align === \"center\" && \"flex w-16 shrink-0 justify-center\",\n align === \"start\" && \"inline-flex shrink-0\",\n )}\n >\n <div className={cn(frame, blurred && \"blur-[2px]\", className)} {...props}>\n <img alt={alt} className=\"size-full object-cover\" src={src} />\n </div>\n </div>\n );\n },\n);\nTableMediaThumbnail.displayName = \"TableMediaThumbnail\";\n\nexport interface TableMediaTileProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** Logo or icon centred on the tile, or edge-to-edge media when `fill` is set. */\n children: React.ReactNode;\n /** Lets the child fill the tile edge to edge (e.g. a video preview) with no border or fill. @default false */\n fill?: boolean;\n}\n\n/**\n * 40px tile for a {@link TableCell}: a logo or icon (e.g. a social platform)\n * centred on `surface-table-row` with a 0.5px border, or, with `fill`, custom\n * media that fills it. Its row grows to 56px. For a plain image URL use\n * {@link TableMediaThumbnail}.\n */\nexport const TableMediaTile = React.forwardRef<HTMLSpanElement, TableMediaTileProps>(\n ({ className, fill = false, ...props }, ref) => {\n return (\n <span\n ref={ref}\n data-table-media=\"\"\n className={cn(\n \"inline-flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-xs\",\n fill\n ? \"[&>*]:size-full\"\n : \"border-[0.5px] border-border-primary bg-surface-table-row text-icons-secondary\",\n className,\n )}\n {...props}\n />\n );\n },\n);\nTableMediaTile.displayName = \"TableMediaTile\";\n\nexport interface TableStatusDotProps extends React.HTMLAttributes<HTMLDivElement> {}\n\n/**\n * Small status indicator dot for table cells (Figma status column).\n */\nexport const TableStatusDot = React.forwardRef<HTMLDivElement, TableStatusDotProps>(\n ({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\"size-2 shrink-0 rounded-full bg-info-content\", className)}\n {...props}\n />\n );\n },\n);\nTableStatusDot.displayName = \"TableStatusDot\";\n\nexport interface TableProgressTrackProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Fill width from 0–100. @default 0 */\n value?: number;\n}\n\n/**\n * Thin progress track used with badges in table cells (Figma pill + progress).\n * Renders with `role=\"progressbar\"` and a default `aria-label` of `\"Progress\"`.\n */\nexport const TableProgressTrack = React.forwardRef<HTMLDivElement, TableProgressTrackProps>(\n ({ className, value = 0, \"aria-label\": ariaLabel = \"Progress\", ...props }, ref) => {\n const width = Math.min(100, Math.max(0, value));\n const rounded = Math.round(width);\n return (\n <div\n ref={ref}\n role=\"progressbar\"\n aria-valuenow={rounded}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-label={ariaLabel}\n className={cn(\n \"relative h-1 w-full overflow-hidden rounded-full bg-neutral-alphas-200\",\n className,\n )}\n {...props}\n >\n <div\n className=\"absolute top-0 left-0 h-1 rounded-full bg-buttons-primary-default\"\n style={{ width: `${width}%` }}\n aria-hidden\n />\n </div>\n );\n },\n);\nTableProgressTrack.displayName = \"TableProgressTrack\";\n\nexport interface TablePillProgressLayoutProps extends React.HTMLAttributes<HTMLDivElement> {}\n\n/**\n * Vertical layout for pill label + {@link TableProgressTrack} in a cell.\n */\nexport const TablePillProgressLayout = React.forwardRef<\n HTMLDivElement,\n TablePillProgressLayoutProps\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\"flex min-w-[120px] flex-col items-start gap-2\", className)}\n {...props}\n />\n );\n});\nTablePillProgressLayout.displayName = \"TablePillProgressLayout\";\n\n/** Current sort direction of a {@link TableSortLabel}. `null` means unsorted. */\nexport type TableSortDirection = \"asc\" | \"desc\" | null;\n\nexport interface TableSortLabelProps extends React.HTMLAttributes<HTMLSpanElement> {\n children: React.ReactNode;\n /**\n * Visual indicator of the column's sort state. When set to `\"asc\"` or\n * `\"desc\"`, the label turns primary and the Arrow Sort Up / Down chevrons\n * appear next to it, the active direction highlighted. @default null\n */\n direction?: TableSortDirection;\n}\n\nfunction SortArrows({ direction }: { direction: \"asc\" | \"desc\" }) {\n return (\n <svg\n width={16}\n height={16}\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n aria-hidden=\"true\"\n className=\"shrink-0\"\n >\n <path\n d=\"M5 6L8 3L11 6\"\n strokeWidth={1.2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={direction === \"asc\" ? \"stroke-current\" : \"stroke-icons-tertiary\"}\n />\n <path\n d=\"M11 10L8 13L5 10\"\n strokeWidth={1.2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={direction === \"desc\" ? \"stroke-current\" : \"stroke-icons-tertiary\"}\n />\n </svg>\n );\n}\n\n/**\n * Sortable column label. A sorted column reads primary with the Arrow Sort\n * Up / Down chevrons; an unsorted one keeps the header colour.\n */\nexport const TableSortLabel = React.forwardRef<HTMLSpanElement, TableSortLabelProps>(\n ({ className, children, direction = null, ...props }, ref) => {\n return (\n <span\n ref={ref}\n className={cn(\n \"inline-flex items-center gap-1\",\n direction != null && \"text-content-primary\",\n className,\n )}\n {...props}\n >\n {children}\n {direction != null && <SortArrows direction={direction} />}\n </span>\n );\n },\n);\nTableSortLabel.displayName = \"TableSortLabel\";\n\nexport interface TableStackedTextProps {\n /** Primary line (semibold body). */\n title: React.ReactNode;\n /** Secondary line (caption, muted). */\n subtitle: React.ReactNode;\n}\n\n/**\n * Two-line primary + secondary text block for \"cell + info\" patterns.\n *\n * @deprecated Prefer {@link TableCellContent} which supports adornments and\n * matches the Figma `V2 Table Content` slot.\n */\nexport function TableStackedText({ title, subtitle }: TableStackedTextProps) {\n return <TableCellContent primary={title} secondary={subtitle} />;\n}\n\nTableStackedText.displayName = \"TableStackedText\";\n\nexport interface TableLineClampProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Number of lines before ellipsis. @default 2 */\n lines?: 1 | 2 | 3;\n}\n\n/**\n * Clamps child text to a fixed number of lines inside a {@link TableCell}.\n */\nexport const TableLineClamp = React.forwardRef<HTMLDivElement, TableLineClampProps>(\n ({ className, lines = 2, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n lines === 1 && \"line-clamp-1\",\n lines === 2 && \"line-clamp-2\",\n lines === 3 && \"line-clamp-3\",\n className,\n )}\n {...props}\n />\n );\n },\n);\nTableLineClamp.displayName = \"TableLineClamp\";\n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,UAAA;AAAA,QAAA;AAAA,MACvD;AAAA,IAAA;AAAA,EAAA;AAGN;AAMO,MAAM,iBAAiB,MAAM;AAAA,EAClC,CAAC,EAAE,WAAW,UAAU,YAAY,MAAM,GAAG,MAAA,GAAS,QAAQ;AAC5D,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA,aAAa,QAAQ;AAAA,UACrB;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA;AAAA,UACA,aAAa,QAAQ,oBAAC,YAAA,EAAW,UAAA,CAAsB;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAG9D;AACF;AACA,eAAe,cAAc;AAetB,SAAS,iBAAiB,EAAE,OAAO,YAAmC;AAC3E,SAAO,oBAAC,kBAAA,EAAiB,SAAS,OAAO,WAAW,UAAU;AAChE;AAEA,iBAAiB,cAAc;AAUxB,MAAM,iBAAiB,MAAM;AAAA,EAClC,CAAC,EAAE,WAAW,QAAQ,GAAG,GAAG,MAAA,GAAS,QAAQ;AAC3C,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT,UAAU,KAAK;AAAA,UACf,UAAU,KAAK;AAAA,UACf,UAAU,KAAK;AAAA,UACf;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AACA,eAAe,cAAc;"}
@@ -242,7 +242,7 @@ const TabsList = React.forwardRef(
242
242
  // context. Without it, `relative` alone creates no stacking context, so
243
243
  // the indicator escapes and paints above page chrome (e.g. the header).
244
244
  "relative isolate",
245
- isPill ? "inline-flex w-fit max-w-full items-center gap-1 overflow-x-auto rounded-full bg-background-secondary p-1 shadow-md [scrollbar-width:none] [&::-webkit-scrollbar]:hidden" : [
245
+ isPill ? "bg-(image:--fv-raised-control-fill) inline-flex w-fit max-w-full items-center gap-1 overflow-x-auto rounded-full bg-background-secondary p-1 shadow-(--fv-raised-control-shadow) [scrollbar-width:none] [&::-webkit-scrollbar]:hidden" : [
246
246
  getLayoutClass(variant, fullWidth, alignLeft),
247
247
  // Horizontal only: in the vertical orientation the leading padding is
248
248
  // the row's left inset, not a label offset, so zeroing it would pull
@@ -268,7 +268,7 @@ const TabsList = React.forwardRef(
268
268
  "aria-hidden": true,
269
269
  className: cn(
270
270
  "pointer-events-none absolute rounded-full motion-safe:transition-[transform,width,height]",
271
- isPill ? "z-5 motion-safe:duration-(--pill-slide) motion-safe:ease-(--pill-ease)" : "z-10 motion-safe:duration-200 motion-safe:ease-in-out"
271
+ isPill ? "z-5 shadow-(--fv-raised-control-thumb-shadow) motion-safe:duration-(--pill-slide) motion-safe:ease-(--pill-ease)" : "z-10 motion-safe:duration-200 motion-safe:ease-in-out"
272
272
  ),
273
273
  style: { opacity: 0 }
274
274
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TabsList.mjs","sources":["../../../src/components/Tabs/TabsList.tsx"],"sourcesContent":["import * as TabsPrimitive from \"@radix-ui/react-tabs\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/** Breakpoint values for responsive props. */\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\";\n\n/** Visual style of a {@link TabsList}. */\nexport type TabsListAppearance = \"underline\" | \"pill\";\n\n/** Height in pixels of each tab in a pill {@link TabsList}. */\nexport type TabsListPillSize = \"32\" | \"36\";\n\nexport const TabsAppearanceContext = React.createContext<{\n appearance: TabsListAppearance;\n size: TabsListPillSize;\n}>({ appearance: \"underline\", size: \"32\" });\n\ntype TabBox = { left: number; top: number; width: number; height: number };\n\nconst PILL_EASE = \"cubic-bezier(0.22, 1, 0.36, 1)\";\nconst PILL_STEP_MS = 360;\nconst PILL_STEP_MS_TOUCH = 200;\nconst PILL_EXTRA_STEP_MS = 220;\nconst PILL_MAX_MS = 1000;\n/** Share of a slide by which the eased pill has covered 80% of the way, so the label recolours under it. */\nconst PILL_ARRIVAL_SHARE = 0.27;\n\nfunction pillStepMs(canHover: boolean) {\n return canHover ? PILL_STEP_MS : PILL_STEP_MS_TOUCH;\n}\n\nfunction pillSlideMs(distance: number, canHover: boolean) {\n if (!canHover) return PILL_STEP_MS_TOUCH;\n return Math.min(PILL_STEP_MS + Math.max(distance - 1, 0) * PILL_EXTRA_STEP_MS, PILL_MAX_MS);\n}\n\nconst prefersReducedMotion = () =>\n window.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches ?? false;\n\nfunction pillTarget(list: HTMLElement, hovered: HTMLElement | null, activeTab: HTMLElement) {\n return (\n list.querySelector<HTMLElement>('[role=\"tab\"][aria-expanded=\"true\"]') ??\n (hovered?.isConnected ? hovered : activeTab)\n );\n}\n\nfunction measureTabs(list: HTMLElement, observer: ResizeObserver | null) {\n const boxes = new Map<Element, TabBox>();\n const order = new Map<Element, number>();\n for (const tab of list.querySelectorAll<HTMLElement>('[role=\"tab\"]')) {\n observer?.observe(tab);\n order.set(tab, order.size);\n boxes.set(tab, {\n left: tab.offsetLeft,\n top: tab.offsetTop,\n width: tab.offsetWidth,\n height: tab.offsetHeight,\n });\n }\n return { boxes, order };\n}\n\nfunction slideFromPrevious(\n list: HTMLElement,\n previous: Map<Element, TabBox>,\n next: Map<Element, TabBox>,\n durationMs: number,\n) {\n const moved: HTMLElement[] = [];\n for (const [tab, box] of next) {\n const before = previous.get(tab);\n if (!before || before.left === box.left || !(tab instanceof HTMLElement)) continue;\n tab.style.transition = \"none\";\n tab.style.transform = `translateX(${before.left - box.left}px)`;\n moved.push(tab);\n }\n if (moved.length === 0) return;\n list.getBoundingClientRect();\n for (const tab of moved) {\n tab.style.transition = `transform ${durationMs}ms var(--pill-ease)`;\n tab.style.transform = \"\";\n const settle = (event: TransitionEvent) => {\n if (event.propertyName !== \"transform\") return;\n tab.style.transition = \"\";\n tab.removeEventListener(\"transitionend\", settle);\n };\n tab.addEventListener(\"transitionend\", settle);\n }\n}\n\nconst alignLeftClasses: Record<Breakpoint | \"always\", string> = {\n always: \"[&>[role=tab]]:flex-initial\",\n sm: \"[&>[role=tab]]:sm:flex-initial\",\n md: \"[&>[role=tab]]:md:flex-initial\",\n lg: \"[&>[role=tab]]:lg:flex-initial\",\n xl: \"[&>[role=tab]]:xl:flex-initial\",\n};\n\nfunction getLayoutClass(\n variant: \"fill\" | \"hug\" | undefined,\n fullWidth: boolean,\n alignLeft?: boolean | Breakpoint,\n): string {\n if (variant === \"hug\") return \"inline-flex\";\n if (variant === \"fill\") return \"flex w-full [&>[role=tab]]:flex-1\";\n\n if (!fullWidth) return \"inline-flex\";\n\n const base = \"flex w-full [&>[role=tab]]:flex-1\";\n if (alignLeft === true) return `${base} ${alignLeftClasses.always}`;\n if (typeof alignLeft === \"string\") return `${base} ${alignLeftClasses[alignLeft]}`;\n return base;\n}\n\n/** Props for the {@link TabsList} component. */\nexport type TabsListProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.List> & {\n /** When `true` (the default), the tab list spans the full width of its container and each tab grows equally. Set to `false` for inline sizing. */\n fullWidth?: boolean;\n /**\n * Controls tab alignment within a full-width container.\n * - `false` (default): tabs spread evenly\n * - `true`: tabs left-aligned, sized to content\n * - `\"md\"` (breakpoint): spread on mobile, left-aligned at breakpoint and up\n */\n alignLeft?: boolean | Breakpoint;\n /** Explicit layout variant. `\"hug\"` sizes the list to its content; `\"fill\"` stretches it full-width with equal-width tabs. Takes precedence over `fullWidth`/`alignLeft`. */\n variant?: \"fill\" | \"hug\";\n /**\n * Drops the leading padding on the first tab so its label sits flush with the\n * list's left edge, lining it up with page content above or below the bar\n * (a heading, for instance) rather than being indented by the tab's own\n * padding. Spacing between tabs is unaffected. Pair with `alignLeft` or\n * `variant=\"hug\"`. @default false\n */\n flushLeft?: boolean;\n /**\n * Scrolls the row horizontally when the tabs don't fit, instead of letting\n * them compress. By default a tab may shrink until its label ellipsises,\n * which on a narrow viewport can truncate every label at once; here each tab\n * keeps its natural width and the overflow scrolls. The scrollbar itself is\n * hidden — the clipped tab at the edge is the affordance.\n *\n * Because the tabs are content-sized, they no longer spread to fill the row:\n * a set that does fit sits left-aligned, as with `alignLeft`.\n *\n * Horizontal orientation only: a vertical list already grows downwards.\n * @default false\n */\n scrollable?: boolean;\n /**\n * `\"underline\"` marks the active tab with a line under the row. `\"pill\"` sits\n * the tabs in a rounded track, sized to its tabs, and slides a filled pill\n * behind the active one. A pill list is horizontal and ignores `fullWidth`,\n * `alignLeft`, `variant` and `flushLeft`; it scrolls when it doesn't fit.\n * @default \"underline\"\n */\n appearance?: TabsListAppearance;\n /** Height of each tab in a pill list. Ignored by the underline appearance. @default \"32\" */\n size?: TabsListPillSize;\n /**\n * Pill only: the pill follows the mouse across the tabs and settles back on the\n * selected one when the pointer leaves. Mouse only, and off when the user prefers\n * reduced motion. @default false\n */\n followHover?: boolean;\n};\n\n/** Container for {@link TabsTrigger} elements. Renders a sliding active-tab indicator that animates between tabs. */\nexport const TabsList = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.List>,\n TabsListProps\n>(\n (\n {\n className,\n children,\n fullWidth = true,\n alignLeft,\n variant,\n flushLeft = false,\n scrollable = false,\n appearance = \"underline\",\n size = \"32\",\n followHover = false,\n onPointerOver,\n onPointerLeave,\n style,\n ...props\n },\n ref,\n ) => {\n const innerRef = React.useRef<HTMLDivElement>(null);\n const indicatorRef = React.useRef<HTMLSpanElement>(null);\n\n React.useImperativeHandle(ref, () => innerRef.current as HTMLDivElement);\n\n const tabBoxes = React.useRef(new Map<Element, TabBox>());\n const resizeObserverRef = React.useRef<ResizeObserver | null>(null);\n const listWidth = React.useRef<number | null>(null);\n const hoveredTab = React.useRef<HTMLElement | null>(null);\n const pillTab = React.useRef<HTMLElement | null>(null);\n const tabOrder = React.useRef(new Map<Element, number>());\n const canHover = React.useRef(false);\n\n const placePill = React.useCallback((tab: HTMLElement) => {\n const list = innerRef.current;\n const indicator = indicatorRef.current;\n if (!list || !indicator) return;\n const box = tabBoxes.current.get(tab);\n if (!box) return;\n const from = pillTab.current;\n pillTab.current = tab;\n const distance =\n from && from !== tab\n ? Math.abs((tabOrder.current.get(tab) ?? 0) - (tabOrder.current.get(from) ?? 0))\n : 0;\n const slideMs = pillSlideMs(distance, canHover.current);\n list.style.setProperty(\"--pill-slide\", `${slideMs}ms`);\n list.style.setProperty(\"--pill-arrive\", `${Math.round(slideMs * PILL_ARRIVAL_SHARE)}ms`);\n indicator.style.width = `${box.width}px`;\n indicator.style.height = `${box.height}px`;\n indicator.style.transform = `translate(${box.left}px, ${box.top}px)`;\n for (const marked of list.querySelectorAll(\"[data-pill]\")) {\n if (marked !== tab) marked.removeAttribute(\"data-pill\");\n }\n tab.setAttribute(\"data-pill\", \"\");\n }, []);\n\n const layoutPill = React.useCallback(\n (list: HTMLElement, indicator: HTMLElement, activeTab: HTMLElement) => {\n indicator.style.background = \"var(--color-content-primary)\";\n indicator.style.inset = \"0 auto auto 0\";\n const previous = tabBoxes.current;\n const rowResized = listWidth.current !== null && listWidth.current !== list.offsetWidth;\n listWidth.current = list.offsetWidth;\n const { boxes, order } = measureTabs(list, resizeObserverRef.current);\n tabBoxes.current = boxes;\n tabOrder.current = order;\n if (!rowResized && previous.size > 0 && !prefersReducedMotion()) {\n slideFromPrevious(list, previous, boxes, pillStepMs(canHover.current));\n }\n placePill(pillTarget(list, hoveredTab.current, activeTab));\n },\n [placePill],\n );\n\n const updateIndicator = React.useCallback(() => {\n const list = innerRef.current;\n const indicator = indicatorRef.current;\n if (!list || !indicator) return;\n\n const activeTab = list.querySelector<HTMLElement>('[data-state=\"active\"]');\n if (!activeTab) {\n indicator.style.opacity = \"0\";\n list.querySelector(\"[data-pill]\")?.removeAttribute(\"data-pill\");\n return;\n }\n\n const isVertical = list.dataset.orientation === \"vertical\";\n\n indicator.style.opacity = \"1\";\n\n if (appearance === \"pill\") {\n layoutPill(list, indicator, activeTab);\n } else if (isVertical) {\n indicator.style.background =\n \"linear-gradient(180deg, var(--color-buttons-tertiary-default) 0%, var(--color-tab-active) 50%, var(--color-buttons-tertiary-default) 100%)\";\n indicator.style.inset = `0 -1px auto auto`;\n indicator.style.width = \"1px\";\n indicator.style.height = `${activeTab.offsetHeight}px`;\n indicator.style.transform = `translateY(${activeTab.offsetTop}px)`;\n } else {\n indicator.style.background =\n \"linear-gradient(90deg, var(--color-buttons-tertiary-default) 0%, var(--color-tab-active) 50%, var(--color-buttons-tertiary-default) 100%)\";\n indicator.style.inset = \"auto auto 0 0\";\n indicator.style.height = \"1px\";\n indicator.style.width = `${activeTab.offsetWidth}px`;\n indicator.style.transform = `translateX(${activeTab.offsetLeft}px)`;\n }\n }, [appearance, layoutPill]);\n\n const followsHover = appearance === \"pill\" && followHover;\n\n const handlePointerOver = (event: React.PointerEvent<HTMLDivElement>) => {\n onPointerOver?.(event);\n if (!followsHover || event.pointerType !== \"mouse\") return;\n if (prefersReducedMotion()) return;\n const tab = (event.target as Element).closest<HTMLElement>('[role=\"tab\"]');\n if (!tab || tab === hoveredTab.current || !event.currentTarget.contains(tab)) return;\n hoveredTab.current = tab;\n placePill(pillTarget(event.currentTarget, tab, tab));\n };\n\n const handlePointerLeave = (event: React.PointerEvent<HTMLDivElement>) => {\n onPointerLeave?.(event);\n if (!hoveredTab.current) return;\n hoveredTab.current = null;\n const list = innerRef.current;\n const activeTab = list?.querySelector<HTMLElement>('[data-state=\"active\"]');\n if (list && activeTab) placePill(pillTarget(list, null, activeTab));\n };\n\n // Radix scrolls a tab into view when it takes focus, and mount is not focus, so\n // URL-driven state can land on a tab that is off to the right with nothing on\n // screen to say so: no indicator, and tab one showing as though it were active.\n // Assigns `scrollLeft` rather than calling `scrollIntoView`, which would also\n // scroll every ancestor and the page with it. Only ever scrolls further right, so\n // re-running it after the webfont settles corrects a short initial scroll without\n // yanking the row back from wherever the user has since dragged it.\n const revealActiveTab = React.useCallback(() => {\n const list = innerRef.current;\n const scrolls = scrollable || appearance === \"pill\";\n if (!list || !scrolls || list.dataset.orientation === \"vertical\") return;\n const activeTab = list.querySelector<HTMLElement>('[data-state=\"active\"]');\n if (!activeTab) return;\n const overshoot = activeTab.offsetLeft + activeTab.offsetWidth - list.clientWidth;\n if (overshoot > list.scrollLeft) list.scrollLeft = overshoot;\n }, [scrollable, appearance]);\n\n React.useLayoutEffect(() => {\n const list = innerRef.current;\n const indicator = indicatorRef.current;\n if (!list || !indicator) return;\n\n canHover.current = window.matchMedia?.(\"(hover: hover)\").matches ?? false;\n\n const resizeObserver = new ResizeObserver(updateIndicator);\n resizeObserver.observe(list);\n resizeObserverRef.current = resizeObserver;\n\n indicator.style.transitionDuration = \"0s\";\n updateIndicator();\n indicator.getBoundingClientRect();\n indicator.style.transitionDuration = \"\";\n revealActiveTab();\n\n const mutationObserver = new MutationObserver(updateIndicator);\n mutationObserver.observe(list, {\n attributes: true,\n attributeFilter: [\"data-state\", \"aria-expanded\"],\n childList: true,\n subtree: true,\n });\n\n let cancelled = false;\n if (document.fonts?.status !== \"loaded\") {\n document.fonts?.ready.then(() => {\n if (cancelled) return;\n updateIndicator();\n // The tabs are wider once the real font is in, so the mount-time scroll can\n // fall short of the active tab. Recomputed here against the settled layout.\n revealActiveTab();\n });\n }\n\n return () => {\n cancelled = true;\n mutationObserver.disconnect();\n resizeObserver.disconnect();\n resizeObserverRef.current = null;\n };\n }, [updateIndicator, revealActiveTab]);\n\n const isPill = appearance === \"pill\";\n const listStyle: React.CSSProperties & { \"--pill-ease\"?: string } = isPill\n ? { \"--pill-ease\": PILL_EASE, ...style }\n : { ...style };\n\n return (\n <TabsAppearanceContext.Provider value={{ appearance, size }}>\n <TabsPrimitive.List\n ref={innerRef}\n onPointerOver={handlePointerOver}\n onPointerLeave={handlePointerLeave}\n style={listStyle}\n className={cn(\n // `isolate` scopes the active indicator's `z-10` to a local stacking\n // context. Without it, `relative` alone creates no stacking context, so\n // the indicator escapes and paints above page chrome (e.g. the header).\n \"relative isolate\",\n isPill\n ? \"inline-flex w-fit max-w-full items-center gap-1 overflow-x-auto rounded-full bg-background-secondary p-1 shadow-md [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\"\n : [\n getLayoutClass(variant, fullWidth, alignLeft),\n // Horizontal only: in the vertical orientation the leading padding is\n // the row's left inset, not a label offset, so zeroing it would pull\n // the first label out of line with the others.\n flushLeft && \"data-[orientation=horizontal]:[&>[role=tab]:first-child]:pl-0\",\n // `flex-none` is what stops the tabs compressing — without it they\n // share the row and never overflow, so there is nothing to scroll.\n // The scrollbar is hidden in both engines: Firefox reads\n // `scrollbar-width`, WebKit and Blink the pseudo-element.\n scrollable &&\n \"data-[orientation=horizontal]:overflow-x-auto data-[orientation=horizontal]:[scrollbar-width:none] data-[orientation=horizontal]:[&::-webkit-scrollbar]:hidden data-[orientation=horizontal]:[&>[role=tab]]:flex-none\",\n \"data-[orientation=horizontal]:items-center data-[orientation=horizontal]:shadow-[inset_0_-1px_0_0_var(--color-border-primary)]\",\n \"data-[orientation=vertical]:flex-col data-[orientation=vertical]:shadow-[inset_-1px_0_0_0_var(--color-border-primary)]\",\n ],\n className,\n )}\n {...props}\n >\n {children}\n <span\n ref={indicatorRef}\n aria-hidden\n className={cn(\n \"pointer-events-none absolute rounded-full motion-safe:transition-[transform,width,height]\",\n isPill\n ? \"z-5 motion-safe:duration-(--pill-slide) motion-safe:ease-(--pill-ease)\"\n : \"z-10 motion-safe:duration-200 motion-safe:ease-in-out\",\n )}\n style={{ opacity: 0 }}\n />\n </TabsPrimitive.List>\n </TabsAppearanceContext.Provider>\n );\n },\n);\n\nTabsList.displayName = \"TabsList\";\n"],"names":[],"mappings":";;;;;AAaO,MAAM,wBAAwB,MAAM,cAGxC,EAAE,YAAY,aAAa,MAAM,MAAM;AAI1C,MAAM,YAAY;AAClB,MAAM,eAAe;AACrB,MAAM,qBAAqB;AAC3B,MAAM,qBAAqB;AAC3B,MAAM,cAAc;AAEpB,MAAM,qBAAqB;AAE3B,SAAS,WAAW,UAAmB;AACrC,SAAO,WAAW,eAAe;AACnC;AAEA,SAAS,YAAY,UAAkB,UAAm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AO,MAAM,KAAK,MAAM;AAC/B,cAAI,UAAW;AACf,0BAAA;AAGA,0BAAA;AAAA,QACF,CAAC;AAAA,MACH;AAEA,aAAO,MAAM;AACX,oBAAY;AACZ,yBAAiB,WAAA;AACjB,uBAAe,WAAA;AACf,0BAAkB,UAAU;AAAA,MAC9B;AAAA,IACF,GAAG,CAAC,iBAAiB,eAAe,CAAC;AAErC,UAAM,SAAS,eAAe;AAC9B,UAAM,YAA8D,SAChE,EAAE,eAAe,WAAW,GAAG,MAAA,IAC/B,EAAE,GAAG,MAAA;AAET,WACE,oBAAC,sBAAsB,UAAtB,EAA+B,OAAO,EAAE,YAAY,QACnD,UAAA;AAAA,MAAC,cAAc;AAAA,MAAd;AAAA,QACC,KAAK;AAAA,QACL,eAAe;AAAA,QACf,gBAAgB;AAAA,QAChB,OAAO;AAAA,QACP,WAAW;AAAA;AAAA;AAAA;AAAA,UAIT;AAAA,UACA,SACI,4KACA;AAAA,YACE,eAAe,SAAS,WAAW,SAAS;AAAA;AAAA;AAAA;AAAA,YAI5C,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA,YAKb,cACE;AAAA,YACF;AAAA,YACA;AAAA,UAAA;AAAA,UAEN;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA;AAAA,UACD;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,KAAK;AAAA,cACL,eAAW;AAAA,cACX,WAAW;AAAA,gBACT;AAAA,gBACA,SACI,2EACA;AAAA,cAAA;AAAA,cAEN,OAAO,EAAE,SAAS,EAAA;AAAA,YAAE;AAAA,UAAA;AAAA,QACtB;AAAA,MAAA;AAAA,IAAA,GAEJ;AAAA,EAEJ;AACF;AAEA,SAAS,cAAc;"}
1
+ {"version":3,"file":"TabsList.mjs","sources":["../../../src/components/Tabs/TabsList.tsx"],"sourcesContent":["import * as TabsPrimitive from \"@radix-ui/react-tabs\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/** Breakpoint values for responsive props. */\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\";\n\n/** Visual style of a {@link TabsList}. */\nexport type TabsListAppearance = \"underline\" | \"pill\";\n\n/** Height in pixels of each tab in a pill {@link TabsList}. */\nexport type TabsListPillSize = \"32\" | \"36\";\n\nexport const TabsAppearanceContext = React.createContext<{\n appearance: TabsListAppearance;\n size: TabsListPillSize;\n}>({ appearance: \"underline\", size: \"32\" });\n\ntype TabBox = { left: number; top: number; width: number; height: number };\n\nconst PILL_EASE = \"cubic-bezier(0.22, 1, 0.36, 1)\";\nconst PILL_STEP_MS = 360;\nconst PILL_STEP_MS_TOUCH = 200;\nconst PILL_EXTRA_STEP_MS = 220;\nconst PILL_MAX_MS = 1000;\n/** Share of a slide by which the eased pill has covered 80% of the way, so the label recolours under it. */\nconst PILL_ARRIVAL_SHARE = 0.27;\n\nfunction pillStepMs(canHover: boolean) {\n return canHover ? PILL_STEP_MS : PILL_STEP_MS_TOUCH;\n}\n\nfunction pillSlideMs(distance: number, canHover: boolean) {\n if (!canHover) return PILL_STEP_MS_TOUCH;\n return Math.min(PILL_STEP_MS + Math.max(distance - 1, 0) * PILL_EXTRA_STEP_MS, PILL_MAX_MS);\n}\n\nconst prefersReducedMotion = () =>\n window.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches ?? false;\n\nfunction pillTarget(list: HTMLElement, hovered: HTMLElement | null, activeTab: HTMLElement) {\n return (\n list.querySelector<HTMLElement>('[role=\"tab\"][aria-expanded=\"true\"]') ??\n (hovered?.isConnected ? hovered : activeTab)\n );\n}\n\nfunction measureTabs(list: HTMLElement, observer: ResizeObserver | null) {\n const boxes = new Map<Element, TabBox>();\n const order = new Map<Element, number>();\n for (const tab of list.querySelectorAll<HTMLElement>('[role=\"tab\"]')) {\n observer?.observe(tab);\n order.set(tab, order.size);\n boxes.set(tab, {\n left: tab.offsetLeft,\n top: tab.offsetTop,\n width: tab.offsetWidth,\n height: tab.offsetHeight,\n });\n }\n return { boxes, order };\n}\n\nfunction slideFromPrevious(\n list: HTMLElement,\n previous: Map<Element, TabBox>,\n next: Map<Element, TabBox>,\n durationMs: number,\n) {\n const moved: HTMLElement[] = [];\n for (const [tab, box] of next) {\n const before = previous.get(tab);\n if (!before || before.left === box.left || !(tab instanceof HTMLElement)) continue;\n tab.style.transition = \"none\";\n tab.style.transform = `translateX(${before.left - box.left}px)`;\n moved.push(tab);\n }\n if (moved.length === 0) return;\n list.getBoundingClientRect();\n for (const tab of moved) {\n tab.style.transition = `transform ${durationMs}ms var(--pill-ease)`;\n tab.style.transform = \"\";\n const settle = (event: TransitionEvent) => {\n if (event.propertyName !== \"transform\") return;\n tab.style.transition = \"\";\n tab.removeEventListener(\"transitionend\", settle);\n };\n tab.addEventListener(\"transitionend\", settle);\n }\n}\n\nconst alignLeftClasses: Record<Breakpoint | \"always\", string> = {\n always: \"[&>[role=tab]]:flex-initial\",\n sm: \"[&>[role=tab]]:sm:flex-initial\",\n md: \"[&>[role=tab]]:md:flex-initial\",\n lg: \"[&>[role=tab]]:lg:flex-initial\",\n xl: \"[&>[role=tab]]:xl:flex-initial\",\n};\n\nfunction getLayoutClass(\n variant: \"fill\" | \"hug\" | undefined,\n fullWidth: boolean,\n alignLeft?: boolean | Breakpoint,\n): string {\n if (variant === \"hug\") return \"inline-flex\";\n if (variant === \"fill\") return \"flex w-full [&>[role=tab]]:flex-1\";\n\n if (!fullWidth) return \"inline-flex\";\n\n const base = \"flex w-full [&>[role=tab]]:flex-1\";\n if (alignLeft === true) return `${base} ${alignLeftClasses.always}`;\n if (typeof alignLeft === \"string\") return `${base} ${alignLeftClasses[alignLeft]}`;\n return base;\n}\n\n/** Props for the {@link TabsList} component. */\nexport type TabsListProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.List> & {\n /** When `true` (the default), the tab list spans the full width of its container and each tab grows equally. Set to `false` for inline sizing. */\n fullWidth?: boolean;\n /**\n * Controls tab alignment within a full-width container.\n * - `false` (default): tabs spread evenly\n * - `true`: tabs left-aligned, sized to content\n * - `\"md\"` (breakpoint): spread on mobile, left-aligned at breakpoint and up\n */\n alignLeft?: boolean | Breakpoint;\n /** Explicit layout variant. `\"hug\"` sizes the list to its content; `\"fill\"` stretches it full-width with equal-width tabs. Takes precedence over `fullWidth`/`alignLeft`. */\n variant?: \"fill\" | \"hug\";\n /**\n * Drops the leading padding on the first tab so its label sits flush with the\n * list's left edge, lining it up with page content above or below the bar\n * (a heading, for instance) rather than being indented by the tab's own\n * padding. Spacing between tabs is unaffected. Pair with `alignLeft` or\n * `variant=\"hug\"`. @default false\n */\n flushLeft?: boolean;\n /**\n * Scrolls the row horizontally when the tabs don't fit, instead of letting\n * them compress. By default a tab may shrink until its label ellipsises,\n * which on a narrow viewport can truncate every label at once; here each tab\n * keeps its natural width and the overflow scrolls. The scrollbar itself is\n * hidden — the clipped tab at the edge is the affordance.\n *\n * Because the tabs are content-sized, they no longer spread to fill the row:\n * a set that does fit sits left-aligned, as with `alignLeft`.\n *\n * Horizontal orientation only: a vertical list already grows downwards.\n * @default false\n */\n scrollable?: boolean;\n /**\n * `\"underline\"` marks the active tab with a line under the row. `\"pill\"` sits\n * the tabs in a rounded track, sized to its tabs, and slides a filled pill\n * behind the active one. A pill list is horizontal and ignores `fullWidth`,\n * `alignLeft`, `variant` and `flushLeft`; it scrolls when it doesn't fit.\n * @default \"underline\"\n */\n appearance?: TabsListAppearance;\n /** Height of each tab in a pill list. Ignored by the underline appearance. @default \"32\" */\n size?: TabsListPillSize;\n /**\n * Pill only: the pill follows the mouse across the tabs and settles back on the\n * selected one when the pointer leaves. Mouse only, and off when the user prefers\n * reduced motion. @default false\n */\n followHover?: boolean;\n};\n\n/** Container for {@link TabsTrigger} elements. Renders a sliding active-tab indicator that animates between tabs. */\nexport const TabsList = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.List>,\n TabsListProps\n>(\n (\n {\n className,\n children,\n fullWidth = true,\n alignLeft,\n variant,\n flushLeft = false,\n scrollable = false,\n appearance = \"underline\",\n size = \"32\",\n followHover = false,\n onPointerOver,\n onPointerLeave,\n style,\n ...props\n },\n ref,\n ) => {\n const innerRef = React.useRef<HTMLDivElement>(null);\n const indicatorRef = React.useRef<HTMLSpanElement>(null);\n\n React.useImperativeHandle(ref, () => innerRef.current as HTMLDivElement);\n\n const tabBoxes = React.useRef(new Map<Element, TabBox>());\n const resizeObserverRef = React.useRef<ResizeObserver | null>(null);\n const listWidth = React.useRef<number | null>(null);\n const hoveredTab = React.useRef<HTMLElement | null>(null);\n const pillTab = React.useRef<HTMLElement | null>(null);\n const tabOrder = React.useRef(new Map<Element, number>());\n const canHover = React.useRef(false);\n\n const placePill = React.useCallback((tab: HTMLElement) => {\n const list = innerRef.current;\n const indicator = indicatorRef.current;\n if (!list || !indicator) return;\n const box = tabBoxes.current.get(tab);\n if (!box) return;\n const from = pillTab.current;\n pillTab.current = tab;\n const distance =\n from && from !== tab\n ? Math.abs((tabOrder.current.get(tab) ?? 0) - (tabOrder.current.get(from) ?? 0))\n : 0;\n const slideMs = pillSlideMs(distance, canHover.current);\n list.style.setProperty(\"--pill-slide\", `${slideMs}ms`);\n list.style.setProperty(\"--pill-arrive\", `${Math.round(slideMs * PILL_ARRIVAL_SHARE)}ms`);\n indicator.style.width = `${box.width}px`;\n indicator.style.height = `${box.height}px`;\n indicator.style.transform = `translate(${box.left}px, ${box.top}px)`;\n for (const marked of list.querySelectorAll(\"[data-pill]\")) {\n if (marked !== tab) marked.removeAttribute(\"data-pill\");\n }\n tab.setAttribute(\"data-pill\", \"\");\n }, []);\n\n const layoutPill = React.useCallback(\n (list: HTMLElement, indicator: HTMLElement, activeTab: HTMLElement) => {\n indicator.style.background = \"var(--color-content-primary)\";\n indicator.style.inset = \"0 auto auto 0\";\n const previous = tabBoxes.current;\n const rowResized = listWidth.current !== null && listWidth.current !== list.offsetWidth;\n listWidth.current = list.offsetWidth;\n const { boxes, order } = measureTabs(list, resizeObserverRef.current);\n tabBoxes.current = boxes;\n tabOrder.current = order;\n if (!rowResized && previous.size > 0 && !prefersReducedMotion()) {\n slideFromPrevious(list, previous, boxes, pillStepMs(canHover.current));\n }\n placePill(pillTarget(list, hoveredTab.current, activeTab));\n },\n [placePill],\n );\n\n const updateIndicator = React.useCallback(() => {\n const list = innerRef.current;\n const indicator = indicatorRef.current;\n if (!list || !indicator) return;\n\n const activeTab = list.querySelector<HTMLElement>('[data-state=\"active\"]');\n if (!activeTab) {\n indicator.style.opacity = \"0\";\n list.querySelector(\"[data-pill]\")?.removeAttribute(\"data-pill\");\n return;\n }\n\n const isVertical = list.dataset.orientation === \"vertical\";\n\n indicator.style.opacity = \"1\";\n\n if (appearance === \"pill\") {\n layoutPill(list, indicator, activeTab);\n } else if (isVertical) {\n indicator.style.background =\n \"linear-gradient(180deg, var(--color-buttons-tertiary-default) 0%, var(--color-tab-active) 50%, var(--color-buttons-tertiary-default) 100%)\";\n indicator.style.inset = `0 -1px auto auto`;\n indicator.style.width = \"1px\";\n indicator.style.height = `${activeTab.offsetHeight}px`;\n indicator.style.transform = `translateY(${activeTab.offsetTop}px)`;\n } else {\n indicator.style.background =\n \"linear-gradient(90deg, var(--color-buttons-tertiary-default) 0%, var(--color-tab-active) 50%, var(--color-buttons-tertiary-default) 100%)\";\n indicator.style.inset = \"auto auto 0 0\";\n indicator.style.height = \"1px\";\n indicator.style.width = `${activeTab.offsetWidth}px`;\n indicator.style.transform = `translateX(${activeTab.offsetLeft}px)`;\n }\n }, [appearance, layoutPill]);\n\n const followsHover = appearance === \"pill\" && followHover;\n\n const handlePointerOver = (event: React.PointerEvent<HTMLDivElement>) => {\n onPointerOver?.(event);\n if (!followsHover || event.pointerType !== \"mouse\") return;\n if (prefersReducedMotion()) return;\n const tab = (event.target as Element).closest<HTMLElement>('[role=\"tab\"]');\n if (!tab || tab === hoveredTab.current || !event.currentTarget.contains(tab)) return;\n hoveredTab.current = tab;\n placePill(pillTarget(event.currentTarget, tab, tab));\n };\n\n const handlePointerLeave = (event: React.PointerEvent<HTMLDivElement>) => {\n onPointerLeave?.(event);\n if (!hoveredTab.current) return;\n hoveredTab.current = null;\n const list = innerRef.current;\n const activeTab = list?.querySelector<HTMLElement>('[data-state=\"active\"]');\n if (list && activeTab) placePill(pillTarget(list, null, activeTab));\n };\n\n // Radix scrolls a tab into view when it takes focus, and mount is not focus, so\n // URL-driven state can land on a tab that is off to the right with nothing on\n // screen to say so: no indicator, and tab one showing as though it were active.\n // Assigns `scrollLeft` rather than calling `scrollIntoView`, which would also\n // scroll every ancestor and the page with it. Only ever scrolls further right, so\n // re-running it after the webfont settles corrects a short initial scroll without\n // yanking the row back from wherever the user has since dragged it.\n const revealActiveTab = React.useCallback(() => {\n const list = innerRef.current;\n const scrolls = scrollable || appearance === \"pill\";\n if (!list || !scrolls || list.dataset.orientation === \"vertical\") return;\n const activeTab = list.querySelector<HTMLElement>('[data-state=\"active\"]');\n if (!activeTab) return;\n const overshoot = activeTab.offsetLeft + activeTab.offsetWidth - list.clientWidth;\n if (overshoot > list.scrollLeft) list.scrollLeft = overshoot;\n }, [scrollable, appearance]);\n\n React.useLayoutEffect(() => {\n const list = innerRef.current;\n const indicator = indicatorRef.current;\n if (!list || !indicator) return;\n\n canHover.current = window.matchMedia?.(\"(hover: hover)\").matches ?? false;\n\n const resizeObserver = new ResizeObserver(updateIndicator);\n resizeObserver.observe(list);\n resizeObserverRef.current = resizeObserver;\n\n indicator.style.transitionDuration = \"0s\";\n updateIndicator();\n indicator.getBoundingClientRect();\n indicator.style.transitionDuration = \"\";\n revealActiveTab();\n\n const mutationObserver = new MutationObserver(updateIndicator);\n mutationObserver.observe(list, {\n attributes: true,\n attributeFilter: [\"data-state\", \"aria-expanded\"],\n childList: true,\n subtree: true,\n });\n\n let cancelled = false;\n if (document.fonts?.status !== \"loaded\") {\n document.fonts?.ready.then(() => {\n if (cancelled) return;\n updateIndicator();\n // The tabs are wider once the real font is in, so the mount-time scroll can\n // fall short of the active tab. Recomputed here against the settled layout.\n revealActiveTab();\n });\n }\n\n return () => {\n cancelled = true;\n mutationObserver.disconnect();\n resizeObserver.disconnect();\n resizeObserverRef.current = null;\n };\n }, [updateIndicator, revealActiveTab]);\n\n const isPill = appearance === \"pill\";\n const listStyle: React.CSSProperties & { \"--pill-ease\"?: string } = isPill\n ? { \"--pill-ease\": PILL_EASE, ...style }\n : { ...style };\n\n return (\n <TabsAppearanceContext.Provider value={{ appearance, size }}>\n <TabsPrimitive.List\n ref={innerRef}\n onPointerOver={handlePointerOver}\n onPointerLeave={handlePointerLeave}\n style={listStyle}\n className={cn(\n // `isolate` scopes the active indicator's `z-10` to a local stacking\n // context. Without it, `relative` alone creates no stacking context, so\n // the indicator escapes and paints above page chrome (e.g. the header).\n \"relative isolate\",\n isPill\n ? \"bg-(image:--fv-raised-control-fill) inline-flex w-fit max-w-full items-center gap-1 overflow-x-auto rounded-full bg-background-secondary p-1 shadow-(--fv-raised-control-shadow) [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\"\n : [\n getLayoutClass(variant, fullWidth, alignLeft),\n // Horizontal only: in the vertical orientation the leading padding is\n // the row's left inset, not a label offset, so zeroing it would pull\n // the first label out of line with the others.\n flushLeft && \"data-[orientation=horizontal]:[&>[role=tab]:first-child]:pl-0\",\n // `flex-none` is what stops the tabs compressing — without it they\n // share the row and never overflow, so there is nothing to scroll.\n // The scrollbar is hidden in both engines: Firefox reads\n // `scrollbar-width`, WebKit and Blink the pseudo-element.\n scrollable &&\n \"data-[orientation=horizontal]:overflow-x-auto data-[orientation=horizontal]:[scrollbar-width:none] data-[orientation=horizontal]:[&::-webkit-scrollbar]:hidden data-[orientation=horizontal]:[&>[role=tab]]:flex-none\",\n \"data-[orientation=horizontal]:items-center data-[orientation=horizontal]:shadow-[inset_0_-1px_0_0_var(--color-border-primary)]\",\n \"data-[orientation=vertical]:flex-col data-[orientation=vertical]:shadow-[inset_-1px_0_0_0_var(--color-border-primary)]\",\n ],\n className,\n )}\n {...props}\n >\n {children}\n <span\n ref={indicatorRef}\n aria-hidden\n className={cn(\n \"pointer-events-none absolute rounded-full motion-safe:transition-[transform,width,height]\",\n isPill\n ? \"z-5 shadow-(--fv-raised-control-thumb-shadow) motion-safe:duration-(--pill-slide) motion-safe:ease-(--pill-ease)\"\n : \"z-10 motion-safe:duration-200 motion-safe:ease-in-out\",\n )}\n style={{ opacity: 0 }}\n />\n </TabsPrimitive.List>\n </TabsAppearanceContext.Provider>\n );\n },\n);\n\nTabsList.displayName = \"TabsList\";\n"],"names":[],"mappings":";;;;;AAaO,MAAM,wBAAwB,MAAM,cAGxC,EAAE,YAAY,aAAa,MAAM,MAAM;AAI1C,MAAM,YAAY;AAClB,MAAM,eAAe;AACrB,MAAM,qBAAqB;AAC3B,MAAM,qBAAqB;AAC3B,MAAM,cAAc;AAEpB,MAAM,qBAAqB;AAE3B,SAAS,WAAW,UAAmB;AACrC,SAAO,WAAW,eAAe;AACnC;AAEA,SAAS,YAAY,UAAkB,UAAmB;AACxD,MAAI,CAAC,SAAU,QAAO;AACtB,SAAO,KAAK,IAAI,eAAe,KAAK,IAAI,WAAW,GAAG,CAAC,IAAI,oBAAoB,WAAW;AAC5F;AAEA,MAAM,uBAAuB,MAC3B,OAAO,aAAa,kCAAkC,EAAE,WAAW;AAErE,SAAS,WAAW,MAAmB,SAA6B,WAAwB;AAC1F,SACE,KAAK,cAA2B,oCAAoC,MACnE,SAAS,cAAc,UAAU;AAEtC;AAEA,SAAS,YAAY,MAAmB,UAAiC;AACvE,QAAM,4BAAY,IAAA;AAClB,QAAM,4BAAY,IAAA;AAClB,aAAW,OAAO,KAAK,iBAA8B,cAAc,GAAG;AACpE,cAAU,QAAQ,GAAG;AACrB,UAAM,IAAI,KAAK,MAAM,IAAI;AACzB,UAAM,IAAI,KAAK;AAAA,MACb,MAAM,IAAI;AAAA,MACV,KAAK,IAAI;AAAA,MACT,OAAO,IAAI;AAAA,MACX,QAAQ,IAAI;AAAA,IAAA,CACb;AAAA,EACH;AACA,SAAO,EAAE,OAAO,MAAA;AA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,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA,YAKb,cACE;AAAA,YACF;AAAA,YACA;AAAA,UAAA;AAAA,UAEN;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA;AAAA,UACD;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,KAAK;AAAA,cACL,eAAW;AAAA,cACX,WAAW;AAAA,gBACT;AAAA,gBACA,SACI,qHACA;AAAA,cAAA;AAAA,cAEN,OAAO,EAAE,SAAS,EAAA;AAAA,YAAE;AAAA,UAAA;AAAA,QACtB;AAAA,MAAA;AAAA,IAAA,GAEJ;AAAA,EAEJ;AACF;AAEA,SAAS,cAAc;"}
@@ -30,7 +30,7 @@ const TooltipContent = React.forwardRef(
30
30
  collisionPadding: 8,
31
31
  style: { zIndex: "var(--fanvue-ui-portal-z-index, 50)", ...style },
32
32
  className: cn(
33
- "typography-description-12px-semibold max-w-[320px] rounded-sm bg-surface-primary-inverted px-4 py-2 text-content-primary-inverted shadow-[0px_1px_4px_0px_rgba(0,0,0,0.06),0px_1px_3px_0px_rgba(0,0,0,0.05)]",
33
+ "typography-description-12px-semibold max-w-[320px] rounded-xs border-[0.5px] border-border-strong bg-surface-secondary px-4 py-2 text-content-primary shadow-sm",
34
34
  className
35
35
  ),
36
36
  ...props,
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.mjs","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/** Props for the {@link TooltipProvider}. Wraps Radix `Tooltip.Provider`. */\nexport type TooltipProviderProps = React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Provider>;\n\nconst DEFAULT_DELAY_DURATION = 200;\n\n/**\n * Provides tooltip delay and skip-delay context. Wrap your app or a subtree.\n *\n * Defaults `delayDuration` to 200ms rather than inheriting Radix's 700ms, which\n * reads as unresponsive on the short hint labels this library uses tooltips for.\n * Pass `delayDuration` to override.\n *\n * Note that `TooltipLabel`, `ChartCard` and `SwitchField` each mount their own\n * provider internally, so they take this default but not an app-level override.\n */\nexport const TooltipProvider = ({\n delayDuration = DEFAULT_DELAY_DURATION,\n ...props\n}: TooltipProviderProps) => <TooltipPrimitive.Provider delayDuration={delayDuration} {...props} />;\nTooltipProvider.displayName = \"TooltipProvider\";\n\n/** Props for the {@link Tooltip} root component. */\nexport interface TooltipProps extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Root> {\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n defaultOpen?: boolean;\n}\n\n/** Root component that manages open/close state for a single tooltip. */\nexport const Tooltip = TooltipPrimitive.Root;\n\n/** Props for the {@link TooltipTrigger} component. */\nexport type TooltipTriggerProps = React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Trigger>;\n\n/** The element that triggers the tooltip on hover/focus. */\nexport const TooltipTrigger = TooltipPrimitive.Trigger;\n\n/** Position of the tooltip relative to its trigger, combining side and alignment (MUI-style). */\nexport type TooltipPlacement =\n | \"top\"\n | \"top-start\"\n | \"top-end\"\n | \"bottom\"\n | \"bottom-start\"\n | \"bottom-end\"\n | \"left\"\n | \"left-start\"\n | \"left-end\"\n | \"right\"\n | \"right-start\"\n | \"right-end\";\n\nexport interface TooltipContentProps\n extends Omit<React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>, \"title\"> {\n /**\n * Position of the tooltip relative to the trigger. Takes precedence over `side` and `align`.\n * @default \"top\"\n */\n placement?: TooltipPlacement;\n /**\n * Optional heading above the body, for the two-row tooltip: a bold label\n * naming the thing, then a plain-weight description of it. Without it the\n * tooltip is a single bold line.\n */\n title?: React.ReactNode;\n}\n\nexport const TooltipContent = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Content>,\n TooltipContentProps\n>(\n (\n { className, sideOffset = 8, style, placement, side, align, title, children, ...props },\n ref,\n ) => {\n let resolvedSide = side;\n let resolvedAlign: \"start\" | \"center\" | \"end\" = align ?? \"center\";\n if (placement) {\n const [parsedSide, parsedAlign] = placement.split(\"-\") as [\n \"top\" | \"right\" | \"bottom\" | \"left\",\n \"start\" | \"end\" | undefined,\n ];\n resolvedSide = parsedSide;\n resolvedAlign = parsedAlign ?? \"center\";\n }\n\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n ref={ref}\n side={resolvedSide}\n align={resolvedAlign}\n sideOffset={sideOffset}\n collisionPadding={8}\n style={{ zIndex: \"var(--fanvue-ui-portal-z-index, 50)\", ...style }}\n className={cn(\n \"typography-description-12px-semibold max-w-[320px] rounded-sm bg-surface-primary-inverted px-4 py-2 text-content-primary-inverted shadow-[0px_1px_4px_0px_rgba(0,0,0,0.06),0px_1px_3px_0px_rgba(0,0,0,0.05)]\",\n className,\n )}\n {...props}\n >\n {title ? (\n <span className=\"flex flex-col gap-1\">\n <span>{title}</span>\n <span className=\"typography-description-12px-regular\">{children}</span>\n </span>\n ) : (\n children\n )}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n },\n);\nTooltipContent.displayName = \"TooltipContent\";\n"],"names":[],"mappings":";;;;;AAOA,MAAM,yBAAyB;AAYxB,MAAM,kBAAkB,CAAC;AAAA,EAC9B,gBAAgB;AAAA,EAChB,GAAG;AACL,0BAA6B,iBAAiB,UAAjB,EAA0B,eAA+B,GAAG,MAAA,CAAO;AAChG,gBAAgB,cAAc;AAUvB,MAAM,UAAU,iBAAiB;AAMjC,MAAM,iBAAiB,iBAAiB;AAgCxC,MAAM,iBAAiB,MAAM;AAAA,EAIlC,CACE,EAAE,WAAW,aAAa,GAAG,OAAO,WAAW,MAAM,OAAO,OAAO,UAAU,GAAG,MAAA,GAChF,QACG;AACH,QAAI,eAAe;AACnB,QAAI,gBAA4C,SAAS;AACzD,QAAI,WAAW;AACb,YAAM,CAAC,YAAY,WAAW,IAAI,UAAU,MAAM,GAAG;AAIrD,qBAAe;AACf,sBAAgB,eAAe;AAAA,IACjC;AAEA,WACE,oBAAC,iBAAiB,QAAjB,EACC,UAAA;AAAA,MAAC,iBAAiB;AAAA,MAAjB;AAAA,QACC;AAAA,QACA,MAAM;AAAA,QACN,OAAO;AAAA,QACP;AAAA,QACA,kBAAkB;AAAA,QAClB,OAAO,EAAE,QAAQ,uCAAuC,GAAG,MAAA;AAAA,QAC3D,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,QAEH,UAAA,QACC,qBAAC,QAAA,EAAK,WAAU,uBACd,UAAA;AAAA,UAAA,oBAAC,UAAM,UAAA,MAAA,CAAM;AAAA,UACb,oBAAC,QAAA,EAAK,WAAU,uCAAuC,SAAA,CAAS;AAAA,QAAA,EAAA,CAClE,IAEA;AAAA,MAAA;AAAA,IAAA,GAGN;AAAA,EAEJ;AACF;AACA,eAAe,cAAc;"}
1
+ {"version":3,"file":"Tooltip.mjs","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/** Props for the {@link TooltipProvider}. Wraps Radix `Tooltip.Provider`. */\nexport type TooltipProviderProps = React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Provider>;\n\nconst DEFAULT_DELAY_DURATION = 200;\n\n/**\n * Provides tooltip delay and skip-delay context. Wrap your app or a subtree.\n *\n * Defaults `delayDuration` to 200ms rather than inheriting Radix's 700ms, which\n * reads as unresponsive on the short hint labels this library uses tooltips for.\n * Pass `delayDuration` to override.\n *\n * Note that `TooltipLabel`, `ChartCard`, `SwitchField` and `TableTruncatedText`\n * each mount their own provider internally, so they take this default but not an\n * app-level override.\n */\nexport const TooltipProvider = ({\n delayDuration = DEFAULT_DELAY_DURATION,\n ...props\n}: TooltipProviderProps) => <TooltipPrimitive.Provider delayDuration={delayDuration} {...props} />;\nTooltipProvider.displayName = \"TooltipProvider\";\n\n/** Props for the {@link Tooltip} root component. */\nexport interface TooltipProps extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Root> {\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n defaultOpen?: boolean;\n}\n\n/** Root component that manages open/close state for a single tooltip. */\nexport const Tooltip = TooltipPrimitive.Root;\n\n/** Props for the {@link TooltipTrigger} component. */\nexport type TooltipTriggerProps = React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Trigger>;\n\n/** The element that triggers the tooltip on hover/focus. */\nexport const TooltipTrigger = TooltipPrimitive.Trigger;\n\n/** Position of the tooltip relative to its trigger, combining side and alignment (MUI-style). */\nexport type TooltipPlacement =\n | \"top\"\n | \"top-start\"\n | \"top-end\"\n | \"bottom\"\n | \"bottom-start\"\n | \"bottom-end\"\n | \"left\"\n | \"left-start\"\n | \"left-end\"\n | \"right\"\n | \"right-start\"\n | \"right-end\";\n\nexport interface TooltipContentProps\n extends Omit<React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>, \"title\"> {\n /**\n * Position of the tooltip relative to the trigger. Takes precedence over `side` and `align`.\n * @default \"top\"\n */\n placement?: TooltipPlacement;\n /**\n * Optional heading above the body, for the two-row tooltip: a bold label\n * naming the thing, then a plain-weight description of it. Without it the\n * tooltip is a single bold line.\n */\n title?: React.ReactNode;\n}\n\n/**\n * The floating tooltip panel. It sits on a same-mode surface rather than an\n * inverted one, so it is dark in dark mode and light in light mode, set off by\n * a hairline border.\n */\nexport const TooltipContent = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Content>,\n TooltipContentProps\n>(\n (\n { className, sideOffset = 8, style, placement, side, align, title, children, ...props },\n ref,\n ) => {\n let resolvedSide = side;\n let resolvedAlign: \"start\" | \"center\" | \"end\" = align ?? \"center\";\n if (placement) {\n const [parsedSide, parsedAlign] = placement.split(\"-\") as [\n \"top\" | \"right\" | \"bottom\" | \"left\",\n \"start\" | \"end\" | undefined,\n ];\n resolvedSide = parsedSide;\n resolvedAlign = parsedAlign ?? \"center\";\n }\n\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n ref={ref}\n side={resolvedSide}\n align={resolvedAlign}\n sideOffset={sideOffset}\n collisionPadding={8}\n style={{ zIndex: \"var(--fanvue-ui-portal-z-index, 50)\", ...style }}\n className={cn(\n \"typography-description-12px-semibold max-w-[320px] rounded-xs border-[0.5px] border-border-strong bg-surface-secondary px-4 py-2 text-content-primary shadow-sm\",\n className,\n )}\n {...props}\n >\n {title ? (\n <span className=\"flex flex-col gap-1\">\n <span>{title}</span>\n <span className=\"typography-description-12px-regular\">{children}</span>\n </span>\n ) : (\n children\n )}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n },\n);\nTooltipContent.displayName = \"TooltipContent\";\n"],"names":[],"mappings":";;;;;AAOA,MAAM,yBAAyB;AAaxB,MAAM,kBAAkB,CAAC;AAAA,EAC9B,gBAAgB;AAAA,EAChB,GAAG;AACL,0BAA6B,iBAAiB,UAAjB,EAA0B,eAA+B,GAAG,MAAA,CAAO;AAChG,gBAAgB,cAAc;AAUvB,MAAM,UAAU,iBAAiB;AAMjC,MAAM,iBAAiB,iBAAiB;AAqCxC,MAAM,iBAAiB,MAAM;AAAA,EAIlC,CACE,EAAE,WAAW,aAAa,GAAG,OAAO,WAAW,MAAM,OAAO,OAAO,UAAU,GAAG,MAAA,GAChF,QACG;AACH,QAAI,eAAe;AACnB,QAAI,gBAA4C,SAAS;AACzD,QAAI,WAAW;AACb,YAAM,CAAC,YAAY,WAAW,IAAI,UAAU,MAAM,GAAG;AAIrD,qBAAe;AACf,sBAAgB,eAAe;AAAA,IACjC;AAEA,WACE,oBAAC,iBAAiB,QAAjB,EACC,UAAA;AAAA,MAAC,iBAAiB;AAAA,MAAjB;AAAA,QACC;AAAA,QACA,MAAM;AAAA,QACN,OAAO;AAAA,QACP;AAAA,QACA,kBAAkB;AAAA,QAClB,OAAO,EAAE,QAAQ,uCAAuC,GAAG,MAAA;AAAA,QAC3D,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,QAEH,UAAA,QACC,qBAAC,QAAA,EAAK,WAAU,uBACd,UAAA;AAAA,UAAA,oBAAC,UAAM,UAAA,MAAA,CAAM;AAAA,UACb,oBAAC,QAAA,EAAK,WAAU,uCAAuC,SAAA,CAAS;AAAA,QAAA,EAAA,CAClE,IAEA;AAAA,MAAA;AAAA,IAAA,GAGN;AAAA,EAEJ;AACF;AACA,eAAe,cAAc;"}
@@ -0,0 +1,48 @@
1
+ "use client";
2
+ import { jsxs, jsx } from "react/jsx-runtime";
3
+ import * as ToastPrimitive from "@radix-ui/react-toast";
4
+ import * as React from "react";
5
+ import { cn } from "../../utils/cn.mjs";
6
+ import { Button } from "../Button/Button.mjs";
7
+ import { TickCircleIcon } from "../Icons/TickCircleIcon.mjs";
8
+ import { TrashIcon } from "../Icons/TrashIcon.mjs";
9
+ const TypeIcon = ({ type }) => type === "removed" ? /* @__PURE__ */ jsx(TrashIcon, { size: 16, filled: true, className: "text-alerts-toast-icon-error" }) : /* @__PURE__ */ jsx(TickCircleIcon, { size: 16, filled: true, className: "text-alerts-toast-icon-success" });
10
+ const UndoAlertPrompt = React.forwardRef(
11
+ ({ className, type = "positive", title, onUndo, undoLabel = "Undo", undoAltText, ...props }, ref) => {
12
+ return /* @__PURE__ */ jsxs(
13
+ ToastPrimitive.Root,
14
+ {
15
+ ref,
16
+ "data-testid": "undo-alert-prompt",
17
+ className: cn(
18
+ "group pointer-events-auto relative flex w-fit max-w-full items-center gap-6 overflow-hidden rounded-md bg-surface-primary-inverted py-3 pr-3 pl-4 text-content-primary-inverted shadow-md transition-all",
19
+ "data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-bottom-full data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-(--radix-toast-swipe-end-x) data-[swipe=move]:translate-x-(--radix-toast-swipe-move-x) data-[state=closed]:animate-out data-[state=open]:animate-in data-[swipe=end]:animate-out data-[swipe=move]:transition-none",
20
+ className
21
+ ),
22
+ ...props,
23
+ children: [
24
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-start gap-3 py-1 pr-1", children: [
25
+ /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center pt-px", children: /* @__PURE__ */ jsx(TypeIcon, { type }) }),
26
+ /* @__PURE__ */ jsx(ToastPrimitive.Title, { className: "typography-body-small-14px-semibold min-w-0", children: title })
27
+ ] }),
28
+ /* @__PURE__ */ jsx(ToastPrimitive.Action, { altText: undoAltText ?? undoLabel, asChild: true, children: /* @__PURE__ */ jsx(
29
+ Button,
30
+ {
31
+ variant: "secondary",
32
+ negative: true,
33
+ size: "24",
34
+ onClick: onUndo,
35
+ className: "typography-description-12px-semibold shrink-0 rounded-xs",
36
+ children: undoLabel
37
+ }
38
+ ) })
39
+ ]
40
+ }
41
+ );
42
+ }
43
+ );
44
+ UndoAlertPrompt.displayName = "UndoAlertPrompt";
45
+ export {
46
+ UndoAlertPrompt
47
+ };
48
+ //# sourceMappingURL=UndoAlertPrompt.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UndoAlertPrompt.mjs","sources":["../../../src/components/UndoAlertPrompt/UndoAlertPrompt.tsx"],"sourcesContent":["import * as ToastPrimitive from \"@radix-ui/react-toast\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Button } from \"../Button/Button\";\nimport { TickCircleIcon } from \"../Icons/TickCircleIcon\";\nimport { TrashIcon } from \"../Icons/TrashIcon\";\n\n/** Outcome the prompt confirms: a completed change, or a removal. */\nexport type UndoAlertPromptType = \"positive\" | \"removed\";\n\nexport interface UndoAlertPromptProps\n extends Omit<React.ComponentPropsWithoutRef<typeof ToastPrimitive.Root>, \"type\" | \"title\"> {\n /** Outcome being confirmed. Drives the leading icon. @default \"positive\" */\n type?: UndoAlertPromptType;\n /**\n * Confirmation of the action that just completed. Write it for the action\n * being undone, e.g. \"Folder deleted\", \"Template moved\" or\n * \"3 messages archived\". Accepts rich content for emphasising an item name.\n */\n title: React.ReactNode;\n /** Called when the user activates the undo button. The prompt closes afterwards. */\n onUndo: () => void;\n /** Label for the undo button. @default \"Undo\" */\n undoLabel?: string;\n /**\n * Describes an alternative way to undo, announced to screen reader users\n * who cannot reach the button before the prompt dismisses. Word it for the\n * action, e.g. \"Restore the folder from Recently deleted\". @default undoLabel\n */\n undoAltText?: string;\n}\n\nconst TypeIcon = ({ type }: { type: UndoAlertPromptType }) =>\n type === \"removed\" ? (\n <TrashIcon size={16} filled className=\"text-alerts-toast-icon-error\" />\n ) : (\n <TickCircleIcon size={16} filled className=\"text-alerts-toast-icon-success\" />\n );\n\n/**\n * A compact, auto-dismissing confirmation with a single undo action. Use it\n * straight after a reversible change, such as moving or deleting an item, so\n * the user can reverse it without leaving their flow. The copy is not fixed:\n * pass a `title` describing the action that just happened, and pick `type`\n * by outcome (`removed` for deletions, `positive` for everything else).\n *\n * Use inside a {@link ToastProvider} with a {@link ToastViewport}.\n *\n * @example\n * ```tsx\n * <UndoAlertPrompt type=\"removed\" title=\"Folder deleted\" onUndo={restoreFolder} />\n * ```\n */\nexport const UndoAlertPrompt = React.forwardRef<\n React.ComponentRef<typeof ToastPrimitive.Root>,\n UndoAlertPromptProps\n>(\n (\n { className, type = \"positive\", title, onUndo, undoLabel = \"Undo\", undoAltText, ...props },\n ref,\n ) => {\n return (\n <ToastPrimitive.Root\n ref={ref}\n data-testid=\"undo-alert-prompt\"\n className={cn(\n \"group pointer-events-auto relative flex w-fit max-w-full items-center gap-6 overflow-hidden rounded-md bg-surface-primary-inverted py-3 pr-3 pl-4 text-content-primary-inverted shadow-md transition-all\",\n \"data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-bottom-full data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-(--radix-toast-swipe-end-x) data-[swipe=move]:translate-x-(--radix-toast-swipe-move-x) data-[state=closed]:animate-out data-[state=open]:animate-in data-[swipe=end]:animate-out data-[swipe=move]:transition-none\",\n className,\n )}\n {...props}\n >\n <div className=\"flex min-w-0 items-start gap-3 py-1 pr-1\">\n <div className=\"flex shrink-0 items-center pt-px\">\n <TypeIcon type={type} />\n </div>\n <ToastPrimitive.Title className=\"typography-body-small-14px-semibold min-w-0\">\n {title}\n </ToastPrimitive.Title>\n </div>\n <ToastPrimitive.Action altText={undoAltText ?? undoLabel} asChild>\n <Button\n variant=\"secondary\"\n negative\n size=\"24\"\n onClick={onUndo}\n className=\"typography-description-12px-semibold shrink-0 rounded-xs\"\n >\n {undoLabel}\n </Button>\n </ToastPrimitive.Action>\n </ToastPrimitive.Root>\n );\n },\n);\n\nUndoAlertPrompt.displayName = \"UndoAlertPrompt\";\n"],"names":[],"mappings":";;;;;;;;AAgCA,MAAM,WAAW,CAAC,EAAE,KAAA,MAClB,SAAS,YACP,oBAAC,WAAA,EAAU,MAAM,IAAI,QAAM,MAAC,WAAU,+BAAA,CAA+B,IAErE,oBAAC,gBAAA,EAAe,MAAM,IAAI,QAAM,MAAC,WAAU,iCAAA,CAAiC;AAiBzE,MAAM,kBAAkB,MAAM;AAAA,EAInC,CACE,EAAE,WAAW,OAAO,YAAY,OAAO,QAAQ,YAAY,QAAQ,aAAa,GAAG,MAAA,GACnF,QACG;AACH,WACE;AAAA,MAAC,eAAe;AAAA,MAAf;AAAA,QACC;AAAA,QACA,eAAY;AAAA,QACZ,WAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAA,qBAAC,OAAA,EAAI,WAAU,4CACb,UAAA;AAAA,YAAA,oBAAC,SAAI,WAAU,oCACb,UAAA,oBAAC,UAAA,EAAS,MAAY,GACxB;AAAA,gCACC,eAAe,OAAf,EAAqB,WAAU,+CAC7B,UAAA,MAAA,CACH;AAAA,UAAA,GACF;AAAA,UACA,oBAAC,eAAe,QAAf,EAAsB,SAAS,eAAe,WAAW,SAAO,MAC/D,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,SAAQ;AAAA,cACR,UAAQ;AAAA,cACR,MAAK;AAAA,cACL,SAAS;AAAA,cACT,WAAU;AAAA,cAET,UAAA;AAAA,YAAA;AAAA,UAAA,EACH,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,gBAAgB,cAAc;"}