@fanvue/ui 3.51.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.
- package/dist/cjs/components/Drawer/Drawer.cjs +11 -3
- package/dist/cjs/components/Drawer/Drawer.cjs.map +1 -1
- package/dist/cjs/components/InlineEmptyState/InlineEmptyState.cjs +42 -0
- package/dist/cjs/components/InlineEmptyState/InlineEmptyState.cjs.map +1 -0
- package/dist/cjs/components/Link/Link.cjs +30 -7
- package/dist/cjs/components/Link/Link.cjs.map +1 -1
- package/dist/cjs/components/SegmentedControl/SegmentedControl.cjs +6 -10
- package/dist/cjs/components/SegmentedControl/SegmentedControl.cjs.map +1 -1
- package/dist/cjs/components/SegmentedControl/segmentedControlClassNames.cjs +54 -0
- package/dist/cjs/components/SegmentedControl/segmentedControlClassNames.cjs.map +1 -0
- package/dist/cjs/components/Table/Table.cjs +31 -2
- package/dist/cjs/components/Table/Table.cjs.map +1 -1
- package/dist/cjs/components/Table/TableRowLink.cjs +55 -0
- package/dist/cjs/components/Table/TableRowLink.cjs.map +1 -0
- package/dist/cjs/index.cjs +4 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/components/Drawer/Drawer.mjs +11 -3
- package/dist/components/Drawer/Drawer.mjs.map +1 -1
- package/dist/components/InlineEmptyState/InlineEmptyState.mjs +25 -0
- package/dist/components/InlineEmptyState/InlineEmptyState.mjs.map +1 -0
- package/dist/components/Link/Link.mjs +31 -8
- package/dist/components/Link/Link.mjs.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.mjs +6 -10
- package/dist/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
- package/dist/components/SegmentedControl/segmentedControlClassNames.mjs +54 -0
- package/dist/components/SegmentedControl/segmentedControlClassNames.mjs.map +1 -0
- package/dist/components/Table/Table.mjs +31 -2
- package/dist/components/Table/Table.mjs.map +1 -1
- package/dist/components/Table/TableRowLink.mjs +38 -0
- package/dist/components/Table/TableRowLink.mjs.map +1 -0
- package/dist/index.d.ts +122 -15
- package/dist/index.mjs +4 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.mjs","sources":["../../../src/components/Table/Table.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { Button, type ButtonProps } from \"../Button/Button\";\nimport { CloseIcon } from \"../Icons/CloseIcon\";\nimport { SearchIcon } from \"../Icons/SearchIcon\";\nimport { TranscationArrowIcon } from \"../Icons/TranscationArrowIcon\";\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":[],"mappings":";;;;;;;;;AAyBA,MAAM,mBAAmB,MAAM,cAAyB,IAAI;AAE5D,SAAS,eAA0B;AACjC,SAAO,MAAM,WAAW,gBAAgB;AAC1C;AA8BO,MAAM,YAAY,MAAM;AAAA,EAC7B,CAAC,EAAE,WAAW,OAAO,MAAM,GAAG,MAAA,GAAS,QAAQ;AAC7C,WACE,oBAAC,iBAAiB,UAAjB,EAA0B,OAAO,MAChC,UAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,MAAA;AAAA,IAAA,GAER;AAAA,EAEJ;AACF;AACA,UAAU,cAAc;AAoBjB,MAAM,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etB,SAAS,iBAAiB,EAAE,OAAO,YAAmC;AAC3E,SAAO,oBAAC,kBAAA,EAAiB,SAAS,OAAO,WAAW,UAAU;AAChE;AAEA,iBAAiB,cAAc;AAUxB,MAAM,iBAAiB,MAAM;AAAA,EAClC,CAAC,EAAE,WAAW,QAAQ,GAAG,GAAG,MAAA,GAAS,QAAQ;AAC3C,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT,UAAU,KAAK;AAAA,UACf,UAAU,KAAK;AAAA,UACf,UAAU,KAAK;AAAA,UACf;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AACA,eAAe,cAAc;"}
|
|
1
|
+
{"version":3,"file":"Table.mjs","sources":["../../../src/components/Table/Table.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { Button, type ButtonProps } from \"../Button/Button\";\nimport { CloseIcon } from \"../Icons/CloseIcon\";\nimport { SearchIcon } from \"../Icons/SearchIcon\";\nimport { TranscationArrowIcon } from \"../Icons/TranscationArrowIcon\";\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from \"../Tooltip/Tooltip\";\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":[],"mappings":";;;;;;;;;;AAkCA,MAAM,mBAAmB,MAAM,cAAyB,IAAI;AAE5D,SAAS,eAA0B;AACjC,SAAO,MAAM,WAAW,gBAAgB;AAC1C;AA8BO,MAAM,YAAY,MAAM;AAAA,EAC7B,CAAC,EAAE,WAAW,OAAO,MAAM,GAAG,MAAA,GAAS,QAAQ;AAC7C,WACE,oBAAC,iBAAiB,UAAjB,EAA0B,OAAO,MAChC,UAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,MAAA;AAAA,IAAA,GAER;AAAA,EAEJ;AACF;AACA,UAAU,cAAc;AAoBjB,MAAM,eAAe,MAAM;AAAA,EAChC,CAAC,EAAE,WAAW,QAAQ,UAAU,GAAG,MAAA,GAAS,QAAQ;AAClD,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;A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5D,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA,aAAa,QAAQ;AAAA,UACrB;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA;AAAA,UACA,aAAa,QAAQ,oBAAC,YAAA,EAAW,UAAA,CAAsB;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAG9D;AACF;AACA,eAAe,cAAc;AAetB,SAAS,iBAAiB,EAAE,OAAO,YAAmC;AAC3E,SAAO,oBAAC,kBAAA,EAAiB,SAAS,OAAO,WAAW,UAAU;AAChE;AAEA,iBAAiB,cAAc;AAUxB,MAAM,iBAAiB,MAAM;AAAA,EAClC,CAAC,EAAE,WAAW,QAAQ,GAAG,GAAG,MAAA,GAAS,QAAQ;AAC3C,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT,UAAU,KAAK;AAAA,UACf,UAAU,KAAK;AAAA,UACf,UAAU,KAAK;AAAA,UACf;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AACA,eAAe,cAAc;"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { cn } from "../../utils/cn.mjs";
|
|
6
|
+
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]";
|
|
7
|
+
function openTableRowLink(event) {
|
|
8
|
+
const row = event.currentTarget;
|
|
9
|
+
const target = event.target;
|
|
10
|
+
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) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const links = row.querySelectorAll("[data-table-row-link]");
|
|
14
|
+
Array.from(links).find((link) => link.closest("tr") === row)?.click();
|
|
15
|
+
}
|
|
16
|
+
const TableRowLink = React.forwardRef(
|
|
17
|
+
({ asChild = false, className, ...props }, ref) => {
|
|
18
|
+
const Comp = asChild ? Slot : "a";
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
Comp,
|
|
21
|
+
{
|
|
22
|
+
ref,
|
|
23
|
+
"data-table-row-link": "",
|
|
24
|
+
className: cn(
|
|
25
|
+
"text-content-primary no-underline underline-offset-2 hover:underline focus-visible:shadow-focus-ring focus-visible:outline-hidden",
|
|
26
|
+
className
|
|
27
|
+
),
|
|
28
|
+
...props
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
TableRowLink.displayName = "TableRowLink";
|
|
34
|
+
export {
|
|
35
|
+
TableRowLink,
|
|
36
|
+
openTableRowLink
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=TableRowLink.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableRowLink.mjs","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":[],"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,eAAe,MAAM;AAAA,EAChC,CAAC,EAAE,UAAU,OAAO,WAAW,GAAG,MAAA,GAAS,QAAQ;AACjD,UAAM,OAAO,UAAU,OAAO;AAC9B,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,uBAAoB;AAAA,QACpB,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AACA,aAAa,cAAc;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2924,21 +2924,26 @@ export declare interface DrawerContentProps extends React_2.ComponentPropsWithou
|
|
|
2924
2924
|
* `side` concept used by Radix Popover/Tooltip and to better convey the
|
|
2925
2925
|
* spatial relationship of the drawer to the viewport.
|
|
2926
2926
|
*
|
|
2927
|
+
* Ignored by `variant="page"`, which always rises from the bottom.
|
|
2928
|
+
*
|
|
2927
2929
|
* @default "right"
|
|
2928
2930
|
*/
|
|
2929
2931
|
position?: DrawerPosition;
|
|
2930
2932
|
/**
|
|
2931
2933
|
* Controls the maximum extent of the drawer panel.
|
|
2932
2934
|
* For left/right drawers this sets `max-width`; for top/bottom it sets `max-height`.
|
|
2933
|
-
* Ignored by a left/right `variant="modal"`, which is always the 440px modal
|
|
2935
|
+
* Ignored by a left/right `variant="modal"`, which is always the 440px modal,
|
|
2936
|
+
* and by `variant="page"`, which always runs to the bottom edge.
|
|
2934
2937
|
* @default "sm"
|
|
2935
2938
|
*/
|
|
2936
2939
|
size?: DrawerSize;
|
|
2937
2940
|
/**
|
|
2938
2941
|
* Visual treatment of the panel. Use `"sheet"` (with `position="bottom"`) for
|
|
2939
2942
|
* a bottom sheet with the modal surface treatment, `"menu"` for a floating
|
|
2940
|
-
* inset menu carrying the dropdown surface,
|
|
2941
|
-
* the page on desktop, from the bottom on mobile
|
|
2943
|
+
* inset menu carrying the dropdown surface, `"modal"` for the V2 Modal: beside
|
|
2944
|
+
* the page on desktop, from the bottom on mobile, or `"page"` for a detail page
|
|
2945
|
+
* that rises from the bottom over the one behind it.
|
|
2946
|
+
* @default "panel"
|
|
2942
2947
|
*/
|
|
2943
2948
|
variant?: DrawerVariant;
|
|
2944
2949
|
/**
|
|
@@ -3063,8 +3068,16 @@ export declare type DrawerTriggerProps = React_2.ComponentPropsWithoutRef<typeof
|
|
|
3063
3068
|
* with the modal surface and stroke and a 32px radius, over the heavy overlay.
|
|
3064
3069
|
* Beside the page (`position="left"` or `"right"`) it is 440px wide with 24px
|
|
3065
3070
|
* padding; from the top or bottom it is the mobile modal, with 16px padding.
|
|
3071
|
+
* - `"page"` — a detail page that rises over the one behind it: the opaque page
|
|
3072
|
+
* background, a 16px top radius, a stroke on the top and sides, and a 16px gap
|
|
3073
|
+
* left above it so the page behind stays in view. It always runs to the bottom
|
|
3074
|
+
* edge, so `size` is ignored. Its rise is slower than its fall, and both are
|
|
3075
|
+
* dropped under reduced motion. It always rises from the bottom, so `position`
|
|
3076
|
+
* is ignored too. It cannot be dragged down to dismiss, and it clips what
|
|
3077
|
+
* overflows it, so give its body a scroll container (`min-h-0 flex-1
|
|
3078
|
+
* overflow-y-auto`). Meant for wide viewports; on a phone, use `"sheet"`.
|
|
3066
3079
|
*/
|
|
3067
|
-
export declare type DrawerVariant = "panel" | "sheet" | "menu" | "modal";
|
|
3080
|
+
export declare type DrawerVariant = "panel" | "sheet" | "menu" | "modal" | "page";
|
|
3068
3081
|
|
|
3069
3082
|
/** Root component that manages open/close state for a dropdown menu. */
|
|
3070
3083
|
export declare function DropdownMenu({ open: openProp, defaultOpen, onOpenChange, variant, children, ...props }: DropdownMenuProps): JSX.Element;
|
|
@@ -4189,6 +4202,23 @@ export declare interface InlineEditProps extends Omit<React_2.InputHTMLAttribute
|
|
|
4189
4202
|
/** Height of the inline edit field in pixels. */
|
|
4190
4203
|
export declare type InlineEditSize = "32" | "40";
|
|
4191
4204
|
|
|
4205
|
+
/**
|
|
4206
|
+
* An empty or coming-soon state as one quiet, centred line in an 80px block. Use it inside a
|
|
4207
|
+
* card, table or panel that has nothing to show yet. For a state with a title, artwork or
|
|
4208
|
+
* actions, use {@link EmptyState}.
|
|
4209
|
+
*
|
|
4210
|
+
* @example
|
|
4211
|
+
* ```tsx
|
|
4212
|
+
* <InlineEmptyState>No links in this campaign yet.</InlineEmptyState>
|
|
4213
|
+
* ```
|
|
4214
|
+
*/
|
|
4215
|
+
export declare const InlineEmptyState: React_2.ForwardRefExoticComponent<InlineEmptyStateProps & React_2.RefAttributes<HTMLParagraphElement>>;
|
|
4216
|
+
|
|
4217
|
+
export declare interface InlineEmptyStateProps extends Omit<React_2.HTMLAttributes<HTMLParagraphElement>, "dangerouslySetInnerHTML"> {
|
|
4218
|
+
/** The message. Keep it to one short sentence. */
|
|
4219
|
+
children?: React_2.ReactNode;
|
|
4220
|
+
}
|
|
4221
|
+
|
|
4192
4222
|
/**
|
|
4193
4223
|
* Language icon. Renders at sizes 16, 24, or 32 px with outlined and filled variants.
|
|
4194
4224
|
*
|
|
@@ -4207,7 +4237,8 @@ export declare type LanguageIconProps = BaseIconProps;
|
|
|
4207
4237
|
* using a button. Use `primary` for standard navigation and `brand` for the
|
|
4208
4238
|
* Fanvue green accent on calls to action within content. Use `inherit` with
|
|
4209
4239
|
* `size="inherit"` for a link inside copy that sets its own colour and type,
|
|
4210
|
-
* such as a tooltip.
|
|
4240
|
+
* such as a tooltip. Use `subtle` for a quiet link beside controls, such as
|
|
4241
|
+
* "Open full page" in a panel footer.
|
|
4211
4242
|
*
|
|
4212
4243
|
* Renders an underlined `<a>` by default. Pass `asChild` to compose with a
|
|
4213
4244
|
* router link (e.g. Next.js `Link`). When rendering without a visible label,
|
|
@@ -4217,6 +4248,13 @@ export declare type LanguageIconProps = BaseIconProps;
|
|
|
4217
4248
|
* ```tsx
|
|
4218
4249
|
* <Link href="/pricing" variant="brand">See our plans</Link>
|
|
4219
4250
|
* ```
|
|
4251
|
+
*
|
|
4252
|
+
* @example A quiet link with an arrow, level with a 32px control
|
|
4253
|
+
* ```tsx
|
|
4254
|
+
* <Link href="/campaigns/1" variant="subtle" size="14" rightIcon={<ArrowRightIcon />}>
|
|
4255
|
+
* Open full page
|
|
4256
|
+
* </Link>
|
|
4257
|
+
* ```
|
|
4220
4258
|
*/
|
|
4221
4259
|
export declare const Link: React_2.ForwardRefExoticComponent<LinkProps & React_2.RefAttributes<HTMLAnchorElement>>;
|
|
4222
4260
|
|
|
@@ -4258,9 +4296,13 @@ export declare type LinkSize = "16" | "14" | "inherit";
|
|
|
4258
4296
|
/**
|
|
4259
4297
|
* Visual style variant of the link. `inherit` takes the colour of the
|
|
4260
4298
|
* surrounding text, for links inside tooltips, alerts and other copy that sets
|
|
4261
|
-
* its own colour.
|
|
4299
|
+
* its own colour. `subtle` is a quiet "go there" link for card headers, footers
|
|
4300
|
+
* and toolbars: secondary text that turns primary and underlines on hover. With
|
|
4301
|
+
* an icon it is at least 32px tall, so it sits level with a 32px control, and a
|
|
4302
|
+
* `rightIcon` moves 2px towards the destination on hover unless the user asks
|
|
4303
|
+
* for reduced motion.
|
|
4262
4304
|
*/
|
|
4263
|
-
export declare type LinkVariant = "primary" | "brand" | "inherit";
|
|
4305
|
+
export declare type LinkVariant = "primary" | "brand" | "inherit" | "subtle";
|
|
4264
4306
|
|
|
4265
4307
|
/**
|
|
4266
4308
|
* List view icon. Renders at sizes 16, 24, or 32 px.
|
|
@@ -5558,6 +5600,21 @@ export declare type SearchIconProps = BaseIconProps;
|
|
|
5558
5600
|
* />
|
|
5559
5601
|
* ```
|
|
5560
5602
|
*
|
|
5603
|
+
* @example A quiet squared control beside buttons of the same height (e.g. a date-range picker)
|
|
5604
|
+
* ```tsx
|
|
5605
|
+
* <SegmentedControl
|
|
5606
|
+
* appearance="squared"
|
|
5607
|
+
* options={[
|
|
5608
|
+
* { label: "7 days", value: "7" },
|
|
5609
|
+
* { label: "30 days", value: "30" },
|
|
5610
|
+
* { label: "90 days", value: "90" },
|
|
5611
|
+
* ]}
|
|
5612
|
+
* value={range}
|
|
5613
|
+
* onChange={setRange}
|
|
5614
|
+
* aria-label="Date range"
|
|
5615
|
+
* />
|
|
5616
|
+
* ```
|
|
5617
|
+
*
|
|
5561
5618
|
* @example A collapsed toggle that shows one switch glyph instead of the selected icon
|
|
5562
5619
|
* ```tsx
|
|
5563
5620
|
* <SegmentedControl
|
|
@@ -5585,13 +5642,16 @@ export declare const SegmentedControl: React_2.ForwardRefExoticComponent<Segment
|
|
|
5585
5642
|
* A selected segment takes the neutral selected pill, except the one marked `ai`, which takes the
|
|
5586
5643
|
* AI fill and gradient stroke. Designed for prominent toggles such as the Home/Agent navigation
|
|
5587
5644
|
* switch.
|
|
5645
|
+
* - `"squared"`: a bordered track with squared corners, where the selected segment is a raised
|
|
5646
|
+
* surface rather than a filled pill and unselected labels are muted. Designed for quiet
|
|
5647
|
+
* in-page controls that sit beside buttons of the same height, such as a date-range picker.
|
|
5588
5648
|
*/
|
|
5589
|
-
export declare type SegmentedControlAppearance = "pill" | "plain" | "brand";
|
|
5649
|
+
export declare type SegmentedControlAppearance = "pill" | "plain" | "brand" | "squared";
|
|
5590
5650
|
|
|
5591
5651
|
/** Describes one selectable segment. */
|
|
5592
5652
|
export declare interface SegmentedControlOption {
|
|
5593
5653
|
/**
|
|
5594
|
-
* Display label for the segment. In `pill`/`plain` appearances, when `icon` is provided the
|
|
5654
|
+
* Display label for the segment. In `pill`/`plain`/`squared` appearances, when `icon` is provided the
|
|
5595
5655
|
* segment renders icon-only and this value becomes its accessible name (applied as `aria-label`)
|
|
5596
5656
|
* instead of visible text. In the `brand` appearance the label is always rendered as visible text
|
|
5597
5657
|
* (alongside the icon when present).
|
|
@@ -5600,7 +5660,7 @@ export declare interface SegmentedControlOption {
|
|
|
5600
5660
|
/** Value identifier returned via `onChange`. */
|
|
5601
5661
|
value: string;
|
|
5602
5662
|
/**
|
|
5603
|
-
* Icon to render for the segment. In `pill`/`plain` appearances the segment renders icon-only and
|
|
5663
|
+
* Icon to render for the segment. In `pill`/`plain`/`squared` appearances the segment renders icon-only and
|
|
5604
5664
|
* `label` becomes required as its accessible name (applied as `aria-label`, no visible text). In
|
|
5605
5665
|
* the `brand` appearance the icon renders alongside the visible `label`. Required for every option
|
|
5606
5666
|
* when `collapsible` is set unless a `collapsedIcon` is given, since the collapsed control
|
|
@@ -6495,7 +6555,11 @@ export declare interface TableCardPaginationProps extends Omit<React_2.HTMLAttri
|
|
|
6495
6555
|
}
|
|
6496
6556
|
|
|
6497
6557
|
export declare interface TableCardProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
6498
|
-
/**
|
|
6558
|
+
/**
|
|
6559
|
+
* Row density applied to {@link TableCell} descendants: 40px rows for `md`,
|
|
6560
|
+
* `default` and `condensed`, 48px for `comfortable`, 56px for `lg`.
|
|
6561
|
+
* @default "md"
|
|
6562
|
+
*/
|
|
6499
6563
|
size?: TableSize;
|
|
6500
6564
|
}
|
|
6501
6565
|
|
|
@@ -6682,6 +6746,7 @@ export declare interface TableProps extends React_2.TableHTMLAttributes<HTMLTabl
|
|
|
6682
6746
|
/**
|
|
6683
6747
|
* Table row. A body row holding a {@link TableMediaThumbnail} or
|
|
6684
6748
|
* {@link TableMediaTile} grows from 40px to 56px to keep 8px around it.
|
|
6749
|
+
* Set `interactive` on rows that open or expand so they respond to hover.
|
|
6685
6750
|
*/
|
|
6686
6751
|
export declare const TableRow: React_2.ForwardRefExoticComponent<TableRowProps & React_2.RefAttributes<HTMLTableRowElement>>;
|
|
6687
6752
|
|
|
@@ -6695,7 +6760,45 @@ export declare const TableRowButton: React_2.ForwardRefExoticComponent<TableRowB
|
|
|
6695
6760
|
export declare interface TableRowButtonProps extends Omit<ButtonProps, "size"> {
|
|
6696
6761
|
}
|
|
6697
6762
|
|
|
6763
|
+
/**
|
|
6764
|
+
* The link an interactive `TableRow` opens, usually the row's name. It is a real
|
|
6765
|
+
* link, so the keyboard and "open in a new tab" work as on any link, and it is
|
|
6766
|
+
* the row's one tab stop. A click anywhere else on the row, except on another
|
|
6767
|
+
* control, opens it too. A `TableRowLink` portalled out of the row, in a popover
|
|
6768
|
+
* or dialog, is an ordinary link and does not take over the row's click.
|
|
6769
|
+
*
|
|
6770
|
+
* @example
|
|
6771
|
+
* ```tsx
|
|
6772
|
+
* <TableRow interactive>
|
|
6773
|
+
* <TableCell>
|
|
6774
|
+
* <TableRowLink href="/campaigns/summer">Summer launch</TableRowLink>
|
|
6775
|
+
* </TableCell>
|
|
6776
|
+
* <TableCell>1,204 clicks</TableCell>
|
|
6777
|
+
* </TableRow>
|
|
6778
|
+
* ```
|
|
6779
|
+
*/
|
|
6780
|
+
export declare const TableRowLink: React_2.ForwardRefExoticComponent<TableRowLinkProps & React_2.RefAttributes<HTMLAnchorElement>>;
|
|
6781
|
+
|
|
6782
|
+
export declare interface TableRowLinkProps extends React_2.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
6783
|
+
/**
|
|
6784
|
+
* Merge props onto the child element instead of rendering an `<a>`. Use it
|
|
6785
|
+
* for a router link. The child must render an anchor.
|
|
6786
|
+
* @default false
|
|
6787
|
+
*/
|
|
6788
|
+
asChild?: boolean;
|
|
6789
|
+
}
|
|
6790
|
+
|
|
6698
6791
|
export declare interface TableRowProps extends React_2.HTMLAttributes<HTMLTableRowElement> {
|
|
6792
|
+
/**
|
|
6793
|
+
* Marks a body row that opens or expands into more content. The row shows a
|
|
6794
|
+
* pointer cursor and eases to `background-secondary` while hovered, or while
|
|
6795
|
+
* a control inside it has keyboard focus. The row itself is not focusable, so
|
|
6796
|
+
* its action must also be on a button or link inside it. With a
|
|
6797
|
+
* {@link TableRowLink} inside, a click anywhere on the row that is not on
|
|
6798
|
+
* another control opens that link.
|
|
6799
|
+
* @default false
|
|
6800
|
+
*/
|
|
6801
|
+
interactive?: boolean;
|
|
6699
6802
|
}
|
|
6700
6803
|
|
|
6701
6804
|
/**
|
|
@@ -6722,14 +6825,18 @@ export declare interface TableScrollAreaProps extends React_2.HTMLAttributes<HTM
|
|
|
6722
6825
|
/**
|
|
6723
6826
|
* Row density for body cells.
|
|
6724
6827
|
*
|
|
6725
|
-
* - `"md"` (default) →
|
|
6726
|
-
* - `"condensed"` →
|
|
6727
|
-
* - `"
|
|
6828
|
+
* - `"md"` (default) → 40px rows, Figma `V2 Table Cell` Default.
|
|
6829
|
+
* - `"condensed"` → 40px rows, Figma `V2 Table Cell` Condensed.
|
|
6830
|
+
* - `"comfortable"` → 48px rows, for a 32px avatar with 8px above and below.
|
|
6831
|
+
* - `"lg"` → 56px rows; no longer in Figma, kept for back-compat.
|
|
6832
|
+
*
|
|
6833
|
+
* A row holding a {@link TableMediaThumbnail} (above 32px) or {@link TableMediaTile} is 56px at
|
|
6834
|
+
* any size.
|
|
6728
6835
|
*
|
|
6729
6836
|
* `"default"` is the v2 numeric-token equivalent of `"md"` and is preferred
|
|
6730
6837
|
* for new code.
|
|
6731
6838
|
*/
|
|
6732
|
-
export declare type TableSize = "md" | "lg" | "condensed" | "default";
|
|
6839
|
+
export declare type TableSize = "md" | "lg" | "condensed" | "comfortable" | "default";
|
|
6733
6840
|
|
|
6734
6841
|
/** Current sort direction of a {@link TableSortLabel}. `null` means unsorted. */
|
|
6735
6842
|
export declare type TableSortDirection = "asc" | "desc" | null;
|
package/dist/index.mjs
CHANGED
|
@@ -224,6 +224,7 @@ import { WifiOnIcon } from "./components/Icons/WifiOnIcon.mjs";
|
|
|
224
224
|
import { WrenchIcon } from "./components/Icons/WrenchIcon.mjs";
|
|
225
225
|
import { InfoBox, InfoBoxContent, InfoBoxTrigger } from "./components/InfoBox/InfoBox.mjs";
|
|
226
226
|
import { InlineEdit } from "./components/InlineEdit/InlineEdit.mjs";
|
|
227
|
+
import { InlineEmptyState } from "./components/InlineEmptyState/InlineEmptyState.mjs";
|
|
227
228
|
import { Link } from "./components/Link/Link.mjs";
|
|
228
229
|
import { LiveStatus } from "./components/LiveStatus/LiveStatus.mjs";
|
|
229
230
|
import { Loader } from "./components/Loader/Loader.mjs";
|
|
@@ -262,6 +263,7 @@ import { SwitchToggle } from "./components/SwitchToggle/SwitchToggle.mjs";
|
|
|
262
263
|
import { Table, TableBody, TableCard, TableCell, TableCellContent, TableCellGroup, TableFooter, TableHead, TableHeader, TableLineClamp, TableMediaThumbnail, TableMediaTile, TablePillProgressLayout, TableProgressTrack, TableRow, TableRowButton, TableScrollArea, TableSortLabel, TableStackedText, TableStatusDot, TableToolbar, TableToolbarAction, TableToolbarButton, TableToolbarSearch, TableTruncatedText } from "./components/Table/Table.mjs";
|
|
263
264
|
import { TableMobileRow } from "./components/Table/TableMobileRow.mjs";
|
|
264
265
|
import { TableCardPagination } from "./components/Table/TablePagination.mjs";
|
|
266
|
+
import { TableRowLink } from "./components/Table/TableRowLink.mjs";
|
|
265
267
|
import { Tabs } from "./components/Tabs/Tabs.mjs";
|
|
266
268
|
import { TabsContent } from "./components/Tabs/TabsContent.mjs";
|
|
267
269
|
import { TabsList } from "./components/Tabs/TabsList.mjs";
|
|
@@ -474,6 +476,7 @@ export {
|
|
|
474
476
|
InfoCircleIcon,
|
|
475
477
|
InfoIcon,
|
|
476
478
|
InlineEdit,
|
|
479
|
+
InlineEmptyState,
|
|
477
480
|
LanguageIcon,
|
|
478
481
|
Link,
|
|
479
482
|
LinkIcon,
|
|
@@ -588,6 +591,7 @@ export {
|
|
|
588
591
|
TableProgressTrack,
|
|
589
592
|
TableRow,
|
|
590
593
|
TableRowButton,
|
|
594
|
+
TableRowLink,
|
|
591
595
|
TableScrollArea,
|
|
592
596
|
TableSortLabel,
|
|
593
597
|
TableStackedText,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fanvue/ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.52.0",
|
|
4
4
|
"description": "React component library built with Tailwind CSS for Fanvue ecosystem",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org",
|
|
@@ -216,7 +216,7 @@
|
|
|
216
216
|
"size-limit": [
|
|
217
217
|
{
|
|
218
218
|
"path": "dist/index.mjs",
|
|
219
|
-
"limit": "
|
|
219
|
+
"limit": "230 KB",
|
|
220
220
|
"ignore": [
|
|
221
221
|
"@radix-ui/*",
|
|
222
222
|
"clsx",
|