import { Card, CardContent, CardDescription, CardHeader, CardTitle, Carousel, CarouselContent, CarouselDots, CarouselItem, CarouselNext, CarouselPrevious, StatCard, } from "@godxjp/ui/data-display"; import { Flex, PageContainer } from "@godxjp/ui/layout"; /** * Carousel — Embla-backed stepping list with prev/next controls. * Compose Carousel > CarouselContent > CarouselItem + CarouselPrevious/Next. * Structurally configured via `opts` (loop, align, axis) and `plugins`; `setApi` * exposes the Embla api for external controls (e.g. dot indicators via scrollTo). * Composed only from real @godxjp/ui components. */ const months = [ { label: "1月 売上", value: "¥7.4M", delta: "+4%" }, { label: "2月 売上", value: "¥7.9M", delta: "+7%" }, { label: "3月 売上", value: "¥8.0M", delta: "+1%" }, { label: "4月 売上", value: "¥8.2M", delta: "+12%" }, { label: "5月 売上", value: "¥8.6M", delta: "+5%" }, ]; const slides = [ { label: "第1四半期", value: "¥23.3M" }, { label: "第2四半期", value: "¥25.4M" }, { label: "第3四半期", value: "¥26.1M" }, ]; /** Dot navigation — `CarouselDots` reads the Embla api from context; no manual `setApi` wiring. */ function DotNavExample() { return ( {slides.map((s) => ( ))} ); } export default function Demo() { return ( {/* Default horizontal, multi-up responsive track. px-10 clears the absolute arrow buttons. */} 月次 KPI Default horizontal track. Step with prev/next; arrows auto-disable at the first and last slide. {months.map((m) => ( ))} {/* opts: looping single-up gallery — wraps past the ends, so both arrows stay enabled. */} ループ ギャラリー opts={{ loop: true, align: "start" }} — wraps past the ends, so prev/next never disable. {months.map((m) => ( ))} {/* setApi + scrollTo: external dot navigation, active dot seeded visible at rest. */} ドット ナビゲーション Drop in CarouselDots and it reads the Embla api from context, rendering one dot per slide. The active dot widens and carries aria-current. {/* opts.axis: vertical orientation — emits data-orientation="vertical". */} 縦方向 (vertical) opts={{ axis: "y" }} — stacks slides and moves the prev/next controls to top and bottom. {slides.map((s) => ( ))} ); }