@fanvue/ui 3.25.0 → 3.26.1
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/Accordion/AccordionTrigger.cjs +1 -1
- package/dist/cjs/components/Accordion/AccordionTrigger.cjs.map +1 -1
- package/dist/cjs/components/AiButton/AiButton.cjs +2 -2
- package/dist/cjs/components/AiButton/AiButton.cjs.map +1 -1
- package/dist/cjs/components/AiDisclosureBadge/AiDisclosureBadge.cjs +65 -0
- package/dist/cjs/components/AiDisclosureBadge/AiDisclosureBadge.cjs.map +1 -0
- package/dist/cjs/components/AiDisclosureLabel/AiDisclosureLabel.cjs +72 -0
- package/dist/cjs/components/AiDisclosureLabel/AiDisclosureLabel.cjs.map +1 -0
- package/dist/cjs/components/Alert/Alert.cjs +1 -1
- package/dist/cjs/components/Alert/Alert.cjs.map +1 -1
- package/dist/cjs/components/BottomNavigation/BottomNavigation.cjs +1 -1
- package/dist/cjs/components/BottomNavigation/BottomNavigation.cjs.map +1 -1
- package/dist/cjs/components/DropdownMenu/DropdownMenu.cjs +4 -4
- package/dist/cjs/components/DropdownMenu/DropdownMenu.cjs.map +1 -1
- package/dist/cjs/components/EmptyState/EmptyState.cjs +2 -2
- package/dist/cjs/components/EmptyState/EmptyState.cjs.map +1 -1
- package/dist/cjs/components/Icons/AISettingsIcon.cjs +83 -0
- package/dist/cjs/components/Icons/AISettingsIcon.cjs.map +1 -0
- package/dist/cjs/components/Icons/ProgrammingArrowIcon.cjs +72 -0
- package/dist/cjs/components/Icons/ProgrammingArrowIcon.cjs.map +1 -0
- package/dist/cjs/components/Icons/RefreshArrowIcon.cjs +52 -0
- package/dist/cjs/components/Icons/RefreshArrowIcon.cjs.map +1 -0
- package/dist/cjs/components/Logo/Logo.cjs +1 -1
- package/dist/cjs/components/Logo/Logo.cjs.map +1 -1
- package/dist/cjs/components/SegmentedControl/SegmentedControl.cjs +169 -32
- package/dist/cjs/components/SegmentedControl/SegmentedControl.cjs.map +1 -1
- package/dist/cjs/components/Slider/SliderLayout.cjs +1 -1
- package/dist/cjs/components/Slider/SliderLayout.cjs.map +1 -1
- package/dist/cjs/components/Table/Table.cjs +2 -2
- package/dist/cjs/components/Table/Table.cjs.map +1 -1
- package/dist/cjs/components/UserDisplayName/UserDisplayName.cjs +1 -1
- package/dist/cjs/components/UserDisplayName/UserDisplayName.cjs.map +1 -1
- package/dist/cjs/index.cjs +10 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/components/Accordion/AccordionTrigger.mjs +1 -1
- package/dist/components/Accordion/AccordionTrigger.mjs.map +1 -1
- package/dist/components/AiButton/AiButton.mjs +2 -2
- package/dist/components/AiButton/AiButton.mjs.map +1 -1
- package/dist/components/AiDisclosureBadge/AiDisclosureBadge.mjs +48 -0
- package/dist/components/AiDisclosureBadge/AiDisclosureBadge.mjs.map +1 -0
- package/dist/components/AiDisclosureLabel/AiDisclosureLabel.mjs +55 -0
- package/dist/components/AiDisclosureLabel/AiDisclosureLabel.mjs.map +1 -0
- package/dist/components/Alert/Alert.mjs +1 -1
- package/dist/components/Alert/Alert.mjs.map +1 -1
- package/dist/components/BottomNavigation/BottomNavigation.mjs +1 -1
- package/dist/components/BottomNavigation/BottomNavigation.mjs.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.mjs +4 -4
- package/dist/components/DropdownMenu/DropdownMenu.mjs.map +1 -1
- package/dist/components/EmptyState/EmptyState.mjs +2 -2
- package/dist/components/EmptyState/EmptyState.mjs.map +1 -1
- package/dist/components/Icons/AISettingsIcon.mjs +66 -0
- package/dist/components/Icons/AISettingsIcon.mjs.map +1 -0
- package/dist/components/Icons/ProgrammingArrowIcon.mjs +55 -0
- package/dist/components/Icons/ProgrammingArrowIcon.mjs.map +1 -0
- package/dist/components/Icons/RefreshArrowIcon.mjs +35 -0
- package/dist/components/Icons/RefreshArrowIcon.mjs.map +1 -0
- package/dist/components/Logo/Logo.mjs +1 -1
- package/dist/components/Logo/Logo.mjs.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.mjs +170 -33
- package/dist/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
- package/dist/components/Slider/SliderLayout.mjs +1 -1
- package/dist/components/Slider/SliderLayout.mjs.map +1 -1
- package/dist/components/Table/Table.mjs +2 -2
- package/dist/components/Table/Table.mjs.map +1 -1
- package/dist/components/UserDisplayName/UserDisplayName.mjs +1 -1
- package/dist/components/UserDisplayName/UserDisplayName.mjs.map +1 -1
- package/dist/index.d.ts +127 -2
- package/dist/index.mjs +10 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -5
|
@@ -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-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 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-b border-content-primary 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,C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N;;;;;;;;;;;;;;;;;;;;;"}
|
|
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,MAA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BAAiBD,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;AAatB,SAAS,uBAAuB,OAAoC;AACzE,QAAM,EAAE,IAAI,cAAc,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;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -68,7 +68,7 @@ const UserDisplayName = React__namespace.forwardRef(
|
|
|
68
68
|
children: /* @__PURE__ */ jsxRuntime.jsx(AIDisclosureIcon.AIDisclosureIcon, { size: 16 })
|
|
69
69
|
}
|
|
70
70
|
),
|
|
71
|
-
showOnlineStatus && /* @__PURE__ */ jsxRuntime.jsx(ProfileOnlineStatus.ProfileOnlineStatus, { label: onlineLabel, className: "shrink-0
|
|
71
|
+
showOnlineStatus && /* @__PURE__ */ jsxRuntime.jsx(ProfileOnlineStatus.ProfileOnlineStatus, { label: onlineLabel, className: "ml-2 shrink-0" })
|
|
72
72
|
]
|
|
73
73
|
}
|
|
74
74
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserDisplayName.cjs","sources":["../../../../src/components/UserDisplayName/UserDisplayName.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { AIDisclosureIcon } from \"../Icons/AIDisclosureIcon\";\nimport { VerifiedIcon } from \"../Icons/VerifiedIcon\";\nimport { ProfileOnlineStatus } from \"../ProfileOnlineStatus/ProfileOnlineStatus\";\n\nexport interface UserDisplayNameProps extends React.HTMLAttributes<HTMLElement> {\n /** Render an AI-disclosure badge after the name, alongside any status badge. */\n aiDisclosure?: boolean;\n /** Accessible label for the AI-disclosure badge. @default \"AI creator\" */\n aiDisclosureLabel?: string;\n /** Render an ambassador badge after the name. */\n ambassador?: boolean;\n /** Accessible label for the ambassador badge. @default \"Ambassador\" */\n ambassadorLabel?: string;\n /** HTML element used for the root wrapper. @default \"span\" */\n component?: \"span\" | \"h1\" | \"h2\" | \"h3\" | \"p\" | \"div\";\n /** Truncate the display name on a single line. @default true */\n noWrap?: boolean;\n /** Accessible label for the online-status indicator. @default \"Online\" */\n onlineLabel?: string;\n /** Render the inline online-status indicator after the name. @default false */\n showOnlineStatus?: boolean;\n /** Render a verified badge after the name (ignored when `ambassador` is set). */\n verified?: boolean;\n /** Accessible label for the verified badge. @default \"Verified\" */\n verifiedLabel?: string;\n}\n\n/**\n * Renders a user's display name with optional ambassador/verified badges and an\n * online-status indicator. Only the name shrinks and truncates; trailing badges\n * and the online-status indicator stay visible on the same line.\n *\n * Typography is not baked in: pass a `typography-*` utility via `className` on\n * the root and the name inherits it. Use `typography-body-small-14px-semibold`\n * for the standard display-name scale.\n *\n * When both `ambassador` and `verified` are set, the ambassador badge takes\n * precedence. `aiDisclosure` is independent of both and renders after whichever\n * status badge is shown, since it discloses how the account is operated rather\n * than ranking it.\n *\n * The verified and AI-disclosure badges inherit the name's colour, so setting a\n * colour on the root tints them with it. That keeps them legible on surfaces\n * that fix their own text colour — over a cover image, for example, where a\n * theme-dependent tint would turn black against white text in light mode.\n *\n * The ambassador tint is deliberately not inherited: it uses `text-success-content`\n * (not `text-icons-brand-green`) so the green darkens in light mode and lightens\n * in dark mode, matching {@link ProfileOnlineStatus}; `text-icons-brand-green` is\n * fixed across modes.\n *\n * @example\n * ```tsx\n * <UserDisplayName className=\"typography-body-small-14px-semibold\">Jane Doe</UserDisplayName>\n * ```\n */\nexport const UserDisplayName = React.forwardRef<HTMLElement, UserDisplayNameProps>(\n (\n {\n aiDisclosure,\n aiDisclosureLabel = \"AI creator\",\n ambassador,\n ambassadorLabel = \"Ambassador\",\n children,\n className,\n component = \"span\",\n noWrap = true,\n onlineLabel = \"Online\",\n showOnlineStatus,\n verified,\n verifiedLabel = \"Verified\",\n ...props\n },\n ref,\n ) => {\n const Component = component as React.ElementType;\n\n const badge = ambassador\n ? { label: ambassadorLabel, tint: \"text-success-content\" }\n : verified\n ? { label: verifiedLabel, tint: \"text-current\" }\n : null;\n\n return (\n <Component\n ref={ref}\n className={cn(\"inline-flex max-w-full items-center\", className)}\n {...props}\n >\n <span className={cn(\"min-w-0\", noWrap && \"truncate\")}>{children}</span>\n {badge && (\n <span\n role=\"img\"\n aria-label={badge.label}\n className={cn(\"ml-2 inline-flex shrink-0 items-center\", badge.tint)}\n >\n <VerifiedIcon size={16} />\n </span>\n )}\n {aiDisclosure && (\n <span\n role=\"img\"\n aria-label={aiDisclosureLabel}\n className=\"ml-2 inline-flex shrink-0 items-center text-current\"\n >\n <AIDisclosureIcon size={16} />\n </span>\n )}\n {showOnlineStatus && <ProfileOnlineStatus label={onlineLabel} className=\"shrink-0
|
|
1
|
+
{"version":3,"file":"UserDisplayName.cjs","sources":["../../../../src/components/UserDisplayName/UserDisplayName.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { AIDisclosureIcon } from \"../Icons/AIDisclosureIcon\";\nimport { VerifiedIcon } from \"../Icons/VerifiedIcon\";\nimport { ProfileOnlineStatus } from \"../ProfileOnlineStatus/ProfileOnlineStatus\";\n\nexport interface UserDisplayNameProps extends React.HTMLAttributes<HTMLElement> {\n /** Render an AI-disclosure badge after the name, alongside any status badge. */\n aiDisclosure?: boolean;\n /** Accessible label for the AI-disclosure badge. @default \"AI creator\" */\n aiDisclosureLabel?: string;\n /** Render an ambassador badge after the name. */\n ambassador?: boolean;\n /** Accessible label for the ambassador badge. @default \"Ambassador\" */\n ambassadorLabel?: string;\n /** HTML element used for the root wrapper. @default \"span\" */\n component?: \"span\" | \"h1\" | \"h2\" | \"h3\" | \"p\" | \"div\";\n /** Truncate the display name on a single line. @default true */\n noWrap?: boolean;\n /** Accessible label for the online-status indicator. @default \"Online\" */\n onlineLabel?: string;\n /** Render the inline online-status indicator after the name. @default false */\n showOnlineStatus?: boolean;\n /** Render a verified badge after the name (ignored when `ambassador` is set). */\n verified?: boolean;\n /** Accessible label for the verified badge. @default \"Verified\" */\n verifiedLabel?: string;\n}\n\n/**\n * Renders a user's display name with optional ambassador/verified badges and an\n * online-status indicator. Only the name shrinks and truncates; trailing badges\n * and the online-status indicator stay visible on the same line.\n *\n * Typography is not baked in: pass a `typography-*` utility via `className` on\n * the root and the name inherits it. Use `typography-body-small-14px-semibold`\n * for the standard display-name scale.\n *\n * When both `ambassador` and `verified` are set, the ambassador badge takes\n * precedence. `aiDisclosure` is independent of both and renders after whichever\n * status badge is shown, since it discloses how the account is operated rather\n * than ranking it.\n *\n * The verified and AI-disclosure badges inherit the name's colour, so setting a\n * colour on the root tints them with it. That keeps them legible on surfaces\n * that fix their own text colour — over a cover image, for example, where a\n * theme-dependent tint would turn black against white text in light mode.\n *\n * The ambassador tint is deliberately not inherited: it uses `text-success-content`\n * (not `text-icons-brand-green`) so the green darkens in light mode and lightens\n * in dark mode, matching {@link ProfileOnlineStatus}; `text-icons-brand-green` is\n * fixed across modes.\n *\n * @example\n * ```tsx\n * <UserDisplayName className=\"typography-body-small-14px-semibold\">Jane Doe</UserDisplayName>\n * ```\n */\nexport const UserDisplayName = React.forwardRef<HTMLElement, UserDisplayNameProps>(\n (\n {\n aiDisclosure,\n aiDisclosureLabel = \"AI creator\",\n ambassador,\n ambassadorLabel = \"Ambassador\",\n children,\n className,\n component = \"span\",\n noWrap = true,\n onlineLabel = \"Online\",\n showOnlineStatus,\n verified,\n verifiedLabel = \"Verified\",\n ...props\n },\n ref,\n ) => {\n const Component = component as React.ElementType;\n\n const badge = ambassador\n ? { label: ambassadorLabel, tint: \"text-success-content\" }\n : verified\n ? { label: verifiedLabel, tint: \"text-current\" }\n : null;\n\n return (\n <Component\n ref={ref}\n className={cn(\"inline-flex max-w-full items-center\", className)}\n {...props}\n >\n <span className={cn(\"min-w-0\", noWrap && \"truncate\")}>{children}</span>\n {badge && (\n <span\n role=\"img\"\n aria-label={badge.label}\n className={cn(\"ml-2 inline-flex shrink-0 items-center\", badge.tint)}\n >\n <VerifiedIcon size={16} />\n </span>\n )}\n {aiDisclosure && (\n <span\n role=\"img\"\n aria-label={aiDisclosureLabel}\n className=\"ml-2 inline-flex shrink-0 items-center text-current\"\n >\n <AIDisclosureIcon size={16} />\n </span>\n )}\n {showOnlineStatus && <ProfileOnlineStatus label={onlineLabel} className=\"ml-2 shrink-0\" />}\n </Component>\n );\n },\n);\n\nUserDisplayName.displayName = \"UserDisplayName\";\n"],"names":["React","jsxs","cn","jsx","VerifiedIcon","AIDisclosureIcon","ProfileOnlineStatus"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0DO,MAAM,kBAAkBA,iBAAM;AAAA,EACnC,CACE;AAAA,IACE;AAAA,IACA,oBAAoB;AAAA,IACpB;AAAA,IACA,kBAAkB;AAAA,IAClB;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB,GAAG;AAAA,EAAA,GAEL,QACG;AACH,UAAM,YAAY;AAElB,UAAM,QAAQ,aACV,EAAE,OAAO,iBAAiB,MAAM,uBAAA,IAChC,WACE,EAAE,OAAO,eAAe,MAAM,mBAC9B;AAEN,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAWC,GAAAA,GAAG,uCAAuC,SAAS;AAAA,QAC7D,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAAC,+BAAC,UAAK,WAAWD,GAAAA,GAAG,WAAW,UAAU,UAAU,GAAI,UAAS;AAAA,UAC/D,SACCC,2BAAAA;AAAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,cAAY,MAAM;AAAA,cAClB,WAAWD,GAAAA,GAAG,0CAA0C,MAAM,IAAI;AAAA,cAElE,UAAAC,2BAAAA,IAACC,aAAAA,cAAA,EAAa,MAAM,GAAA,CAAI;AAAA,YAAA;AAAA,UAAA;AAAA,UAG3B,gBACCD,2BAAAA;AAAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,cAAY;AAAA,cACZ,WAAU;AAAA,cAEV,UAAAA,2BAAAA,IAACE,iBAAAA,kBAAA,EAAiB,MAAM,GAAA,CAAI;AAAA,YAAA;AAAA,UAAA;AAAA,UAG/B,oBAAoBF,2BAAAA,IAACG,yCAAA,EAAoB,OAAO,aAAa,WAAU,gBAAA,CAAgB;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAG9F;AACF;AAEA,gBAAgB,cAAc;;"}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -7,6 +7,8 @@ const AccordionContent = require("./components/Accordion/AccordionContent.cjs");
|
|
|
7
7
|
const AccordionItem = require("./components/Accordion/AccordionItem.cjs");
|
|
8
8
|
const AccordionTrigger = require("./components/Accordion/AccordionTrigger.cjs");
|
|
9
9
|
const AiButton = require("./components/AiButton/AiButton.cjs");
|
|
10
|
+
const AiDisclosureBadge = require("./components/AiDisclosureBadge/AiDisclosureBadge.cjs");
|
|
11
|
+
const AiDisclosureLabel = require("./components/AiDisclosureLabel/AiDisclosureLabel.cjs");
|
|
10
12
|
const Alert = require("./components/Alert/Alert.cjs");
|
|
11
13
|
const AnimatedNumber = require("./components/AnimatedNumber/AnimatedNumber.cjs");
|
|
12
14
|
const AudioPlayer = require("./components/AudioPlayer/AudioPlayer.cjs");
|
|
@@ -49,6 +51,7 @@ const AI2Icon = require("./components/Icons/AI2Icon.cjs");
|
|
|
49
51
|
const AICallIcon = require("./components/Icons/AICallIcon.cjs");
|
|
50
52
|
const AIDisclosureIcon = require("./components/Icons/AIDisclosureIcon.cjs");
|
|
51
53
|
const AIIcon = require("./components/Icons/AIIcon.cjs");
|
|
54
|
+
const AISettingsIcon = require("./components/Icons/AISettingsIcon.cjs");
|
|
52
55
|
const AlertIcon = require("./components/Icons/AlertIcon.cjs");
|
|
53
56
|
const AppsIcon = require("./components/Icons/AppsIcon.cjs");
|
|
54
57
|
const ArrowDownIcon = require("./components/Icons/ArrowDownIcon.cjs");
|
|
@@ -158,8 +161,10 @@ const PinIcon = require("./components/Icons/PinIcon.cjs");
|
|
|
158
161
|
const PlayIcon = require("./components/Icons/PlayIcon.cjs");
|
|
159
162
|
const PlusIcon = require("./components/Icons/PlusIcon.cjs");
|
|
160
163
|
const PrivacyIcon = require("./components/Icons/PrivacyIcon.cjs");
|
|
164
|
+
const ProgrammingArrowIcon = require("./components/Icons/ProgrammingArrowIcon.cjs");
|
|
161
165
|
const QueueIcon = require("./components/Icons/QueueIcon.cjs");
|
|
162
166
|
const ReceiveMoneyIcon = require("./components/Icons/ReceiveMoneyIcon.cjs");
|
|
167
|
+
const RefreshArrowIcon = require("./components/Icons/RefreshArrowIcon.cjs");
|
|
163
168
|
const RepeatIcon = require("./components/Icons/RepeatIcon.cjs");
|
|
164
169
|
const Reply2Icon = require("./components/Icons/Reply2Icon.cjs");
|
|
165
170
|
const ReplyIcon = require("./components/Icons/ReplyIcon.cjs");
|
|
@@ -278,6 +283,8 @@ exports.AccordionContent = AccordionContent.AccordionContent;
|
|
|
278
283
|
exports.AccordionItem = AccordionItem.AccordionItem;
|
|
279
284
|
exports.AccordionTrigger = AccordionTrigger.AccordionTrigger;
|
|
280
285
|
exports.AiButton = AiButton.AiButton;
|
|
286
|
+
exports.AiDisclosureBadge = AiDisclosureBadge.AiDisclosureBadge;
|
|
287
|
+
exports.AiDisclosureLabel = AiDisclosureLabel.AiDisclosureLabel;
|
|
281
288
|
exports.Alert = Alert.Alert;
|
|
282
289
|
exports.AnimatedNumber = AnimatedNumber.AnimatedNumber;
|
|
283
290
|
exports.AudioPlayer = AudioPlayer.AudioPlayer;
|
|
@@ -360,6 +367,7 @@ exports.AI2Icon = AI2Icon.AI2Icon;
|
|
|
360
367
|
exports.AICallIcon = AICallIcon.AICallIcon;
|
|
361
368
|
exports.AIDisclosureIcon = AIDisclosureIcon.AIDisclosureIcon;
|
|
362
369
|
exports.AIIcon = AIIcon.AIIcon;
|
|
370
|
+
exports.AISettingsIcon = AISettingsIcon.AISettingsIcon;
|
|
363
371
|
exports.AlertIcon = AlertIcon.AlertIcon;
|
|
364
372
|
exports.AppsIcon = AppsIcon.AppsIcon;
|
|
365
373
|
exports.ArrowDownIcon = ArrowDownIcon.ArrowDownIcon;
|
|
@@ -469,8 +477,10 @@ exports.PinIcon = PinIcon.PinIcon;
|
|
|
469
477
|
exports.PlayIcon = PlayIcon.PlayIcon;
|
|
470
478
|
exports.PlusIcon = PlusIcon.PlusIcon;
|
|
471
479
|
exports.PrivacyIcon = PrivacyIcon.PrivacyIcon;
|
|
480
|
+
exports.ProgrammingArrowIcon = ProgrammingArrowIcon.ProgrammingArrowIcon;
|
|
472
481
|
exports.QueueIcon = QueueIcon.QueueIcon;
|
|
473
482
|
exports.ReceiveMoneyIcon = ReceiveMoneyIcon.ReceiveMoneyIcon;
|
|
483
|
+
exports.RefreshArrowIcon = RefreshArrowIcon.RefreshArrowIcon;
|
|
474
484
|
exports.RepeatIcon = RepeatIcon.RepeatIcon;
|
|
475
485
|
exports.Reply2Icon = Reply2Icon.Reply2Icon;
|
|
476
486
|
exports.ReplyIcon = ReplyIcon.ReplyIcon;
|
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -29,7 +29,7 @@ const AccordionTrigger = React.forwardRef(({ className, children, icon, descript
|
|
|
29
29
|
/* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 items-start gap-2 text-left", children: [
|
|
30
30
|
leadingIcon && /* @__PURE__ */ jsx("span", { className: "flex shrink-0 items-center pt-px [&>svg]:size-4", "aria-hidden": "true", children: leadingIcon }),
|
|
31
31
|
/* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
32
|
-
/* @__PURE__ */ jsx("span", { className: "
|
|
32
|
+
/* @__PURE__ */ jsx("span", { className: "typography-body-small-14px-semibold truncate text-content-primary", children }),
|
|
33
33
|
description && /* @__PURE__ */ jsx("span", { className: "typography-description-12px-regular text-content-secondary", children: description })
|
|
34
34
|
] })
|
|
35
35
|
] })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionTrigger.mjs","sources":["../../../src/components/Accordion/AccordionTrigger.tsx"],"sourcesContent":["import * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { ChevronDownIcon } from \"../Icons/ChevronDownIcon\";\n\n/** Props for the {@link AccordionTrigger} button component. */\nexport type AccordionTriggerProps = React.ComponentPropsWithoutRef<\n typeof AccordionPrimitive.Trigger\n> & {\n /** Trailing indicator icon. Defaults to `ChevronDownIcon` (rotates when open). Pass `null` to suppress it. */\n icon?: React.ReactNode | null;\n /** Secondary line rendered under the title, for extra context. */\n description?: React.ReactNode;\n /** Leading icon shown before the title (sized to 16px). */\n leadingIcon?: React.ReactNode;\n /** Leading avatar shown before the title, for headers representing a person or account. Pass an `Avatar` sized to `24`. */\n avatar?: React.ReactNode;\n};\n\n/** An interactive button that toggles the visibility of its associated {@link AccordionContent} panel. */\nexport const AccordionTrigger = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Trigger>,\n AccordionTriggerProps\n>(({ className, children, icon, description, leadingIcon, avatar, ...props }, ref) => {\n const showIcon = icon !== null;\n const iconElement =\n icon === undefined ? (\n <ChevronDownIcon className=\"size-4 shrink-0 text-content-secondary\" />\n ) : (\n icon\n );\n\n return (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex flex-1 items-center justify-between gap-3\",\n \"rounded-sm px-3 py-3\",\n \"typography-body-small-14px-semibold text-content-primary\",\n \"cursor-pointer\",\n \"motion-safe:transition-colors motion-safe:duration-200 motion-safe:ease-in-out\",\n \"hover:bg-neutral-alphas-100\",\n \"focus-visible:shadow-focus-ring focus-visible:outline-none\",\n \"data-disabled:pointer-events-none data-disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"flex min-w-0 flex-1 items-center gap-3\">\n {avatar && (\n <span className=\"flex shrink-0 items-center\" aria-hidden=\"true\">\n {avatar}\n </span>\n )}\n <span className=\"flex min-w-0 flex-1 items-start gap-2 text-left\">\n {leadingIcon && (\n <span className=\"flex shrink-0 items-center pt-px [&>svg]:size-4\" aria-hidden=\"true\">\n {leadingIcon}\n </span>\n )}\n <span className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <span className=\"
|
|
1
|
+
{"version":3,"file":"AccordionTrigger.mjs","sources":["../../../src/components/Accordion/AccordionTrigger.tsx"],"sourcesContent":["import * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { ChevronDownIcon } from \"../Icons/ChevronDownIcon\";\n\n/** Props for the {@link AccordionTrigger} button component. */\nexport type AccordionTriggerProps = React.ComponentPropsWithoutRef<\n typeof AccordionPrimitive.Trigger\n> & {\n /** Trailing indicator icon. Defaults to `ChevronDownIcon` (rotates when open). Pass `null` to suppress it. */\n icon?: React.ReactNode | null;\n /** Secondary line rendered under the title, for extra context. */\n description?: React.ReactNode;\n /** Leading icon shown before the title (sized to 16px). */\n leadingIcon?: React.ReactNode;\n /** Leading avatar shown before the title, for headers representing a person or account. Pass an `Avatar` sized to `24`. */\n avatar?: React.ReactNode;\n};\n\n/** An interactive button that toggles the visibility of its associated {@link AccordionContent} panel. */\nexport const AccordionTrigger = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Trigger>,\n AccordionTriggerProps\n>(({ className, children, icon, description, leadingIcon, avatar, ...props }, ref) => {\n const showIcon = icon !== null;\n const iconElement =\n icon === undefined ? (\n <ChevronDownIcon className=\"size-4 shrink-0 text-content-secondary\" />\n ) : (\n icon\n );\n\n return (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex flex-1 items-center justify-between gap-3\",\n \"rounded-sm px-3 py-3\",\n \"typography-body-small-14px-semibold text-content-primary\",\n \"cursor-pointer\",\n \"motion-safe:transition-colors motion-safe:duration-200 motion-safe:ease-in-out\",\n \"hover:bg-neutral-alphas-100\",\n \"focus-visible:shadow-focus-ring focus-visible:outline-none\",\n \"data-disabled:pointer-events-none data-disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"flex min-w-0 flex-1 items-center gap-3\">\n {avatar && (\n <span className=\"flex shrink-0 items-center\" aria-hidden=\"true\">\n {avatar}\n </span>\n )}\n <span className=\"flex min-w-0 flex-1 items-start gap-2 text-left\">\n {leadingIcon && (\n <span className=\"flex shrink-0 items-center pt-px [&>svg]:size-4\" aria-hidden=\"true\">\n {leadingIcon}\n </span>\n )}\n <span className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <span className=\"typography-body-small-14px-semibold truncate text-content-primary\">\n {children}\n </span>\n {description && (\n <span className=\"typography-description-12px-regular text-content-secondary\">\n {description}\n </span>\n )}\n </span>\n </span>\n </span>\n {showIcon && (\n <span className=\"shrink-0 motion-safe:transition-transform motion-safe:duration-200 [[data-state=open]>&]:rotate-180\">\n {iconElement}\n </span>\n )}\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n );\n});\n\nAccordionTrigger.displayName = \"AccordionTrigger\";\n"],"names":[],"mappings":";;;;;;AAoBO,MAAM,mBAAmB,MAAM,WAGpC,CAAC,EAAE,WAAW,UAAU,MAAM,aAAa,aAAa,QAAQ,GAAG,MAAA,GAAS,QAAQ;AACpF,QAAM,WAAW,SAAS;AAC1B,QAAM,cACJ,SAAS,6BACN,iBAAA,EAAgB,WAAU,0CAAyC,IAEpE;AAGJ,SACE,oBAAC,mBAAmB,QAAnB,EAA0B,WAAU,QACnC,UAAA;AAAA,IAAC,mBAAmB;AAAA,IAAnB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,MAED,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAA,qBAAC,QAAA,EAAK,WAAU,0CACb,UAAA;AAAA,UAAA,8BACE,QAAA,EAAK,WAAU,8BAA6B,eAAY,QACtD,UAAA,QACH;AAAA,UAEF,qBAAC,QAAA,EAAK,WAAU,mDACb,UAAA;AAAA,YAAA,mCACE,QAAA,EAAK,WAAU,mDAAkD,eAAY,QAC3E,UAAA,aACH;AAAA,YAEF,qBAAC,QAAA,EAAK,WAAU,sCACd,UAAA;AAAA,cAAA,oBAAC,QAAA,EAAK,WAAU,qEACb,SAAA,CACH;AAAA,cACC,eACC,oBAAC,QAAA,EAAK,WAAU,8DACb,UAAA,YAAA,CACH;AAAA,YAAA,EAAA,CAEJ;AAAA,UAAA,EAAA,CACF;AAAA,QAAA,GACF;AAAA,QACC,YACC,oBAAC,QAAA,EAAK,WAAU,uGACb,UAAA,YAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ,CAAC;AAED,iBAAiB,cAAc;"}
|
|
@@ -108,11 +108,11 @@ const AiButton = React.forwardRef(
|
|
|
108
108
|
// Same reasoning as the letters: no flicker and no green lift once the
|
|
109
109
|
// button is unavailable.
|
|
110
110
|
!disabled && [
|
|
111
|
-
"[animation:fv-ai-flicker_2s_linear_infinite]
|
|
111
|
+
"[animation-delay:0.5s] [animation:fv-ai-flicker_2s_linear_infinite]",
|
|
112
112
|
// Settles solid on hover, lit green from below like the sheen.
|
|
113
113
|
"group-hover/ai:[animation:none]",
|
|
114
114
|
"group-hover/ai:[filter:drop-shadow(0_0_3px_var(--color-brand-primary-default))_drop-shadow(0_-4px_6px_color-mix(in_srgb,var(--color-content-always-black)_60%,transparent))]",
|
|
115
|
-
"group-focus-visible/ai:[animation-
|
|
115
|
+
"group-focus-visible/ai:[animation-delay:0.2s] group-focus-visible/ai:[animation-duration:1.2s]"
|
|
116
116
|
],
|
|
117
117
|
"motion-reduce:[animation:none]"
|
|
118
118
|
),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AiButton.mjs","sources":["../../../src/components/AiButton/AiButton.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { AIIcon } from \"../Icons/AIIcon\";\nimport type { IconSize } from \"../Icons/types\";\n\n/** Height, padding and label typography, matching {@link Button}'s scale. */\nexport type AiButtonSize = \"24\" | \"32\" | \"40\";\n\nconst sizeVariants: Record<AiButtonSize, string> = {\n // At 24 the label steps down to the 12px description scale: the 14px label\n // Button uses at this height leaves the glyph and text crowding a 24px box,\n // since 16px is the smallest authored icon geometry and cannot step down with it.\n \"24\": \"h-6 gap-1 px-2 py-1 typography-description-12px-semibold\",\n \"32\": \"h-8 gap-2 px-3 py-[7px] typography-body-small-14px-semibold\",\n \"40\": \"h-10 gap-2 px-4 py-2 typography-body-default-16px-semibold\",\n};\n\nconst iconSizeVariants: Record<AiButtonSize, IconSize> = {\n \"24\": 16,\n \"32\": 16,\n \"40\": 24,\n};\n\n/**\n * Optical size, applied on top of the authored geometry. Only 16, 24 and 32 have\n * dedicated paths, so the 24 button renders the 16px glyph down at 14 to sit with\n * its 12px label rather than towering over it.\n */\nconst iconScaleVariants: Record<AiButtonSize, string> = {\n \"24\": \"[&_svg]:size-3.5\",\n \"32\": \"\",\n \"40\": \"\",\n};\n\n/** Delay between adjacent letters, in seconds. */\nconst LETTER_STAGGER = 0.08;\n\n/**\n * Points the bottom sheen at the cursor by writing its x offset, as a percentage\n * of the button's width, straight to the DOM node. Deliberately not React state:\n * this fires every pointer-move frame, and a re-render per frame would both cost\n * more than the paint and leave the glow trailing the cursor.\n */\nconst trackPointer = (event: React.PointerEvent<HTMLButtonElement>) => {\n const { left, width } = event.currentTarget.getBoundingClientRect();\n event.currentTarget.style.setProperty(\"--fv-ai-x\", `${((event.clientX - left) / width) * 100}%`);\n};\n\n/** Props for {@link AiButton}. */\nexport interface AiButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"type\"> {\n /** Resting label. Also the accessible name unless `aria-label` is given. */\n label: string;\n /** Label shown while `active`. Falls back to {@link label}. */\n activeLabel?: string;\n /** Swap to {@link activeLabel} and keep the shimmer running. @default false */\n active?: boolean;\n /** @default \"32\" */\n size?: AiButtonSize;\n /** Replace the leading AI glyph. */\n icon?: React.ReactNode;\n /** @default \"button\" */\n type?: \"button\" | \"submit\" | \"reset\";\n}\n\n/**\n * Renders one `<span>` per character so each can carry its own animation delay.\n * The run is hidden from assistive tech — the button's accessible name comes from\n * its `aria-label`, so a screen reader says \"Analyse\" rather than spelling it out.\n */\nconst ShimmerLabel: React.FC<{ text: string; disabled?: boolean }> = ({ text, disabled }) => (\n <span aria-hidden=\"true\">\n {Array.from(text).map((character, index) => (\n <span\n key={`${character}-${index}`}\n className={cn(\n \"inline-block whitespace-pre text-content-secondary\",\n // Gated in JS rather than with a `group-disabled/ai:` override, because\n // that would rely on the generated rule ordering to beat `group-hover`.\n // A faded control that still shimmers and still lights up green under the\n // cursor reads as busy rather than unavailable.\n !disabled && [\n \"[animation:fv-ai-letter_2s_ease-in-out_infinite]\",\n \"group-hover/ai:text-content-primary group-hover/ai:[animation:none]\",\n // On focus each letter blows up and settles, then the idle shimmer\n // resumes underneath it — the two animations are sequenced by delay.\n \"group-focus-visible/ai:[animation:fv-ai-letter-focus_1s_ease-in-out,fv-ai-letter_1.2s_ease-in-out_infinite_1s]\",\n \"group-active/ai:text-content-primary group-active/ai:[animation:none]\",\n \"group-active/ai:[text-shadow:0_0_4px_var(--color-content-primary)]\",\n ],\n \"motion-reduce:[animation:none]\",\n )}\n style={{ animationDelay: `${index * LETTER_STAGGER}s` }}\n >\n {character}\n </span>\n ))}\n </span>\n);\n\n/**\n * A pill button for AI actions. The label shimmers letter by letter and the glyph\n * flickers at rest; on hover both settle and the green treatment eases in together\n * — outline, rim and a sheen pooling along the bottom edge under the cursor, which\n * follows it across the button. On focus each letter blooms once before the shimmer\n * resumes. The lit rim and sheen come from the `fv-ai-button` utility in `base.css`.\n *\n * It shares {@link Button}'s geometry — `rounded-full`, the same heights and label\n * typography — so it sits alongside one without looking foreign. Both labels are\n * rendered stacked in a single grid cell, so swapping to `active` crossfades\n * without the button changing width.\n *\n * Honours `prefers-reduced-motion`: the shimmer and flicker are dropped and the\n * label renders in its settled state.\n *\n * @example\n * ```tsx\n * <AiButton label=\"Analyse\" activeLabel=\"Analysing\" active={isPending} onClick={run} />\n * ```\n */\nexport const AiButton = React.forwardRef<HTMLButtonElement, AiButtonProps>(\n (\n {\n label,\n activeLabel,\n active = false,\n size = \"32\",\n icon,\n type = \"button\",\n className,\n disabled,\n onPointerMove,\n onPointerLeave,\n ...props\n },\n ref,\n ) => {\n const resolvedActiveLabel = activeLabel ?? label;\n\n return (\n <button\n ref={ref}\n type={type}\n disabled={disabled}\n aria-label={props[\"aria-label\"] ?? (active ? resolvedActiveLabel : label)}\n aria-busy={active || undefined}\n onPointerMove={(event) => {\n trackPointer(event);\n onPointerMove?.(event);\n }}\n // Drop back to the utility's centred default, so a keyboard focus after\n // the pointer has left does not light up wherever the cursor last was.\n onPointerLeave={(event) => {\n event.currentTarget.style.removeProperty(\"--fv-ai-x\");\n onPointerLeave?.(event);\n }}\n className={cn(\n \"fv-ai-button\",\n \"group/ai inline-flex cursor-pointer items-center justify-center whitespace-nowrap rounded-full\",\n \"border border-border-primary bg-background-primary\",\n // Matched to the rim and sheen so the whole treatment arrives as one\n // movement — at the old 300ms the outline landed ahead of the glow.\n \"transition-[background-color,border-color] duration-[400ms] ease-out\",\n \"hover:border-brand-primary-default\",\n \"focus-visible:outline-none\",\n \"active:border-brand-primary-hover active:bg-brand-primary-muted\",\n \"disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:border-border-primary\",\n sizeVariants[size],\n className,\n )}\n {...props}\n >\n <span\n className={cn(\n \"flex shrink-0 items-center text-content-primary\",\n iconScaleVariants[size],\n \"[filter:drop-shadow(0_0_2px_color-mix(in_srgb,var(--color-content-primary)_60%,transparent))]\",\n // Same reasoning as the letters: no flicker and no green lift once the\n // button is unavailable.\n !disabled && [\n \"[animation:fv-ai-flicker_2s_linear_infinite] [animation-delay:0.5s]\",\n // Settles solid on hover, lit green from below like the sheen.\n \"group-hover/ai:[animation:none]\",\n \"group-hover/ai:[filter:drop-shadow(0_0_3px_var(--color-brand-primary-default))_drop-shadow(0_-4px_6px_color-mix(in_srgb,var(--color-content-always-black)_60%,transparent))]\",\n \"group-focus-visible/ai:[animation-duration:1.2s] group-focus-visible/ai:[animation-delay:0.2s]\",\n ],\n \"motion-reduce:[animation:none]\",\n )}\n >\n {icon ?? <AIIcon size={iconSizeVariants[size]} filled />}\n </span>\n {/* Both labels occupy one grid cell so the button keeps the width of the\n longer of the two and the swap never reflows the row around it. */}\n <span className=\"grid\">\n <span\n className={cn(\n \"col-start-1 row-start-1 transition-opacity duration-300\",\n active ? \"opacity-0\" : \"opacity-100\",\n )}\n >\n <ShimmerLabel text={label} disabled={disabled} />\n </span>\n <span\n className={cn(\n \"col-start-1 row-start-1 transition-opacity duration-300\",\n active ? \"opacity-100\" : \"opacity-0\",\n )}\n >\n <ShimmerLabel text={resolvedActiveLabel} disabled={disabled} />\n </span>\n </span>\n </button>\n );\n },\n);\n\nAiButton.displayName = \"AiButton\";\n"],"names":[],"mappings":";;;;;AAQA,MAAM,eAA6C;AAAA;AAAA;AAAA;AAAA,EAIjD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,mBAAmD;AAAA,EACvD,MAAM;AAAA,EACN,MAAM;AAAA,EACN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tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { AIIcon } from \"../Icons/AIIcon\";\nimport type { IconSize } from \"../Icons/types\";\n\n/** Height, padding and label typography, matching {@link Button}'s scale. */\nexport type AiButtonSize = \"24\" | \"32\" | \"40\";\n\nconst sizeVariants: Record<AiButtonSize, string> = {\n // At 24 the label steps down to the 12px description scale: the 14px label\n // Button uses at this height leaves the glyph and text crowding a 24px box,\n // since 16px is the smallest authored icon geometry and cannot step down with it.\n \"24\": \"h-6 gap-1 px-2 py-1 typography-description-12px-semibold\",\n \"32\": \"h-8 gap-2 px-3 py-[7px] typography-body-small-14px-semibold\",\n \"40\": \"h-10 gap-2 px-4 py-2 typography-body-default-16px-semibold\",\n};\n\nconst iconSizeVariants: Record<AiButtonSize, IconSize> = {\n \"24\": 16,\n \"32\": 16,\n \"40\": 24,\n};\n\n/**\n * Optical size, applied on top of the authored geometry. Only 16, 24 and 32 have\n * dedicated paths, so the 24 button renders the 16px glyph down at 14 to sit with\n * its 12px label rather than towering over it.\n */\nconst iconScaleVariants: Record<AiButtonSize, string> = {\n \"24\": \"[&_svg]:size-3.5\",\n \"32\": \"\",\n \"40\": \"\",\n};\n\n/** Delay between adjacent letters, in seconds. */\nconst LETTER_STAGGER = 0.08;\n\n/**\n * Points the bottom sheen at the cursor by writing its x offset, as a percentage\n * of the button's width, straight to the DOM node. Deliberately not React state:\n * this fires every pointer-move frame, and a re-render per frame would both cost\n * more than the paint and leave the glow trailing the cursor.\n */\nconst trackPointer = (event: React.PointerEvent<HTMLButtonElement>) => {\n const { left, width } = event.currentTarget.getBoundingClientRect();\n event.currentTarget.style.setProperty(\"--fv-ai-x\", `${((event.clientX - left) / width) * 100}%`);\n};\n\n/** Props for {@link AiButton}. */\nexport interface AiButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"type\"> {\n /** Resting label. Also the accessible name unless `aria-label` is given. */\n label: string;\n /** Label shown while `active`. Falls back to {@link label}. */\n activeLabel?: string;\n /** Swap to {@link activeLabel} and keep the shimmer running. @default false */\n active?: boolean;\n /** @default \"32\" */\n size?: AiButtonSize;\n /** Replace the leading AI glyph. */\n icon?: React.ReactNode;\n /** @default \"button\" */\n type?: \"button\" | \"submit\" | \"reset\";\n}\n\n/**\n * Renders one `<span>` per character so each can carry its own animation delay.\n * The run is hidden from assistive tech — the button's accessible name comes from\n * its `aria-label`, so a screen reader says \"Analyse\" rather than spelling it out.\n */\nconst ShimmerLabel: React.FC<{ text: string; disabled?: boolean }> = ({ text, disabled }) => (\n <span aria-hidden=\"true\">\n {Array.from(text).map((character, index) => (\n <span\n key={`${character}-${index}`}\n className={cn(\n \"inline-block whitespace-pre text-content-secondary\",\n // Gated in JS rather than with a `group-disabled/ai:` override, because\n // that would rely on the generated rule ordering to beat `group-hover`.\n // A faded control that still shimmers and still lights up green under the\n // cursor reads as busy rather than unavailable.\n !disabled && [\n \"[animation:fv-ai-letter_2s_ease-in-out_infinite]\",\n \"group-hover/ai:text-content-primary group-hover/ai:[animation:none]\",\n // On focus each letter blows up and settles, then the idle shimmer\n // resumes underneath it — the two animations are sequenced by delay.\n \"group-focus-visible/ai:[animation:fv-ai-letter-focus_1s_ease-in-out,fv-ai-letter_1.2s_ease-in-out_infinite_1s]\",\n \"group-active/ai:text-content-primary group-active/ai:[animation:none]\",\n \"group-active/ai:[text-shadow:0_0_4px_var(--color-content-primary)]\",\n ],\n \"motion-reduce:[animation:none]\",\n )}\n style={{ animationDelay: `${index * LETTER_STAGGER}s` }}\n >\n {character}\n </span>\n ))}\n </span>\n);\n\n/**\n * A pill button for AI actions. The label shimmers letter by letter and the glyph\n * flickers at rest; on hover both settle and the green treatment eases in together\n * — outline, rim and a sheen pooling along the bottom edge under the cursor, which\n * follows it across the button. On focus each letter blooms once before the shimmer\n * resumes. The lit rim and sheen come from the `fv-ai-button` utility in `base.css`.\n *\n * It shares {@link Button}'s geometry — `rounded-full`, the same heights and label\n * typography — so it sits alongside one without looking foreign. Both labels are\n * rendered stacked in a single grid cell, so swapping to `active` crossfades\n * without the button changing width.\n *\n * Honours `prefers-reduced-motion`: the shimmer and flicker are dropped and the\n * label renders in its settled state.\n *\n * @example\n * ```tsx\n * <AiButton label=\"Analyse\" activeLabel=\"Analysing\" active={isPending} onClick={run} />\n * ```\n */\nexport const AiButton = React.forwardRef<HTMLButtonElement, AiButtonProps>(\n (\n {\n label,\n activeLabel,\n active = false,\n size = \"32\",\n icon,\n type = \"button\",\n className,\n disabled,\n onPointerMove,\n onPointerLeave,\n ...props\n },\n ref,\n ) => {\n const resolvedActiveLabel = activeLabel ?? label;\n\n return (\n <button\n ref={ref}\n type={type}\n disabled={disabled}\n aria-label={props[\"aria-label\"] ?? (active ? resolvedActiveLabel : label)}\n aria-busy={active || undefined}\n onPointerMove={(event) => {\n trackPointer(event);\n onPointerMove?.(event);\n }}\n // Drop back to the utility's centred default, so a keyboard focus after\n // the pointer has left does not light up wherever the cursor last was.\n onPointerLeave={(event) => {\n event.currentTarget.style.removeProperty(\"--fv-ai-x\");\n onPointerLeave?.(event);\n }}\n className={cn(\n \"fv-ai-button\",\n \"group/ai inline-flex cursor-pointer items-center justify-center whitespace-nowrap rounded-full\",\n \"border border-border-primary bg-background-primary\",\n // Matched to the rim and sheen so the whole treatment arrives as one\n // movement — at the old 300ms the outline landed ahead of the glow.\n \"transition-[background-color,border-color] duration-[400ms] ease-out\",\n \"hover:border-brand-primary-default\",\n \"focus-visible:outline-none\",\n \"active:border-brand-primary-hover active:bg-brand-primary-muted\",\n \"disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:border-border-primary\",\n sizeVariants[size],\n className,\n )}\n {...props}\n >\n <span\n className={cn(\n \"flex shrink-0 items-center text-content-primary\",\n iconScaleVariants[size],\n \"[filter:drop-shadow(0_0_2px_color-mix(in_srgb,var(--color-content-primary)_60%,transparent))]\",\n // Same reasoning as the letters: no flicker and no green lift once the\n // button is unavailable.\n !disabled && [\n \"[animation-delay:0.5s] [animation:fv-ai-flicker_2s_linear_infinite]\",\n // Settles solid on hover, lit green from below like the sheen.\n \"group-hover/ai:[animation:none]\",\n \"group-hover/ai:[filter:drop-shadow(0_0_3px_var(--color-brand-primary-default))_drop-shadow(0_-4px_6px_color-mix(in_srgb,var(--color-content-always-black)_60%,transparent))]\",\n \"group-focus-visible/ai:[animation-delay:0.2s] group-focus-visible/ai:[animation-duration:1.2s]\",\n ],\n \"motion-reduce:[animation:none]\",\n )}\n >\n {icon ?? <AIIcon size={iconSizeVariants[size]} filled />}\n </span>\n {/* Both labels occupy one grid cell so the button keeps the width of the\n longer of the two and the swap never reflows the row around it. */}\n <span className=\"grid\">\n <span\n className={cn(\n \"col-start-1 row-start-1 transition-opacity duration-300\",\n active ? \"opacity-0\" : \"opacity-100\",\n )}\n >\n <ShimmerLabel text={label} disabled={disabled} />\n </span>\n <span\n className={cn(\n \"col-start-1 row-start-1 transition-opacity duration-300\",\n active ? \"opacity-100\" : \"opacity-0\",\n )}\n >\n <ShimmerLabel text={resolvedActiveLabel} disabled={disabled} />\n </span>\n </span>\n </button>\n );\n },\n);\n\nAiButton.displayName = \"AiButton\";\n"],"names":[],"mappings":";;;;;AAQA,MAAM,eAA6C;AAAA;AAAA;AAAA;AAAA,EAIjD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,mBAAmD;AAAA,EACvD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAOA,MAAM,oBAAkD;AAAA,EACtD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAGA,MAAM,iBAAiB;AAQvB,MAAM,eAAe,CAAC,UAAiD;AACrE,QAAM,EAAE,MAAM,MAAA,IAAU,MAAM,cAAc,sBAAA;AAC5C,QAAM,cAAc,MAAM,YAAY,aAAa,IAAK,MAAM,UAAU,QAAQ,QAAS,GAAG,GAAG;AACjG;AAuBA,MAAM,eAA+D,CAAC,EAAE,MAAM,SAAA,MAC5E,oBAAC,QAA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AA,gBACT;AAAA,gBACA,kBAAkB,IAAI;AAAA,gBACtB;AAAA;AAAA;AAAA,gBAGA,CAAC,YAAY;AAAA,kBACX;AAAA;AAAA,kBAEA;AAAA,kBACA;AAAA,kBACA;AAAA,gBAAA;AAAA,gBAEF;AAAA,cAAA;AAAA,cAGD,UAAA,4BAAS,QAAA,EAAO,MAAM,iBAAiB,IAAI,GAAG,QAAM,KAAA,CAAC;AAAA,YAAA;AAAA,UAAA;AAAA,UAIxD,qBAAC,QAAA,EAAK,WAAU,QACd,UAAA;AAAA,YAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAW;AAAA,kBACT;AAAA,kBACA,SAAS,cAAc;AAAA,gBAAA;AAAA,gBAGzB,UAAA,oBAAC,cAAA,EAAa,MAAM,OAAO,SAAA,CAAoB;AAAA,cAAA;AAAA,YAAA;AAAA,YAEjD;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAW;AAAA,kBACT;AAAA,kBACA,SAAS,gBAAgB;AAAA,gBAAA;AAAA,gBAG3B,UAAA,oBAAC,cAAA,EAAa,MAAM,qBAAqB,SAAA,CAAoB;AAAA,cAAA;AAAA,YAAA;AAAA,UAC/D,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,SAAS,cAAc;"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../../utils/cn.mjs";
|
|
5
|
+
const toneVariants = {
|
|
6
|
+
dark: { disc: "fill-buttons-always-black-default", glyph: "fill-content-always-white" },
|
|
7
|
+
light: { disc: "fill-buttons-always-white-default", glyph: "fill-content-always-black" },
|
|
8
|
+
transparent: { disc: "fill-background-overlay-default", glyph: "fill-content-always-white" }
|
|
9
|
+
};
|
|
10
|
+
const AiDisclosureBadge = React.forwardRef(
|
|
11
|
+
({ className, tone = "dark", ...props }, ref) => {
|
|
12
|
+
const fill = toneVariants[tone];
|
|
13
|
+
return /* @__PURE__ */ jsxs(
|
|
14
|
+
"svg",
|
|
15
|
+
{
|
|
16
|
+
ref,
|
|
17
|
+
viewBox: "0 0 16 16",
|
|
18
|
+
fill: "none",
|
|
19
|
+
"aria-hidden": "true",
|
|
20
|
+
className: cn("size-4", className),
|
|
21
|
+
...props,
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ jsx(
|
|
24
|
+
"path",
|
|
25
|
+
{
|
|
26
|
+
className: fill.disc,
|
|
27
|
+
fillRule: "evenodd",
|
|
28
|
+
clipRule: "evenodd",
|
|
29
|
+
d: "M7.677.835a7.165 7.165 0 1 1 0 14.33 7.165 7.165 0 0 1 0-14.33"
|
|
30
|
+
}
|
|
31
|
+
),
|
|
32
|
+
/* @__PURE__ */ jsx(
|
|
33
|
+
"path",
|
|
34
|
+
{
|
|
35
|
+
className: fill.glyph,
|
|
36
|
+
d: "M3.708 10.756a.16.16 0 0 1-.114-.051.16.16 0 0 1-.052-.115q0-.04.008-.07l1.856-5.071a.3.3 0 0 1 .1-.154.3.3 0 0 1 .208-.067h1.17q.133 0 .209.067a.3.3 0 0 1 .098.154l1.849 5.07q.015.032.015.071 0 .063-.051.115a.17.17 0 0 1-.122.051H7.91q-.119 0-.177-.06a.3.3 0 0 1-.075-.106l-.309-.806H5.241l-.3.806a.3.3 0 0 1-.071.107q-.055.06-.19.059h-.97m1.856-2.109h1.47L6.29 6.562zm4.31 2.109a.2.2 0 0 1-.142-.055.2.2 0 0 1-.055-.143V5.425q0-.087.055-.142a.2.2 0 0 1 .142-.056h1.059q.087 0 .142.056a.2.2 0 0 1 .055.142v5.133a.2.2 0 0 1-.055.143.2.2 0 0 1-.142.055z"
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
AiDisclosureBadge.displayName = "AiDisclosureBadge";
|
|
45
|
+
export {
|
|
46
|
+
AiDisclosureBadge
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=AiDisclosureBadge.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AiDisclosureBadge.mjs","sources":["../../../src/components/AiDisclosureBadge/AiDisclosureBadge.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/** The three treatments the EU disclosure spec defines. */\nexport type AiDisclosureBadgeTone = \"dark\" | \"light\" | \"transparent\";\n\n/**\n * Theme-fixed rather than `currentColor`: the badge is a regulatory marker\n * overlaid on arbitrary creator media, so it has to stay legible whatever\n * surface it lands on. That is also why it is not an icon — it cannot take part\n * in the `currentColor` contract the icon set relies on, and `tone` has to say\n * what is behind the mark.\n */\nconst toneVariants: Record<AiDisclosureBadgeTone, { disc: string; glyph: string }> = {\n dark: { disc: \"fill-buttons-always-black-default\", glyph: \"fill-content-always-white\" },\n light: { disc: \"fill-buttons-always-white-default\", glyph: \"fill-content-always-black\" },\n transparent: { disc: \"fill-background-overlay-default\", glyph: \"fill-content-always-white\" },\n};\n\n/** Props for {@link AiDisclosureBadge}. */\nexport interface AiDisclosureBadgeProps extends React.SVGAttributes<SVGSVGElement> {\n /** Colour of the mark itself, chosen for the media behind it. @default \"dark\" */\n tone?: AiDisclosureBadgeTone;\n}\n\n/**\n * EU AI-disclosure badge: an \"AI\" wordmark on a filled disc, for overlaying on\n * AI-generated or AI-modified media. Ships at 16px and scales via `className`.\n *\n * Decorative by default. For standalone use pass `aria-hidden={false}` with\n * `role=\"img\"` and an `aria-label`. For the form that carries wording, use\n * `AiDisclosureLabel`.\n *\n * @example\n * ```tsx\n * <AiDisclosureBadge tone=\"light\" className=\"size-6\" />\n * ```\n */\nexport const AiDisclosureBadge = React.forwardRef<SVGSVGElement, AiDisclosureBadgeProps>(\n ({ className, tone = \"dark\", ...props }, ref) => {\n const fill = toneVariants[tone];\n\n return (\n <svg\n ref={ref}\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n aria-hidden=\"true\"\n className={cn(\"size-4\", className)}\n {...props}\n >\n <path\n className={fill.disc}\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M7.677.835a7.165 7.165 0 1 1 0 14.33 7.165 7.165 0 0 1 0-14.33\"\n />\n <path\n className={fill.glyph}\n d=\"M3.708 10.756a.16.16 0 0 1-.114-.051.16.16 0 0 1-.052-.115q0-.04.008-.07l1.856-5.071a.3.3 0 0 1 .1-.154.3.3 0 0 1 .208-.067h1.17q.133 0 .209.067a.3.3 0 0 1 .098.154l1.849 5.07q.015.032.015.071 0 .063-.051.115a.17.17 0 0 1-.122.051H7.91q-.119 0-.177-.06a.3.3 0 0 1-.075-.106l-.309-.806H5.241l-.3.806a.3.3 0 0 1-.071.107q-.055.06-.19.059h-.97m1.856-2.109h1.47L6.29 6.562zm4.31 2.109a.2.2 0 0 1-.142-.055.2.2 0 0 1-.055-.143V5.425q0-.087.055-.142a.2.2 0 0 1 .142-.056h1.059q.087 0 .142.056a.2.2 0 0 1 .055.142v5.133a.2.2 0 0 1-.055.143.2.2 0 0 1-.142.055z\"\n />\n </svg>\n );\n },\n);\n\nAiDisclosureBadge.displayName = \"AiDisclosureBadge\";\n"],"names":[],"mappings":";;;;AAaA,MAAM,eAA+E;AAAA,EACnF,MAAM,EAAE,MAAM,qCAAqC,OAAO,4BAAA;AAAA,EAC1D,OAAO,EAAE,MAAM,qCAAqC,OAAO,4BAAA;AAAA,EAC3D,aAAa,EAAE,MAAM,mCAAmC,OAAO,4BAAA;AACjE;AAqBO,MAAM,oBAAoB,MAAM;AAAA,EACrC,CAAC,EAAE,WAAW,OAAO,QAAQ,GAAG,MAAA,GAAS,QAAQ;AAC/C,UAAM,OAAO,aAAa,IAAI;AAE9B,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,eAAY;AAAA,QACZ,WAAW,GAAG,UAAU,SAAS;AAAA,QAChC,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAW,KAAK;AAAA,cAChB,UAAS;AAAA,cACT,UAAS;AAAA,cACT,GAAE;AAAA,YAAA;AAAA,UAAA;AAAA,UAEJ;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAW,KAAK;AAAA,cAChB,GAAE;AAAA,YAAA;AAAA,UAAA;AAAA,QACJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,kBAAkB,cAAc;"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../../utils/cn.mjs";
|
|
5
|
+
const toneVariants = {
|
|
6
|
+
dark: "bg-buttons-always-black-default text-content-always-white",
|
|
7
|
+
light: "bg-buttons-always-white-default text-content-always-black",
|
|
8
|
+
transparent: "bg-background-overlay-default text-content-always-white"
|
|
9
|
+
};
|
|
10
|
+
const sizeVariants = {
|
|
11
|
+
"12": "h-3 gap-1 px-[5px]",
|
|
12
|
+
"16": "h-4 gap-1.5 px-[7px]",
|
|
13
|
+
"20": "h-5 gap-[7px] px-[9px]"
|
|
14
|
+
};
|
|
15
|
+
const TRACKING = "tracking-[0.1em]";
|
|
16
|
+
const markSizeVariants = {
|
|
17
|
+
"12": "text-[8px]",
|
|
18
|
+
"16": "text-[11px]",
|
|
19
|
+
"20": "text-[13px]"
|
|
20
|
+
};
|
|
21
|
+
const labelSizeVariants = {
|
|
22
|
+
"12": "text-[6px]",
|
|
23
|
+
"16": "text-[8px]",
|
|
24
|
+
"20": "text-[10px]"
|
|
25
|
+
};
|
|
26
|
+
const AiDisclosureLabel = React.forwardRef(
|
|
27
|
+
({ className, label, size = "20", tone = "dark", ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
28
|
+
"span",
|
|
29
|
+
{
|
|
30
|
+
ref,
|
|
31
|
+
"data-testid": "ai-disclosure-label",
|
|
32
|
+
role: "img",
|
|
33
|
+
"aria-label": `AI ${label}`,
|
|
34
|
+
className: cn(
|
|
35
|
+
"inline-flex select-none items-center justify-center whitespace-nowrap rounded-full",
|
|
36
|
+
// Carries `font-family: Inter` and weight 600; the per-run `text-[Npx]`
|
|
37
|
+
// below overrides its size, as `Count` does for its sub-12px steps.
|
|
38
|
+
"typography-description-12px-semibold uppercase leading-none",
|
|
39
|
+
sizeVariants[size],
|
|
40
|
+
toneVariants[tone],
|
|
41
|
+
className
|
|
42
|
+
),
|
|
43
|
+
...props,
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ jsx("span", { className: cn(TRACKING, markSizeVariants[size]), children: "AI" }),
|
|
46
|
+
/* @__PURE__ */ jsx("span", { className: cn(TRACKING, labelSizeVariants[size]), children: label })
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
);
|
|
51
|
+
AiDisclosureLabel.displayName = "AiDisclosureLabel";
|
|
52
|
+
export {
|
|
53
|
+
AiDisclosureLabel
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=AiDisclosureLabel.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AiDisclosureLabel.mjs","sources":["../../../src/components/AiDisclosureLabel/AiDisclosureLabel.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n/** The three treatments the EU disclosure spec defines. */\nexport type AiDisclosureLabelTone = \"dark\" | \"light\" | \"transparent\";\n\n/** Overall pill height in px. */\nexport type AiDisclosureLabelSize = \"12\" | \"16\" | \"20\";\n\nconst toneVariants: Record<AiDisclosureLabelTone, string> = {\n dark: \"bg-buttons-always-black-default text-content-always-white\",\n light: \"bg-buttons-always-white-default text-content-always-black\",\n transparent: \"bg-background-overlay-default text-content-always-white\",\n};\n\n/** Padding and gap are proportional to the pill height, taken from the Figma mark. */\nconst sizeVariants: Record<AiDisclosureLabelSize, string> = {\n \"12\": \"h-3 gap-1 px-[5px]\",\n \"16\": \"h-4 gap-1.5 px-[7px]\",\n \"20\": \"h-5 gap-[7px] px-[9px]\",\n};\n\n/**\n * Tracking has to sit on each run rather than the pill: as an `em` it resolves\n * against the element's own font size, so putting it on the pill would freeze it\n * at one absolute value for every size and anchor it to whatever font size the\n * host happens to inherit.\n */\nconst TRACKING = \"tracking-[0.1em]\";\n\n/**\n * The \"AI\" run sits at roughly two thirds of the pill height and the wording at\n * just over half. Both land below the 12px floor of the typography scale, so\n * they are spelled out in px, over a base utility that supplies the family.\n */\nconst markSizeVariants: Record<AiDisclosureLabelSize, string> = {\n \"12\": \"text-[8px]\",\n \"16\": \"text-[11px]\",\n \"20\": \"text-[13px]\",\n};\n\nconst labelSizeVariants: Record<AiDisclosureLabelSize, string> = {\n \"12\": \"text-[6px]\",\n \"16\": \"text-[8px]\",\n \"20\": \"text-[10px]\",\n};\n\n/** Props for {@link AiDisclosureLabel}. */\nexport interface AiDisclosureLabelProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** Wording after the \"AI\" mark, e.g. a translated \"Generated\" or \"Modified\". */\n label: string;\n /** @default \"20\" */\n size?: AiDisclosureLabelSize;\n /** Colour of the mark itself, chosen for the media behind it. @default \"dark\" */\n tone?: AiDisclosureLabelTone;\n}\n\n/**\n * EU AI-disclosure label: an \"AI\" mark followed by wording, on a filled pill,\n * for marking AI-generated or AI-modified media.\n *\n * The wording is live text rather than baked artwork, so it translates and\n * scales with the reader's font settings. It is uppercased in CSS, which keeps\n * the mark consistent without forcing callers to pass shouting strings.\n *\n * For the compact disc form with no wording, use `AiDisclosureBadge`.\n *\n * @example\n * ```tsx\n * <AiDisclosureLabel label={t(\"ai.modified\")} tone=\"transparent\" />\n * ```\n */\nexport const AiDisclosureLabel = React.forwardRef<HTMLSpanElement, AiDisclosureLabelProps>(\n ({ className, label, size = \"20\", tone = \"dark\", ...props }, ref) => (\n <span\n ref={ref}\n data-testid=\"ai-disclosure-label\"\n // \"AI\" and the wording are separate elements with only a flex gap\n // between them, so without a name of its own the pill is announced as\n // the single token \"AIGenerated\".\n role=\"img\"\n aria-label={`AI ${label}`}\n className={cn(\n \"inline-flex select-none items-center justify-center whitespace-nowrap rounded-full\",\n // Carries `font-family: Inter` and weight 600; the per-run `text-[Npx]`\n // below overrides its size, as `Count` does for its sub-12px steps.\n \"typography-description-12px-semibold uppercase leading-none\",\n sizeVariants[size],\n toneVariants[tone],\n className,\n )}\n {...props}\n >\n <span className={cn(TRACKING, markSizeVariants[size])}>AI</span>\n <span className={cn(TRACKING, labelSizeVariants[size])}>{label}</span>\n </span>\n ),\n);\n\nAiDisclosureLabel.displayName = \"AiDisclosureLabel\";\n"],"names":[],"mappings":";;;;AAQA,MAAM,eAAsD;AAAA,EAC1D,MAAM;AAAA,EACN,OAAO;AAAA,EACP,aAAa;AACf;AAGA,MAAM,eAAsD;AAAA,EAC1D,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAQA,MAAM,WAAW;AAOjB,MAAM,mBAA0D;AAAA,EAC9D,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,oBAA2D;AAAA,EAC/D,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AA2BO,MAAM,oBAAoB,MAAM;AAAA,EACrC,CAAC,EAAE,WAAW,OAAO,OAAO,MAAM,OAAO,QAAQ,GAAG,SAAS,QAC3D;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,eAAY;AAAA,MAIZ,MAAK;AAAA,MACL,cAAY,MAAM,KAAK;AAAA,MACvB,WAAW;AAAA,QACT;AAAA;AAAA;AAAA,QAGA;AAAA,QACA,aAAa,IAAI;AAAA,QACjB,aAAa,IAAI;AAAA,QACjB;AAAA,MAAA;AAAA,MAED,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAA,oBAAC,QAAA,EAAK,WAAW,GAAG,UAAU,iBAAiB,IAAI,CAAC,GAAG,UAAA,KAAA,CAAE;AAAA,QACzD,oBAAC,UAAK,WAAW,GAAG,UAAU,kBAAkB,IAAI,CAAC,GAAI,UAAA,MAAA,CAAM;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGrE;AAEA,kBAAkB,cAAc;"}
|
|
@@ -65,7 +65,7 @@ const Alert = React.forwardRef(
|
|
|
65
65
|
),
|
|
66
66
|
...props,
|
|
67
67
|
children: [
|
|
68
|
-
resolvedIcon && /* @__PURE__ */ jsx("span", { className: "flex shrink-0 items-start
|
|
68
|
+
resolvedIcon && /* @__PURE__ */ jsx("span", { className: "flex h-full shrink-0 items-start", "aria-hidden": "true", children: resolvedIcon }),
|
|
69
69
|
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-2", children: [
|
|
70
70
|
/* @__PURE__ */ jsxs("div", { role: "alert", className: "flex flex-col gap-2", children: [
|
|
71
71
|
title && /* @__PURE__ */ jsx("div", { className: "typography-body-small-14px-semibold text-content-primary", children: title }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.mjs","sources":["../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import { Slot } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Button } from \"../Button/Button\";\nimport { CheckCircleIcon } from \"../Icons/CheckCircleIcon\";\nimport { CrossIcon } from \"../Icons/CrossIcon\";\nimport { ErrorCircleIcon } from \"../Icons/ErrorCircleIcon\";\nimport { InfoCircleIcon } from \"../Icons/InfoCircleIcon\";\nimport { WarningTriangleIcon } from \"../Icons/WarningTriangleIcon\";\n\n/** Visual style variant of the alert. */\nexport type AlertVariant = \"info\" | \"success\" | \"warning\" | \"error\" | \"neutral\";\n\nconst DEFAULT_ICONS: Record<AlertVariant, React.ReactNode> = {\n info: <InfoCircleIcon />,\n success: <CheckCircleIcon />,\n warning: <WarningTriangleIcon />,\n error: <ErrorCircleIcon />,\n neutral: <InfoCircleIcon />,\n};\n\nexport interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Visual style variant of the alert. @default \"info\" */\n variant?: AlertVariant;\n /** Optional title text displayed in bold above the description. */\n title?: string;\n /** Custom icon override. Pass `null` to hide the icon entirely. Each variant shows a default icon when left `undefined`. */\n icon?: React.ReactNode | null;\n /** Whether to show the close button. @default false */\n closable?: boolean;\n /** Callback fired when the close button is clicked. */\n onClose?: () => void;\n /** Accessible label for the close button. @default \"Close alert\" */\n closeLabel?: string;\n /**\n * Composable action slot rendered beneath the description, outside the\n * `role=\"alert\"` live region. Pass your own element (an `<a>`, a `next/link`\n * `<Link>`, or a `<Button>`) and it receives the variant-appropriate link\n * styling via the Radix `Slot` pattern while remaining a real link/button.\n */\n action?: React.ReactNode;\n}\n\nconst CLOSE_BUTTON_CLASSES: Record<AlertVariant, string> = {\n info: \"hover:bg-info-content/10 active:bg-info-content/20 text-info-content motion-safe:transition-colors motion-safe:duration-150\",\n success:\n \"hover:bg-success-content/10 active:bg-success-content/20 text-success-content motion-safe:transition-colors motion-safe:duration-150\",\n warning:\n \"hover:bg-warning-content/10 active:bg-warning-content/20 text-warning-content motion-safe:transition-colors motion-safe:duration-150\",\n error:\n \"hover:bg-error-content/10 active:bg-error-content/20 text-error-content motion-safe:transition-colors motion-safe:duration-150\",\n neutral:\n \"hover:bg-content-secondary/10 active:bg-content-secondary/20 text-content-secondary motion-safe:transition-colors motion-safe:duration-150\",\n};\n\nconst LINK_CLASSES: Record<AlertVariant, string> = {\n info: \"text-alerts-info-prompt-content-info\",\n success: \"text-alerts-info-prompt-content-success\",\n warning: \"text-alerts-info-prompt-content-warning\",\n error: \"text-alerts-info-prompt-content-error\",\n neutral: \"text-content-secondary\",\n};\n\n/**\n * Displays a contextual feedback message to the user.\n *\n * Supports `info`, `success`, `warning`, `error`, and `neutral` variants with a\n * default icon per variant, optional title, description, dismiss button, and an\n * optional composable `action` slot.\n *\n * Each variant renders a default icon automatically. Pass a custom `icon` to\n * override, or `icon={null}` to hide the icon entirely.\n *\n * Only the title and description live inside the `role=\"alert\"` live region.\n * The icon, `action`, and close button are rendered outside it so interactive\n * controls are announced and navigated consistently by screen readers.\n *\n * @example\n * ```tsx\n * <Alert variant=\"success\" title=\"Saved\" closable onClose={handleClose}>\n * Your changes have been saved.\n * </Alert>\n * ```\n *\n * @example\n * ```tsx\n * <Alert variant=\"neutral\" title=\"Heads up\" action={<a href=\"/docs\">Learn more</a>}>\n * A general notice with no specific sentiment.\n * </Alert>\n * ```\n *\n * @example\n * ```tsx\n * import Link from \"next/link\";\n *\n * <Alert variant=\"info\" title=\"Update available\" action={<Link href=\"/changelog\">See what's new</Link>}>\n * A new version is ready to install.\n * </Alert>\n * ```\n */\nexport const Alert = React.forwardRef<HTMLDivElement, AlertProps>(\n (\n {\n className,\n variant = \"info\",\n title,\n icon,\n closable = false,\n onClose,\n closeLabel = \"Close alert\",\n action,\n children,\n ...props\n },\n ref,\n ) => {\n const resolvedIcon = icon === null ? null : (icon ?? DEFAULT_ICONS[variant]);\n\n return (\n <div\n ref={ref}\n data-testid=\"alert\"\n className={cn(\n \"grid gap-x-3 rounded-xs p-4 text-sm leading-[18px]\",\n resolvedIcon && closable && \"grid-cols-[auto_1fr_auto]\",\n resolvedIcon && !closable && \"grid-cols-[auto_1fr]\",\n !resolvedIcon && closable && \"grid-cols-[1fr_auto]\",\n !resolvedIcon && !closable && \"grid-cols-[1fr]\",\n title && children ? \"items-start\" : \"items-center\",\n variant === \"info\" && \"bg-info-surface text-info-content\",\n variant === \"success\" && \"bg-success-surface text-success-content\",\n variant === \"warning\" && \"bg-warning-surface text-warning-content\",\n variant === \"error\" && \"bg-error-surface text-error-content\",\n variant === \"neutral\" &&\n \"bg-alerts-info-prompt-background-neutral text-alerts-info-prompt-icon-neutral\",\n className,\n )}\n {...props}\n >\n {resolvedIcon && (\n <span className=\"flex shrink-0 items-start
|
|
1
|
+
{"version":3,"file":"Alert.mjs","sources":["../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import { Slot } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Button } from \"../Button/Button\";\nimport { CheckCircleIcon } from \"../Icons/CheckCircleIcon\";\nimport { CrossIcon } from \"../Icons/CrossIcon\";\nimport { ErrorCircleIcon } from \"../Icons/ErrorCircleIcon\";\nimport { InfoCircleIcon } from \"../Icons/InfoCircleIcon\";\nimport { WarningTriangleIcon } from \"../Icons/WarningTriangleIcon\";\n\n/** Visual style variant of the alert. */\nexport type AlertVariant = \"info\" | \"success\" | \"warning\" | \"error\" | \"neutral\";\n\nconst DEFAULT_ICONS: Record<AlertVariant, React.ReactNode> = {\n info: <InfoCircleIcon />,\n success: <CheckCircleIcon />,\n warning: <WarningTriangleIcon />,\n error: <ErrorCircleIcon />,\n neutral: <InfoCircleIcon />,\n};\n\nexport interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Visual style variant of the alert. @default \"info\" */\n variant?: AlertVariant;\n /** Optional title text displayed in bold above the description. */\n title?: string;\n /** Custom icon override. Pass `null` to hide the icon entirely. Each variant shows a default icon when left `undefined`. */\n icon?: React.ReactNode | null;\n /** Whether to show the close button. @default false */\n closable?: boolean;\n /** Callback fired when the close button is clicked. */\n onClose?: () => void;\n /** Accessible label for the close button. @default \"Close alert\" */\n closeLabel?: string;\n /**\n * Composable action slot rendered beneath the description, outside the\n * `role=\"alert\"` live region. Pass your own element (an `<a>`, a `next/link`\n * `<Link>`, or a `<Button>`) and it receives the variant-appropriate link\n * styling via the Radix `Slot` pattern while remaining a real link/button.\n */\n action?: React.ReactNode;\n}\n\nconst CLOSE_BUTTON_CLASSES: Record<AlertVariant, string> = {\n info: \"hover:bg-info-content/10 active:bg-info-content/20 text-info-content motion-safe:transition-colors motion-safe:duration-150\",\n success:\n \"hover:bg-success-content/10 active:bg-success-content/20 text-success-content motion-safe:transition-colors motion-safe:duration-150\",\n warning:\n \"hover:bg-warning-content/10 active:bg-warning-content/20 text-warning-content motion-safe:transition-colors motion-safe:duration-150\",\n error:\n \"hover:bg-error-content/10 active:bg-error-content/20 text-error-content motion-safe:transition-colors motion-safe:duration-150\",\n neutral:\n \"hover:bg-content-secondary/10 active:bg-content-secondary/20 text-content-secondary motion-safe:transition-colors motion-safe:duration-150\",\n};\n\nconst LINK_CLASSES: Record<AlertVariant, string> = {\n info: \"text-alerts-info-prompt-content-info\",\n success: \"text-alerts-info-prompt-content-success\",\n warning: \"text-alerts-info-prompt-content-warning\",\n error: \"text-alerts-info-prompt-content-error\",\n neutral: \"text-content-secondary\",\n};\n\n/**\n * Displays a contextual feedback message to the user.\n *\n * Supports `info`, `success`, `warning`, `error`, and `neutral` variants with a\n * default icon per variant, optional title, description, dismiss button, and an\n * optional composable `action` slot.\n *\n * Each variant renders a default icon automatically. Pass a custom `icon` to\n * override, or `icon={null}` to hide the icon entirely.\n *\n * Only the title and description live inside the `role=\"alert\"` live region.\n * The icon, `action`, and close button are rendered outside it so interactive\n * controls are announced and navigated consistently by screen readers.\n *\n * @example\n * ```tsx\n * <Alert variant=\"success\" title=\"Saved\" closable onClose={handleClose}>\n * Your changes have been saved.\n * </Alert>\n * ```\n *\n * @example\n * ```tsx\n * <Alert variant=\"neutral\" title=\"Heads up\" action={<a href=\"/docs\">Learn more</a>}>\n * A general notice with no specific sentiment.\n * </Alert>\n * ```\n *\n * @example\n * ```tsx\n * import Link from \"next/link\";\n *\n * <Alert variant=\"info\" title=\"Update available\" action={<Link href=\"/changelog\">See what's new</Link>}>\n * A new version is ready to install.\n * </Alert>\n * ```\n */\nexport const Alert = React.forwardRef<HTMLDivElement, AlertProps>(\n (\n {\n className,\n variant = \"info\",\n title,\n icon,\n closable = false,\n onClose,\n closeLabel = \"Close alert\",\n action,\n children,\n ...props\n },\n ref,\n ) => {\n const resolvedIcon = icon === null ? null : (icon ?? DEFAULT_ICONS[variant]);\n\n return (\n <div\n ref={ref}\n data-testid=\"alert\"\n className={cn(\n \"grid gap-x-3 rounded-xs p-4 text-sm leading-[18px]\",\n resolvedIcon && closable && \"grid-cols-[auto_1fr_auto]\",\n resolvedIcon && !closable && \"grid-cols-[auto_1fr]\",\n !resolvedIcon && closable && \"grid-cols-[1fr_auto]\",\n !resolvedIcon && !closable && \"grid-cols-[1fr]\",\n title && children ? \"items-start\" : \"items-center\",\n variant === \"info\" && \"bg-info-surface text-info-content\",\n variant === \"success\" && \"bg-success-surface text-success-content\",\n variant === \"warning\" && \"bg-warning-surface text-warning-content\",\n variant === \"error\" && \"bg-error-surface text-error-content\",\n variant === \"neutral\" &&\n \"bg-alerts-info-prompt-background-neutral text-alerts-info-prompt-icon-neutral\",\n className,\n )}\n {...props}\n >\n {resolvedIcon && (\n <span className=\"flex h-full shrink-0 items-start\" aria-hidden=\"true\">\n {resolvedIcon}\n </span>\n )}\n\n <div className=\"flex min-w-0 flex-col gap-2\">\n <div role=\"alert\" className=\"flex flex-col gap-2\">\n {title && (\n <div className=\"typography-body-small-14px-semibold text-content-primary\">\n {title}\n </div>\n )}\n <div className=\"typography-body-small-14px-regular text-content-primary\">\n {children}\n </div>\n </div>\n {action && (\n <Slot\n className={cn(\n \"typography-body-small-14px-semibold w-fit cursor-pointer underline underline-offset-2\",\n LINK_CLASSES[variant],\n )}\n >\n {action}\n </Slot>\n )}\n </div>\n\n {closable && (\n <Button\n variant=\"tertiary\"\n size=\"24\"\n onClick={onClose}\n className={cn(\"self-start px-0\", CLOSE_BUTTON_CLASSES[variant])}\n aria-label={closeLabel}\n >\n <CrossIcon />\n </Button>\n )}\n </div>\n );\n },\n);\n\nAlert.displayName = \"Alert\";\n"],"names":[],"mappings":";;;;;;;;;;;AAaA,MAAM,gBAAuD;AAAA,EAC3D,0BAAO,gBAAA,EAAe;AAAA,EACtB,6BAAU,iBAAA,EAAgB;AAAA,EAC1B,6BAAU,qBAAA,EAAoB;AAAA,EAC9B,2BAAQ,iBAAA,EAAgB;AAAA,EACxB,6BAAU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AAAA,YAAA,GACF;AAAA,YACC,UACC;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAW;AAAA,kBACT;AAAA,kBACA,aAAa,OAAO;AAAA,gBAAA;AAAA,gBAGrB,UAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UACH,GAEJ;AAAA,UAEC,YACC;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,SAAQ;AAAA,cACR,MAAK;AAAA,cACL,SAAS;AAAA,cACT,WAAW,GAAG,mBAAmB,qBAAqB,OAAO,CAAC;AAAA,cAC9D,cAAY;AAAA,cAEZ,8BAAC,WAAA,CAAA,CAAU;AAAA,YAAA;AAAA,UAAA;AAAA,QACb;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,MAAM,cAAc;"}
|
|
@@ -64,7 +64,7 @@ const BottomNavigation = React.forwardRef(
|
|
|
64
64
|
},
|
|
65
65
|
children: [
|
|
66
66
|
/* @__PURE__ */ jsx("div", { className: "h-px w-full bg-linear-to-r from-transparent via-(--color-special-bottom-nav-highlight) to-transparent" }),
|
|
67
|
-
/* @__PURE__ */ jsx("div", { className: "@container h-20 w-full overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "mx-auto aspect-square w-[70%] max-w-[70px] -translate-y-1/2 rounded-full bg-(--color-special-bottom-nav-highlight) opacity-30 blur-[min(20px,2vw)]
|
|
67
|
+
/* @__PURE__ */ jsx("div", { className: "@container h-20 w-full overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "mx-auto aspect-square @max-[80px]:w-[calc(70%-10px)] w-[70%] max-w-[70px] -translate-y-1/2 rounded-full bg-(--color-special-bottom-nav-highlight) opacity-30 blur-[min(20px,2vw)] dark:opacity-15" }) })
|
|
68
68
|
]
|
|
69
69
|
}
|
|
70
70
|
)
|