@fanvue/ui 3.50.0 → 3.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/charts.d.ts +7 -0
  2. package/dist/cjs/components/Button/Button.cjs +12 -8
  3. package/dist/cjs/components/Button/Button.cjs.map +1 -1
  4. package/dist/cjs/components/Chart/ChartCard.cjs +4 -3
  5. package/dist/cjs/components/Chart/ChartCard.cjs.map +1 -1
  6. package/dist/cjs/components/Dialog/Dialog.cjs +29 -2
  7. package/dist/cjs/components/Dialog/Dialog.cjs.map +1 -1
  8. package/dist/cjs/components/Drawer/Drawer.cjs +72 -17
  9. package/dist/cjs/components/Drawer/Drawer.cjs.map +1 -1
  10. package/dist/cjs/components/DropdownMenu/DropdownMenuItem.cjs +26 -7
  11. package/dist/cjs/components/DropdownMenu/DropdownMenuItem.cjs.map +1 -1
  12. package/dist/cjs/components/IconButton/IconButton.cjs +11 -2
  13. package/dist/cjs/components/IconButton/IconButton.cjs.map +1 -1
  14. package/dist/cjs/components/Icons/DocumentIcon.cjs +74 -0
  15. package/dist/cjs/components/Icons/DocumentIcon.cjs.map +1 -0
  16. package/dist/cjs/components/Icons/EpisodesIcon.cjs +65 -0
  17. package/dist/cjs/components/Icons/EpisodesIcon.cjs.map +1 -0
  18. package/dist/cjs/components/Icons/ShortsIcon.cjs +74 -0
  19. package/dist/cjs/components/Icons/ShortsIcon.cjs.map +1 -0
  20. package/dist/cjs/components/InfoBox/InfoBox.cjs +1 -1
  21. package/dist/cjs/components/InfoBox/InfoBox.cjs.map +1 -1
  22. package/dist/cjs/components/InlineEmptyState/InlineEmptyState.cjs +42 -0
  23. package/dist/cjs/components/InlineEmptyState/InlineEmptyState.cjs.map +1 -0
  24. package/dist/cjs/components/Link/Link.cjs +30 -7
  25. package/dist/cjs/components/Link/Link.cjs.map +1 -1
  26. package/dist/cjs/components/Pill/Pill.cjs +1 -1
  27. package/dist/cjs/components/Pill/Pill.cjs.map +1 -1
  28. package/dist/cjs/components/SegmentedControl/SegmentedControl.cjs +6 -10
  29. package/dist/cjs/components/SegmentedControl/SegmentedControl.cjs.map +1 -1
  30. package/dist/cjs/components/SegmentedControl/segmentedControlClassNames.cjs +54 -0
  31. package/dist/cjs/components/SegmentedControl/segmentedControlClassNames.cjs.map +1 -0
  32. package/dist/cjs/components/Table/Table.cjs +31 -2
  33. package/dist/cjs/components/Table/Table.cjs.map +1 -1
  34. package/dist/cjs/components/Table/TableRowLink.cjs +55 -0
  35. package/dist/cjs/components/Table/TableRowLink.cjs.map +1 -0
  36. package/dist/cjs/index.cjs +10 -0
  37. package/dist/cjs/index.cjs.map +1 -1
  38. package/dist/components/Button/Button.mjs +12 -8
  39. package/dist/components/Button/Button.mjs.map +1 -1
  40. package/dist/components/Chart/ChartCard.mjs +4 -3
  41. package/dist/components/Chart/ChartCard.mjs.map +1 -1
  42. package/dist/components/Dialog/Dialog.mjs +29 -2
  43. package/dist/components/Dialog/Dialog.mjs.map +1 -1
  44. package/dist/components/Drawer/Drawer.mjs +72 -17
  45. package/dist/components/Drawer/Drawer.mjs.map +1 -1
  46. package/dist/components/DropdownMenu/DropdownMenuItem.mjs +26 -7
  47. package/dist/components/DropdownMenu/DropdownMenuItem.mjs.map +1 -1
  48. package/dist/components/IconButton/IconButton.mjs +11 -2
  49. package/dist/components/IconButton/IconButton.mjs.map +1 -1
  50. package/dist/components/Icons/DocumentIcon.mjs +57 -0
  51. package/dist/components/Icons/DocumentIcon.mjs.map +1 -0
  52. package/dist/components/Icons/EpisodesIcon.mjs +48 -0
  53. package/dist/components/Icons/EpisodesIcon.mjs.map +1 -0
  54. package/dist/components/Icons/ShortsIcon.mjs +57 -0
  55. package/dist/components/Icons/ShortsIcon.mjs.map +1 -0
  56. package/dist/components/InfoBox/InfoBox.mjs +1 -1
  57. package/dist/components/InfoBox/InfoBox.mjs.map +1 -1
  58. package/dist/components/InlineEmptyState/InlineEmptyState.mjs +25 -0
  59. package/dist/components/InlineEmptyState/InlineEmptyState.mjs.map +1 -0
  60. package/dist/components/Link/Link.mjs +31 -8
  61. package/dist/components/Link/Link.mjs.map +1 -1
  62. package/dist/components/Pill/Pill.mjs +1 -1
  63. package/dist/components/Pill/Pill.mjs.map +1 -1
  64. package/dist/components/SegmentedControl/SegmentedControl.mjs +6 -10
  65. package/dist/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
  66. package/dist/components/SegmentedControl/segmentedControlClassNames.mjs +54 -0
  67. package/dist/components/SegmentedControl/segmentedControlClassNames.mjs.map +1 -0
  68. package/dist/components/Table/Table.mjs +31 -2
  69. package/dist/components/Table/Table.mjs.map +1 -1
  70. package/dist/components/Table/TableRowLink.mjs +38 -0
  71. package/dist/components/Table/TableRowLink.mjs.map +1 -0
  72. package/dist/index.d.ts +204 -22
  73. package/dist/index.mjs +10 -0
  74. package/dist/index.mjs.map +1 -1
  75. package/dist/styles/base.css +157 -4
  76. package/dist/styles/theme.css +20 -12
  77. package/package.json +2 -2
@@ -9,6 +9,7 @@ const CloseIcon = require("../Icons/CloseIcon.cjs");
9
9
  const SearchIcon = require("../Icons/SearchIcon.cjs");
10
10
  const TranscationArrowIcon = require("../Icons/TranscationArrowIcon.cjs");
11
11
  const Tooltip = require("../Tooltip/Tooltip.cjs");
