"use client" import * as React from "react" import { AttachmentCountCell, BooleanToggleCell, CurrencyCell, EmptyCell, ExternalLinkCell, FavoriteNameCell, NumericCell, PeopleAvatarRailCell, PillCell, ProgressCell, RatingCell, RelativeTimeCell, RowActionsCell, SignalBarsCell, StatusCell, TableNewRowDot, TagListCell, type StatusCellOption, } from "@exxatdesignux/ui/components/data-views" import { Label } from "@/components/ui/label" import { Slider } from "@/components/ui/slider" export function ProgressCellPreview() { const [progress, setProgress] = React.useState(42) return (
setProgress(v[0] ?? 0)} max={100} step={1} />
) } export function CurrencyCellPreview() { return } export function NumericCellPreview() { return } export function RatingCellPreview() { return } export function SignalBarsCellPreview() { return } /** * The dot is never a column of its own. It rides in `FavoriteNameCell`'s * `leading` slot, which is how every real caller uses it, so the preview shows * a new row against a seen row rather than a lone dot with no context. The seen * row passes `leading={null}` to prove the gutter stays reserved and the two * titles align. */ export function TableNewRowDotPreview() { const [favorites, setFavorites] = React.useState>({ new: false, seen: true, }) const toggle = (key: string) => setFavorites((current) => ({ ...current, [key]: !current[key] })) return (
toggle("new")} interactive leading={} /> toggle("seen")} interactive leading={null} />

The swatch is aria-hidden and a sibling sr-only{" "} string carries the meaning, so the dot is never the only signal.

) } export function FavoriteNameCellPreview() { const [isFavorite, setIsFavorite] = React.useState(true) return ( setIsFavorite((v) => !v)} interactive /> ) } export function EmptyCellPreview() { return (
) } /** Lifecycle used by the actionable half of the StatusCell preview. */ const STATUS_CELL_PREVIEW_OPTIONS: StatusCellOption[] = [ { value: "draft", label: "Draft", tone: "neutral", icon: "fa-pen-line" }, { value: "in-review", label: "In review", tone: "info", icon: "fa-clock" }, { value: "changes", label: "Changes requested", tone: "warning", icon: "fa-triangle-exclamation" }, { value: "published", label: "Published", tone: "success", icon: "fa-circle-check" }, ] export function StatusCellPreview() { const [status, setStatus] = React.useState("in-review") const current = STATUS_CELL_PREVIEW_OPTIONS.find((o) => o.value === status) ?? STATUS_CELL_PREVIEW_OPTIONS[0] return (
Static
Actionable
) } export function BooleanToggleCellPreview() { const [published, setPublished] = React.useState(true) return } export function PillCellPreview() { return } export function TagListCellPreview() { return } export function PeopleAvatarRailCellPreview() { return ( ) } export function ExternalLinkCellPreview() { return } export function RelativeTimeCellPreview() { return } export function AttachmentCountCellPreview() { return } export function RowActionsCellPreview() { return ( {} }, { label: "Edit", icon: "fa-pen", onSelect: () => {} }, ]} /> ) }