@fanvue/ui 3.44.0 → 3.46.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/CreatorCard/CreatorCard.cjs +47 -20
- package/dist/cjs/components/CreatorCard/CreatorCard.cjs.map +1 -1
- package/dist/cjs/components/Icons/BookmarkIcon.cjs +65 -0
- package/dist/cjs/components/Icons/BookmarkIcon.cjs.map +1 -0
- package/dist/cjs/components/Table/Table.cjs +180 -50
- package/dist/cjs/components/Table/Table.cjs.map +1 -1
- package/dist/cjs/components/Table/TablePagination.cjs +78 -35
- package/dist/cjs/components/Table/TablePagination.cjs.map +1 -1
- package/dist/cjs/index.cjs +7 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/components/CreatorCard/CreatorCard.mjs +47 -20
- package/dist/components/CreatorCard/CreatorCard.mjs.map +1 -1
- package/dist/components/Icons/BookmarkIcon.mjs +48 -0
- package/dist/components/Icons/BookmarkIcon.mjs.map +1 -0
- package/dist/components/Table/Table.mjs +181 -51
- package/dist/components/Table/Table.mjs.map +1 -1
- package/dist/components/Table/TablePagination.mjs +78 -35
- package/dist/components/Table/TablePagination.mjs.map +1 -1
- package/dist/index.d.ts +196 -91
- package/dist/index.mjs +9 -4
- package/dist/index.mjs.map +1 -1
- package/dist/styles/theme.css +3 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.cjs","sources":["../../../../src/components/Table/Table.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { 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` 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: 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 * 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\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. Uses 16px semibold type, or 14px when\n * the parent {@link TableCard} is `size=\"condensed\"`.\n */\nexport const TableHead = React.forwardRef<HTMLTableCellElement, TableHeadProps>(\n ({ className, intent = \"default\", scope = \"col\", ...props }, ref) => {\n const size = useTableSize();\n return (\n <th\n ref={ref}\n scope={scope}\n className={cn(\n size === \"condensed\"\n ? \"typography-body-small-14px-semibold\"\n : \"typography-body-default-16px-semibold\",\n \"box-border h-12 min-h-12 border-border-primary border-b 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 condensed: \"h-12 min-h-12 py-1\",\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\"\n ? \"typography-body-small-14px-semibold\"\n : \"typography-body-small-14px-regular\";\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-body-small-14px-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-body-small-14px-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\" | \"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; `\"32\"` matches the current Figma `V2 Media Thumbnail Item`. @default \"48\" */\n size?: TableMediaThumbnailSize;\n}\n\n/**\n * Square 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\", size = \"48\", ...props }, ref) => {\n const frame = cn(\n \"overflow-hidden bg-neutral-alphas-200\",\n size === \"48\" && \"size-12 rounded-sm\",\n size === \"32\" && \"size-8 rounded-xs\",\n );\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-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\"`, 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 className={cn(direction != null && \"border-content-primary border-b pb-px\")}>\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-inputs-inputs-primary\"\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":["React","jsx","cn","jsxs","ArrowDownIcon","ArrowUpIcon","Select","SelectContent","SelectItem"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAM,mBAAmBA,iBAAM,cAAyB,IAAI;AAE5D,SAAS,eAA0B;AACjC,SAAOA,iBAAM,WAAW,gBAAgB;AAC1C;AA6BO,MAAM,YAAYA,iBAAM;AAAA,EAC7B,CAAC,EAAE,WAAW,OAAO,MAAM,GAAG,MAAA,GAAS,QAAQ;AAC7C,WACEC,2BAAAA,IAAC,iBAAiB,UAAjB,EAA0B,OAAO,MAChC,UAAAA,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAWC,GAAAA;AAAAA,UACT;AAAA,UACA;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,MAAA;AAAA,IAAA,GAER;AAAA,EAEJ;AACF;AACA,UAAU,cAAc;AAOjB,MAAM,eAAeF,iBAAM;AAAA,EAChC,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QAAQ;AAChC,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAWC,GAAAA,GAAG,+CAA+C,SAAS;AAAA,QACrE,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AACA,aAAa,cAAc;AAqBpB,MAAM,kBAAkBF,iBAAM;AAAA,EACnC,CAAC,EAAE,WAAW,UAAU,UAAU,WAAW,gBAAgB,OAAO,GAAG,MAAA,GAAS,QAAQ;AACtF,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAWC,GA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c,YAAY,oBAAoB;AAC1D,SACED,2BAAAA;AAAAA,IAACK,OAAAA;AAAAA,IAAA;AAAA,MACC,cAAa;AAAA,MACb,MAAK;AAAA,MACL,cAAY;AAAA,MACZ,WAAU;AAAA,MACV;AAAA,MAEA,0CAACC,sBAAA,EACC,UAAA;AAAA,QAAAN,2BAAAA,IAACO,OAAAA,YAAA,EAAW,OAAM,MAAK,UAAA,oBAAgB;AAAA,QACvCP,2BAAAA,IAACO,OAAAA,YAAA,EAAW,OAAM,MAAK,UAAA,oBAAgB;AAAA,QACvCP,2BAAAA,IAACO,OAAAA,YAAA,EAAW,OAAM,MAAK,UAAA,mBAAA,CAAgB;AAAA,MAAA,EAAA,CACzC;AAAA,IAAA;AAAA,EAAA;AAGN;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"Table.cjs","sources":["../../../../src/components/Table/Table.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { Button, type ButtonProps } from \"../Button/Button\";\nimport { CloseIcon } from \"../Icons/CloseIcon\";\nimport { SearchIcon } from \"../Icons/SearchIcon\";\nimport { TranscationArrowIcon } from \"../Icons/TranscationArrowIcon\";\n\n/**\n * Row density for body cells.\n *\n * - `\"md\"` (default) → 64px Figma `V2 Table Cell` Default.\n * - `\"condensed\"` → 48px Figma `V2 Table Cell` Condensed.\n * - `\"lg\"` → 80px rows; no longer in Figma, kept for back-compat.\n *\n * `\"default\"` is the v2 numeric-token equivalent of `\"md\"` and is preferred\n * for new code.\n */\nexport type TableSize = \"md\" | \"lg\" | \"condensed\" | \"default\";\n\nexport interface TableCardProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Row density applied to {@link TableCell} descendants. @default \"md\" */\n size?: TableSize;\n}\n\nconst TableSizeContext = React.createContext<TableSize>(\"md\");\n\nfunction useTableSize(): TableSize {\n return React.useContext(TableSizeContext);\n}\n\n/**\n * Surface wrapper for data tables: 12px-radius container with a 0.5px\n * hairline border and no inner padding, so the header, rows and\n * {@link TableCardPagination} footer run edge to edge. Provides the size\n * context for {@link TableCell} descendants. Compose with {@link TableScrollArea}, {@link Table},\n * {@link TableHeader}, {@link TableBody}, {@link TableRow},\n * {@link TableHead}, and {@link TableCell}.\n *\n * @example\n * ```tsx\n * <TableCard>\n * <TableScrollArea>\n * <Table>\n * <TableHeader>\n * <TableRow>\n * <TableHead>Name</TableHead>\n * </TableRow>\n * </TableHeader>\n * <TableBody>\n * <TableRow>\n * <TableCell>Jane Doe</TableCell>\n * </TableRow>\n * </TableBody>\n * </Table>\n * </TableScrollArea>\n * </TableCard>\n * ```\n */\nexport const TableCard = React.forwardRef<HTMLDivElement, TableCardProps>(\n ({ className, size = \"md\", ...props }, ref) => {\n return (\n <TableSizeContext.Provider value={size}>\n <div\n ref={ref}\n className={cn(\n \"isolate flex flex-col overflow-hidden rounded-sm border-[0.5px] border-border-primary\",\n className,\n )}\n {...props}\n />\n </TableSizeContext.Provider>\n );\n },\n);\nTableCard.displayName = \"TableCard\";\n\nexport interface TableToolbarProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Left slot, usually a {@link TableToolbarSearch}. */\n search?: React.ReactNode;\n}\n\n/**\n * 40px action bar above a {@link TableCard}: search on the left, every other\n * control (menus, toggles, buttons) on the right, 24px apart. On phones\n * {@link TableToolbarAction} controls go icon-only so the bar fits.\n *\n * @example\n * ```tsx\n * <TableToolbar search={<TableToolbarSearch value={q} onValueChange={setQ} placeholder=\"Search\" clearLabel=\"Clear search\" />}>\n * <TableToolbarAction icon={<SettingsIcon />}>Filters</TableToolbarAction>\n * <TableToolbarButton>Create</TableToolbarButton>\n * </TableToolbar>\n * ```\n */\nexport const TableToolbar = React.forwardRef<HTMLDivElement, TableToolbarProps>(\n ({ className, search, children, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"flex h-10 w-full min-w-0 items-center gap-4 rounded-sm border-[0.5px] border-border-strong bg-surface-table-row pr-2 pl-4\",\n className,\n )}\n {...props}\n >\n <div className=\"flex min-w-24 flex-1 items-center\">{search}</div>\n {children != null && (\n <div className=\"flex min-w-0 items-center gap-6 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\">\n {children}\n </div>\n )}\n </div>\n );\n },\n);\nTableToolbar.displayName = \"TableToolbar\";\n\nexport interface TableToolbarSearchProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, \"value\" | \"onChange\" | \"type\"> {\n /** Current query. */\n value: string;\n /** Called with the new query, and with `\"\"` when cleared. */\n onValueChange: (value: string) => void;\n /** Accessible name of the clear button. */\n clearLabel: string;\n}\n\n/**\n * Borderless search field for the left slot of {@link TableToolbar}:\n * 16px search icon, 12px text and a clear button once there is a query.\n */\nexport const TableToolbarSearch = React.forwardRef<HTMLInputElement, TableToolbarSearchProps>(\n ({ className, value, onValueChange, clearLabel, placeholder, ...props }, ref) => {\n return (\n <label className={cn(\"flex h-6 w-full min-w-0 cursor-text items-center gap-2\", className)}>\n <SearchIcon size={16} className=\"shrink-0 text-icons-secondary\" aria-hidden />\n <input\n ref={ref}\n type=\"search\"\n value={value}\n onChange={(event) => onValueChange(event.target.value)}\n placeholder={placeholder}\n aria-label={props[\"aria-label\"] ?? placeholder}\n className=\"typography-description-12px-regular min-w-0 flex-1 border-none bg-transparent p-0 text-content-primary outline-none placeholder:text-content-secondary [&::-webkit-search-cancel-button]:hidden\"\n {...props}\n />\n {value !== \"\" && (\n <button\n type=\"button\"\n aria-label={clearLabel}\n onClick={() => onValueChange(\"\")}\n className=\"inline-flex size-4 shrink-0 cursor-pointer items-center justify-center border-none bg-transparent p-0 text-icons-secondary hover:text-icons-primary\"\n >\n <CloseIcon size={16} />\n </button>\n )}\n </label>\n );\n },\n);\nTableToolbarSearch.displayName = \"TableToolbarSearch\";\n\nexport interface TableToolbarActionProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** 16px icon after the label. @default up/down arrows, for a menu trigger showing its current value */\n icon?: React.ReactNode;\n /** Tints the icon with the brand colour while a toggle or filter is on. @default false */\n active?: boolean;\n}\n\n/**\n * Labelled control for {@link TableToolbar}: 12px label followed by a 16px\n * icon. Below the `md` breakpoint only the icon shows, and the label stays as\n * the accessible name, so a full bar still fits a phone. Works as a plain\n * button or as a `DropdownMenuTrigger` child.\n */\nexport const TableToolbarAction = React.forwardRef<HTMLButtonElement, TableToolbarActionProps>(\n ({ className, children, icon, active = false, type = \"button\", ...props }, ref) => {\n return (\n <button\n ref={ref}\n type={type}\n className={cn(\n \"typography-description-12px-regular inline-flex h-6 shrink-0 cursor-pointer items-center gap-2 whitespace-nowrap rounded-xs border-none bg-transparent p-0 text-content-secondary outline-none\",\n \"hover:text-content-primary focus-visible:shadow-focus-ring disabled:cursor-default disabled:opacity-40\",\n className,\n )}\n {...props}\n >\n <span className=\"max-md:sr-only\">{children}</span>\n <span\n aria-hidden\n className={cn(\n \"inline-flex size-4 shrink-0 items-center justify-center [&>svg]:size-4\",\n active ? \"text-brand-primary-default\" : \"text-icons-secondary\",\n )}\n >\n {icon ?? <TranscationArrowIcon size={16} />}\n </span>\n </button>\n );\n },\n);\nTableToolbarAction.displayName = \"TableToolbarAction\";\n\nexport interface TableToolbarButtonProps extends Omit<ButtonProps, \"size\"> {}\n\n/**\n * Call to action for {@link TableToolbar} (e.g. \"Create New\"): a 24px\n * {@link Button} squared to the toolbar's 8px radius with 12px semibold type,\n * so it sits 8px from the bar's edges. Elsewhere use {@link Button}.\n */\nexport const TableToolbarButton = React.forwardRef<HTMLButtonElement, TableToolbarButtonProps>(\n ({ className, ...props }, ref) => {\n return (\n <Button\n ref={ref}\n size=\"24\"\n className={cn(\"typography-description-12px-semibold rounded-xs\", className)}\n {...props}\n />\n );\n },\n);\nTableToolbarButton.displayName = \"TableToolbarButton\";\n\nexport interface TableScrollAreaProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * No longer needed in v2 — {@link TableCard} handles corner rounding via\n * its own `overflow-hidden rounded-3xl`. Accepted for back-compat.\n *\n * @deprecated v2 ignores this prop; safe to remove.\n */\n roundTop?: boolean;\n /**\n * Shows a slim horizontal scrollbar beneath the table when the content\n * overflows (Figma `V2 Scroll Bar`). @default false\n */\n showScrollbar?: boolean;\n}\n\n/**\n * Horizontal scroll container for wide tables. The inner scrollport keeps\n * `border-collapse` styles intact when the table wraps.\n */\nexport const TableScrollArea = React.forwardRef<HTMLDivElement, TableScrollAreaProps>(\n ({ className, children, roundTop: _roundTop, showScrollbar = false, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\"relative w-full min-w-0 overflow-hidden\", className)}\n {...props}\n >\n <div\n className={cn(\n \"overflow-x-auto\",\n showScrollbar &&\n \"pb-3 [scrollbar-color:var(--color-border-strong)_transparent] [scrollbar-width:thin]\",\n )}\n >\n {children}\n </div>\n </div>\n );\n },\n);\nTableScrollArea.displayName = \"TableScrollArea\";\n\nexport interface TableProps extends React.TableHTMLAttributes<HTMLTableElement> {}\n\n/**\n * Semantic `<table>` element. Place inside {@link TableScrollArea}.\n */\nexport const Table = React.forwardRef<HTMLTableElement, TableProps>(\n ({ className, ...props }, ref) => {\n return (\n <table\n ref={ref}\n className={cn(\n \"w-full caption-bottom border-separate border-spacing-0 text-left\",\n className,\n )}\n {...props}\n />\n );\n },\n);\nTable.displayName = \"Table\";\n\nexport interface TableHeaderProps extends React.HTMLAttributes<HTMLTableSectionElement> {}\n\nexport const TableHeader = React.forwardRef<HTMLTableSectionElement, TableHeaderProps>(\n ({ className, ...props }, ref) => {\n return <thead ref={ref} className={cn(className)} {...props} />;\n },\n);\nTableHeader.displayName = \"TableHeader\";\n\nexport interface TableBodyProps extends React.HTMLAttributes<HTMLTableSectionElement> {}\n\n/**\n * `<tbody>` wrapper. Removes the bottom border on cells in the final row to\n * match the Figma `V2 Table Final Row` treatment.\n */\nexport const TableBody = React.forwardRef<HTMLTableSectionElement, TableBodyProps>(\n ({ className, ...props }, ref) => {\n return (\n <tbody ref={ref} className={cn(\"[&_tr:last-child_td]:border-b-0\", className)} {...props} />\n );\n },\n);\nTableBody.displayName = \"TableBody\";\n\nexport interface TableFooterProps extends React.HTMLAttributes<HTMLTableSectionElement> {}\n\nexport const TableFooter = React.forwardRef<HTMLTableSectionElement, TableFooterProps>(\n ({ className, ...props }, ref) => {\n return <tfoot ref={ref} className={cn(className)} {...props} />;\n },\n);\nTableFooter.displayName = \"TableFooter\";\n\nexport interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement> {}\n\n/**\n * Table row. A body row holding a {@link TableMediaThumbnail} or\n * {@link TableMediaTile} grows from 40px to 56px to keep 8px around it.\n */\nexport const TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(\n ({ className, ...props }, ref) => {\n return (\n <tr ref={ref} className={cn(\"[&:has([data-table-media])>td]:h-14\", className)} {...props} />\n );\n },\n);\nTableRow.displayName = \"TableRow\";\n\n/** Column layout preset for {@link TableHead}. */\nexport type TableHeadIntent = \"default\" | \"checkbox\" | \"sort\" | \"leading\";\n\nconst HEAD_INTENT_CLASSES: Record<TableHeadIntent, string> = {\n default: \"text-left\",\n checkbox: \"w-px pr-0 text-left\",\n sort: \"text-right\",\n leading: \"min-w-0 w-2/5 text-left\",\n};\n\nconst CELL_GUTTERS = \"px-5 first:pl-4 last:pr-4\";\n\nexport interface TableHeadProps extends React.ThHTMLAttributes<HTMLTableCellElement> {\n /** Layout preset for common column types. @default \"default\" */\n intent?: TableHeadIntent;\n}\n\n/**\n * Header cell: 32px tall on `surface-table-row`, 12px secondary text and a\n * 0.5px bottom rule. Columns sit at least 40px apart, with 16px against the\n * card edges.\n */\nexport const TableHead = React.forwardRef<HTMLTableCellElement, TableHeadProps>(\n ({ className, intent = \"default\", scope = \"col\", ...props }, ref) => {\n return (\n <th\n ref={ref}\n scope={scope}\n className={cn(\n \"typography-description-12px-regular box-border h-8 whitespace-nowrap border-border-primary border-b-[0.5px] bg-surface-table-row py-0 align-middle font-normal text-content-secondary\",\n CELL_GUTTERS,\n HEAD_INTENT_CLASSES[intent],\n className,\n )}\n {...props}\n />\n );\n },\n);\nTableHead.displayName = \"TableHead\";\n\nconst CELL_MIN_HEIGHT: Record<TableSize, string> = {\n md: \"h-10\",\n default: \"h-10\",\n condensed: \"h-10\",\n lg: \"h-14\",\n};\n\n/** Bottom border and padding preset for body cells (Figma table cell component). */\nexport type TableCellVariant = \"default\" | \"chip\" | \"pillProgress\";\n\nconst CELL_VARIANT_CLASSES: Record<TableCellVariant, string> = {\n default: \"border-b-[0.5px] border-border-primary py-0\",\n chip: \"border-b-[0.5px] border-border-primary py-0\",\n pillProgress: \"border-b-[0.5px] border-border-primary py-1\",\n};\n\n/** Layout / typography preset for {@link TableCell} (orthogonal to {@link TableCellVariant}). */\nexport type TableCellIntent = \"default\" | \"checkbox\" | \"stacked\" | \"multiline\" | \"sideLabel\";\n\nconst CELL_INTENT_CLASSES: Record<TableCellIntent, string> = {\n default: \"\",\n checkbox: \"w-px pr-0 text-left\",\n stacked: \"align-top py-2\",\n multiline: \"max-w-[240px]\",\n sideLabel: \"\",\n};\n\nexport interface TableCellProps extends React.TdHTMLAttributes<HTMLTableCellElement> {\n /** Padding preset for the cell. v2 uses identical padding across variants; values are kept for back-compat. @default \"default\" */\n cellVariant?: TableCellVariant;\n /** Alignment and typography preset for common cell types. @default \"default\" */\n intent?: TableCellIntent;\n /** Keeps the content on one line, for short values (dates, amounts, statuses). @default false */\n nowrap?: boolean;\n}\n\n/**\n * Body cell: 40px rows (56px when the parent {@link TableCard} uses\n * `size=\"lg\"` or the row holds media), 12px type, transparent background and\n * a 0.5px rule that {@link TableBody} drops on the final row. Long text wraps\n * and the row grows; set `nowrap` on short columns to keep them on one line.\n */\nexport const TableCell = React.forwardRef<HTMLTableCellElement, TableCellProps>(\n ({ className, cellVariant = \"default\", intent = \"default\", nowrap = false, ...props }, ref) => {\n const size = useTableSize();\n const typo =\n intent === \"sideLabel\"\n ? \"typography-description-12px-semibold\"\n : \"typography-description-12px-regular\";\n return (\n <td\n ref={ref}\n className={cn(\n typo,\n \"align-middle text-content-primary\",\n nowrap && \"whitespace-nowrap\",\n CELL_GUTTERS,\n CELL_VARIANT_CLASSES[cellVariant],\n CELL_MIN_HEIGHT[size],\n CELL_INTENT_CLASSES[intent],\n className,\n )}\n {...props}\n />\n );\n },\n);\nTableCell.displayName = \"TableCell\";\n\nexport interface TableCellGroupProps extends React.HTMLAttributes<HTMLDivElement> {}\n\n/**\n * Horizontal group for icons, chips, and metadata inside a {@link TableCell}\n * (Figma `gap-[4px]`).\n */\nexport const TableCellGroup = React.forwardRef<HTMLDivElement, TableCellGroupProps>(\n ({ className, ...props }, ref) => {\n return <div ref={ref} className={cn(\"flex items-center gap-1\", className)} {...props} />;\n },\n);\nTableCellGroup.displayName = \"TableCellGroup\";\n\nexport interface TableCellContentProps {\n /** Primary line (semibold body-sm). */\n primary: React.ReactNode;\n /** Optional secondary line (regular body-sm, secondary color). */\n secondary?: React.ReactNode;\n /** Inline node rendered next to the primary line (icon, chip). */\n primaryAdornment?: React.ReactNode;\n /** Inline node rendered next to the secondary line. */\n secondaryAdornment?: React.ReactNode;\n /** Class for the outer wrapper. */\n className?: string;\n}\n\n/**\n * Two-line content slot matching Figma `V2 Table Content` — 12px primary line\n * (semibold) over an optional 12px secondary line (regular, muted), so both\n * fit a 40px row. Use inside {@link TableCell} for the common stacked-text pattern.\n */\nexport function TableCellContent({\n primary,\n secondary,\n primaryAdornment,\n secondaryAdornment,\n className,\n}: TableCellContentProps) {\n return (\n <div className={cn(\"flex flex-col\", className)}>\n <div className=\"flex items-center gap-1\">\n <span className=\"typography-description-12px-semibold text-content-primary\">{primary}</span>\n {primaryAdornment}\n </div>\n {(secondary != null || secondaryAdornment != null) && (\n <div className=\"flex items-center gap-1\">\n {secondary != null && (\n <span className=\"typography-description-12px-regular text-content-secondary\">\n {secondary}\n </span>\n )}\n {secondaryAdornment}\n </div>\n )}\n </div>\n );\n}\nTableCellContent.displayName = \"TableCellContent\";\n\n/** Pixel size of the square {@link TableMediaThumbnail}. */\nexport type TableMediaThumbnailSize = \"48\" | \"40\" | \"32\";\n\nexport interface TableMediaThumbnailProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"children\"> {\n /** Image URL. */\n src: string;\n /** Alt text for the image. @default \"\" */\n alt?: string;\n /** Applies the table's blurred-media treatment. @default false */\n blurred?: boolean;\n /** `center` uses the fixed media column width from the lg spec. @default \"start\" */\n align?: \"start\" | \"center\";\n /** Pixel size of the square thumbnail. At 40 or 48 its row grows to 56px; 32 fits a 40px row. @default \"40\" */\n size?: TableMediaThumbnailSize;\n}\n\n/**\n * Square photo that fills its frame, used inside {@link TableCell} for media\n * columns. At the 40px and 48px sizes its row grows to 56px; the 32px size\n * fits a regular 40px row.\n */\nexport const TableMediaThumbnail = React.forwardRef<HTMLDivElement, TableMediaThumbnailProps>(\n ({ className, src, alt = \"\", blurred, align = \"start\", size = \"40\", ...props }, ref) => {\n const frame = cn(\n \"overflow-hidden bg-neutral-alphas-200\",\n size === \"48\" && \"size-12 rounded-sm\",\n size === \"40\" && \"size-10 rounded-xs\",\n size === \"32\" && \"size-8 rounded-xs\",\n );\n return (\n <div\n ref={ref}\n data-table-media={size === \"32\" ? undefined : \"\"}\n className={cn(\n align === \"center\" && \"flex w-16 shrink-0 justify-center\",\n align === \"start\" && \"inline-flex shrink-0\",\n )}\n >\n <div className={cn(frame, blurred && \"blur-[2px]\", className)} {...props}>\n <img alt={alt} className=\"size-full object-cover\" src={src} />\n </div>\n </div>\n );\n },\n);\nTableMediaThumbnail.displayName = \"TableMediaThumbnail\";\n\nexport interface TableMediaTileProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** Logo or icon centred on the tile, or edge-to-edge media when `fill` is set. */\n children: React.ReactNode;\n /** Lets the child fill the tile edge to edge (e.g. a video preview) with no border or fill. @default false */\n fill?: boolean;\n}\n\n/**\n * 40px tile for a {@link TableCell}: a logo or icon (e.g. a social platform)\n * centred on `surface-table-row` with a 0.5px border, or, with `fill`, custom\n * media that fills it. Its row grows to 56px. For a plain image URL use\n * {@link TableMediaThumbnail}.\n */\nexport const TableMediaTile = React.forwardRef<HTMLSpanElement, TableMediaTileProps>(\n ({ className, fill = false, ...props }, ref) => {\n return (\n <span\n ref={ref}\n data-table-media=\"\"\n className={cn(\n \"inline-flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-xs\",\n fill\n ? \"[&>*]:size-full\"\n : \"border-[0.5px] border-border-primary bg-surface-table-row text-icons-secondary\",\n className,\n )}\n {...props}\n />\n );\n },\n);\nTableMediaTile.displayName = \"TableMediaTile\";\n\nexport interface TableStatusDotProps extends React.HTMLAttributes<HTMLDivElement> {}\n\n/**\n * Small status indicator dot for table cells (Figma status column).\n */\nexport const TableStatusDot = React.forwardRef<HTMLDivElement, TableStatusDotProps>(\n ({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\"size-2 shrink-0 rounded-full bg-info-content\", className)}\n {...props}\n />\n );\n },\n);\nTableStatusDot.displayName = \"TableStatusDot\";\n\nexport interface TableProgressTrackProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Fill width from 0–100. @default 0 */\n value?: number;\n}\n\n/**\n * Thin progress track used with badges in table cells (Figma pill + progress).\n * Renders with `role=\"progressbar\"` and a default `aria-label` of `\"Progress\"`.\n */\nexport const TableProgressTrack = React.forwardRef<HTMLDivElement, TableProgressTrackProps>(\n ({ className, value = 0, \"aria-label\": ariaLabel = \"Progress\", ...props }, ref) => {\n const width = Math.min(100, Math.max(0, value));\n const rounded = Math.round(width);\n return (\n <div\n ref={ref}\n role=\"progressbar\"\n aria-valuenow={rounded}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-label={ariaLabel}\n className={cn(\n \"relative h-1 w-full overflow-hidden rounded-full bg-neutral-alphas-200\",\n className,\n )}\n {...props}\n >\n <div\n className=\"absolute top-0 left-0 h-1 rounded-full bg-buttons-primary-default\"\n style={{ width: `${width}%` }}\n aria-hidden\n />\n </div>\n );\n },\n);\nTableProgressTrack.displayName = \"TableProgressTrack\";\n\nexport interface TablePillProgressLayoutProps extends React.HTMLAttributes<HTMLDivElement> {}\n\n/**\n * Vertical layout for pill label + {@link TableProgressTrack} in a cell.\n */\nexport const TablePillProgressLayout = React.forwardRef<\n HTMLDivElement,\n TablePillProgressLayoutProps\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\"flex min-w-[120px] flex-col items-start gap-2\", className)}\n {...props}\n />\n );\n});\nTablePillProgressLayout.displayName = \"TablePillProgressLayout\";\n\n/** Current sort direction of a {@link TableSortLabel}. `null` means unsorted. */\nexport type TableSortDirection = \"asc\" | \"desc\" | null;\n\nexport interface TableSortLabelProps extends React.HTMLAttributes<HTMLSpanElement> {\n children: React.ReactNode;\n /**\n * Visual indicator of the column's sort state. When set to `\"asc\"` or\n * `\"desc\"`, the label turns primary and the Arrow Sort Up / Down chevrons\n * appear next to it, the active direction highlighted. @default null\n */\n direction?: TableSortDirection;\n}\n\nfunction SortArrows({ direction }: { direction: \"asc\" | \"desc\" }) {\n return (\n <svg\n width={16}\n height={16}\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n aria-hidden=\"true\"\n className=\"shrink-0\"\n >\n <path\n d=\"M5 6L8 3L11 6\"\n strokeWidth={1.2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={direction === \"asc\" ? \"stroke-current\" : \"stroke-icons-tertiary\"}\n />\n <path\n d=\"M11 10L8 13L5 10\"\n strokeWidth={1.2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={direction === \"desc\" ? \"stroke-current\" : \"stroke-icons-tertiary\"}\n />\n </svg>\n );\n}\n\n/**\n * Sortable column label. A sorted column reads primary with the Arrow Sort\n * Up / Down chevrons; an unsorted one keeps the header colour.\n */\nexport const TableSortLabel = React.forwardRef<HTMLSpanElement, TableSortLabelProps>(\n ({ className, children, direction = null, ...props }, ref) => {\n return (\n <span\n ref={ref}\n className={cn(\n \"inline-flex items-center gap-1\",\n direction != null && \"text-content-primary\",\n className,\n )}\n {...props}\n >\n {children}\n {direction != null && <SortArrows direction={direction} />}\n </span>\n );\n },\n);\nTableSortLabel.displayName = \"TableSortLabel\";\n\nexport interface TableStackedTextProps {\n /** Primary line (semibold body). */\n title: React.ReactNode;\n /** Secondary line (caption, muted). */\n subtitle: React.ReactNode;\n}\n\n/**\n * Two-line primary + secondary text block for \"cell + info\" patterns.\n *\n * @deprecated Prefer {@link TableCellContent} which supports adornments and\n * matches the Figma `V2 Table Content` slot.\n */\nexport function TableStackedText({ title, subtitle }: TableStackedTextProps) {\n return <TableCellContent primary={title} secondary={subtitle} />;\n}\n\nTableStackedText.displayName = \"TableStackedText\";\n\nexport interface TableLineClampProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Number of lines before ellipsis. @default 2 */\n lines?: 1 | 2 | 3;\n}\n\n/**\n * Clamps child text to a fixed number of lines inside a {@link TableCell}.\n */\nexport const TableLineClamp = React.forwardRef<HTMLDivElement, TableLineClampProps>(\n ({ className, lines = 2, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n lines === 1 && \"line-clamp-1\",\n lines === 2 && \"line-clamp-2\",\n lines === 3 && \"line-clamp-3\",\n className,\n )}\n {...props}\n />\n );\n },\n);\nTableLineClamp.displayName = \"TableLineClamp\";\n"],"names":["React","jsx","cn","jsxs","SearchIcon","CloseIcon","TranscationArrowIcon","Button"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAM,mBAAmBA,iBAAM,cAAyB,IAAI;AAE5D,SAAS,eAA0B;AACjC,SAAOA,iBAAM,WAAW,gBAAgB;AAC1C;AA8BO,MAAM,YAAYA,iBAAM;AAAA,EAC7B,CAAC,EAAE,WAAW,OAAO,MAAM,GAAG,MAAA,GAAS,QAAQ;AAC7C,WACEC,2BAAAA,IAAC,iBAAiB,UAAjB,EAA0B,OAAO,MAChC,UAAAA,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAWC,GAAAA;AAAA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,EAAA;AAGN;AAMO,MAAM,iBAAiBD,iBAAM;AAAA,EAClC,CAAC,EAAE,WAAW,UAAU,YAAY,MAAM,GAAG,MAAA,GAAS,QAAQ;AAC5D,WACEG,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAWD,GAAAA;AAAAA,UACT;AAAA,UACA,aAAa,QAAQ;AAAA,UACrB;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA;AAAA,UACA,aAAa,QAAQD,2BAAAA,IAAC,YAAA,EAAW,UAAA,CAAsB;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAG9D;AACF;AACA,eAAe,cAAc;AAetB,SAAS,iBAAiB,EAAE,OAAO,YAAmC;AAC3E,SAAOA,2BAAAA,IAAC,kBAAA,EAAiB,SAAS,OAAO,WAAW,UAAU;AAChE;AAEA,iBAAiB,cAAc;AAUxB,MAAM,iBAAiBD,iBAAM;AAAA,EAClC,CAAC,EAAE,WAAW,QAAQ,GAAG,GAAG,MAAA,GAAS,QAAQ;AAC3C,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAWC,GAAAA;AAAAA,UACT,UAAU,KAAK;AAAA,UACf,UAAU,KAAK;AAAA,UACf,UAAU,KAAK;AAAA,UACf;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AACA,eAAe,cAAc;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -4,6 +4,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
5
|
const React = require("react");
|
|
6
6
|
const cn = require("../../utils/cn.cjs");
|
|
7
|
+
const ChevronDownIcon = require("../Icons/ChevronDownIcon.cjs");
|
|
8
|
+
const ChevronLeftIcon = require("../Icons/ChevronLeftIcon.cjs");
|
|
9
|
+
const ChevronRightIcon = require("../Icons/ChevronRightIcon.cjs");
|
|
10
|
+
const DropdownMenuRoot = require("../DropdownMenu/DropdownMenuRoot.cjs");
|
|
11
|
+
const DropdownMenuItem = require("../DropdownMenu/DropdownMenuItem.cjs");
|
|
7
12
|
function _interopNamespaceDefault(e) {
|
|
8
13
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
9
14
|
if (e) {
|
|
@@ -21,50 +26,88 @@ function _interopNamespaceDefault(e) {
|
|
|
21
26
|
return Object.freeze(n);
|
|
22
27
|
}
|
|
23
28
|
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
24
|
-
const
|
|
25
|
-
({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
),
|
|
44
|
-
children: summary
|
|
45
|
-
}
|
|
46
|
-
)
|
|
47
|
-
] }),
|
|
48
|
-
paginationSlot != null ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center", children: paginationSlot }) : null
|
|
49
|
-
]
|
|
50
|
-
}
|
|
51
|
-
);
|
|
52
|
-
}
|
|
29
|
+
const TableCardPagination = React__namespace.forwardRef(
|
|
30
|
+
({
|
|
31
|
+
className,
|
|
32
|
+
page,
|
|
33
|
+
pageCount,
|
|
34
|
+
onPageChange,
|
|
35
|
+
pageSize,
|
|
36
|
+
pageSizeOptions,
|
|
37
|
+
onPageSizeChange,
|
|
38
|
+
formatPage = (current, total) => `${current} of ${total}`,
|
|
39
|
+
formatPageSize = (size) => `${size} rows`,
|
|
40
|
+
navigationLabel = "Pagination",
|
|
41
|
+
previousLabel = "Previous page",
|
|
42
|
+
nextLabel = "Next page",
|
|
43
|
+
pageSizeLabel = "Rows per page",
|
|
44
|
+
...props
|
|
45
|
+
}, ref) => {
|
|
46
|
+
const total = Math.max(pageCount, 1);
|
|
47
|
+
const stepButton = "inline-flex size-4 shrink-0 cursor-pointer items-center justify-center border-none bg-transparent p-0 text-icons-primary disabled:cursor-default disabled:opacity-40";
|
|
53
48
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
54
49
|
"div",
|
|
55
50
|
{
|
|
56
51
|
ref,
|
|
57
|
-
className: cn.cn(
|
|
52
|
+
className: cn.cn(
|
|
53
|
+
"typography-description-12px-regular flex h-8 shrink-0 items-center gap-6 border-border-primary border-t-[0.5px] bg-surface-table-row px-4 text-content-primary",
|
|
54
|
+
className
|
|
55
|
+
),
|
|
58
56
|
...props,
|
|
59
57
|
children: [
|
|
60
|
-
/* @__PURE__ */ jsxRuntime.
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
/* @__PURE__ */ jsxRuntime.jsxs("nav", { "aria-label": navigationLabel, className: "flex items-center gap-2", children: [
|
|
59
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
60
|
+
"button",
|
|
61
|
+
{
|
|
62
|
+
type: "button",
|
|
63
|
+
"aria-label": previousLabel,
|
|
64
|
+
className: stepButton,
|
|
65
|
+
disabled: page <= 1,
|
|
66
|
+
onClick: () => onPageChange(page - 1),
|
|
67
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronLeftIcon.ChevronLeftIcon, { size: 16 })
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "whitespace-nowrap", children: formatPage(page, total) }),
|
|
71
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
72
|
+
"button",
|
|
73
|
+
{
|
|
74
|
+
type: "button",
|
|
75
|
+
"aria-label": nextLabel,
|
|
76
|
+
className: stepButton,
|
|
77
|
+
disabled: page >= pageCount,
|
|
78
|
+
onClick: () => onPageChange(page + 1),
|
|
79
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronRightIcon.ChevronRightIcon, { size: 16 })
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
] }),
|
|
83
|
+
/* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuRoot.DropdownMenu, { children: [
|
|
84
|
+
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuRoot.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
85
|
+
"button",
|
|
86
|
+
{
|
|
87
|
+
type: "button",
|
|
88
|
+
"aria-label": `${pageSizeLabel}, ${formatPageSize(pageSize)}`,
|
|
89
|
+
className: "typography-description-12px-regular inline-flex cursor-pointer items-center gap-2 whitespace-nowrap border-none bg-transparent p-0 text-content-primary",
|
|
90
|
+
children: [
|
|
91
|
+
formatPageSize(pageSize),
|
|
92
|
+
/* @__PURE__ */ jsxRuntime.jsx(ChevronDownIcon.ChevronDownIcon, { size: 16, className: "text-icons-primary", "aria-hidden": true })
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
) }),
|
|
96
|
+
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuRoot.DropdownMenuContent, { align: "start", children: pageSizeOptions.map((option) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
97
|
+
DropdownMenuItem.DropdownMenuItem,
|
|
98
|
+
{
|
|
99
|
+
selected: option === pageSize,
|
|
100
|
+
onSelect: () => onPageSizeChange(option),
|
|
101
|
+
children: formatPageSize(option)
|
|
102
|
+
},
|
|
103
|
+
option
|
|
104
|
+
)) })
|
|
105
|
+
] })
|
|
63
106
|
]
|
|
64
107
|
}
|
|
65
108
|
);
|
|
66
109
|
}
|
|
67
110
|
);
|
|
68
|
-
|
|
69
|
-
exports.
|
|
111
|
+
TableCardPagination.displayName = "TableCardPagination";
|
|
112
|
+
exports.TableCardPagination = TableCardPagination;
|
|
70
113
|
//# sourceMappingURL=TablePagination.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TablePagination.cjs","sources":["../../../../src/components/Table/TablePagination.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\
|
|
1
|
+
{"version":3,"file":"TablePagination.cjs","sources":["../../../../src/components/Table/TablePagination.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"../DropdownMenu/DropdownMenu\";\nimport { ChevronDownIcon } from \"../Icons/ChevronDownIcon\";\nimport { ChevronLeftIcon } from \"../Icons/ChevronLeftIcon\";\nimport { ChevronRightIcon } from \"../Icons/ChevronRightIcon\";\n\nexport interface TableCardPaginationProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onChange\"> {\n /** Current page, 1-based. */\n page: number;\n /** Total number of pages. */\n pageCount: number;\n /** Called with the 1-based page to show. */\n onPageChange: (page: number) => void;\n /** Rows per page currently shown. */\n pageSize: number;\n /** Choices offered in the rows-per-page menu. */\n pageSizeOptions: readonly number[];\n /** Called with the new rows-per-page choice. */\n onPageSizeChange: (pageSize: number) => void;\n /** Formats the page indicator. @default (page, pageCount) => `${page} of ${pageCount}` */\n formatPage?: (page: number, pageCount: number) => string;\n /** Formats a rows-per-page choice. @default (pageSize) => `${pageSize} rows` */\n formatPageSize?: (pageSize: number) => string;\n /** Accessible name of the page navigation. @default \"Pagination\" */\n navigationLabel?: string;\n /** Accessible name of the previous-page button. @default \"Previous page\" */\n previousLabel?: string;\n /** Accessible name of the next-page button. @default \"Next page\" */\n nextLabel?: string;\n /** Accessible name of the rows-per-page menu trigger, followed by the current choice (e.g. \"Rows per page, 10 rows\"). @default \"Rows per page\" */\n pageSizeLabel?: string;\n}\n\n/**\n * 32px footer that closes a {@link TableCard}: previous, \"1 of N\", next, then\n * a rows-per-page menu, on `surface-table-row`. Place it after\n * {@link TableScrollArea} inside the card.\n *\n * @example\n * ```tsx\n * <TableCard>\n * <TableScrollArea>…</TableScrollArea>\n * <TableCardPagination\n * page={page}\n * pageCount={12}\n * onPageChange={setPage}\n * pageSize={10}\n * pageSizeOptions={[10, 25, 50]}\n * onPageSizeChange={setPageSize}\n * />\n * </TableCard>\n * ```\n */\nexport const TableCardPagination = React.forwardRef<HTMLDivElement, TableCardPaginationProps>(\n (\n {\n className,\n page,\n pageCount,\n onPageChange,\n pageSize,\n pageSizeOptions,\n onPageSizeChange,\n formatPage = (current, total) => `${current} of ${total}`,\n formatPageSize = (size) => `${size} rows`,\n navigationLabel = \"Pagination\",\n previousLabel = \"Previous page\",\n nextLabel = \"Next page\",\n pageSizeLabel = \"Rows per page\",\n ...props\n },\n ref,\n ) => {\n const total = Math.max(pageCount, 1);\n const stepButton =\n \"inline-flex size-4 shrink-0 cursor-pointer items-center justify-center border-none bg-transparent p-0 text-icons-primary disabled:cursor-default disabled:opacity-40\";\n return (\n <div\n ref={ref}\n className={cn(\n \"typography-description-12px-regular flex h-8 shrink-0 items-center gap-6 border-border-primary border-t-[0.5px] bg-surface-table-row px-4 text-content-primary\",\n className,\n )}\n {...props}\n >\n <nav aria-label={navigationLabel} className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n aria-label={previousLabel}\n className={stepButton}\n disabled={page <= 1}\n onClick={() => onPageChange(page - 1)}\n >\n <ChevronLeftIcon size={16} />\n </button>\n <span className=\"whitespace-nowrap\">{formatPage(page, total)}</span>\n <button\n type=\"button\"\n aria-label={nextLabel}\n className={stepButton}\n disabled={page >= pageCount}\n onClick={() => onPageChange(page + 1)}\n >\n <ChevronRightIcon size={16} />\n </button>\n </nav>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <button\n type=\"button\"\n aria-label={`${pageSizeLabel}, ${formatPageSize(pageSize)}`}\n className=\"typography-description-12px-regular inline-flex cursor-pointer items-center gap-2 whitespace-nowrap border-none bg-transparent p-0 text-content-primary\"\n >\n {formatPageSize(pageSize)}\n <ChevronDownIcon size={16} className=\"text-icons-primary\" aria-hidden />\n </button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\">\n {pageSizeOptions.map((option) => (\n <DropdownMenuItem\n key={option}\n selected={option === pageSize}\n onSelect={() => onPageSizeChange(option)}\n >\n {formatPageSize(option)}\n </DropdownMenuItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n );\n },\n);\nTableCardPagination.displayName = \"TableCardPagination\";\n"],"names":["React","jsxs","cn","jsx","ChevronLeftIcon","ChevronRightIcon","DropdownMenu","DropdownMenuTrigger","ChevronDownIcon","DropdownMenuContent","DropdownMenuItem"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DO,MAAM,sBAAsBA,iBAAM;AAAA,EACvC,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa,CAAC,SAAS,UAAU,GAAG,OAAO,OAAO,KAAK;AAAA,IACvD,iBAAiB,CAAC,SAAS,GAAG,IAAI;AAAA,IAClC,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,GAAG;AAAA,EAAA,GAEL,QACG;AACH,UAAM,QAAQ,KAAK,IAAI,WAAW,CAAC;AACnC,UAAM,aACJ;AACF,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAWC,GAAAA;AAAAA,UACT;AAAA,UACA;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAAD,2BAAAA,KAAC,OAAA,EAAI,cAAY,iBAAiB,WAAU,2BAC1C,UAAA;AAAA,YAAAE,2BAAAA;AAAAA,cAAC;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,cAAY;AAAA,gBACZ,WAAW;AAAA,gBACX,UAAU,QAAQ;AAAA,gBAClB,SAAS,MAAM,aAAa,OAAO,CAAC;AAAA,gBAEpC,UAAAA,2BAAAA,IAACC,gBA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@@ -66,6 +66,7 @@ const BankIcon = require("./components/Icons/BankIcon.cjs");
|
|
|
66
66
|
const BellIcon = require("./components/Icons/BellIcon.cjs");
|
|
67
67
|
const BellOffIcon = require("./components/Icons/BellOffIcon.cjs");
|
|
68
68
|
const BoltIcon = require("./components/Icons/BoltIcon.cjs");
|
|
69
|
+
const BookmarkIcon = require("./components/Icons/BookmarkIcon.cjs");
|
|
69
70
|
const BulbIcon = require("./components/Icons/BulbIcon.cjs");
|
|
70
71
|
const Calendar2Icon = require("./components/Icons/Calendar2Icon.cjs");
|
|
71
72
|
const CalendarIcon = require("./components/Icons/CalendarIcon.cjs");
|
|
@@ -390,6 +391,7 @@ exports.BankIcon = BankIcon.BankIcon;
|
|
|
390
391
|
exports.BellIcon = BellIcon.BellIcon;
|
|
391
392
|
exports.BellOffIcon = BellOffIcon.BellOffIcon;
|
|
392
393
|
exports.BoltIcon = BoltIcon.BoltIcon;
|
|
394
|
+
exports.BookmarkIcon = BookmarkIcon.BookmarkIcon;
|
|
393
395
|
exports.BulbIcon = BulbIcon.BulbIcon;
|
|
394
396
|
exports.Calendar2Icon = Calendar2Icon.Calendar2Icon;
|
|
395
397
|
exports.CalendarIcon = CalendarIcon.CalendarIcon;
|
|
@@ -598,17 +600,20 @@ exports.TableHead = Table.TableHead;
|
|
|
598
600
|
exports.TableHeader = Table.TableHeader;
|
|
599
601
|
exports.TableLineClamp = Table.TableLineClamp;
|
|
600
602
|
exports.TableMediaThumbnail = Table.TableMediaThumbnail;
|
|
603
|
+
exports.TableMediaTile = Table.TableMediaTile;
|
|
601
604
|
exports.TablePillProgressLayout = Table.TablePillProgressLayout;
|
|
602
605
|
exports.TableProgressTrack = Table.TableProgressTrack;
|
|
603
606
|
exports.TableRow = Table.TableRow;
|
|
604
|
-
exports.TableRowsPerPageSelect = Table.TableRowsPerPageSelect;
|
|
605
607
|
exports.TableScrollArea = Table.TableScrollArea;
|
|
606
608
|
exports.TableSortLabel = Table.TableSortLabel;
|
|
607
609
|
exports.TableStackedText = Table.TableStackedText;
|
|
608
610
|
exports.TableStatusDot = Table.TableStatusDot;
|
|
609
611
|
exports.TableToolbar = Table.TableToolbar;
|
|
612
|
+
exports.TableToolbarAction = Table.TableToolbarAction;
|
|
613
|
+
exports.TableToolbarButton = Table.TableToolbarButton;
|
|
614
|
+
exports.TableToolbarSearch = Table.TableToolbarSearch;
|
|
610
615
|
exports.TableMobileRow = TableMobileRow.TableMobileRow;
|
|
611
|
-
exports.
|
|
616
|
+
exports.TableCardPagination = TablePagination.TableCardPagination;
|
|
612
617
|
exports.Tabs = Tabs.Tabs;
|
|
613
618
|
exports.TabsContent = TabsContent.TabsContent;
|
|
614
619
|
exports.TabsList = TabsList.TabsList;
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,46 +3,73 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { cn } from "../../utils/cn.mjs";
|
|
5
5
|
import { Avatar } from "../Avatar/Avatar.mjs";
|
|
6
|
+
import { VerifiedIcon } from "../Icons/VerifiedIcon.mjs";
|
|
7
|
+
import { Pill } from "../Pill/Pill.mjs";
|
|
6
8
|
const CreatorCard = React.forwardRef(
|
|
7
|
-
({
|
|
9
|
+
({
|
|
10
|
+
className,
|
|
11
|
+
background,
|
|
12
|
+
pill,
|
|
13
|
+
avatar,
|
|
14
|
+
name,
|
|
15
|
+
verified = false,
|
|
16
|
+
verifiedLabel = "Verified",
|
|
17
|
+
tagline,
|
|
18
|
+
content,
|
|
19
|
+
action,
|
|
20
|
+
...props
|
|
21
|
+
}, ref) => {
|
|
8
22
|
return /* @__PURE__ */ jsxs(
|
|
9
23
|
"div",
|
|
10
24
|
{
|
|
11
25
|
ref,
|
|
12
26
|
className: cn(
|
|
13
|
-
"relative isolate flex
|
|
27
|
+
"relative isolate flex flex-col overflow-hidden bg-surface-primary",
|
|
14
28
|
className
|
|
15
29
|
),
|
|
16
30
|
...props,
|
|
17
31
|
children: [
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
/* @__PURE__ */ jsxs("div", { className: "relative aspect-10/11 w-full shrink-0 overflow-hidden", children: [
|
|
33
|
+
/* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0 select-none *:h-full *:w-full [&>img]:object-cover [&>video]:object-cover", children: background }),
|
|
34
|
+
pill ? /* @__PURE__ */ jsx(
|
|
35
|
+
Pill,
|
|
36
|
+
{
|
|
37
|
+
variant: "contrast",
|
|
38
|
+
...pill,
|
|
39
|
+
className: cn("absolute top-2 left-2 max-w-[calc(100%-1rem)]", pill.className)
|
|
40
|
+
}
|
|
41
|
+
) : null
|
|
42
|
+
] }),
|
|
43
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-2.5 p-3", children: [
|
|
44
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
30
45
|
/* @__PURE__ */ jsx(
|
|
31
46
|
Avatar,
|
|
32
47
|
{
|
|
33
|
-
size:
|
|
48
|
+
size: 32,
|
|
34
49
|
src: avatar?.src,
|
|
35
|
-
alt: avatar?.alt ?? name,
|
|
50
|
+
alt: avatar?.alt ?? (typeof name === "string" ? name : void 0),
|
|
36
51
|
fallback: avatar?.fallback,
|
|
37
52
|
...avatar
|
|
38
53
|
}
|
|
39
54
|
),
|
|
40
|
-
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
|
|
55
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
56
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-1", children: [
|
|
57
|
+
/* @__PURE__ */ jsx("p", { className: "typography-body-small-14px-semibold m-0 truncate text-content-primary", children: name }),
|
|
58
|
+
verified ? /* @__PURE__ */ jsx(
|
|
59
|
+
"span",
|
|
60
|
+
{
|
|
61
|
+
role: "img",
|
|
62
|
+
"aria-label": verifiedLabel,
|
|
63
|
+
className: "inline-flex shrink-0 text-content-primary",
|
|
64
|
+
children: /* @__PURE__ */ jsx(VerifiedIcon, { size: 16, filled: true })
|
|
65
|
+
}
|
|
66
|
+
) : null
|
|
67
|
+
] }),
|
|
68
|
+
tagline ? /* @__PURE__ */ jsx("p", { className: "typography-body-small-14px-regular m-0 truncate text-content-secondary", children: tagline }) : null
|
|
43
69
|
] })
|
|
44
70
|
] }),
|
|
45
|
-
|
|
71
|
+
content ? /* @__PURE__ */ jsx("div", { className: "typography-body-small-14px-semibold min-w-0 text-content-primary", children: content }) : null,
|
|
72
|
+
action ? /* @__PURE__ */ jsx("div", { className: "flex w-full", children: action }) : null
|
|
46
73
|
] })
|
|
47
74
|
]
|
|
48
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreatorCard.mjs","sources":["../../../src/components/CreatorCard/CreatorCard.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Avatar } from \"../Avatar/Avatar\";\n\nexport interface CreatorCardProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Decorative
|
|
1
|
+
{"version":3,"file":"CreatorCard.mjs","sources":["../../../src/components/CreatorCard/CreatorCard.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Avatar } from \"../Avatar/Avatar\";\nimport { VerifiedIcon } from \"../Icons/VerifiedIcon\";\nimport { Pill, type PillProps } from \"../Pill/Pill\";\n\nexport interface CreatorCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"content\"> {\n /** Decorative banner media rendered at the top of the card. */\n background: React.ReactNode;\n /**\n * Props forwarded to a {@link Pill} overlaid on the top-left of the banner.\n * Pass the label as `children`. Omit to hide the pill.\n */\n pill?: PillProps;\n /** Avatar props forwarded to the inner {@link Avatar}. */\n avatar?: React.ComponentPropsWithoutRef<typeof Avatar>;\n /** Creator display name shown next to the avatar. */\n name: React.ReactNode;\n /** When `true`, renders a verified badge after the name. @default false */\n verified?: boolean;\n /** Accessible label for the verified badge. @default \"Verified\" */\n verifiedLabel?: string;\n /** Optional secondary line shown under the name (e.g. post count). */\n tagline?: React.ReactNode;\n /**\n * Optional content shown under the creator details (e.g. the subscription\n * price). It wraps by default; pass a `truncate` element to keep it on one line.\n */\n content?: React.ReactNode;\n /**\n * Action element rendered full-width at the bottom of the card (e.g. a\n * `Button` with `fullWidth` for subscribing to the creator).\n */\n action?: React.ReactNode;\n}\n\n/**\n * A card suggesting a creator, with a banner image, an optional {@link Pill},\n * the creator's avatar, name and tagline, free-form content such as a price,\n * and an optional action.\n *\n * The card has no fixed width or corner radius: set both through `className`\n * (e.g. `className=\"w-40 rounded-md\"`). The banner keeps a 10:11 ratio at any\n * width.\n *\n * @example\n * ```tsx\n * <CreatorCard\n * className=\"w-40 rounded-md\"\n * background={<img src=\"/banner.jpg\" alt=\"\" />}\n * pill={{ variant: \"contrast\", children: \"Popular this week\" }}\n * avatar={{ src: \"/avatar.jpg\", fallback: \"JD\" }}\n * name=\"Jane Doe\"\n * verified\n * tagline=\"412 posts\"\n * content={<span className=\"block truncate\">$9.99 / month</span>}\n * action={<Button variant=\"primary\" size=\"32\" fullWidth>Subscribe</Button>}\n * />\n * ```\n */\nexport const CreatorCard = React.forwardRef<HTMLDivElement, CreatorCardProps>(\n (\n {\n className,\n background,\n pill,\n avatar,\n name,\n verified = false,\n verifiedLabel = \"Verified\",\n tagline,\n content,\n action,\n ...props\n },\n ref,\n ) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"relative isolate flex flex-col overflow-hidden bg-surface-primary\",\n className,\n )}\n {...props}\n >\n <div className=\"relative aspect-10/11 w-full shrink-0 overflow-hidden\">\n <div className=\"pointer-events-none absolute inset-0 select-none *:h-full *:w-full [&>img]:object-cover [&>video]:object-cover\">\n {background}\n </div>\n {pill ? (\n <Pill\n variant=\"contrast\"\n {...pill}\n className={cn(\"absolute top-2 left-2 max-w-[calc(100%-1rem)]\", pill.className)}\n />\n ) : null}\n </div>\n <div className=\"flex min-w-0 flex-col gap-2.5 p-3\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <Avatar\n size={32}\n src={avatar?.src}\n alt={avatar?.alt ?? (typeof name === \"string\" ? name : undefined)}\n fallback={avatar?.fallback}\n {...avatar}\n />\n <div className=\"flex min-w-0 flex-1 flex-col\">\n <div className=\"flex min-w-0 items-center gap-1\">\n <p className=\"typography-body-small-14px-semibold m-0 truncate text-content-primary\">\n {name}\n </p>\n {verified ? (\n <span\n role=\"img\"\n aria-label={verifiedLabel}\n className=\"inline-flex shrink-0 text-content-primary\"\n >\n <VerifiedIcon size={16} filled />\n </span>\n ) : null}\n </div>\n {tagline ? (\n <p className=\"typography-body-small-14px-regular m-0 truncate text-content-secondary\">\n {tagline}\n </p>\n ) : null}\n </div>\n </div>\n {content ? (\n <div className=\"typography-body-small-14px-semibold min-w-0 text-content-primary\">\n {content}\n </div>\n ) : null}\n {action ? <div className=\"flex w-full\">{action}</div> : null}\n </div>\n </div>\n );\n },\n);\n\nCreatorCard.displayName = \"CreatorCard\";\n"],"names":[],"mappings":";;;;;;;AA4DO,MAAM,cAAc,MAAM;AAAA,EAC/B,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,gBAAgB;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QACG;AACH,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAA,qBAAC,OAAA,EAAI,WAAU,yDACb,UAAA;AAAA,YAAA,oBAAC,OAAA,EAAI,WAAU,kHACZ,UAAA,YACH;AAAA,YACC,OACC;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,SAAQ;AAAA,gBACP,GAAG;AAAA,gBACJ,WAAW,GAAG,iDAAiD,KAAK,SAAS;AAAA,cAAA;AAAA,YAAA,IAE7E;AAAA,UAAA,GACN;AAAA,UACA,qBAAC,OAAA,EAAI,WAAU,qCACb,UAAA;AAAA,YAAA,qBAAC,OAAA,EAAI,WAAU,mCACb,UAAA;AAAA,cAAA;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,MAAM;AAAA,kBACN,KAAK,QAAQ;AAAA,kBACb,KAAK,QAAQ,QAAQ,OAAO,SAAS,WAAW,OAAO;AAAA,kBACvD,UAAU,QAAQ;AAAA,kBACjB,GAAG;AAAA,gBAAA;AAAA,cAAA;AAAA,cAEN,qBAAC,OAAA,EAAI,WAAU,gCACb,UAAA;AAAA,gBAAA,qBAAC,OAAA,EAAI,WAAU,mCACb,UAAA;AAAA,kBAAA,oBAAC,KAAA,EAAE,WAAU,yEACV,UAAA,MACH;AAAA,kBACC,WACC;AAAA,oBAAC;AAAA,oBAAA;AAAA,sBACC,MAAK;AAAA,sBACL,cAAY;AAAA,sBACZ,WAAU;AAAA,sBAEV,UAAA,oBAAC,cAAA,EAAa,MAAM,IAAI,QAAM,KAAA,CAAC;AAAA,oBAAA;AAAA,kBAAA,IAE/B;AAAA,gBAAA,GACN;AAAA,gBACC,UACC,oBAAC,KAAA,EAAE,WAAU,0EACV,mBACH,IACE;AAAA,cAAA,EAAA,CACN;AAAA,YAAA,GACF;AAAA,YACC,UACC,oBAAC,OAAA,EAAI,WAAU,oEACZ,mBACH,IACE;AAAA,YACH,SAAS,oBAAC,OAAA,EAAI,WAAU,eAAe,kBAAO,IAAS;AAAA,UAAA,EAAA,CAC1D;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,YAAY,cAAc;"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { BaseIcon } from "./BaseIcon.mjs";
|
|
5
|
+
const VARIANTS = {
|
|
6
|
+
16: {
|
|
7
|
+
outlined: [
|
|
8
|
+
{
|
|
9
|
+
d: "M12.713 15.167c-.34 0-.713-.1-1.073-.307l-3.253-1.807c-.194-.106-.574-.106-.767 0L4.367 14.86c-.66.367-1.334.407-1.847.1-.513-.3-.807-.907-.807-1.66V3.907A3.08 3.08 0 0 1 4.787.833h6.433a3.08 3.08 0 0 1 3.073 3.074V13.3c0 .753-.293 1.36-.806 1.66-.234.14-.5.207-.774.207M8 11.973c.313 0 .62.067.867.207l3.253 1.807c.34.193.653.233.853.113s.314-.407.314-.8V3.907a2.08 2.08 0 0 0-2.074-2.074H4.787a2.08 2.08 0 0 0-2.074 2.074V13.3c0 .393.114.687.314.8s.506.08.853-.113l3.253-1.807c.247-.14.554-.207.867-.207"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
filled: [
|
|
13
|
+
{
|
|
14
|
+
d: "M11.213 1.333H4.787a2.58 2.58 0 0 0-2.574 2.574V13.3c0 1.2.86 1.707 1.914 1.127L7.38 12.62c.347-.193.907-.193 1.247 0l3.253 1.807c1.053.586 1.913.08 1.913-1.127V3.907a2.59 2.59 0 0 0-2.58-2.574"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
24: {
|
|
19
|
+
outlined: [
|
|
20
|
+
{
|
|
21
|
+
d: "M19.07 22.75c-.51 0-1.07-.15-1.61-.46l-4.88-2.71c-.29-.16-.86-.16-1.15 0l-4.88 2.71c-.99.55-2 .61-2.77.15-.77-.45-1.21-1.36-1.21-2.49V5.86c0-2.54 2.07-4.61 4.61-4.61h9.65c2.54 0 4.61 2.07 4.61 4.61v14.09c0 1.13-.44 2.04-1.21 2.49-.35.21-.75.31-1.16.31M12 17.96c.47 0 .93.1 1.3.31l4.88 2.71c.51.29.98.35 1.28.17s.47-.61.47-1.2V5.86c0-1.71-1.4-3.11-3.11-3.11H7.18a3.12 3.12 0 0 0-3.11 3.11v14.09c0 .59.17 1.03.47 1.2s.76.12 1.28-.17l4.88-2.71c.37-.21.83-.31 1.3-.31"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
filled: [
|
|
25
|
+
{
|
|
26
|
+
d: "M16.82 2H7.18C5.05 2 3.32 3.74 3.32 5.86v14.09c0 1.8 1.29 2.56 2.87 1.69l4.88-2.71c.52-.29 1.36-.29 1.87 0l4.88 2.71c1.58.88 2.87.12 2.87-1.69V5.86C20.68 3.74 18.95 2 16.82 2"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
32: {
|
|
31
|
+
outlined: [
|
|
32
|
+
{
|
|
33
|
+
d: "M25.427 30.333c-.68 0-1.427-.2-2.147-.613l-6.507-3.613c-.386-.214-1.146-.214-1.533 0L8.733 29.72c-1.32.733-2.666.813-3.693.2-1.027-.6-1.613-1.813-1.613-3.32V7.813a6.157 6.157 0 0 1 6.146-6.146H22.44a6.157 6.157 0 0 1 6.147 6.146V26.6c0 1.507-.587 2.72-1.613 3.32-.467.28-1 .413-1.547.413M16 23.947c.627 0 1.24.133 1.733.413l6.507 3.613c.68.387 1.307.467 1.707.227s.627-.813.627-1.6V7.813a4.16 4.16 0 0 0-4.147-4.146H9.573a4.16 4.16 0 0 0-4.146 4.146V26.6c0 .787.226 1.373.626 1.6s1.014.16 1.707-.227l6.507-3.613c.493-.28 1.107-.413 1.733-.413"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
filled: [
|
|
37
|
+
{
|
|
38
|
+
d: "M22.427 2.667H9.573c-2.84 0-5.146 2.32-5.146 5.146V26.6c0 2.4 1.72 3.413 3.826 2.253l6.507-3.613c.694-.387 1.813-.387 2.493 0l6.507 3.613c2.107 1.174 3.827.16 3.827-2.253V7.813c-.014-2.826-2.32-5.146-5.16-5.146"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const BookmarkIcon = React.forwardRef((props, ref) => /* @__PURE__ */ jsx(BaseIcon, { ref, variants: VARIANTS, ...props }));
|
|
44
|
+
BookmarkIcon.displayName = "BookmarkIcon";
|
|
45
|
+
export {
|
|
46
|
+
BookmarkIcon
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=BookmarkIcon.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BookmarkIcon.mjs","sources":["../../../src/components/Icons/BookmarkIcon.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { BaseIcon } from \"./BaseIcon\";\nimport type { BaseIconProps, IconVariants } from \"./types\";\n\nconst VARIANTS: IconVariants = {\n 16: {\n outlined: [\n {\n d: \"M12.713 15.167c-.34 0-.713-.1-1.073-.307l-3.253-1.807c-.194-.106-.574-.106-.767 0L4.367 14.86c-.66.367-1.334.407-1.847.1-.513-.3-.807-.907-.807-1.66V3.907A3.08 3.08 0 0 1 4.787.833h6.433a3.08 3.08 0 0 1 3.073 3.074V13.3c0 .753-.293 1.36-.806 1.66-.234.14-.5.207-.774.207M8 11.973c.313 0 .62.067.867.207l3.253 1.807c.34.193.653.233.853.113s.314-.407.314-.8V3.907a2.08 2.08 0 0 0-2.074-2.074H4.787a2.08 2.08 0 0 0-2.074 2.074V13.3c0 .393.114.687.314.8s.506.08.853-.113l3.253-1.807c.247-.14.554-.207.867-.207\",\n },\n ],\n filled: [\n {\n d: \"M11.213 1.333H4.787a2.58 2.58 0 0 0-2.574 2.574V13.3c0 1.2.86 1.707 1.914 1.127L7.38 12.62c.347-.193.907-.193 1.247 0l3.253 1.807c1.053.586 1.913.08 1.913-1.127V3.907a2.59 2.59 0 0 0-2.58-2.574\",\n },\n ],\n },\n 24: {\n outlined: [\n {\n d: \"M19.07 22.75c-.51 0-1.07-.15-1.61-.46l-4.88-2.71c-.29-.16-.86-.16-1.15 0l-4.88 2.71c-.99.55-2 .61-2.77.15-.77-.45-1.21-1.36-1.21-2.49V5.86c0-2.54 2.07-4.61 4.61-4.61h9.65c2.54 0 4.61 2.07 4.61 4.61v14.09c0 1.13-.44 2.04-1.21 2.49-.35.21-.75.31-1.16.31M12 17.96c.47 0 .93.1 1.3.31l4.88 2.71c.51.29.98.35 1.28.17s.47-.61.47-1.2V5.86c0-1.71-1.4-3.11-3.11-3.11H7.18a3.12 3.12 0 0 0-3.11 3.11v14.09c0 .59.17 1.03.47 1.2s.76.12 1.28-.17l4.88-2.71c.37-.21.83-.31 1.3-.31\",\n },\n ],\n filled: [\n {\n d: \"M16.82 2H7.18C5.05 2 3.32 3.74 3.32 5.86v14.09c0 1.8 1.29 2.56 2.87 1.69l4.88-2.71c.52-.29 1.36-.29 1.87 0l4.88 2.71c1.58.88 2.87.12 2.87-1.69V5.86C20.68 3.74 18.95 2 16.82 2\",\n },\n ],\n },\n 32: {\n outlined: [\n {\n d: \"M25.427 30.333c-.68 0-1.427-.2-2.147-.613l-6.507-3.613c-.386-.214-1.146-.214-1.533 0L8.733 29.72c-1.32.733-2.666.813-3.693.2-1.027-.6-1.613-1.813-1.613-3.32V7.813a6.157 6.157 0 0 1 6.146-6.146H22.44a6.157 6.157 0 0 1 6.147 6.146V26.6c0 1.507-.587 2.72-1.613 3.32-.467.28-1 .413-1.547.413M16 23.947c.627 0 1.24.133 1.733.413l6.507 3.613c.68.387 1.307.467 1.707.227s.627-.813.627-1.6V7.813a4.16 4.16 0 0 0-4.147-4.146H9.573a4.16 4.16 0 0 0-4.146 4.146V26.6c0 .787.226 1.373.626 1.6s1.014.16 1.707-.227l6.507-3.613c.493-.28 1.107-.413 1.733-.413\",\n },\n ],\n filled: [\n {\n d: \"M22.427 2.667H9.573c-2.84 0-5.146 2.32-5.146 5.146V26.6c0 2.4 1.72 3.413 3.826 2.253l6.507-3.613c.694-.387 1.813-.387 2.493 0l6.507 3.613c2.107 1.174 3.827.16 3.827-2.253V7.813c-.014-2.826-2.32-5.146-5.16-5.146\",\n },\n ],\n },\n};\n\n/** Props for {@link BookmarkIcon}. See {@link BaseIconProps} for the shared shape. */\nexport type BookmarkIconProps = BaseIconProps;\n\n/**\n * Bookmark icon. Renders at sizes 16, 24, or 32 px with outlined and filled variants.\n *\n * @example\n * ```tsx\n * <BookmarkIcon size={24} filled />\n * ```\n */\nexport const BookmarkIcon = React.forwardRef<SVGSVGElement, BookmarkIconProps>((props, ref) => (\n <BaseIcon ref={ref} variants={VARIANTS} {...props} />\n));\n\nBookmarkIcon.displayName = \"BookmarkIcon\";\n"],"names":[],"mappings":";;;;AAIA,MAAM,WAAyB;AAAA,EAC7B,IAAI;AAAA,IACF,UAAU;AAAA,MACR;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,IAEF,QAAQ;AAAA,MACN;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,EACF;AAAA,EAEF,IAAI;AAAA,IACF,UAAU;AAAA,MACR;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,IAEF,QAAQ;AAAA,MACN;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,EACF;AAAA,EAEF,IAAI;AAAA,IACF,UAAU;AAAA,MACR;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,IAEF,QAAQ;AAAA,MACN;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,EACF;AAEJ;AAaO,MAAM,eAAe,MAAM,WAA6C,CAAC,OAAO,QACrF,oBAAC,UAAA,EAAS,KAAU,UAAU,UAAW,GAAG,OAAO,CACpD;AAED,aAAa,cAAc;"}
|