12
+ const TableRowLink = require("./TableRowLink.cjs");
12
13
  function _interopNamespaceDefault(e) {
13
14
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
14
15
  if (e) {
@@ -261,8 +262,35 @@ const TableFooter = React__namespace.forwardRef(
261
262
  );
262
263
  TableFooter.displayName = "TableFooter";
263
264
  const TableRow = React__namespace.forwardRef(
264
- ({ className, ...props }, ref) => {
265
- return /* @__PURE__ */ jsxRuntime.jsx("tr", { ref, className: cn.cn("[&:has([data-table-media])>td]:h-14", className), ...props });
265
+ ({ className, interactive = false, onClick, ...props }, ref) => {
266
+ const openingRowLink = React__namespace.useRef(false);
267
+ return /* @__PURE__ */ jsxRuntime.jsx(
268
+ "tr",
269
+ {
270
+ ref,
271
+ className: cn.cn(
272
+ "[&:has([data-table-media])>td]:h-14",
273
+ interactive && "cursor-pointer transition-colors duration-200 ease-in-out hover:bg-background-secondary has-[:focus-visible]:bg-background-secondary motion-reduce:transition-none",
274
+ className
275
+ ),
276
+ onClick: (event) => {
277
+ if (openingRowLink.current) {
278
+ event.stopPropagation();
279
+ return;
280
+ }
281
+ onClick?.(event);
282
+ if (interactive && !event.defaultPrevented) {
283
+ openingRowLink.current = true;
284
+ try {
285
+ TableRowLink.openTableRowLink(event);
286
+ } finally {
287
+ openingRowLink.current = false;
288
+ }
289
+ }
290
+ },
291
+ ...props
292
+ }
293
+ );
266
294
  }
267
295
  );
268
296
  TableRow.displayName = "TableRow";
@@ -296,6 +324,7 @@ const CELL_MIN_HEIGHT = {
296
324
  md: "h-10",
297
325
  default: "h-10",
298
326
  condensed: "h-10",
327
+ comfortable: "h-12",
299
328
  lg: "h-14"
300
329
  };
301
330
  const CELL_VARIANT_CLASSES = {
@@ -1 +1 @@
1
- {"version":3,"file":"Table.cjs","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"],"names":["React","jsx","cn","jsxs","SearchIcon","CloseIcon","TranscationArrowIcon","Button","TooltipProvider","Tooltip","TooltipTrigger","TooltipContent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,mBAAmBA,iBAAM,cAAyB,IAAI;AAE5D,SAAS,eAA0B;AACjC,SAAOA,iBAAM,WAAW,gBAAgB;AAC1C;AA8BO,MAAM,YAAYA,iBAAM;AAAA,EAC7B,CAAC,EAAE,WAAW,OAAO,MAAM,GAAG,MAAA,GAAS,QAAQ;AAC7C,WACEC,2BAAAA,IAAC,iBAAiB,UAAjB,EAA0B,OAAO,MAChC,UAAAA,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAWC,GAAAA;AAAAA,UACT;AAAA,UACA;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,MAAA;AAAA,IAAA,GAER;AAAA,EAEJ;AACF;AACA,UAAU,cAAc;AAoBjB,MAAM,eAAeF,iBAAM;AAAA,EAChC,CAAC,EAAE,WAAW,QAAQ,UAAU,GAAG,MAAA,GAAS,QAAQ;AAClD,WACEG,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAWD,GAAAA;AAAAA,UACT;AAAA,UACA;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAAD,2BAAAA,IAAC,OAAA,EAAI,WAAU,qCAAqC,UAAA,QAAO;AAAA,UAC1D,YAAY,QACXA,+BAAC,OAAA,EAAI,WAAU,wGACZ,SAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AACA,aAAa,cAAc;AAgBpB,MAAM,qBAAqBD,iBAAM;AAAA,EACtC,CAAC,EAAE,WAAW,OAAO,eAAe,YAAY,aAAa,GAAG,MAAA,GAAS,QAAQ;AAC/E,2CACG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UAAA;AAAA,UAAA;AAAA,UACA,aAAa,QAAQD,2BAAAA,IAAC,YAAA,EAAW,UAAA,CAAsB;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAG9D;AACF;AACA,eAAe,cAAc;AAetB,SAAS,iBAAiB,EAAE,OAAO,YAAmC;AAC3E,SAAOA,2BAAAA,IAAC,kBAAA,EAAiB,SAAS,OAAO,WAAW,UAAU;AAChE;AAEA,iBAAiB,cAAc;AAUxB,MAAM,iBAAiBD,iBAAM;AAAA,EAClC,CAAC,EAAE,WAAW,QAAQ,GAAG,GAAG,MAAA,GAAS,QAAQ;AAC3C,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAWC,GAAAA;AAAAA,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.cjs","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\";\nimport { openTableRowLink } from \"./TableRowLink\";\n\n/**\n * Row density for body cells.\n *\n * - `\"md\"` (default) → 40px rows, Figma `V2 Table Cell` Default.\n * - `\"condensed\"` → 40px rows, Figma `V2 Table Cell` Condensed.\n * - `\"comfortable\"` → 48px rows, for a 32px avatar with 8px above and below.\n * - `\"lg\"` → 56px rows; no longer in Figma, kept for back-compat.\n *\n * A row holding a {@link TableMediaThumbnail} (above 32px) or {@link TableMediaTile} is 56px at\n * any size.\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\" | \"comfortable\" | \"default\";\n\nexport interface TableCardProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Row density applied to {@link TableCell} descendants: 40px rows for `md`,\n * `default` and `condensed`, 48px for `comfortable`, 56px for `lg`.\n * @default \"md\"\n */\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 * Marks a body row that opens or expands into more content. The row shows a\n * pointer cursor and eases to `background-secondary` while hovered, or while\n * a control inside it has keyboard focus. The row itself is not focusable, so\n * its action must also be on a button or link inside it. With a\n * {@link TableRowLink} inside, a click anywhere on the row that is not on\n * another control opens that link.\n * @default false\n */\n interactive?: boolean;\n}\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 * Set `interactive` on rows that open or expand so they respond to hover.\n */\nexport const TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(\n ({ className, interactive = false, onClick, ...props }, ref) => {\n const openingRowLink = React.useRef(false);\n return (\n <tr\n ref={ref}\n className={cn(\n \"[&:has([data-table-media])>td]:h-14\",\n interactive &&\n \"cursor-pointer transition-colors duration-200 ease-in-out hover:bg-background-secondary has-[:focus-visible]:bg-background-secondary motion-reduce:transition-none\",\n className,\n )}\n onClick={(event) => {\n if (openingRowLink.current) {\n event.stopPropagation();\n return;\n }\n onClick?.(event);\n if (interactive && !event.defaultPrevented) {\n openingRowLink.current = true;\n try {\n openTableRowLink(event);\n } finally {\n openingRowLink.current = false;\n }\n }\n }}\n {...props}\n />\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 comfortable: \"h-12\",\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":["React","jsx","cn","jsxs","SearchIcon","CloseIcon","TranscationArrowIcon","Button","TooltipProvider","Tooltip","TooltipTrigger","TooltipContent","openTableRowLink"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAM,mBAAmBA,iBAAM,cAAyB,IAAI;AAE5D,SAAS,eAA0B;AACjC,SAAOA,iBAAM,WAAW,gBAAgB;AAC1C;AA8BO,MAAM,YAAYA,iBAAM;AAAA,EAC7B,CAAC,EAAE,WAAW,OAAO,MAAM,GAAG,MAAA,GAAS,QAAQ;AAC7C,WACEC,2BAAAA,IAAC,iBA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,QAED,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA;AAAA,UACA,aAAa,QAAQD,2BAAAA,IAAC,YAAA,EAAW,UAAA,CAAsB;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAG9D;AACF;AACA,eAAe,cAAc;AAetB,SAAS,iBAAiB,EAAE,OAAO,YAAmC;AAC3E,SAAOA,2BAAAA,IAAC,kBAAA,EAAiB,SAAS,OAAO,WAAW,UAAU;AAChE;AAEA,iBAAiB,cAAc;AAUxB,MAAM,iBAAiBD,iBAAM;AAAA,EAClC,CAAC,EAAE,WAAW,QAAQ,GAAG,GAAG,MAAA,GAAS,QAAQ;AAC3C,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAWC,GAAAA;AAAAA,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;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,55 @@
1
+ "use client";
2
+ "use strict";
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
+ const jsxRuntime = require("react/jsx-runtime");
5
+ const reactSlot = require("@radix-ui/react-slot");
6
+ const React = require("react");
7
+ const cn = require("../../utils/cn.cjs");
8
+ function _interopNamespaceDefault(e) {
9
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
10
+ if (e) {
11
+ for (const k in e) {
12
+ if (k !== "default") {
13
+ const d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: () => e[k]
17
+ });
18
+ }
19
+ }
20
+ }
21
+ n.default = e;
22
+ return Object.freeze(n);
23
+ }
24
+ const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
25
+ const ROW_CLICK_IGNORES = "a, button, summary, input, select, textarea, label, [contenteditable]:not([contenteditable='false']), [role='button'], [role='link'], [role='checkbox'], [role='radio'], [role='switch'], [role='slider'], [role='tab'], [role='combobox'], [role='option'], [role^='menu'], [data-table-row-click-ignore]";
26
+ function openTableRowLink(event) {
27
+ const row = event.currentTarget;
28
+ const target = event.target;
29
+ if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || target.closest("tr") !== row || target.closest(ROW_CLICK_IGNORES) || window.getSelection()?.isCollapsed === false) {
30
+ return;
31
+ }
32
+ const links = row.querySelectorAll("[data-table-row-link]");
33
+ Array.from(links).find((link) => link.closest("tr") === row)?.click();
34
+ }
35
+ const TableRowLink = React__namespace.forwardRef(
36
+ ({ asChild = false, className, ...props }, ref) => {
37
+ const Comp = asChild ? reactSlot.Slot : "a";
38
+ return /* @__PURE__ */ jsxRuntime.jsx(
39
+ Comp,
40
+ {
41
+ ref,
42
+ "data-table-row-link": "",
43
+ className: cn.cn(
44
+ "text-content-primary no-underline underline-offset-2 hover:underline focus-visible:shadow-focus-ring focus-visible:outline-hidden",
45
+ className
46
+ ),
47
+ ...props
48
+ }
49
+ );
50
+ }
51
+ );
52
+ TableRowLink.displayName = "TableRowLink";
53
+ exports.TableRowLink = TableRowLink;
54
+ exports.openTableRowLink = openTableRowLink;
55
+ //# sourceMappingURL=TableRowLink.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableRowLink.cjs","sources":["../../../../src/components/Table/TableRowLink.tsx"],"sourcesContent":["import { Slot } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\n\n/**\n * What a click on an interactive row leaves to the control it landed on. A\n * click on any of these, or on something portalled out of the row such as a\n * menu or dialog, does not open the row's link. `data-table-row-click-ignore`\n * opts out anything else, such as a custom control with no role of its own.\n */\nconst ROW_CLICK_IGNORES =\n \"a, button, summary, input, select, textarea, label, [contenteditable]:not([contenteditable='false']), [role='button'], [role='link'], [role='checkbox'], [role='radio'], [role='switch'], [role='slider'], [role='tab'], [role='combobox'], [role='option'], [role^='menu'], [data-table-row-click-ignore]\";\n\n/**\n * Opens the row's {@link TableRowLink} for a plain primary click that landed on\n * the row but not on a control of its own, nor on a row of a table nested in it.\n * A click with a modifier key is left alone: the forwarded click could not carry\n * the modifier, so it would open in this tab what the user asked for in a new one.\n * So is the click that ends a drag to select text.\n *\n * The link is looked up in the row's DOM when the click happens. A\n * `TableRowLink` portalled out of the row, or sitting in a table nested in it,\n * is not the row's link.\n */\nexport function openTableRowLink(event: React.MouseEvent<HTMLTableRowElement>) {\n const row = event.currentTarget;\n const target = event.target as Element;\n if (\n event.button !== 0 ||\n event.metaKey ||\n event.ctrlKey ||\n event.shiftKey ||\n event.altKey ||\n target.closest(\"tr\") !== row ||\n target.closest(ROW_CLICK_IGNORES) ||\n window.getSelection()?.isCollapsed === false\n ) {\n return;\n }\n const links = row.querySelectorAll<HTMLElement>(\"[data-table-row-link]\");\n Array.from(links)\n .find((link) => link.closest(\"tr\") === row)\n ?.click();\n}\n\nexport interface TableRowLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n /**\n * Merge props onto the child element instead of rendering an `<a>`. Use it\n * for a router link. The child must render an anchor.\n * @default false\n */\n asChild?: boolean;\n}\n\n/**\n * The link an interactive `TableRow` opens, usually the row's name. It is a real\n * link, so the keyboard and \"open in a new tab\" work as on any link, and it is\n * the row's one tab stop. A click anywhere else on the row, except on another\n * control, opens it too. A `TableRowLink` portalled out of the row, in a popover\n * or dialog, is an ordinary link and does not take over the row's click.\n *\n * @example\n * ```tsx\n * <TableRow interactive>\n * <TableCell>\n * <TableRowLink href=\"/campaigns/summer\">Summer launch</TableRowLink>\n * </TableCell>\n * <TableCell>1,204 clicks</TableCell>\n * </TableRow>\n * ```\n */\nexport const TableRowLink = React.forwardRef<HTMLAnchorElement, TableRowLinkProps>(\n ({ asChild = false, className, ...props }, ref) => {\n const Comp = asChild ? Slot : \"a\";\n return (\n <Comp\n ref={ref}\n data-table-row-link=\"\"\n className={cn(\n \"text-content-primary no-underline underline-offset-2 hover:underline focus-visible:shadow-focus-ring focus-visible:outline-hidden\",\n className,\n )}\n {...props}\n />\n );\n },\n);\nTableRowLink.displayName = \"TableRowLink\";\n"],"names":["React","Slot","jsx","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAUA,MAAM,oBACJ;AAaK,SAAS,iBAAiB,OAA8C;AAC7E,QAAM,MAAM,MAAM;AAClB,QAAM,SAAS,MAAM;AACrB,MACE,MAAM,WAAW,KACjB,MAAM,WACN,MAAM,WACN,MAAM,YACN,MAAM,UACN,OAAO,QAAQ,IAAI,MAAM,OACzB,OAAO,QAAQ,iBAAiB,KAChC,OAAO,gBAAgB,gBAAgB,OACvC;AACA;AAAA,EACF;AACA,QAAM,QAAQ,IAAI,iBAA8B,uBAAuB;AACvE,QAAM,KAAK,KAAK,EACb,KAAK,CAAC,SAAS,KAAK,QAAQ,IAAI,MAAM,GAAG,GACxC,MAAA;AACN;AA4BO,MAAM,eAAeA,iBAAM;AAAA,EAChC,CAAC,EAAE,UAAU,OAAO,WAAW,GAAG,MAAA,GAAS,QAAQ;AACjD,UAAM,OAAO,UAAUC,UAAAA,OAAO;AAC9B,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,uBAAoB;AAAA,QACpB,WAAWC,GAAAA;AAAAA,UACT;AAAA,UACA;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AACA,aAAa,cAAc;;;"}
@@ -97,11 +97,13 @@ const DenseGridViewIcon = require("./components/Icons/DenseGridViewIcon.cjs");
97
97
  const DiamondIcon = require("./components/Icons/DiamondIcon.cjs");
98
98
  const DiscordIcon = require("./components/Icons/DiscordIcon.cjs");
99
99
  const DiscountIcon = require("./components/Icons/DiscountIcon.cjs");
100
+ const DocumentIcon = require("./components/Icons/DocumentIcon.cjs");
100
101
  const DonateIcon = require("./components/Icons/DonateIcon.cjs");
101
102
  const DoubleTickIcon = require("./components/Icons/DoubleTickIcon.cjs");
102
103
  const DownloadIcon = require("./components/Icons/DownloadIcon.cjs");
103
104
  const EditIcon = require("./components/Icons/EditIcon.cjs");
104
105
  const EmojiIcon = require("./components/Icons/EmojiIcon.cjs");
106
+ const EpisodesIcon = require("./components/Icons/EpisodesIcon.cjs");
105
107
  const ErrorCircleIcon = require("./components/Icons/ErrorCircleIcon.cjs");
106
108
  const ErrorIcon = require("./components/Icons/ErrorIcon.cjs");
107
109
  const ExclamationMarkIcon = require("./components/Icons/ExclamationMarkIcon.cjs");
@@ -178,6 +180,7 @@ const SearchIcon = require("./components/Icons/SearchIcon.cjs");
178
180
  const SendIcon = require("./components/Icons/SendIcon.cjs");
179
181
  const SettingsIcon = require("./components/Icons/SettingsIcon.cjs");
180
182
  const ShareIcon = require("./components/Icons/ShareIcon.cjs");
183
+ const ShortsIcon = require("./components/Icons/ShortsIcon.cjs");
181
184
  const SoundIcon = require("./components/Icons/SoundIcon.cjs");
182
185
  const SpinnerIcon = require("./components/Icons/SpinnerIcon.cjs");
183
186
  const StarIcon = require("./components/Icons/StarIcon.cjs");
@@ -223,6 +226,7 @@ const WifiOnIcon = require("./components/Icons/WifiOnIcon.cjs");
223
226
  const WrenchIcon = require("./components/Icons/WrenchIcon.cjs");
224
227
  const InfoBox = require("./components/InfoBox/InfoBox.cjs");
225
228
  const InlineEdit = require("./components/InlineEdit/InlineEdit.cjs");
229
+ const InlineEmptyState = require("./components/InlineEmptyState/InlineEmptyState.cjs");
226
230
  const Link = require("./components/Link/Link.cjs");
227
231
  const LiveStatus = require("./components/LiveStatus/LiveStatus.cjs");
228
232
  const Loader = require("./components/Loader/Loader.cjs");
@@ -261,6 +265,7 @@ const SwitchToggle = require("./components/SwitchToggle/SwitchToggle.cjs");
261
265
  const Table = require("./components/Table/Table.cjs");
262
266
  const TableMobileRow = require("./components/Table/TableMobileRow.cjs");
263
267
  const TablePagination = require("./components/Table/TablePagination.cjs");
268
+ const TableRowLink = require("./components/Table/TableRowLink.cjs");
264
269
  const Tabs = require("./components/Tabs/Tabs.cjs");
265
270
  const TabsContent = require("./components/Tabs/TabsContent.cjs");
266
271
  const TabsList = require("./components/Tabs/TabsList.cjs");
@@ -425,11 +430,13 @@ exports.DenseGridViewIcon = DenseGridViewIcon.DenseGridViewIcon;
425
430
  exports.DiamondIcon = DiamondIcon.DiamondIcon;
426
431
  exports.DiscordIcon = DiscordIcon.DiscordIcon;
427
432
  exports.DiscountIcon = DiscountIcon.DiscountIcon;
433
+ exports.DocumentIcon = DocumentIcon.DocumentIcon;
428
434
  exports.DonateIcon = DonateIcon.DonateIcon;
429
435
  exports.DoubleTickIcon = DoubleTickIcon.DoubleTickIcon;
430
436
  exports.DownloadIcon = DownloadIcon.DownloadIcon;
431
437
  exports.EditIcon = EditIcon.EditIcon;
432
438
  exports.EmojiIcon = EmojiIcon.EmojiIcon;
439
+ exports.EpisodesIcon = EpisodesIcon.EpisodesIcon;
433
440
  exports.ErrorCircleIcon = ErrorCircleIcon.ErrorCircleIcon;
434
441
  exports.ErrorIcon = ErrorIcon.ErrorIcon;
435
442
  exports.ExclamationMarkIcon = ExclamationMarkIcon.ExclamationMarkIcon;
@@ -506,6 +513,7 @@ exports.SearchIcon = SearchIcon.SearchIcon;
506
513
  exports.SendIcon = SendIcon.SendIcon;
507
514
  exports.SettingsIcon = SettingsIcon.SettingsIcon;
508
515
  exports.ShareIcon = ShareIcon.ShareIcon;
516
+ exports.ShortsIcon = ShortsIcon.ShortsIcon;
509
517
  exports.SoundIcon = SoundIcon.SoundIcon;
510
518
  exports.SpinnerIcon = SpinnerIcon.SpinnerIcon;
511
519
  exports.StarIcon = StarIcon.StarIcon;
@@ -553,6 +561,7 @@ exports.InfoBox = InfoBox.InfoBox;
553
561
  exports.InfoBoxContent = InfoBox.InfoBoxContent;
554
562
  exports.InfoBoxTrigger = InfoBox.InfoBoxTrigger;
555
563
  exports.InlineEdit = InlineEdit.InlineEdit;
564
+ exports.InlineEmptyState = InlineEmptyState.InlineEmptyState;
556
565
  exports.Link = Link.Link;
557
566
  exports.LiveStatus = LiveStatus.LiveStatus;
558
567
  exports.Loader = Loader.Loader;
@@ -621,6 +630,7 @@ exports.TableToolbarSearch = Table.TableToolbarSearch;
621
630
  exports.TableTruncatedText = Table.TableTruncatedText;
622
631
  exports.TableMobileRow = TableMobileRow.TableMobileRow;
623
632
  exports.TableCardPagination = TablePagination.TableCardPagination;
633
+ exports.TableRowLink = TableRowLink.TableRowLink;
624
634
  exports.Tabs = Tabs.Tabs;
625
635
  exports.TabsContent = TabsContent.TabsContent;
626
636
  exports.TabsList = TabsList.TabsList;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -9,13 +9,14 @@ const NEGATIVE_AWARE_VARIANTS = /* @__PURE__ */ new Set([
9
9
  "primary",
10
10
  "secondary",
11
11
  "tertiary",
12
- "outline"
12
+ "outline",
13
+ "brand"
13
14
  ]);
14
15
  const SIZE_CLASSES = {
15
- "48": "h-12 px-6 py-3 typography-body-default-16px-semibold",
16
- "40": "h-10 px-4 py-2 typography-body-default-16px-semibold",
17
- "32": "h-8 px-3 py-[7px] typography-body-small-14px-semibold",
18
- "24": "h-6 px-2 py-1 typography-body-small-14px-semibold"
16
+ "48": "h-12 rounded-full px-6 py-3 typography-body-default-16px-semibold",
17
+ "40": "h-10 rounded-full px-4 py-2 typography-body-default-16px-semibold",
18
+ "32": "h-8 rounded-full px-3 py-[7px] typography-body-small-14px-semibold",
19
+ "24": "h-6 rounded-xs px-2 py-1 typography-description-12px-semibold"
19
20
  };
20
21
  const ICON_SIDE_PADDING_CLASSES = {
21
22
  "48": { left: "pl-5", right: "pr-5" },
@@ -38,6 +39,7 @@ const ICON_WRAPPER_CLASS = {
38
39
  const AI_GRADIENT = "[background-clip:padding-box,border-box] [background-image:linear-gradient(var(--color-buttons-ai-default),var(--color-buttons-ai-default)),linear-gradient(50deg,var(--color-buttons-ai-stroke-start)_11.87%,var(--color-buttons-ai-stroke-end)_112.39%)] [background-origin:border-box] hover:[background-image:linear-gradient(var(--color-buttons-ai-hover),var(--color-buttons-ai-hover)),linear-gradient(50deg,var(--color-buttons-ai-stroke-start)_11.87%,var(--color-buttons-ai-stroke-end)_112.39%)]";
39
40
  const DISABLED_FILL = "bg-buttons-disabled-default text-content-disabled";
40
41
  const DISABLED_FILL_NEGATIVE = "bg-buttons-disabled-negative text-content-disabled";
42
+ const BRAND_UPSELL = "fv-upsell fv-upsell-shine bg-buttons-brand-default text-content-always-black hover:[--fv-upsell-end:var(--color-buttons-brand-hover)] active:[--fv-upsell-end:var(--color-buttons-brand-hover)]";
41
43
  const DISABLED_TRANSPARENT = "bg-transparent text-content-disabled";
42
44
  const VARIANT_CLASSES = {
43
45
  primary: {
@@ -65,8 +67,10 @@ const VARIANT_CLASSES = {
65
67
  negativeDisabled: "border border-buttons-disabled-negative bg-transparent text-content-disabled"
66
68
  },
67
69
  brand: {
68
- default: "bg-buttons-brand-default text-content-always-black hover:bg-buttons-brand-hover hover:text-content-always-black active:bg-buttons-brand-hover active:text-content-always-black",
69
- disabled: DISABLED_FILL
70
+ default: BRAND_UPSELL,
71
+ negative: `${BRAND_UPSELL} fv-upsell-negative`,
72
+ disabled: DISABLED_FILL,
73
+ negativeDisabled: DISABLED_FILL_NEGATIVE
70
74
  },
71
75
  destructive: {
72
76
  default: "bg-buttons-error-default text-content-always-white hover:bg-buttons-error-hover hover:text-content-always-white active:bg-buttons-error-hover active:text-content-always-white",
@@ -226,7 +230,7 @@ const Button = React.forwardRef(
226
230
  "aria-busy": loading,
227
231
  ...loadingLabelProps,
228
232
  className: cn(
229
- "inline-flex min-w-0 cursor-pointer items-center gap-2 whitespace-nowrap rounded-full transition-colors",
233
+ "inline-flex min-w-0 cursor-pointer items-center gap-2 whitespace-nowrap transition-colors",
230
234
  "focus-visible:shadow-focus-ring focus-visible:outline-none",
231
235
  isInteractionDisabled && "pointer-events-none cursor-not-allowed",
232
236
  `${price ? "justify-between" : "justify-center"}`,
@@ -1 +1 @@
1
- {"version":3,"file":"Button.mjs","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import { Slot } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { AIIcon } from \"../Icons/AIIcon\";\nimport { SpinnerIcon } from \"../Icons/SpinnerIcon\";\n\n/** Visual style variant of the button. */\nexport type ButtonVariant =\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"outline\"\n | \"link\"\n | \"brand\"\n | \"destructive\"\n | \"white\"\n | \"alwaysBlack\"\n | \"ai\"\n | \"tertiaryDestructive\"\n | \"text\";\n\n/** Button height in pixels. */\nexport type ButtonSize = \"48\" | \"40\" | \"32\" | \"24\";\n\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** Visual style variant of the button. @default \"primary\" */\n variant?: ButtonVariant;\n /** Height of the button in pixels. @default \"40\" */\n size?: ButtonSize;\n /**\n * Forces the dark-surface treatment regardless of theme. Only honored on\n * `primary`, `secondary`, `tertiary`, and `outline` variants; ignored on\n * all others. Use when placing the button on a dark background in a light\n * theme (e.g. an inverted hero or modal).\n * @default false\n */\n negative?: boolean;\n /** Icon element displayed before the label. */\n leftIcon?: React.ReactNode;\n /** Icon element displayed after the label. */\n rightIcon?: React.ReactNode;\n /** When `true`, replaces the label with a spinner and disables interaction. @default false */\n loading?: boolean;\n /** Merge props onto a child element instead of rendering a `<button>`. @default false */\n asChild?: boolean;\n /** Old price shown with a strikethrough before the current price. */\n discount?: string;\n /** Current price shown inside the button after the label and icons. */\n price?: string;\n /** When `true`, the button will take the full width of its container. @default false */\n fullWidth?: boolean;\n}\n\nconst NEGATIVE_AWARE_VARIANTS = new Set<ButtonVariant>([\n \"primary\",\n \"secondary\",\n \"tertiary\",\n \"outline\",\n]);\n\nconst SIZE_CLASSES: Record<ButtonSize, string> = {\n \"48\": \"h-12 px-6 py-3 typography-body-default-16px-semibold\",\n \"40\": \"h-10 px-4 py-2 typography-body-default-16px-semibold\",\n \"32\": \"h-8 px-3 py-[7px] typography-body-small-14px-semibold\",\n \"24\": \"h-6 px-2 py-1 typography-body-small-14px-semibold\",\n};\n\nconst ICON_SIDE_PADDING_CLASSES: Record<ButtonSize, { left: string; right: string }> = {\n \"48\": { left: \"pl-5\", right: \"pr-5\" },\n \"40\": { left: \"pl-3\", right: \"pr-3\" },\n \"32\": { left: \"pl-2\", right: \"pr-2\" },\n \"24\": { left: \"pl-1\", right: \"pr-1\" },\n};\n\nconst ICON_SIZE_CLASS: Record<ButtonSize, string> = {\n \"48\": \"size-5\",\n \"40\": \"size-5\",\n \"32\": \"size-4\",\n \"24\": \"size-3.5\",\n};\n\n/** Targets only direct SVG children so non-icon content (e.g. Pill) can size naturally. */\nconst ICON_WRAPPER_CLASS: Record<ButtonSize, string> = {\n \"48\": \"[&>svg]:size-5\",\n \"40\": \"[&>svg]:size-5\",\n \"32\": \"[&>svg]:size-4\",\n \"24\": \"[&>svg]:size-3.5\",\n};\n\n/**\n * AI variant paints a flat fill over a fixed-angle gradient stroke. The fill is written\n * as a two-stop gradient of one colour because the border-box/padding-box clip trick\n * that draws the stroke requires both layers to be background images.\n */\nconst AI_GRADIENT =\n \"[background-clip:padding-box,border-box] [background-image:linear-gradient(var(--color-buttons-ai-default),var(--color-buttons-ai-default)),linear-gradient(50deg,var(--color-buttons-ai-stroke-start)_11.87%,var(--color-buttons-ai-stroke-end)_112.39%)] [background-origin:border-box] hover:[background-image:linear-gradient(var(--color-buttons-ai-hover),var(--color-buttons-ai-hover)),linear-gradient(50deg,var(--color-buttons-ai-stroke-start)_11.87%,var(--color-buttons-ai-stroke-end)_112.39%)]\";\n\nconst DISABLED_FILL = \"bg-buttons-disabled-default text-content-disabled\";\nconst DISABLED_FILL_NEGATIVE = \"bg-buttons-disabled-negative text-content-disabled\";\nconst DISABLED_TRANSPARENT = \"bg-transparent text-content-disabled\";\n\n/**\n * Class strings for each `ButtonVariant`, indexed by `negative` and `disabled`\n * state. `negative` and `negativeDisabled` are only honored when the variant\n * is in `NEGATIVE_AWARE_VARIANTS` — other variants fall back to the default /\n * disabled entries regardless of the `negative` prop.\n */\ntype VariantClasses = {\n default: string;\n disabled: string;\n negative?: string;\n negativeDisabled?: string;\n};\n\nconst VARIANT_CLASSES: Record<ButtonVariant, VariantClasses> = {\n primary: {\n default:\n \"bg-buttons-primary-default text-content-primary-inverted hover:bg-buttons-primary-hover hover:text-content-primary-inverted active:bg-buttons-primary-hover active:text-content-primary-inverted\",\n disabled: DISABLED_FILL,\n negative:\n \"bg-buttons-primary-negative-default text-content-primary hover:bg-buttons-primary-negative-hover active:bg-buttons-primary-negative-hover\",\n negativeDisabled: DISABLED_FILL_NEGATIVE,\n },\n secondary: {\n default:\n \"bg-buttons-secondary-default text-content-primary hover:bg-buttons-secondary-hover active:bg-buttons-secondary-hover\",\n disabled: DISABLED_FILL,\n negative:\n \"bg-buttons-secondary-negative-default text-content-primary-inverted hover:bg-buttons-secondary-negative-hover active:bg-buttons-secondary-negative-hover\",\n negativeDisabled: DISABLED_FILL_NEGATIVE,\n },\n tertiary: {\n default:\n \"bg-transparent text-content-primary hover:bg-buttons-tertiary-hover active:bg-buttons-tertiary-hover\",\n disabled: DISABLED_TRANSPARENT,\n negative:\n \"bg-transparent text-content-primary-inverted hover:bg-buttons-tertiary-negative-hover active:bg-buttons-tertiary-negative-hover\",\n negativeDisabled: DISABLED_TRANSPARENT,\n },\n outline: {\n default:\n \"border border-buttons-outline-default bg-transparent text-content-primary hover:bg-buttons-outline-hover active:bg-buttons-outline-hover\",\n disabled: \"border border-buttons-disabled-default bg-transparent text-content-disabled\",\n negative:\n \"border border-buttons-outline-negative-default bg-transparent text-content-primary-inverted hover:bg-buttons-outline-negative-hover active:bg-buttons-outline-negative-hover\",\n negativeDisabled:\n \"border border-buttons-disabled-negative bg-transparent text-content-disabled\",\n },\n brand: {\n default:\n \"bg-buttons-brand-default text-content-always-black hover:bg-buttons-brand-hover hover:text-content-always-black active:bg-buttons-brand-hover active:text-content-always-black\",\n disabled: DISABLED_FILL,\n },\n destructive: {\n default:\n \"bg-buttons-error-default text-content-always-white hover:bg-buttons-error-hover hover:text-content-always-white active:bg-buttons-error-hover active:text-content-always-white\",\n disabled: DISABLED_FILL,\n },\n white: {\n default:\n \"bg-buttons-always-white-default text-content-always-black hover:bg-buttons-always-white-hover hover:text-content-always-black active:bg-buttons-always-white-hover active:text-content-always-black\",\n disabled: DISABLED_FILL,\n },\n alwaysBlack: {\n default:\n \"bg-buttons-always-black-default text-content-always-white hover:bg-buttons-always-black-hover hover:text-content-always-white active:bg-buttons-always-black-hover active:text-content-always-white\",\n disabled: DISABLED_FILL,\n },\n ai: {\n default: `border border-transparent text-content-primary shadow-ai-button-glow ${AI_GRADIENT}`,\n disabled: DISABLED_FILL,\n },\n link: {\n default:\n \"bg-transparent text-content-primary underline decoration-solid hover:bg-buttons-tertiary-hover active:bg-buttons-tertiary-hover\",\n disabled: \"bg-transparent text-content-primary underline decoration-solid opacity-50\",\n },\n tertiaryDestructive: {\n default: \"bg-transparent text-error-content hover:bg-error-surface active:bg-error-surface\",\n disabled: \"bg-transparent text-error-content opacity-50\",\n },\n text: {\n default: \"bg-transparent text-content-primary hover:underline active:underline\",\n disabled: \"bg-transparent text-content-primary opacity-50\",\n },\n};\n\nfunction getVariantClasses(variant: ButtonVariant, negative: boolean, disabled: boolean): string {\n const spec = VARIANT_CLASSES[variant];\n const isNegative = NEGATIVE_AWARE_VARIANTS.has(variant) && negative;\n if (disabled) return (isNegative && spec.negativeDisabled) || spec.disabled;\n return (isNegative && spec.negative) || spec.default;\n}\n\nfunction getIconPaddingClasses(\n size: ButtonSize,\n hasLeftIcon: boolean,\n hasRightIcon: boolean,\n): string | undefined {\n const padding = ICON_SIDE_PADDING_CLASSES[size];\n return cn(hasLeftIcon && padding.left, hasRightIcon && padding.right);\n}\n\n/** Recursively extract text content from React nodes for accessible labels */\nfunction getTextContent(node: React.ReactNode): string | undefined {\n if (typeof node === \"string\") return node;\n if (typeof node === \"number\") return String(node);\n if (React.isValidElement(node)) {\n return getTextContent((node.props as { children?: React.ReactNode }).children);\n }\n if (Array.isArray(node)) {\n const text = node.map(getTextContent).filter(Boolean).join(\"\");\n return text || undefined;\n }\n return undefined;\n}\n\nconst LoadingSpinner = ({ size }: { size: ButtonSize }) => {\n return (\n <span aria-hidden=\"true\">\n <SpinnerIcon spin className={ICON_SIZE_CLASS[size]}>\n <title>Loading</title>\n </SpinnerIcon>\n </span>\n );\n};\n\nfunction renderContent({\n loading,\n asChild,\n children,\n size,\n leftIcon,\n rightIcon,\n iconSizeClass,\n discount,\n price,\n}: {\n loading: boolean;\n asChild: boolean;\n children: React.ReactNode;\n size: ButtonSize;\n leftIcon: React.ReactNode;\n rightIcon: React.ReactNode;\n iconSizeClass: string;\n discount?: string;\n price?: string;\n fullWidth?: boolean;\n}) {\n if (loading) {\n if (asChild && React.isValidElement(children)) {\n return React.cloneElement(\n children as React.ReactElement<{ children?: React.ReactNode }>,\n undefined,\n <LoadingSpinner size={size} />,\n );\n }\n return (\n <>\n <LoadingSpinner size={size} />\n <span className=\"sr-only\">{children}</span>\n </>\n );\n }\n\n if (asChild) return children;\n\n return (\n <>\n {leftIcon && (\n <span\n className={cn(\"flex shrink-0 items-center justify-center\", iconSizeClass)}\n aria-hidden=\"true\"\n >\n {leftIcon}\n </span>\n )}\n {React.Children.map(children, (child) =>\n typeof child === \"string\" ? (\n child.trim() ? (\n <span className=\"min-w-0 truncate\">{child}</span>\n ) : null\n ) : typeof child === \"number\" ? (\n <span className=\"min-w-0 truncate\">{child}</span>\n ) : (\n child\n ),\n )}\n {rightIcon && (\n <span\n className={cn(\"flex shrink-0 items-center justify-center\", iconSizeClass)}\n aria-hidden=\"true\"\n >\n {rightIcon}\n </span>\n )}\n {(price || discount) && (\n <div>\n {discount && (\n <span className=\"typography-body-default-16px-regular line-through\" aria-hidden=\"true\">\n {discount}\n </span>\n )}\n {price && (\n <span className=\"ml-2\" aria-hidden=\"true\">\n {price}\n </span>\n )}\n </div>\n )}\n </>\n );\n}\n\n/**\n * A versatile button component with multiple visual variants, sizes, icon\n * slots, loading state, and optional pricing display.\n *\n * Pass `negative` when rendering on a dark surface to opt into the inverted\n * treatment for `primary`, `secondary`, `tertiary`, and `outline` variants.\n *\n * The `ai` variant ships with the AI sparkle icon baked in (locked at 16px\n * regardless of button size); pass `leftIcon` to override the default sparkle.\n *\n * @example\n * ```tsx\n * <Button variant=\"primary\" size=\"40\" leftIcon={<StarIcon />}>\n * Continue\n * </Button>\n * ```\n */\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant = \"primary\",\n size = \"40\",\n negative = false,\n leftIcon,\n rightIcon,\n loading = false,\n asChild = false,\n disabled,\n children,\n discount,\n price,\n fullWidth = false,\n ...props\n },\n ref,\n ) => {\n const Comp = asChild ? Slot : \"button\";\n const isDisabled = Boolean(disabled);\n const isInteractionDisabled = isDisabled || loading;\n const iconSizeClass = variant === \"ai\" ? \"[&>svg]:size-4\" : ICON_WRAPPER_CLASS[size];\n const effectiveLeftIcon = leftIcon ?? (variant === \"ai\" ? <AIIcon filled /> : undefined);\n const iconPaddingClasses = getIconPaddingClasses(\n size,\n Boolean(effectiveLeftIcon),\n Boolean(rightIcon),\n );\n\n const buttonSpecificProps = !asChild\n ? {\n type: \"button\" as const,\n \"data-testid\": \"button\",\n disabled: isInteractionDisabled,\n }\n : isInteractionDisabled\n ? { \"aria-disabled\": true }\n : {};\n\n const loadingLabelProps = loading && asChild ? { \"aria-label\": getTextContent(children) } : {};\n\n const content = renderContent({\n loading,\n asChild,\n children,\n size,\n leftIcon: effectiveLeftIcon,\n rightIcon,\n iconSizeClass,\n discount,\n price,\n });\n\n return (\n <Comp\n ref={ref}\n {...buttonSpecificProps}\n aria-busy={loading}\n {...loadingLabelProps}\n className={cn(\n \"inline-flex min-w-0 cursor-pointer items-center gap-2 whitespace-nowrap rounded-full transition-colors\",\n \"focus-visible:shadow-focus-ring focus-visible:outline-none\",\n isInteractionDisabled && \"pointer-events-none cursor-not-allowed\",\n `${price ? \"justify-between\" : \"justify-center\"}`,\n fullWidth && \"w-full\",\n SIZE_CLASSES[size],\n iconPaddingClasses,\n getVariantClasses(variant, negative, isDisabled),\n className,\n )}\n {...props}\n >\n {content}\n </Comp>\n );\n },\n);\n\nButton.displayName = \"Button\";\n"],"names":[],"mappings":";;;;;;;AAqDA,MAAM,8CAA8B,IAAmB;AAAA,EACrD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,MAAM,eAA2C;AAAA,EAC/C,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,4BAAiF;AAAA,EACrF,MAAM,EAAE,MAAM,QAAQ,OAAO,OAAA;AAAA,EAC7B,MAAM,EAAE,MAAM,QAAQ,OAAO,OAAA;AAAA,EAC7B,MAAM,EAAE,MAAM,QAAQ,OAAO,OAAA;AAAA,EAC7B,MAAM,EAAE,MAAM,QAAQ,OAAO,OAAA;AAC/B;AAEA,MAAM,kBAA8C;AAAA,EAClD,MAAM;AAAA,EACN,MAAM;AAA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AgB,YAAY,OAAO,mBAAmB,mBAAmB,IAAI;AACnF,UAAM,oBAAoB,aAAa,YAAY,2BAAQ,QAAA,EAAO,QAAM,MAAC,IAAK;AAC9E,UAAM,qBAAqB;AAAA,MACzB;AAAA,MACA,QAAQ,iBAAiB;AAAA,MACzB,QAAQ,SAAS;AAAA,IAAA;AAGnB,UAAM,sBAAsB,CAAC,UACzB;AAAA,MACE,MAAM;AAAA,MACN,eAAe;AAAA,MACf,UAAU;AAAA,IAAA,IAEZ,wBACE,EAAE,iBAAiB,KAAA,IACnB,CAAA;AAEN,UAAM,oBAAoB,WAAW,UAAU,EAAE,cAAc,eAAe,QAAQ,EAAA,IAAM,CAAA;AAE5F,UAAM,UAAU,cAAc;AAAA,MAC5B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA,CACD;AAED,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACC,GAAG;AAAA,QACJ,aAAW;AAAA,QACV,GAAG;AAAA,QACJ,WAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA,yBAAyB;AAAA,UACzB,GAAG,QAAQ,oBAAoB,gBAAgB;AAAA,UAC/C,aAAa;AAAA,UACb,aAAa,IAAI;AAAA,UACjB;AAAA,UACA,kBAAkB,SAAS,UAAU,UAAU;AAAA,UAC/C;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,QAEH,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,OAAO,cAAc;"}
1
+ {"version":3,"file":"Button.mjs","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import { Slot } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { AIIcon } from \"../Icons/AIIcon\";\nimport { SpinnerIcon } from \"../Icons/SpinnerIcon\";\n\n/** Visual style variant of the button. */\nexport type ButtonVariant =\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"outline\"\n | \"link\"\n | \"brand\"\n | \"destructive\"\n | \"white\"\n | \"alwaysBlack\"\n | \"ai\"\n | \"tertiaryDestructive\"\n | \"text\";\n\n/** Button height in pixels. */\nexport type ButtonSize = \"48\" | \"40\" | \"32\" | \"24\";\n\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** Visual style variant of the button. @default \"primary\" */\n variant?: ButtonVariant;\n /** Height of the button in pixels. @default \"40\" */\n size?: ButtonSize;\n /**\n * Forces the dark-surface treatment regardless of theme. Only honored on\n * `primary`, `secondary`, `tertiary`, and `outline` variants; ignored on\n * all others. Use when placing the button on a dark background in a light\n * theme (e.g. an inverted hero or modal).\n * @default false\n */\n negative?: boolean;\n /** Icon element displayed before the label. */\n leftIcon?: React.ReactNode;\n /** Icon element displayed after the label. */\n rightIcon?: React.ReactNode;\n /** When `true`, replaces the label with a spinner and disables interaction. @default false */\n loading?: boolean;\n /** Merge props onto a child element instead of rendering a `<button>`. @default false */\n asChild?: boolean;\n /** Old price shown with a strikethrough before the current price. */\n discount?: string;\n /** Current price shown inside the button after the label and icons. */\n price?: string;\n /** When `true`, the button will take the full width of its container. @default false */\n fullWidth?: boolean;\n}\n\nconst NEGATIVE_AWARE_VARIANTS = new Set<ButtonVariant>([\n \"primary\",\n \"secondary\",\n \"tertiary\",\n \"outline\",\n \"brand\",\n]);\n\n/** The `24` size is squared (`rounded-xs`) with 12px text, matching Figma; every larger size is a pill. */\nconst SIZE_CLASSES: Record<ButtonSize, string> = {\n \"48\": \"h-12 rounded-full px-6 py-3 typography-body-default-16px-semibold\",\n \"40\": \"h-10 rounded-full px-4 py-2 typography-body-default-16px-semibold\",\n \"32\": \"h-8 rounded-full px-3 py-[7px] typography-body-small-14px-semibold\",\n \"24\": \"h-6 rounded-xs px-2 py-1 typography-description-12px-semibold\",\n};\n\nconst ICON_SIDE_PADDING_CLASSES: Record<ButtonSize, { left: string; right: string }> = {\n \"48\": { left: \"pl-5\", right: \"pr-5\" },\n \"40\": { left: \"pl-3\", right: \"pr-3\" },\n \"32\": { left: \"pl-2\", right: \"pr-2\" },\n \"24\": { left: \"pl-1\", right: \"pr-1\" },\n};\n\nconst ICON_SIZE_CLASS: Record<ButtonSize, string> = {\n \"48\": \"size-5\",\n \"40\": \"size-5\",\n \"32\": \"size-4\",\n \"24\": \"size-3.5\",\n};\n\n/** Targets only direct SVG children so non-icon content (e.g. Pill) can size naturally. */\nconst ICON_WRAPPER_CLASS: Record<ButtonSize, string> = {\n \"48\": \"[&>svg]:size-5\",\n \"40\": \"[&>svg]:size-5\",\n \"32\": \"[&>svg]:size-4\",\n \"24\": \"[&>svg]:size-3.5\",\n};\n\n/**\n * AI variant paints a flat fill over a fixed-angle gradient stroke. The fill is written\n * as a two-stop gradient of one colour because the border-box/padding-box clip trick\n * that draws the stroke requires both layers to be background images.\n */\nconst AI_GRADIENT =\n \"[background-clip:padding-box,border-box] [background-image:linear-gradient(var(--color-buttons-ai-default),var(--color-buttons-ai-default)),linear-gradient(50deg,var(--color-buttons-ai-stroke-start)_11.87%,var(--color-buttons-ai-stroke-end)_112.39%)] [background-origin:border-box] hover:[background-image:linear-gradient(var(--color-buttons-ai-hover),var(--color-buttons-ai-hover)),linear-gradient(50deg,var(--color-buttons-ai-stroke-start)_11.87%,var(--color-buttons-ai-stroke-end)_112.39%)]\";\n\nconst DISABLED_FILL = \"bg-buttons-disabled-default text-content-disabled\";\nconst DISABLED_FILL_NEGATIVE = \"bg-buttons-disabled-negative text-content-disabled\";\nconst BRAND_UPSELL =\n \"fv-upsell fv-upsell-shine bg-buttons-brand-default text-content-always-black hover:[--fv-upsell-end:var(--color-buttons-brand-hover)] active:[--fv-upsell-end:var(--color-buttons-brand-hover)]\";\nconst DISABLED_TRANSPARENT = \"bg-transparent text-content-disabled\";\n\n/**\n * Class strings for each `ButtonVariant`, indexed by `negative` and `disabled`\n * state. `negative` and `negativeDisabled` are only honored when the variant\n * is in `NEGATIVE_AWARE_VARIANTS` — other variants fall back to the default /\n * disabled entries regardless of the `negative` prop.\n */\ntype VariantClasses = {\n default: string;\n disabled: string;\n negative?: string;\n negativeDisabled?: string;\n};\n\nconst VARIANT_CLASSES: Record<ButtonVariant, VariantClasses> = {\n primary: {\n default:\n \"bg-buttons-primary-default text-content-primary-inverted hover:bg-buttons-primary-hover hover:text-content-primary-inverted active:bg-buttons-primary-hover active:text-content-primary-inverted\",\n disabled: DISABLED_FILL,\n negative:\n \"bg-buttons-primary-negative-default text-content-primary hover:bg-buttons-primary-negative-hover active:bg-buttons-primary-negative-hover\",\n negativeDisabled: DISABLED_FILL_NEGATIVE,\n },\n secondary: {\n default:\n \"bg-buttons-secondary-default text-content-primary hover:bg-buttons-secondary-hover active:bg-buttons-secondary-hover\",\n disabled: DISABLED_FILL,\n negative:\n \"bg-buttons-secondary-negative-default text-content-primary-inverted hover:bg-buttons-secondary-negative-hover active:bg-buttons-secondary-negative-hover\",\n negativeDisabled: DISABLED_FILL_NEGATIVE,\n },\n tertiary: {\n default:\n \"bg-transparent text-content-primary hover:bg-buttons-tertiary-hover active:bg-buttons-tertiary-hover\",\n disabled: DISABLED_TRANSPARENT,\n negative:\n \"bg-transparent text-content-primary-inverted hover:bg-buttons-tertiary-negative-hover active:bg-buttons-tertiary-negative-hover\",\n negativeDisabled: DISABLED_TRANSPARENT,\n },\n outline: {\n default:\n \"border border-buttons-outline-default bg-transparent text-content-primary hover:bg-buttons-outline-hover active:bg-buttons-outline-hover\",\n disabled: \"border border-buttons-disabled-default bg-transparent text-content-disabled\",\n negative:\n \"border border-buttons-outline-negative-default bg-transparent text-content-primary-inverted hover:bg-buttons-outline-negative-hover active:bg-buttons-outline-negative-hover\",\n negativeDisabled:\n \"border border-buttons-disabled-negative bg-transparent text-content-disabled\",\n },\n brand: {\n default: BRAND_UPSELL,\n negative: `${BRAND_UPSELL} fv-upsell-negative`,\n disabled: DISABLED_FILL,\n negativeDisabled: DISABLED_FILL_NEGATIVE,\n },\n destructive: {\n default:\n \"bg-buttons-error-default text-content-always-white hover:bg-buttons-error-hover hover:text-content-always-white active:bg-buttons-error-hover active:text-content-always-white\",\n disabled: DISABLED_FILL,\n },\n white: {\n default:\n \"bg-buttons-always-white-default text-content-always-black hover:bg-buttons-always-white-hover hover:text-content-always-black active:bg-buttons-always-white-hover active:text-content-always-black\",\n disabled: DISABLED_FILL,\n },\n alwaysBlack: {\n default:\n \"bg-buttons-always-black-default text-content-always-white hover:bg-buttons-always-black-hover hover:text-content-always-white active:bg-buttons-always-black-hover active:text-content-always-white\",\n disabled: DISABLED_FILL,\n },\n ai: {\n default: `border border-transparent text-content-primary shadow-ai-button-glow ${AI_GRADIENT}`,\n disabled: DISABLED_FILL,\n },\n link: {\n default:\n \"bg-transparent text-content-primary underline decoration-solid hover:bg-buttons-tertiary-hover active:bg-buttons-tertiary-hover\",\n disabled: \"bg-transparent text-content-primary underline decoration-solid opacity-50\",\n },\n tertiaryDestructive: {\n default: \"bg-transparent text-error-content hover:bg-error-surface active:bg-error-surface\",\n disabled: \"bg-transparent text-error-content opacity-50\",\n },\n text: {\n default: \"bg-transparent text-content-primary hover:underline active:underline\",\n disabled: \"bg-transparent text-content-primary opacity-50\",\n },\n};\n\nfunction getVariantClasses(variant: ButtonVariant, negative: boolean, disabled: boolean): string {\n const spec = VARIANT_CLASSES[variant];\n const isNegative = NEGATIVE_AWARE_VARIANTS.has(variant) && negative;\n if (disabled) return (isNegative && spec.negativeDisabled) || spec.disabled;\n return (isNegative && spec.negative) || spec.default;\n}\n\nfunction getIconPaddingClasses(\n size: ButtonSize,\n hasLeftIcon: boolean,\n hasRightIcon: boolean,\n): string | undefined {\n const padding = ICON_SIDE_PADDING_CLASSES[size];\n return cn(hasLeftIcon && padding.left, hasRightIcon && padding.right);\n}\n\n/** Recursively extract text content from React nodes for accessible labels */\nfunction getTextContent(node: React.ReactNode): string | undefined {\n if (typeof node === \"string\") return node;\n if (typeof node === \"number\") return String(node);\n if (React.isValidElement(node)) {\n return getTextContent((node.props as { children?: React.ReactNode }).children);\n }\n if (Array.isArray(node)) {\n const text = node.map(getTextContent).filter(Boolean).join(\"\");\n return text || undefined;\n }\n return undefined;\n}\n\nconst LoadingSpinner = ({ size }: { size: ButtonSize }) => {\n return (\n <span aria-hidden=\"true\">\n <SpinnerIcon spin className={ICON_SIZE_CLASS[size]}>\n <title>Loading</title>\n </SpinnerIcon>\n </span>\n );\n};\n\nfunction renderContent({\n loading,\n asChild,\n children,\n size,\n leftIcon,\n rightIcon,\n iconSizeClass,\n discount,\n price,\n}: {\n loading: boolean;\n asChild: boolean;\n children: React.ReactNode;\n size: ButtonSize;\n leftIcon: React.ReactNode;\n rightIcon: React.ReactNode;\n iconSizeClass: string;\n discount?: string;\n price?: string;\n fullWidth?: boolean;\n}) {\n if (loading) {\n if (asChild && React.isValidElement(children)) {\n return React.cloneElement(\n children as React.ReactElement<{ children?: React.ReactNode }>,\n undefined,\n <LoadingSpinner size={size} />,\n );\n }\n return (\n <>\n <LoadingSpinner size={size} />\n <span className=\"sr-only\">{children}</span>\n </>\n );\n }\n\n if (asChild) return children;\n\n return (\n <>\n {leftIcon && (\n <span\n className={cn(\"flex shrink-0 items-center justify-center\", iconSizeClass)}\n aria-hidden=\"true\"\n >\n {leftIcon}\n </span>\n )}\n {React.Children.map(children, (child) =>\n typeof child === \"string\" ? (\n child.trim() ? (\n <span className=\"min-w-0 truncate\">{child}</span>\n ) : null\n ) : typeof child === \"number\" ? (\n <span className=\"min-w-0 truncate\">{child}</span>\n ) : (\n child\n ),\n )}\n {rightIcon && (\n <span\n className={cn(\"flex shrink-0 items-center justify-center\", iconSizeClass)}\n aria-hidden=\"true\"\n >\n {rightIcon}\n </span>\n )}\n {(price || discount) && (\n <div>\n {discount && (\n <span className=\"typography-body-default-16px-regular line-through\" aria-hidden=\"true\">\n {discount}\n </span>\n )}\n {price && (\n <span className=\"ml-2\" aria-hidden=\"true\">\n {price}\n </span>\n )}\n </div>\n )}\n </>\n );\n}\n\n/**\n * A versatile button component with multiple visual variants, sizes, icon\n * slots, loading state, and optional pricing display.\n *\n * Pass `negative` when rendering on an inverted surface to opt into the\n * inverted treatment for `primary`, `secondary`, `tertiary`, `outline` and\n * `brand` variants.\n *\n * The `brand` variant is the Figma \"Upsell\" button: a green radial fill with a\n * green glow and a highlight that circles the rim once. With `negative` it takes\n * the other theme's glow, made for the inverted surface. The highlight holds\n * still when the user prefers reduced motion. Keep it for upgrade and purchase\n * prompts. The fill is a gradient, so a `bg-*` class sits under it: recolour it\n * through `--fv-upsell-end`, or pair the class with `bg-none`.\n *\n * The `ai` variant ships with the AI sparkle icon baked in (locked at 16px\n * regardless of button size); pass `leftIcon` to override the default sparkle.\n *\n * @example\n * ```tsx\n * <Button variant=\"primary\" size=\"40\" leftIcon={<StarIcon />}>\n * Continue\n * </Button>\n * ```\n */\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant = \"primary\",\n size = \"40\",\n negative = false,\n leftIcon,\n rightIcon,\n loading = false,\n asChild = false,\n disabled,\n children,\n discount,\n price,\n fullWidth = false,\n ...props\n },\n ref,\n ) => {\n const Comp = asChild ? Slot : \"button\";\n const isDisabled = Boolean(disabled);\n const isInteractionDisabled = isDisabled || loading;\n const iconSizeClass = variant === \"ai\" ? \"[&>svg]:size-4\" : ICON_WRAPPER_CLASS[size];\n const effectiveLeftIcon = leftIcon ?? (variant === \"ai\" ? <AIIcon filled /> : undefined);\n const iconPaddingClasses = getIconPaddingClasses(\n size,\n Boolean(effectiveLeftIcon),\n Boolean(rightIcon),\n );\n\n const buttonSpecificProps = !asChild\n ? {\n type: \"button\" as const,\n \"data-testid\": \"button\",\n disabled: isInteractionDisabled,\n }\n : isInteractionDisabled\n ? { \"aria-disabled\": true }\n : {};\n\n const loadingLabelProps = loading && asChild ? { \"aria-label\": getTextContent(children) } : {};\n\n const content = renderContent({\n loading,\n asChild,\n children,\n size,\n leftIcon: effectiveLeftIcon,\n rightIcon,\n iconSizeClass,\n discount,\n price,\n });\n\n return (\n <Comp\n ref={ref}\n {...buttonSpecificProps}\n aria-busy={loading}\n {...loadingLabelProps}\n className={cn(\n \"inline-flex min-w-0 cursor-pointer items-center gap-2 whitespace-nowrap transition-colors\",\n \"focus-visible:shadow-focus-ring focus-visible:outline-none\",\n isInteractionDisabled && \"pointer-events-none cursor-not-allowed\",\n `${price ? \"justify-between\" : \"justify-center\"}`,\n fullWidth && \"w-full\",\n SIZE_CLASSES[size],\n iconPaddingClasses,\n getVariantClasses(variant, negative, isDisabled),\n className,\n )}\n {...props}\n >\n {content}\n </Comp>\n );\n },\n);\n\nButton.displayName = \"Button\";\n"],"names":[],"mappings":";;;;;;;AAqDA,MAAM,8CAA8B,IAAmB;AAAA,EACrD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGD,MAAM,eAA2C;AAAA,EAC/C,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,4BAAiF;AAAA,EACrF,MAAM,EAAE,MAAM,QAAQ,OAAO,OAAA;AAAA,EAC7B,MAAM,EAAE,MAAM,QAAQ,OAAO,OAAA;AAAA,EAC7B,MAAM,EAAE,MAAM,QAAQ,OAAO,OAAA;AAAA,EAC7B,MAAM,EAAE,MAAM,QAAQ,OAAO,OAAA;AAC/B;AAEA,MAAM,kBAA8C;AAAA,EAClD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAGA,MAAM,qBAAiD;AAAA,EACrD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAOA,MAAM,cACJ;AAEF,MAAM,gBAAgB;AACtB,MAAM,yBAAyB;AAC/B,MAAM,eACJ;AACF,MAAM,uBAAuB;AAe7B,MAAM,kBAAyD;AAAA,EAC7D,SAAS;AAAA,IACP,SACE;AAAA,IACF,UAAU;AAAA,IACV,UACE;AAA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,MAAM;AAAA,MACN,eAAe;AAAA,MACf,UAAU;AAAA,IAAA,IAEZ,wBACE,EAAE,iBAAiB,KAAA,IACnB,CAAA;AAEN,UAAM,oBAAoB,WAAW,UAAU,EAAE,cAAc,eAAe,QAAQ,EAAA,IAAM,CAAA;AAE5F,UAAM,UAAU,cAAc;AAAA,MAC5B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA,CACD;AAED,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACC,GAAG;AAAA,QACJ,aAAW;AAAA,QACV,GAAG;AAAA,QACJ,WAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA,yBAAyB;AAAA,UACzB,GAAG,QAAQ,oBAAoB,gBAAgB;AAAA,UAC/C,aAAa;AAAA,UACb,aAAa,IAAI;AAAA,UACjB;AAAA,UACA,kBAAkB,SAAS,UAAU,UAAU;AAAA,UAC/C;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,QAEH,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,OAAO,cAAc;"}
@@ -26,6 +26,7 @@ const ChartCard = React.forwardRef(
26
26
  dateInfo,
27
27
  trendChip,
28
28
  loading = false,
29
+ fullHeight = false,
29
30
  children,
30
31
  ...props
31
32
  }, ref) => {
@@ -35,9 +36,9 @@ const ChartCard = React.forwardRef(
35
36
  ref,
36
37
  hierarchy,
37
38
  noPadding: true,
38
- className: cn(SURFACE_CLASSES[hierarchy], className),
39
+ className: cn(SURFACE_CLASSES[hierarchy], fullHeight && "h-full", className),
39
40
  ...props,
40
- children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 p-4", children: [
41
+ children: /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-2 p-4", fullHeight && "min-h-0 flex-1"), children: [
41
42
  loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
42
43
  /* @__PURE__ */ jsx(Skeleton, { animation: "wave", variant: "rounded", className: "h-4 w-32" }),
43
44
  /* @__PURE__ */ jsx(Skeleton, { animation: "wave", variant: "rounded", className: "h-7 w-44" }),
@@ -85,7 +86,7 @@ const ChartCard = React.forwardRef(
85
86
  ] }),
86
87
  dateInfo && /* @__PURE__ */ jsx("span", { className: "typography-description-12px-regular text-content-tertiary", children: dateInfo })
87
88
  ] }),
88
- children && /* @__PURE__ */ jsx("div", { className: "mt-auto", children })
89
+ children && /* @__PURE__ */ jsx("div", { className: cn("mt-auto", fullHeight && "flex min-h-0 flex-1 flex-col"), children })
89
90
  ] })
90
91
  }
91
92
  );