{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "hero-section",
  "type": "registry:block",
  "title": "Hero Section Block",
  "description": "A Hero Section Block component for displaying a hero section.",
  "files": [
    {
      "path": "src/registry/blocks/hero-section.tsx",
      "type": "registry:block",
      "content": "import { useId, type ComponentProps } from \"react\";\nimport { ArrowRight } from \"lucide-react\";\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils\";\n\ntype Action = { label: string; href: string };\n\ntype CalendarEvent = {\n  /** 0 = Monday. */\n  day: number;\n  /** Start and end in hours, e.g. 9.5 for 09:30. */\n  start: number;\n  end: number;\n  title: string;\n  /** Protected focus time is drawn in the accent color. */\n  focus?: boolean;\n};\n\nexport type HeroSectionBlockProps = {\n  eyebrow?: string;\n  title?: string;\n  description?: string;\n  primaryAction?: Action;\n  secondaryAction?: Action;\n  note?: string;\n  events?: CalendarEvent[];\n} & ComponentProps<\"section\">;\n\nconst DAYS = [\"Mon 12\", \"Tue 13\", \"Wed 14\", \"Thu 15\", \"Fri 16\"];\nconst FIRST_HOUR = 8;\nconst LAST_HOUR = 18;\n\nconst DEFAULT_EVENTS: CalendarEvent[] = [\n  { day: 0, start: 9, end: 12, title: \"Deep work\", focus: true },\n  { day: 0, start: 14, end: 14.5, title: \"1:1 with Priya\" },\n  { day: 1, start: 9, end: 12, title: \"Deep work\", focus: true },\n  { day: 1, start: 15, end: 16, title: \"Design review\" },\n  { day: 2, start: 10, end: 10.5, title: \"Standup, moved\" },\n  { day: 2, start: 13, end: 17, title: \"No meetings Wednesday\", focus: true },\n  { day: 3, start: 9, end: 12, title: \"Deep work\", focus: true },\n  { day: 3, start: 16, end: 16.5, title: \"Hiring sync\" },\n  { day: 4, start: 9, end: 11, title: \"Writing\", focus: true },\n  { day: 4, start: 15.5, end: 16.5, title: \"Demo\" },\n];\n\nconst DEFAULTS = {\n  eyebrow: \"Margin 3 · Released 6 Oct 2026\",\n  title: \"Fewer meetings. Longer afternoons.\",\n  description:\n    \"Margin is a calendar that defends your focus time. It books meetings into the gaps you choose and quietly declines the rest.\",\n  primaryAction: { label: \"Start free, no card\", href: \"#\" },\n  secondaryAction: { label: \"Read the changelog\", href: \"#\" },\n  note: \"Used by 18,000 people who guard their mornings.\",\n};\n\nconst pad = (n: number) => String(n).padStart(2, \"0\");\nconst formatHour = (h: number) => `${pad(Math.floor(h))}:${pad(Math.round((h % 1) * 60))}`;\n\nexport default function HeroSectionBlock({\n  eyebrow = DEFAULTS.eyebrow,\n  title = DEFAULTS.title,\n  description = DEFAULTS.description,\n  primaryAction = DEFAULTS.primaryAction,\n  secondaryAction = DEFAULTS.secondaryAction,\n  note = DEFAULTS.note,\n  events = DEFAULT_EVENTS,\n  className,\n  ...props\n}: HeroSectionBlockProps) {\n  const headingId = useId();\n  const span = LAST_HOUR - FIRST_HOUR;\n\n  return (\n    <section\n      data-slot=\"hero-section\"\n      aria-labelledby={headingId}\n      className={cn(\"w-full bg-background text-foreground\", className)}\n      {...props}\n    >\n      <div className=\"mx-auto max-w-6xl px-6 pt-20 pb-16 md:pt-28\">\n        <p className=\"font-mono text-xs uppercase tracking-wider text-muted-foreground\">\n          {eyebrow}\n        </p>\n        <h1\n          id={headingId}\n          className=\"mt-8 max-w-5xl text-5xl font-semibold leading-[0.95] tracking-[-0.045em] text-balance sm:text-6xl md:text-8xl\"\n        >\n          {title}\n        </h1>\n\n        <div className=\"mt-12 grid gap-8 border-t pt-6 md:grid-cols-12 md:gap-10\">\n          <p className=\"max-w-md text-base leading-relaxed text-muted-foreground md:col-span-5\">\n            {description}\n          </p>\n          <div className=\"flex flex-wrap items-start gap-x-6 gap-y-3 md:col-span-4\">\n            <Button asChild size=\"lg\" className=\"rounded-none\">\n              <a href={primaryAction.href}>\n                {primaryAction.label}\n                <ArrowRight aria-hidden />\n              </a>\n            </Button>\n            <a\n              href={secondaryAction.href}\n              className=\"py-2 text-sm font-medium underline decoration-1 underline-offset-[6px] hover:text-muted-foreground\"\n            >\n              {secondaryAction.label}\n            </a>\n          </div>\n          <p className=\"font-mono text-xs leading-relaxed text-muted-foreground md:col-span-3 md:text-right\">\n            {note}\n          </p>\n        </div>\n\n        {/* A plain week view: the product, not an illustration of it. */}\n        <figure className=\"mt-16 border\">\n          <figcaption className=\"flex items-center justify-between border-b px-4 py-2.5 font-mono text-xs text-muted-foreground\">\n            <span>Week 42 · October</span>\n            <span className=\"flex items-center gap-2\">\n              <span aria-hidden className=\"size-2 bg-primary\" />\n              Protected focus time\n            </span>\n          </figcaption>\n          <div className=\"overflow-x-auto\">\n            <div className=\"grid min-w-[640px] grid-cols-[3.5rem_repeat(5,1fr)]\">\n              <div className=\"border-r\" />\n              {DAYS.map((day) => (\n                <div\n                  key={day}\n                  className=\"border-r px-3 py-2 font-mono text-xs uppercase tracking-wider text-muted-foreground last:border-r-0\"\n                >\n                  {day}\n                </div>\n              ))}\n\n              <div className=\"relative border-t border-r\" style={{ height: `${span * 2.25}rem` }}>\n                {Array.from({ length: span }, (_, i) => (\n                  <span\n                    key={i}\n                    className=\"absolute right-2 -translate-y-1/2 font-mono text-[10px] text-muted-foreground\"\n                    style={{ top: `${(i / span) * 100}%` }}\n                  >\n                    {i > 0 && formatHour(FIRST_HOUR + i)}\n                  </span>\n                ))}\n              </div>\n              {DAYS.map((day, dayIndex) => (\n                <div\n                  key={day}\n                  className=\"relative border-t border-r last:border-r-0\"\n                  style={{\n                    backgroundImage:\n                      \"linear-gradient(to bottom, var(--border) 1px, transparent 1px)\",\n                    backgroundSize: `100% ${100 / span}%`,\n                  }}\n                >\n                  {events\n                    .filter((event) => event.day === dayIndex)\n                    .map((event) => {\n                      // Half-hour events don't fit two lines, so they get one compact line.\n                      const compact = event.end - event.start < 1;\n                      const time = `${formatHour(event.start)}–${formatHour(event.end)}`;\n                      return (\n                        <div\n                          key={`${event.title}-${event.start}`}\n                          title={`${event.title}, ${time}`}\n                          className={cn(\n                            \"absolute inset-x-1 overflow-hidden border px-2 text-xs\",\n                            compact ? \"flex items-center leading-none\" : \"py-1\",\n                            event.focus\n                              ? \"border-primary bg-primary text-primary-foreground\"\n                              : \"bg-background\"\n                          )}\n                          style={{\n                            top: `${((event.start - FIRST_HOUR) / span) * 100}%`,\n                            height: `${((event.end - event.start) / span) * 100}%`,\n                          }}\n                        >\n                          <p className=\"truncate font-medium\">\n                            {event.title}\n                            {compact && <span className=\"sr-only\">, {time}</span>}\n                          </p>\n                          {!compact && (\n                            <p\n                              className={cn(\n                                \"font-mono text-[10px]\",\n                                event.focus ? \"text-primary-foreground/70\" : \"text-muted-foreground\"\n                              )}\n                            >\n                              {time}\n                            </p>\n                          )}\n                        </div>\n                      );\n                    })}\n                </div>\n              ))}\n            </div>\n          </div>\n        </figure>\n      </div>\n    </section>\n  );\n}\n"
    }
  ],
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "button"
  ]
}
