@fanvue/ui 2.18.0 → 2.19.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/Checkbox/Checkbox.cjs +19 -6
- package/dist/cjs/components/Checkbox/Checkbox.cjs.map +1 -1
- package/dist/cjs/components/DropdownMenu/DropdownMenu.cjs +189 -11
- package/dist/cjs/components/DropdownMenu/DropdownMenu.cjs.map +1 -1
- package/dist/cjs/components/Table/Table.cjs +66 -46
- package/dist/cjs/components/Table/Table.cjs.map +1 -1
- package/dist/cjs/components/Table/TablePagination.cjs +7 -7
- package/dist/cjs/components/Table/TablePagination.cjs.map +1 -1
- package/dist/cjs/index.cjs +4 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.mjs +19 -6
- package/dist/components/Checkbox/Checkbox.mjs.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.mjs +189 -11
- package/dist/components/DropdownMenu/DropdownMenu.mjs.map +1 -1
- package/dist/components/Table/Table.mjs +66 -46
- package/dist/components/Table/Table.mjs.map +1 -1
- package/dist/components/Table/TablePagination.mjs +7 -7
- package/dist/components/Table/TablePagination.mjs.map +1 -1
- package/dist/index.d.ts +224 -31
- package/dist/index.mjs +6 -2
- package/dist/styles/base.css +2 -0
- package/package.json +1 -1
|
@@ -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 { Select, SelectContent, SelectItem } from \"../Select/Select\";\n\n/** Row density for body cells — `md` (60px min height) or `lg` (80px). */\nexport type TableSize = \"md\" | \"lg\";\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: rounded container, spacing, and size\n * context for {@link TableCell} descendants. Compose with {@link TableScrollArea},\n * {@link Table}, {@link TableHeader}, {@link TableBody}, {@link TableRow},\n * {@link TableHead}, and {@link TableCell}.\n *\n * @example\n * ```tsx\n * <TableCard size=\"md\">\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 gap-4 overflow-hidden rounded-md bg-bg-primary pb-4\",\n className,\n )}\n {...props}\n />\n </TableSizeContext.Provider>\n );\n },\n);\nTableCard.displayName = \"TableCard\";\n\nexport interface TableToolbarProps extends React.HTMLAttributes<HTMLDivElement> {}\n\n/**\n * Optional toolbar row above the table (e.g. bulk selection actions).\n */\nexport const TableToolbar = React.forwardRef<HTMLDivElement, TableToolbarProps>(\n ({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"flex flex-wrap items-center gap-4 rounded-t-md bg-bg-primary px-6\",\n className,\n )}\n {...props}\n />\n );\n },\n);\nTableToolbar.displayName = \"TableToolbar\";\n\nexport interface TableScrollAreaProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Rounds the top of the table block to match {@link TableCard}. Set `false` when {@link TableToolbar} is above this scroll area. @default true */\n roundTop?: boolean;\n}\n\n/**\n * Horizontal scroll container for wide tables. Uses an inner scrollport so the\n * table respects the card radius (plain `overflow-x-auto` on the table\n * wrapper often loses rounded corners with `border-collapse`).\n */\nexport const TableScrollArea = React.forwardRef<HTMLDivElement, TableScrollAreaProps>(\n ({ className, roundTop = true, children, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"relative w-full min-w-0 overflow-hidden\",\n roundTop && \"rounded-t-md\",\n className,\n )}\n {...props}\n >\n <div className=\"overflow-x-auto\">{children}</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 (\n <thead\n ref={ref}\n className={cn(\n \"[&_tr:first-child_th:first-child]:rounded-tl-md [&_tr:first-child_th:last-child]:rounded-tr-md\",\n className,\n )}\n {...props}\n />\n );\n },\n);\nTableHeader.displayName = \"TableHeader\";\n\nexport interface TableBodyProps extends React.HTMLAttributes<HTMLTableSectionElement> {}\n\nexport const TableBody = React.forwardRef<HTMLTableSectionElement, TableBodyProps>(\n ({ className, ...props }, ref) => {\n return <tbody ref={ref} className={cn(className)} {...props} />;\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\nexport const TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(\n ({ className, ...props }, ref) => {\n return <tr ref={ref} className={cn(className)} {...props} />;\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-8 min-w-8 max-w-8 text-center\",\n sort: \"text-right\",\n leading: \"min-w-0 w-2/5 text-left\",\n};\n\nexport interface TableHeadProps extends React.ThHTMLAttributes<HTMLTableCellElement> {\n /** Layout preset for common column types. @default \"default\" */\n intent?: TableHeadIntent;\n}\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-semibold-body-sm box-border h-8 min-h-8 bg-surface-secondary px-2 py-2 align-middle text-content-primary\",\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: \"min-h-[60px]\",\n lg: \"min-h-[80px]\",\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-border-primary border-b px-2 py-2\",\n chip: \"border-border-primary border-b px-2 py-2\",\n pillProgress: \"border-border-primary border-b px-4 py-2\",\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: \"text-center\",\n stacked: \"align-top\",\n multiline: \"max-w-[240px]\",\n sideLabel: \"\",\n};\n\nexport interface TableCellProps extends React.TdHTMLAttributes<HTMLTableCellElement> {\n /** `pillProgress` uses wider horizontal padding; row dividers match the default weight for visibility. @default \"default\" */\n cellVariant?: TableCellVariant;\n /** Alignment and typography preset for common cell types. @default \"default\" */\n intent?: TableCellIntent;\n}\n\nexport const TableCell = React.forwardRef<HTMLTableCellElement, TableCellProps>(\n ({ className, cellVariant = \"default\", intent = \"default\", ...props }, ref) => {\n const size = useTableSize();\n const typo =\n intent === \"sideLabel\" ? \"typography-semibold-body-md\" : \"typography-regular-body-md\";\n return (\n <td\n ref={ref}\n className={cn(\n typo,\n \"align-middle text-content-primary\",\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} (Figma `gap-[10px]`).\n */\nexport const TableCellGroup = React.forwardRef<HTMLDivElement, TableCellGroupProps>(\n ({ className, ...props }, ref) => {\n return <div ref={ref} className={cn(\"flex items-center gap-2.5\", className)} {...props} />;\n },\n);\nTableCellGroup.displayName = \"TableCellGroup\";\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}\n\n/**\n * Rounded thumbnail sized from {@link TableCard} `size` (`md` vs `lg`).\n */\nexport const TableMediaThumbnail = React.forwardRef<HTMLDivElement, TableMediaThumbnailProps>(\n ({ className, src, alt = \"\", blurred, align = \"start\", ...props }, ref) => {\n const tableSize = useTableSize();\n const frame =\n tableSize === \"lg\"\n ? \"h-[62px] w-11 overflow-hidden rounded-xs bg-neutral-alphas-200\"\n : \"h-10 w-[29px] overflow-hidden rounded-xs bg-neutral-alphas-200\";\n return (\n <div\n ref={ref}\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 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\"\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-center gap-3\", className)}\n {...props}\n />\n );\n});\nTablePillProgressLayout.displayName = \"TablePillProgressLayout\";\n\nexport interface TableSortLabelProps extends React.HTMLAttributes<HTMLSpanElement> {\n children: React.ReactNode;\n}\n\n/**\n * Sortable column label with caption typography and a sort affordance.\n */\nexport const TableSortLabel = React.forwardRef<HTMLSpanElement, TableSortLabelProps>(\n ({ className, children, ...props }, ref) => {\n return (\n <span ref={ref} className={cn(\"inline-flex items-center gap-2.5\", className)} {...props}>\n <span className=\"typography-semibold-body-sm\">{children}</span>\n <span className=\"text-content-secondary\" aria-hidden>\n ↕\n </span>\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 */\nexport function TableStackedText({ title, subtitle }: TableStackedTextProps) {\n return (\n <div className=\"flex flex-col gap-1\">\n <span className=\"typography-semibold-body-md\">{title}</span>\n <span className=\"typography-regular-body-sm text-content-secondary\">{subtitle}</span>\n </div>\n );\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\nexport interface TableRowsPerPageSelectProps {\n /** Passed to the trigger for forms and labels. */\n id?: string;\n /** Accessible name for the trigger when no visible label. @default \"Rows per page\" */\n \"aria-label\"?: string;\n}\n\n/**\n * Rows-per-page {@link Select} styled for {@link TablePagination} (Figma field).\n */\nexport function TableRowsPerPageSelect(props: TableRowsPerPageSelectProps) {\n const { id, \"aria-label\": ariaLabel = \"Rows per page\" } = props;\n return (\n <Select\n defaultValue=\"10\"\n size=\"32\"\n aria-label={ariaLabel}\n className=\"w-[154px] [&_button]:rounded-xs [&_button]:border-transparent [&_button]:bg-transparent\"\n id={id}\n >\n <SelectContent>\n <SelectItem value=\"10\">10 rows per page</SelectItem>\n <SelectItem value=\"25\">25 rows per page</SelectItem>\n <SelectItem value=\"50\">50 rows per page</SelectItem>\n </SelectContent>\n </Select>\n );\n}\n"],"names":[],"mappings":";;;;;AAYA,MAAM,mBAAmB,MAAM,cAAyB,IAAI;AAE5D,SAAS,eAA0B;AACjC,SAAO,MAAM,WAAW,gBAAgB;AAC1C;AA4BO,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;AAOjB,MAAM,eAAe,MAAM;AAAA,EAChC,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QAAQ;AAChC,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,MAAA;AAA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,EAAA,GAChF;AAEJ;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;AAYtB,SAAS,uBAAuB,OAAoC;AACzE,QAAM,EAAE,IAAI,cAAc,YAAY,oBAAoB;AAC1D,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,cAAa;AAAA,MACb,MAAK;AAAA,MACL,cAAY;AAAA,MACZ,WAAU;AAAA,MACV;AAAA,MAEA,+BAAC,eAAA,EACC,UAAA;AAAA,QAAA,oBAAC,YAAA,EAAW,OAAM,MAAK,UAAA,oBAAgB;AAAA,QACvC,oBAAC,YAAA,EAAW,OAAM,MAAK,UAAA,oBAAgB;AAAA,QACvC,oBAAC,YAAA,EAAW,OAAM,MAAK,UAAA,mBAAA,CAAgB;AAAA,MAAA,EAAA,CACzC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
1
|
+
{"version":3,"file":"Table.mjs","sources":["../../../src/components/Table/Table.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { ArrowDownIcon } from \"../Icons/ArrowDownIcon\";\nimport { ArrowUpIcon } from \"../Icons/ArrowUpIcon\";\nimport { Select, SelectContent, SelectItem } from \"../Select/Select\";\n\n/**\n * Row density for body cells.\n *\n * - `\"md\"` (default) → 64px Figma `V2 Table Cell` Small.\n * - `\"lg\"` → 80px Figma `V2 Table Cell` Large.\n *\n * `\"default\"` is the v2 numeric-token equivalent of `\"md\"` and is preferred\n * for new code.\n */\nexport type TableSize = \"md\" | \"lg\" | \"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: rounded 24px container with a strong\n * outer border, inner spacing, and size context for {@link TableCell}\n * 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 gap-2 overflow-hidden rounded-3xl border border-border-strong px-3 py-1\",\n className,\n )}\n {...props}\n />\n </TableSizeContext.Provider>\n );\n },\n);\nTableCard.displayName = \"TableCard\";\n\nexport interface TableToolbarProps extends React.HTMLAttributes<HTMLDivElement> {}\n\n/**\n * Optional toolbar row above the table (e.g. bulk selection actions).\n */\nexport const TableToolbar = React.forwardRef<HTMLDivElement, TableToolbarProps>(\n ({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\"flex flex-wrap items-center gap-4 px-4 py-3\", className)}\n {...props}\n />\n );\n },\n);\nTableToolbar.displayName = \"TableToolbar\";\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\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, ...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 className=\"overflow-x-auto\">{children}</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\nexport const TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(\n ({ className, ...props }, ref) => {\n return <tr ref={ref} className={cn(className)} {...props} />;\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-12 min-w-12 max-w-12 text-center\",\n sort: \"text-right\",\n leading: \"min-w-0 w-2/5 text-left\",\n};\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. v2: transparent background, 48px min height, tertiary text,\n * `border-border-primary` bottom rule.\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-semibold-body-sm box-border min-h-12 border-b border-border-primary px-4 py-3 align-middle text-content-tertiary\",\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-16 min-h-16\",\n default: \"h-16 min-h-16\",\n lg: \"h-20 min-h-20\",\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 border-border-primary px-4 py-3\",\n chip: \"border-b border-border-primary px-4 py-3\",\n pillProgress: \"border-b border-border-primary px-4 py-3\",\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-12 min-w-12 max-w-12 text-center\",\n stacked: \"align-top\",\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}\n\n/**\n * Body cell. v2: `h-16` (or `h-20` when the parent {@link TableCard} uses\n * `size=\"lg\"`), `px-4 py-3` padding, body-sm typography, and a single\n * `border-border-primary` rule that is zeroed by {@link TableBody} for the\n * final row.\n */\nexport const TableCell = React.forwardRef<HTMLTableCellElement, TableCellProps>(\n ({ className, cellVariant = \"default\", intent = \"default\", ...props }, ref) => {\n const size = useTableSize();\n const typo =\n intent === \"sideLabel\" ? \"typography-semibold-body-sm\" : \"typography-regular-body-sm\";\n return (\n <td\n ref={ref}\n className={cn(\n typo,\n \"align-middle text-content-primary\",\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` — primary line\n * (semibold) over an optional secondary line (regular, muted) with a 2px\n * gap. 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 gap-0.5\", className)}>\n <div className=\"flex items-center gap-1\">\n <span className=\"typography-semibold-body-sm 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-regular-body-sm text-content-secondary\">{secondary}</span>\n )}\n {secondaryAdornment}\n </div>\n )}\n </div>\n );\n}\nTableCellContent.displayName = \"TableCellContent\";\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}\n\n/**\n * Square 48px thumbnail used inside {@link TableCell} for media columns\n * (Figma `V2 Media Thumbnail Item`).\n */\nexport const TableMediaThumbnail = React.forwardRef<HTMLDivElement, TableMediaThumbnailProps>(\n ({ className, src, alt = \"\", blurred, align = \"start\", ...props }, ref) => {\n const frame = \"size-12 overflow-hidden rounded-sm bg-neutral-alphas-200\";\n return (\n <div\n ref={ref}\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 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\"\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\"`, a 1px underline accent appears beneath the label and a small\n * directional arrow is shown next to it. @default null\n */\n direction?: TableSortDirection;\n}\n\n/**\n * Sortable column label. v2 expresses the sort state with a 1px underline\n * beneath the label plus a directional arrow when sorted.\n */\nexport const TableSortLabel = React.forwardRef<HTMLSpanElement, TableSortLabelProps>(\n ({ className, children, direction = null, ...props }, ref) => {\n const Icon = direction === \"desc\" ? ArrowDownIcon : ArrowUpIcon;\n return (\n <span\n ref={ref}\n className={cn(\"inline-flex items-center gap-1 text-content-primary\", className)}\n {...props}\n >\n <span\n className={cn(\n \"typography-semibold-body-sm\",\n direction != null && \"border-b border-content-primary pb-px\",\n )}\n >\n {children}\n </span>\n {direction != null && <Icon className=\"size-4 shrink-0\" aria-hidden />}\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\nexport interface TableRowsPerPageSelectProps {\n /** Passed to the trigger for forms and labels. */\n id?: string;\n /** Accessible name for the trigger when no visible label. @default \"Rows per page\" */\n \"aria-label\"?: string;\n}\n\n/**\n * Rows-per-page {@link Select} styled for {@link TablePagination}. v2 uses a\n * subtle pill trigger with the table's secondary-surface background.\n */\nexport function TableRowsPerPageSelect(props: TableRowsPerPageSelectProps) {\n const { id, \"aria-label\": ariaLabel = \"Rows per page\" } = props;\n return (\n <Select\n defaultValue=\"10\"\n size=\"32\"\n aria-label={ariaLabel}\n className=\"w-[154px] [&_button]:rounded-sm [&_button]:border-transparent [&_button]:bg-surface-inputs\"\n id={id}\n >\n <SelectContent>\n <SelectItem value=\"10\">10 rows per page</SelectItem>\n <SelectItem value=\"25\">25 rows per page</SelectItem>\n <SelectItem value=\"50\">50 rows per page</SelectItem>\n </SelectContent>\n </Select>\n );\n}\n"],"names":[],"mappings":";;;;;;;AAsBA,MAAM,mBAAmB,MAAM,cAAyB,IAAI;AAE5D,SAAS,eAA0B;AACjC,SAAO,MAAM,WAAW,gBAAgB;AAC1C;AA6BO,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,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AAA,MAEA,+BAAC,eAAA,EACC,UAAA;AAAA,QAAA,oBAAC,YAAA,EAAW,OAAM,MAAK,UAAA,oBAAgB;AAAA,QACvC,oBAAC,YAAA,EAAW,OAAM,MAAK,UAAA,oBAAgB;AAAA,QACvC,oBAAC,YAAA,EAAW,OAAM,MAAK,UAAA,mBAAA,CAAgB;AAAA,MAAA,EAAA,CACzC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -9,16 +9,16 @@ const TablePagination = React.forwardRef(
|
|
|
9
9
|
"div",
|
|
10
10
|
{
|
|
11
11
|
ref,
|
|
12
|
-
className: cn("flex w-full max-w-full flex-col gap-
|
|
12
|
+
className: cn("flex w-full max-w-full flex-col gap-4 px-3 py-3", className),
|
|
13
13
|
...props,
|
|
14
14
|
children: [
|
|
15
|
-
/* @__PURE__ */ jsxs("div", { className: "flex w-full items-center gap-2
|
|
16
|
-
leadingSlot != null ? /* @__PURE__ */ jsx("div", { className: "flex min-w-0 shrink-0 items-center
|
|
15
|
+
/* @__PURE__ */ jsxs("div", { className: "flex w-full items-center gap-2", children: [
|
|
16
|
+
leadingSlot != null ? /* @__PURE__ */ jsx("div", { className: "flex min-w-0 shrink-0 items-center", children: leadingSlot }) : null,
|
|
17
17
|
/* @__PURE__ */ jsx(
|
|
18
18
|
"div",
|
|
19
19
|
{
|
|
20
20
|
className: cn(
|
|
21
|
-
"typography-regular-body-
|
|
21
|
+
"typography-regular-body-sm min-w-0 flex-1 text-content-secondary",
|
|
22
22
|
leadingSlot == null && "text-left",
|
|
23
23
|
leadingSlot != null && "text-right"
|
|
24
24
|
),
|
|
@@ -35,12 +35,12 @@ const TablePagination = React.forwardRef(
|
|
|
35
35
|
"div",
|
|
36
36
|
{
|
|
37
37
|
ref,
|
|
38
|
-
className: cn("flex w-full flex-wrap items-center gap-3 px-
|
|
38
|
+
className: cn("flex w-full flex-wrap items-center gap-3 px-3 py-3", className),
|
|
39
39
|
...props,
|
|
40
40
|
children: [
|
|
41
|
-
/* @__PURE__ */ jsx("div", { className: "flex min-h-0 min-w-0 flex-1
|
|
41
|
+
/* @__PURE__ */ jsx("div", { className: "flex min-h-0 min-w-0 flex-1 items-center", children: leadingSlot }),
|
|
42
42
|
paginationSlot != null ? /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center justify-center", children: paginationSlot }) : null,
|
|
43
|
-
/* @__PURE__ */ jsx("div", { className: "typography-regular-body-
|
|
43
|
+
/* @__PURE__ */ jsx("div", { className: "typography-regular-body-sm min-w-0 flex-1 text-right text-content-secondary", children: summary })
|
|
44
44
|
]
|
|
45
45
|
}
|
|
46
46
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TablePagination.mjs","sources":["../../../src/components/Table/TablePagination.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\n\n/** Layout preset for the pagination bar — desktop (range on the right) or stacked mobile. */\nexport type TablePaginationLayout = \"desktop\" | \"mobile\";\n\nexport interface TablePaginationProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Layout preset. @default \"desktop\" */\n layout?: TablePaginationLayout;\n /** Left (desktop) or top row (mobile) content, e.g. rows-per-page {@link Select}. */\n leadingSlot?: React.ReactNode;\n /** Center (desktop) or bottom row (mobile) content, e.g. {@link Pagination}. */\n paginationSlot?: React.ReactNode;\n /** Summary text or node (e.g. current range and total). */\n summary: React.ReactNode;\n}\n\n/**\n * Footer bar for data tables: rows-per-page control, page navigation, and
|
|
1
|
+
{"version":3,"file":"TablePagination.mjs","sources":["../../../src/components/Table/TablePagination.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\n\n/** Layout preset for the pagination bar — desktop (range on the right) or stacked mobile. */\nexport type TablePaginationLayout = \"desktop\" | \"mobile\";\n\nexport interface TablePaginationProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Layout preset. @default \"desktop\" */\n layout?: TablePaginationLayout;\n /** Left (desktop) or top row (mobile) content, e.g. rows-per-page {@link Select}. */\n leadingSlot?: React.ReactNode;\n /** Center (desktop) or bottom row (mobile) content, e.g. {@link Pagination}. */\n paginationSlot?: React.ReactNode;\n /** Summary text or node (e.g. current range and total). */\n summary: React.ReactNode;\n}\n\n/**\n * Footer bar for data tables: rows-per-page control, page navigation, and\n * range summary. Pair `paginationSlot` with {@link Pagination} for numbered\n * controls.\n *\n * v2 sits flush inside {@link TableCard} (`px-3` matches the card's inner\n * gutter); the chip styling now lives on the {@link TableRowsPerPageSelect}\n * trigger itself.\n *\n * @example\n * ```tsx\n * <TablePagination\n * leadingSlot={<TableRowsPerPageSelect />}\n * paginationSlot={<Pagination totalPages={5} currentPage={2} onPageChange={setPage} />}\n * summary=\"20–30 of 100 rows\"\n * />\n * ```\n */\nexport const TablePagination = React.forwardRef<HTMLDivElement, TablePaginationProps>(\n ({ className, layout = \"desktop\", leadingSlot, paginationSlot, summary, ...props }, ref) => {\n if (layout === \"mobile\") {\n return (\n <div\n ref={ref}\n className={cn(\"flex w-full max-w-full flex-col gap-4 px-3 py-3\", className)}\n {...props}\n >\n <div className=\"flex w-full items-center gap-2\">\n {leadingSlot != null ? (\n <div className=\"flex min-w-0 shrink-0 items-center\">{leadingSlot}</div>\n ) : null}\n <div\n className={cn(\n \"typography-regular-body-sm min-w-0 flex-1 text-content-secondary\",\n leadingSlot == null && \"text-left\",\n leadingSlot != null && \"text-right\",\n )}\n >\n {summary}\n </div>\n </div>\n {paginationSlot != null ? (\n <div className=\"flex justify-center\">{paginationSlot}</div>\n ) : null}\n </div>\n );\n }\n\n return (\n <div\n ref={ref}\n className={cn(\"flex w-full flex-wrap items-center gap-3 px-3 py-3\", className)}\n {...props}\n >\n <div className=\"flex min-h-0 min-w-0 flex-1 items-center\">{leadingSlot}</div>\n {paginationSlot != null ? (\n <div className=\"flex shrink-0 items-center justify-center\">{paginationSlot}</div>\n ) : null}\n <div className=\"typography-regular-body-sm min-w-0 flex-1 text-right text-content-secondary\">\n {summary}\n </div>\n </div>\n );\n },\n);\nTablePagination.displayName = \"TablePagination\";\n"],"names":[],"mappings":";;;;AAmCO,MAAM,kBAAkB,MAAM;AAAA,EACnC,CAAC,EAAE,WAAW,SAAS,WAAW,aAAa,gBAAgB,SAAS,GAAG,MAAA,GAAS,QAAQ;AAC1F,QAAI,WAAW,UAAU;AACvB,aACE;AAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACA,WAAW,GAAG,mDAAmD,SAAS;AAAA,UACzE,GAAG;AAAA,UAEJ,UAAA;AAAA,YAAA,qBAAC,OAAA,EAAI,WAAU,kCACZ,UAAA;AAAA,cAAA,eAAe,OACd,oBAAC,OAAA,EAAI,WAAU,sCAAsC,uBAAY,IAC/D;AAAA,cACJ;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WAAW;AAAA,oBACT;AAAA,oBACA,eAAe,QAAQ;AAAA,oBACvB,eAAe,QAAQ;AAAA,kBAAA;AAAA,kBAGxB,UAAA;AAAA,gBAAA;AAAA,cAAA;AAAA,YACH,GACF;AAAA,YACC,kBAAkB,OACjB,oBAAC,SAAI,WAAU,uBAAuB,0BAAe,IACnD;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAGV;AAEA,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW,GAAG,sDAAsD,SAAS;AAAA,QAC5E,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAA,oBAAC,OAAA,EAAI,WAAU,4CAA4C,UAAA,aAAY;AAAA,UACtE,kBAAkB,OACjB,oBAAC,SAAI,WAAU,6CAA6C,0BAAe,IACzE;AAAA,UACJ,oBAAC,OAAA,EAAI,WAAU,+EACZ,UAAA,QAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AACA,gBAAgB,cAAc;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1078,7 +1078,7 @@ export declare const CheckBoxOnIcon: React_2.ForwardRefExoticComponent<BaseIconP
|
|
|
1078
1078
|
export declare type CheckBoxOnIconProps = BaseIconProps;
|
|
1079
1079
|
|
|
1080
1080
|
export declare interface CheckboxProps extends Omit<React_2.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, "asChild"> {
|
|
1081
|
-
/** Size variant
|
|
1081
|
+
/** Size variant. @default "20" */
|
|
1082
1082
|
size?: CheckboxSize;
|
|
1083
1083
|
/** Label text displayed next to the checkbox. */
|
|
1084
1084
|
label?: string;
|
|
@@ -1086,8 +1086,19 @@ export declare interface CheckboxProps extends Omit<React_2.ComponentPropsWithou
|
|
|
1086
1086
|
helperText?: string;
|
|
1087
1087
|
}
|
|
1088
1088
|
|
|
1089
|
-
/**
|
|
1090
|
-
|
|
1089
|
+
/**
|
|
1090
|
+
* Size variant for the checkbox.
|
|
1091
|
+
*
|
|
1092
|
+
* - `"20"` (default) — 20px box, body-lg label.
|
|
1093
|
+
* - `"16"` — 16px box, body-md label, used in compact contexts like data tables.
|
|
1094
|
+
* - `"default"` and `"small"` are legacy aliases retained for back-compat
|
|
1095
|
+
* (`"default"` → `"20"`, `"small"` → `"20"` with smaller label typography).
|
|
1096
|
+
*/
|
|
1097
|
+
export declare type CheckboxSize = "20" | "16"
|
|
1098
|
+
/** @deprecated Use `"20"` instead. */
|
|
1099
|
+
| "default"
|
|
1100
|
+
/** @deprecated Use `"20"` (the smaller-typography variant remains via `"small"`). */
|
|
1101
|
+
| "small";
|
|
1091
1102
|
|
|
1092
1103
|
/** A checkmark inside a filled circle icon (20 × 20). */
|
|
1093
1104
|
export declare const CheckCircleIcon: React_2.ForwardRefExoticComponent<React_2.SVGAttributes<SVGSVGElement> & {
|
|
@@ -1964,6 +1975,62 @@ export declare const DropdownMenuGroup: React_2.ForwardRefExoticComponent<Dropdo
|
|
|
1964
1975
|
/** Props for the {@link DropdownMenuGroup} component. */
|
|
1965
1976
|
export declare type DropdownMenuGroupProps = React_2.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Group>;
|
|
1966
1977
|
|
|
1978
|
+
/**
|
|
1979
|
+
* Optional header rendered at the top of a {@link DropdownMenuContent}. Use
|
|
1980
|
+
* `type="default"` to title the menu, or `type="search"` to embed a search
|
|
1981
|
+
* input for filtering long lists.
|
|
1982
|
+
*
|
|
1983
|
+
* Renders an inset separator beneath the row so it slots cleanly above the
|
|
1984
|
+
* first group of items.
|
|
1985
|
+
*
|
|
1986
|
+
* @example
|
|
1987
|
+
* ```tsx
|
|
1988
|
+
* <DropdownMenuContent>
|
|
1989
|
+
* <DropdownMenuHeader title="Sort by" onClose={() => setOpen(false)} />
|
|
1990
|
+
* <DropdownMenuItem>Newest</DropdownMenuItem>
|
|
1991
|
+
* <DropdownMenuItem>Oldest</DropdownMenuItem>
|
|
1992
|
+
* </DropdownMenuContent>
|
|
1993
|
+
* ```
|
|
1994
|
+
*/
|
|
1995
|
+
export declare const DropdownMenuHeader: React_2.ForwardRefExoticComponent<DropdownMenuHeaderProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
1996
|
+
|
|
1997
|
+
export declare interface DropdownMenuHeaderProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
1998
|
+
/** Visual type. `"default"` shows a title; `"search"` shows a search input. @default "default" */
|
|
1999
|
+
type?: DropdownMenuHeaderType;
|
|
2000
|
+
/** Height preset for the header row. @default "40" */
|
|
2001
|
+
size?: DropdownMenuHeaderSize;
|
|
2002
|
+
/** Title text shown when `type="default"`. Ignored if `children` is provided. */
|
|
2003
|
+
title?: string;
|
|
2004
|
+
/** Configuration for the embedded search input when `type="search"`. */
|
|
2005
|
+
searchProps?: DropdownMenuHeaderSearchProps;
|
|
2006
|
+
/** Whether to render the close icon button on the right. @default true */
|
|
2007
|
+
showClose?: boolean;
|
|
2008
|
+
/** Fires when the close icon button is activated. */
|
|
2009
|
+
onClose?: () => void;
|
|
2010
|
+
/** Accessible label for the close button. @default "Close menu" */
|
|
2011
|
+
closeLabel?: string;
|
|
2012
|
+
}
|
|
2013
|
+
|
|
2014
|
+
/** Search-input configuration for {@link DropdownMenuHeader} when `type="search"`. */
|
|
2015
|
+
export declare interface DropdownMenuHeaderSearchProps {
|
|
2016
|
+
/** Controlled value of the search input. */
|
|
2017
|
+
value?: string;
|
|
2018
|
+
/** Uncontrolled default value. */
|
|
2019
|
+
defaultValue?: string;
|
|
2020
|
+
/** Fires when the input value changes. */
|
|
2021
|
+
onChange?: (value: string) => void;
|
|
2022
|
+
/** Placeholder text shown when the input is empty. @default "Search…" */
|
|
2023
|
+
placeholder?: string;
|
|
2024
|
+
/** Accessible label for the search input. @default "Search" */
|
|
2025
|
+
"aria-label"?: string;
|
|
2026
|
+
}
|
|
2027
|
+
|
|
2028
|
+
/** Header height preset. Matches the menu item sizing scale. */
|
|
2029
|
+
export declare type DropdownMenuHeaderSize = "40" | "32";
|
|
2030
|
+
|
|
2031
|
+
/** Header type. `"default"` shows a title; `"search"` shows a search input. */
|
|
2032
|
+
export declare type DropdownMenuHeaderType = "default" | "search";
|
|
2033
|
+
|
|
1967
2034
|
/**
|
|
1968
2035
|
* An individual item within a {@link DropdownMenuContent}.
|
|
1969
2036
|
*
|
|
@@ -1982,32 +2049,86 @@ export declare type DropdownMenuGroupProps = React_2.ComponentPropsWithoutRef<ty
|
|
|
1982
2049
|
export declare const DropdownMenuItem: React_2.ForwardRefExoticComponent<DropdownMenuItemProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
1983
2050
|
|
|
1984
2051
|
export declare interface DropdownMenuItemProps extends React_2.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> {
|
|
1985
|
-
/** Height of the menu item row. @default "
|
|
2052
|
+
/** Height of the menu item row. @default "40" */
|
|
1986
2053
|
size?: DropdownMenuItemSize;
|
|
1987
|
-
/**
|
|
2054
|
+
/** Applies the destructive (error) treatment. Use for irreversible actions. @default false */
|
|
1988
2055
|
destructive?: boolean;
|
|
1989
|
-
/** Icon rendered before the label. */
|
|
2056
|
+
/** Icon (or other node) rendered before the label. */
|
|
1990
2057
|
leadingIcon?: React_2.ReactNode;
|
|
1991
|
-
/** Icon rendered after the label. */
|
|
2058
|
+
/** Icon (or other node) rendered after the label. */
|
|
1992
2059
|
trailingIcon?: React_2.ReactNode;
|
|
1993
|
-
/**
|
|
2060
|
+
/** Marks the item as the current selection in a single-select menu. @default false */
|
|
1994
2061
|
selected?: boolean;
|
|
1995
2062
|
}
|
|
1996
2063
|
|
|
1997
|
-
/**
|
|
1998
|
-
|
|
2064
|
+
/**
|
|
2065
|
+
* Height preset for a dropdown menu item.
|
|
2066
|
+
*
|
|
2067
|
+
* `"40"` (default) and `"32"` are the v2 numeric tokens that mirror the Figma
|
|
2068
|
+
* design system. `"sm"` and `"md"` are deprecated aliases retained for
|
|
2069
|
+
* backwards compatibility — `"sm"` maps to `"32"`, `"md"` maps to `"40"`.
|
|
2070
|
+
*/
|
|
2071
|
+
export declare type DropdownMenuItemSize = "40" | "32"
|
|
2072
|
+
/** @deprecated Use `"32"` instead. */
|
|
2073
|
+
| "sm"
|
|
2074
|
+
/** @deprecated Use `"40"` instead. */
|
|
2075
|
+
| "md";
|
|
1999
2076
|
|
|
2000
|
-
/** A label
|
|
2077
|
+
/** A non-interactive label that groups related items within a menu. */
|
|
2001
2078
|
export declare const DropdownMenuLabel: React_2.ForwardRefExoticComponent<DropdownMenuLabelProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
2002
2079
|
|
|
2080
|
+
/** Vertical placement of a {@link DropdownMenuLabel} within its group. */
|
|
2081
|
+
export declare type DropdownMenuLabelPosition = "default" | "top";
|
|
2082
|
+
|
|
2003
2083
|
/** Props for the {@link DropdownMenuLabel} component. */
|
|
2004
2084
|
export declare interface DropdownMenuLabelProps extends React_2.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> {
|
|
2085
|
+
/**
|
|
2086
|
+
* Vertical placement within the surrounding group. `"top"` is used for the
|
|
2087
|
+
* first label directly under a header; `"default"` adds extra top padding to
|
|
2088
|
+
* separate it from preceding items. @default "default"
|
|
2089
|
+
*/
|
|
2090
|
+
position?: DropdownMenuLabelPosition;
|
|
2005
2091
|
}
|
|
2006
2092
|
|
|
2007
2093
|
/** Props for the {@link DropdownMenu} root component. */
|
|
2008
2094
|
export declare interface DropdownMenuProps extends React_2.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Root> {
|
|
2009
2095
|
}
|
|
2010
2096
|
|
|
2097
|
+
/**
|
|
2098
|
+
* Groups {@link DropdownMenuRadioItem} children so they behave as a
|
|
2099
|
+
* single-select set. Controlled via `value`/`onValueChange`.
|
|
2100
|
+
*
|
|
2101
|
+
* @example
|
|
2102
|
+
* ```tsx
|
|
2103
|
+
* <DropdownMenuRadioGroup value={sort} onValueChange={setSort}>
|
|
2104
|
+
* <DropdownMenuRadioItem value="newest">Newest first</DropdownMenuRadioItem>
|
|
2105
|
+
* <DropdownMenuRadioItem value="oldest">Oldest first</DropdownMenuRadioItem>
|
|
2106
|
+
* </DropdownMenuRadioGroup>
|
|
2107
|
+
* ```
|
|
2108
|
+
*/
|
|
2109
|
+
export declare const DropdownMenuRadioGroup: React_2.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
2110
|
+
|
|
2111
|
+
/** Props for the {@link DropdownMenuRadioGroup} component. */
|
|
2112
|
+
export declare interface DropdownMenuRadioGroupProps extends React_2.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioGroup> {
|
|
2113
|
+
}
|
|
2114
|
+
|
|
2115
|
+
/**
|
|
2116
|
+
* A single radio-style choice within a {@link DropdownMenuRadioGroup}. Shows
|
|
2117
|
+
* a circular indicator that fills when selected, plus an optional helper line
|
|
2118
|
+
* underneath the title.
|
|
2119
|
+
*/
|
|
2120
|
+
export declare const DropdownMenuRadioItem: React_2.ForwardRefExoticComponent<DropdownMenuRadioItemProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
2121
|
+
|
|
2122
|
+
export declare interface DropdownMenuRadioItemProps extends React_2.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem> {
|
|
2123
|
+
/** Optional secondary text shown below the title. */
|
|
2124
|
+
helper?: string;
|
|
2125
|
+
/** Height of the item row. @default "40" */
|
|
2126
|
+
size?: DropdownMenuRadioItemSize;
|
|
2127
|
+
}
|
|
2128
|
+
|
|
2129
|
+
/** Height preset for a {@link DropdownMenuRadioItem}. */
|
|
2130
|
+
export declare type DropdownMenuRadioItemSize = "40";
|
|
2131
|
+
|
|
2011
2132
|
/** Visual separator between groups of items. */
|
|
2012
2133
|
export declare const DropdownMenuSeparator: React_2.ForwardRefExoticComponent<DropdownMenuSeparatorProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
2013
2134
|
|
|
@@ -3863,20 +3984,25 @@ export declare type SwitchToggleSize = "24" | "32" | "40";
|
|
|
3863
3984
|
*/
|
|
3864
3985
|
export declare const Table: React_2.ForwardRefExoticComponent<TableProps & React_2.RefAttributes<HTMLTableElement>>;
|
|
3865
3986
|
|
|
3987
|
+
/**
|
|
3988
|
+
* `<tbody>` wrapper. Removes the bottom border on cells in the final row to
|
|
3989
|
+
* match the Figma `V2 Table Final Row` treatment.
|
|
3990
|
+
*/
|
|
3866
3991
|
export declare const TableBody: React_2.ForwardRefExoticComponent<TableBodyProps & React_2.RefAttributes<HTMLTableSectionElement>>;
|
|
3867
3992
|
|
|
3868
3993
|
export declare interface TableBodyProps extends React_2.HTMLAttributes<HTMLTableSectionElement> {
|
|
3869
3994
|
}
|
|
3870
3995
|
|
|
3871
3996
|
/**
|
|
3872
|
-
* Surface wrapper for data tables: rounded container
|
|
3873
|
-
*
|
|
3874
|
-
*
|
|
3997
|
+
* Surface wrapper for data tables: rounded 24px container with a strong
|
|
3998
|
+
* outer border, inner spacing, and size context for {@link TableCell}
|
|
3999
|
+
* descendants. Compose with {@link TableScrollArea}, {@link Table},
|
|
4000
|
+
* {@link TableHeader}, {@link TableBody}, {@link TableRow},
|
|
3875
4001
|
* {@link TableHead}, and {@link TableCell}.
|
|
3876
4002
|
*
|
|
3877
4003
|
* @example
|
|
3878
4004
|
* ```tsx
|
|
3879
|
-
* <TableCard
|
|
4005
|
+
* <TableCard>
|
|
3880
4006
|
* <TableScrollArea>
|
|
3881
4007
|
* <Table>
|
|
3882
4008
|
* <TableHeader>
|
|
@@ -3901,10 +4027,41 @@ export declare interface TableCardProps extends React_2.HTMLAttributes<HTMLDivEl
|
|
|
3901
4027
|
size?: TableSize;
|
|
3902
4028
|
}
|
|
3903
4029
|
|
|
4030
|
+
/**
|
|
4031
|
+
* Body cell. v2: `h-16` (or `h-20` when the parent {@link TableCard} uses
|
|
4032
|
+
* `size="lg"`), `px-4 py-3` padding, body-sm typography, and a single
|
|
4033
|
+
* `border-border-primary` rule that is zeroed by {@link TableBody} for the
|
|
4034
|
+
* final row.
|
|
4035
|
+
*/
|
|
3904
4036
|
export declare const TableCell: React_2.ForwardRefExoticComponent<TableCellProps & React_2.RefAttributes<HTMLTableCellElement>>;
|
|
3905
4037
|
|
|
3906
4038
|
/**
|
|
3907
|
-
*
|
|
4039
|
+
* Two-line content slot matching Figma `V2 Table Content` — primary line
|
|
4040
|
+
* (semibold) over an optional secondary line (regular, muted) with a 2px
|
|
4041
|
+
* gap. Use inside {@link TableCell} for the common stacked-text pattern.
|
|
4042
|
+
*/
|
|
4043
|
+
export declare function TableCellContent({ primary, secondary, primaryAdornment, secondaryAdornment, className, }: TableCellContentProps): JSX.Element;
|
|
4044
|
+
|
|
4045
|
+
export declare namespace TableCellContent {
|
|
4046
|
+
var displayName: string;
|
|
4047
|
+
}
|
|
4048
|
+
|
|
4049
|
+
export declare interface TableCellContentProps {
|
|
4050
|
+
/** Primary line (semibold body-sm). */
|
|
4051
|
+
primary: React_2.ReactNode;
|
|
4052
|
+
/** Optional secondary line (regular body-sm, secondary color). */
|
|
4053
|
+
secondary?: React_2.ReactNode;
|
|
4054
|
+
/** Inline node rendered next to the primary line (icon, chip). */
|
|
4055
|
+
primaryAdornment?: React_2.ReactNode;
|
|
4056
|
+
/** Inline node rendered next to the secondary line. */
|
|
4057
|
+
secondaryAdornment?: React_2.ReactNode;
|
|
4058
|
+
/** Class for the outer wrapper. */
|
|
4059
|
+
className?: string;
|
|
4060
|
+
}
|
|
4061
|
+
|
|
4062
|
+
/**
|
|
4063
|
+
* Horizontal group for icons, chips, and metadata inside a {@link TableCell}
|
|
4064
|
+
* (Figma `gap-[4px]`).
|
|
3908
4065
|
*/
|
|
3909
4066
|
export declare const TableCellGroup: React_2.ForwardRefExoticComponent<TableCellGroupProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
3910
4067
|
|
|
@@ -3915,7 +4072,7 @@ export declare interface TableCellGroupProps extends React_2.HTMLAttributes<HTML
|
|
|
3915
4072
|
export declare type TableCellIntent = "default" | "checkbox" | "stacked" | "multiline" | "sideLabel";
|
|
3916
4073
|
|
|
3917
4074
|
export declare interface TableCellProps extends React_2.TdHTMLAttributes<HTMLTableCellElement> {
|
|
3918
|
-
/**
|
|
4075
|
+
/** Padding preset for the cell. v2 uses identical padding across variants; values are kept for back-compat. @default "default" */
|
|
3919
4076
|
cellVariant?: TableCellVariant;
|
|
3920
4077
|
/** Alignment and typography preset for common cell types. @default "default" */
|
|
3921
4078
|
intent?: TableCellIntent;
|
|
@@ -3929,6 +4086,10 @@ export declare const TableFooter: React_2.ForwardRefExoticComponent<TableFooterP
|
|
|
3929
4086
|
export declare interface TableFooterProps extends React_2.HTMLAttributes<HTMLTableSectionElement> {
|
|
3930
4087
|
}
|
|
3931
4088
|
|
|
4089
|
+
/**
|
|
4090
|
+
* Header cell. v2: transparent background, 48px min height, tertiary text,
|
|
4091
|
+
* `border-border-primary` bottom rule.
|
|
4092
|
+
*/
|
|
3932
4093
|
export declare const TableHead: React_2.ForwardRefExoticComponent<TableHeadProps & React_2.RefAttributes<HTMLTableCellElement>>;
|
|
3933
4094
|
|
|
3934
4095
|
export declare const TableHeader: React_2.ForwardRefExoticComponent<TableHeaderProps & React_2.RefAttributes<HTMLTableSectionElement>>;
|
|
@@ -3955,7 +4116,8 @@ export declare interface TableLineClampProps extends React_2.HTMLAttributes<HTML
|
|
|
3955
4116
|
}
|
|
3956
4117
|
|
|
3957
4118
|
/**
|
|
3958
|
-
*
|
|
4119
|
+
* Square 48px thumbnail used inside {@link TableCell} for media columns
|
|
4120
|
+
* (Figma `V2 Media Thumbnail Item`).
|
|
3959
4121
|
*/
|
|
3960
4122
|
export declare const TableMediaThumbnail: React_2.ForwardRefExoticComponent<TableMediaThumbnailProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
3961
4123
|
|
|
@@ -3964,20 +4126,25 @@ export declare interface TableMediaThumbnailProps extends Omit<React_2.HTMLAttri
|
|
|
3964
4126
|
src: string;
|
|
3965
4127
|
/** Alt text for the image. @default "" */
|
|
3966
4128
|
alt?: string;
|
|
3967
|
-
/** Applies the table
|
|
4129
|
+
/** Applies the table's blurred-media treatment. @default false */
|
|
3968
4130
|
blurred?: boolean;
|
|
3969
4131
|
/** `center` uses the fixed media column width from the lg spec. @default "start" */
|
|
3970
4132
|
align?: "start" | "center";
|
|
3971
4133
|
}
|
|
3972
4134
|
|
|
3973
4135
|
/**
|
|
3974
|
-
* Footer bar for data tables: rows-per-page control, page navigation, and
|
|
3975
|
-
* summary. Pair `paginationSlot` with {@link Pagination} for numbered
|
|
4136
|
+
* Footer bar for data tables: rows-per-page control, page navigation, and
|
|
4137
|
+
* range summary. Pair `paginationSlot` with {@link Pagination} for numbered
|
|
4138
|
+
* controls.
|
|
4139
|
+
*
|
|
4140
|
+
* v2 sits flush inside {@link TableCard} (`px-3` matches the card's inner
|
|
4141
|
+
* gutter); the chip styling now lives on the {@link TableRowsPerPageSelect}
|
|
4142
|
+
* trigger itself.
|
|
3976
4143
|
*
|
|
3977
4144
|
* @example
|
|
3978
4145
|
* ```tsx
|
|
3979
4146
|
* <TablePagination
|
|
3980
|
-
* leadingSlot={<
|
|
4147
|
+
* leadingSlot={<TableRowsPerPageSelect />}
|
|
3981
4148
|
* paginationSlot={<Pagination totalPages={5} currentPage={2} onPageChange={setPage} />}
|
|
3982
4149
|
* summary="20–30 of 100 rows"
|
|
3983
4150
|
* />
|
|
@@ -4027,7 +4194,8 @@ export declare interface TableRowProps extends React_2.HTMLAttributes<HTMLTableR
|
|
|
4027
4194
|
}
|
|
4028
4195
|
|
|
4029
4196
|
/**
|
|
4030
|
-
* Rows-per-page {@link Select} styled for {@link TablePagination}
|
|
4197
|
+
* Rows-per-page {@link Select} styled for {@link TablePagination}. v2 uses a
|
|
4198
|
+
* subtle pill trigger with the table's secondary-surface background.
|
|
4031
4199
|
*/
|
|
4032
4200
|
export declare function TableRowsPerPageSelect(props: TableRowsPerPageSelectProps): JSX.Element;
|
|
4033
4201
|
|
|
@@ -4039,31 +4207,56 @@ export declare interface TableRowsPerPageSelectProps {
|
|
|
4039
4207
|
}
|
|
4040
4208
|
|
|
4041
4209
|
/**
|
|
4042
|
-
* Horizontal scroll container for wide tables.
|
|
4043
|
-
*
|
|
4044
|
-
* wrapper often loses rounded corners with `border-collapse`).
|
|
4210
|
+
* Horizontal scroll container for wide tables. The inner scrollport keeps
|
|
4211
|
+
* `border-collapse` styles intact when the table wraps.
|
|
4045
4212
|
*/
|
|
4046
4213
|
export declare const TableScrollArea: React_2.ForwardRefExoticComponent<TableScrollAreaProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
4047
4214
|
|
|
4048
4215
|
export declare interface TableScrollAreaProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
4049
|
-
/**
|
|
4216
|
+
/**
|
|
4217
|
+
* No longer needed in v2 — {@link TableCard} handles corner rounding via
|
|
4218
|
+
* its own `overflow-hidden rounded-3xl`. Accepted for back-compat.
|
|
4219
|
+
*
|
|
4220
|
+
* @deprecated v2 ignores this prop; safe to remove.
|
|
4221
|
+
*/
|
|
4050
4222
|
roundTop?: boolean;
|
|
4051
4223
|
}
|
|
4052
4224
|
|
|
4053
|
-
/**
|
|
4054
|
-
|
|
4225
|
+
/**
|
|
4226
|
+
* Row density for body cells.
|
|
4227
|
+
*
|
|
4228
|
+
* - `"md"` (default) → 64px Figma `V2 Table Cell` Small.
|
|
4229
|
+
* - `"lg"` → 80px Figma `V2 Table Cell` Large.
|
|
4230
|
+
*
|
|
4231
|
+
* `"default"` is the v2 numeric-token equivalent of `"md"` and is preferred
|
|
4232
|
+
* for new code.
|
|
4233
|
+
*/
|
|
4234
|
+
export declare type TableSize = "md" | "lg" | "default";
|
|
4235
|
+
|
|
4236
|
+
/** Current sort direction of a {@link TableSortLabel}. `null` means unsorted. */
|
|
4237
|
+
export declare type TableSortDirection = "asc" | "desc" | null;
|
|
4055
4238
|
|
|
4056
4239
|
/**
|
|
4057
|
-
* Sortable column label
|
|
4240
|
+
* Sortable column label. v2 expresses the sort state with a 1px underline
|
|
4241
|
+
* beneath the label plus a directional arrow when sorted.
|
|
4058
4242
|
*/
|
|
4059
4243
|
export declare const TableSortLabel: React_2.ForwardRefExoticComponent<TableSortLabelProps & React_2.RefAttributes<HTMLSpanElement>>;
|
|
4060
4244
|
|
|
4061
4245
|
export declare interface TableSortLabelProps extends React_2.HTMLAttributes<HTMLSpanElement> {
|
|
4062
4246
|
children: React_2.ReactNode;
|
|
4247
|
+
/**
|
|
4248
|
+
* Visual indicator of the column's sort state. When set to `"asc"` or
|
|
4249
|
+
* `"desc"`, a 1px underline accent appears beneath the label and a small
|
|
4250
|
+
* directional arrow is shown next to it. @default null
|
|
4251
|
+
*/
|
|
4252
|
+
direction?: TableSortDirection;
|
|
4063
4253
|
}
|
|
4064
4254
|
|
|
4065
4255
|
/**
|
|
4066
|
-
* Two-line primary + secondary text block for
|
|
4256
|
+
* Two-line primary + secondary text block for "cell + info" patterns.
|
|
4257
|
+
*
|
|
4258
|
+
* @deprecated Prefer {@link TableCellContent} which supports adornments and
|
|
4259
|
+
* matches the Figma `V2 Table Content` slot.
|
|
4067
4260
|
*/
|
|
4068
4261
|
export declare function TableStackedText({ title, subtitle }: TableStackedTextProps): JSX.Element;
|
|
4069
4262
|
|
package/dist/index.mjs
CHANGED
|
@@ -27,7 +27,7 @@ import { CyclingText } from "./components/CyclingText/CyclingText.mjs";
|
|
|
27
27
|
import { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogTitle, DialogTrigger } from "./components/Dialog/Dialog.mjs";
|
|
28
28
|
import { Divider } from "./components/Divider/Divider.mjs";
|
|
29
29
|
import { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerTitle, DrawerTrigger } from "./components/Drawer/Drawer.mjs";
|
|
30
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "./components/DropdownMenu/DropdownMenu.mjs";
|
|
30
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuHeader, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger } from "./components/DropdownMenu/DropdownMenu.mjs";
|
|
31
31
|
import { EmptyState } from "./components/EmptyState/EmptyState.mjs";
|
|
32
32
|
import { IconButton } from "./components/IconButton/IconButton.mjs";
|
|
33
33
|
import { AddIcon } from "./components/Icons/AddIcon.mjs";
|
|
@@ -212,7 +212,7 @@ import { StepperStep } from "./components/Stepper/StepperStep.mjs";
|
|
|
212
212
|
import { Switch } from "./components/Switch/Switch.mjs";
|
|
213
213
|
import { SwitchField } from "./components/SwitchField/SwitchField.mjs";
|
|
214
214
|
import { SwitchToggle } from "./components/SwitchToggle/SwitchToggle.mjs";
|
|
215
|
-
import { Table, TableBody, TableCard, TableCell, TableCellGroup, TableFooter, TableHead, TableHeader, TableLineClamp, TableMediaThumbnail, TablePillProgressLayout, TableProgressTrack, TableRow, TableRowsPerPageSelect, TableScrollArea, TableSortLabel, TableStackedText, TableStatusDot, TableToolbar } from "./components/Table/Table.mjs";
|
|
215
|
+
import { Table, TableBody, TableCard, TableCell, TableCellContent, TableCellGroup, TableFooter, TableHead, TableHeader, TableLineClamp, TableMediaThumbnail, TablePillProgressLayout, TableProgressTrack, TableRow, TableRowsPerPageSelect, TableScrollArea, TableSortLabel, TableStackedText, TableStatusDot, TableToolbar } from "./components/Table/Table.mjs";
|
|
216
216
|
import { TablePagination } from "./components/Table/TablePagination.mjs";
|
|
217
217
|
import { Tabs } from "./components/Tabs/Tabs.mjs";
|
|
218
218
|
import { TabsContent } from "./components/Tabs/TabsContent.mjs";
|
|
@@ -332,8 +332,11 @@ export {
|
|
|
332
332
|
DropdownMenu,
|
|
333
333
|
DropdownMenuContent,
|
|
334
334
|
DropdownMenuGroup,
|
|
335
|
+
DropdownMenuHeader,
|
|
335
336
|
DropdownMenuItem,
|
|
336
337
|
DropdownMenuLabel,
|
|
338
|
+
DropdownMenuRadioGroup,
|
|
339
|
+
DropdownMenuRadioItem,
|
|
337
340
|
DropdownMenuSeparator,
|
|
338
341
|
DropdownMenuTrigger,
|
|
339
342
|
EditIcon,
|
|
@@ -451,6 +454,7 @@ export {
|
|
|
451
454
|
TableBody,
|
|
452
455
|
TableCard,
|
|
453
456
|
TableCell,
|
|
457
|
+
TableCellContent,
|
|
454
458
|
TableCellGroup,
|
|
455
459
|
TableFooter,
|
|
456
460
|
TableHead,
|
package/dist/styles/base.css
CHANGED
|
@@ -131,8 +131,10 @@
|
|
|
131
131
|
|
|
132
132
|
:root {
|
|
133
133
|
--color-special-bottom-nav-highlight: var(--primitives-color-green-500);
|
|
134
|
+
--color-content-disabled: var(--primitives-color-gray-450);
|
|
134
135
|
}
|
|
135
136
|
|
|
136
137
|
.dark {
|
|
137
138
|
--color-special-bottom-nav-highlight: var(--primitives-color-gray-white);
|
|
139
|
+
--color-content-disabled: var(--primitives-color-gray-450);
|
|
138
140
|
}
|