{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "open-roles-board",
  "title": "Open Roles Board Section",
  "description": "A careers board: search, department chips with live counts, remote, hybrid and on-site toggles, roles grouped by department in expandable rows with summary, highlights, pay and an apply link, New badges for fresh roles, and a get-notified form.",
  "dependencies": [
    "motion",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/open-roles-board/open-roles-board.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nfunction cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nexport type WorkMode = \"Remote\" | \"Hybrid\" | \"On-site\";\n\nexport interface OpenRole {\n  id: string;\n  title: string;\n  department: string;\n  location: string;\n  mode: WorkMode;\n  type?: string;\n  salary?: string;\n  /** Shown when the row is opened. */\n  summary?: string;\n  highlights?: string[];\n  /** ISO date the role was posted; roles from the last 7 days get a New badge. */\n  posted?: string;\n  href?: string;\n}\n\nexport interface OpenRolesBoardProps {\n  eyebrow?: string;\n  title?: string;\n  description?: string;\n  roles?: OpenRole[];\n  /** Today as YYYY-MM-DD, used for the New badge. Defaults to the newest posted date. */\n  today?: string;\n  /** \"Get notified\" form under the list. Return a promise; a rejection shows an error. Pass null to hide it. */\n  onNotify?: ((email: string, departments: string[]) => void | Promise<void>) | null;\n  theme?: \"dark\" | \"light\";\n  className?: string;\n}\n\nconst PALETTES = {\n  dark: { bg: \"#0A0A0A\", text: \"#F5F4F1\", muted: \"rgba(245,244,241,0.6)\", faint: \"rgba(245,244,241,0.38)\", card: \"#111111\", border: \"rgba(255,255,255,0.1)\", chip: \"rgba(255,255,255,0.05)\", field: \"rgba(255,255,255,0.04)\", on: \"#F5F4F1\", onText: \"#0A0A0A\", ok: \"#4ADE80\", error: \"#FF7A6B\", ring: \"rgba(245,244,241,0.6)\" },\n  light: { bg: \"#FAFAF8\", text: \"#0A0A0A\", muted: \"rgba(10,10,10,0.6)\", faint: \"rgba(10,10,10,0.4)\", card: \"#FFFFFF\", border: \"rgba(10,10,10,0.1)\", chip: \"rgba(10,10,10,0.04)\", field: \"#FFFFFF\", on: \"#0A0A0A\", onText: \"#FAFAF8\", ok: \"#16A34A\", error: \"#D93F2B\", ring: \"rgba(10,10,10,0.5)\" },\n};\n\nconst DEFAULT_ROLES: OpenRole[] = [\n  { id: \"pe-editor\", title: \"Senior Product Engineer, Editor\", department: \"Engineering\", location: \"Europe\", mode: \"Remote\", type: \"Full-time\", salary: \"€82k–€118k\", posted: \"2026-10-28\", summary: \"Build the real-time editor thousands of teams write their plans in.\", highlights: [\"TypeScript and React\", \"Real-time or offline sync experience\", \"4h overlap with UTC+0 to UTC+3\"], href: \"#\" },\n  { id: \"be-sync\", title: \"Backend Engineer, Sync\", department: \"Engineering\", location: \"Berlin\", mode: \"Hybrid\", type: \"Full-time\", salary: \"€90k–€115k\", posted: \"2026-10-30\", summary: \"Make edits merge cleanly when people reconnect after a train ride.\", highlights: [\"Go or Rust\", \"Distributed systems\", \"Two days a week in Berlin\"], href: \"#\" },\n  { id: \"sre\", title: \"Site Reliability Engineer\", department: \"Engineering\", location: \"Europe\", mode: \"Remote\", type: \"Full-time\", salary: \"€85k–€110k\", posted: \"2026-10-12\", summary: \"Keep 99.95% uptime boring.\", highlights: [\"Kubernetes\", \"On-call one week in six\"], href: \"#\" },\n  { id: \"pd-editor\", title: \"Product Designer, Editor\", department: \"Design\", location: \"Lisbon\", mode: \"Hybrid\", type: \"Full-time\", salary: \"€70k–€92k\", posted: \"2026-10-21\", summary: \"Design the blocks, menus and shortcuts people use all day.\", highlights: [\"Interaction design\", \"Prototyping in code is a plus\"], href: \"#\" },\n  { id: \"brand\", title: \"Brand Designer\", department: \"Design\", location: \"Berlin\", mode: \"On-site\", type: \"Contract, 6 months\", salary: \"€550 a day\", posted: \"2026-10-31\", summary: \"Shape the launch of our mobile app.\", highlights: [\"Motion and type\", \"A portfolio of launches\"], href: \"#\" },\n  { id: \"pmm\", title: \"Product Marketing Manager\", department: \"Marketing\", location: \"New York\", mode: \"Hybrid\", type: \"Full-time\", salary: \"$130k–$155k\", posted: \"2026-10-05\", summary: \"Tell the story of every release, from the spec to the launch post.\", highlights: [\"B2B SaaS launches\", \"Writing samples\"], href: \"#\" },\n  { id: \"ae\", title: \"Account Executive, Mid-market\", department: \"Sales\", location: \"New York\", mode: \"On-site\", type: \"Full-time\", salary: \"$95k base + commission\", posted: \"2026-09-29\", summary: \"Help 100 to 1,000 person teams move their planning to Nexora.\", highlights: [\"SaaS sales, 3+ years\", \"Consultative selling\"], href: \"#\" },\n  { id: \"support\", title: \"Customer Support Specialist\", department: \"Support\", location: \"Singapore\", mode: \"Hybrid\", type: \"Full-time\", salary: \"S$62k–S$78k\", posted: \"2026-10-26\", summary: \"Answer customers in Asia Pacific and turn their feedback into fixes.\", highlights: [\"Clear writing\", \"English, Mandarin a plus\"], href: \"#\" },\n];\n\nconst MODES: WorkMode[] = [\"Remote\", \"Hybrid\", \"On-site\"];\nconst daysBetween = (a: string, b: string) => Math.round((Date.parse(b) - Date.parse(a)) / 864e5);\n\nexport function OpenRolesBoard({\n  eyebrow = \"Careers\",\n  title = \"Open roles\",\n  description = \"We hire slowly and on purpose. Every role lists its pay range, and everyone who applies hears back within a week.\",\n  roles = DEFAULT_ROLES,\n  today,\n  onNotify,\n  theme = \"dark\",\n  className,\n}: OpenRolesBoardProps) {\n  const p = PALETTES[theme];\n  const reduce = !!useReducedMotion();\n  const uid = React.useId();\n  const [dept, setDept] = React.useState(\"All\");\n  const [modes, setModes] = React.useState<WorkMode[]>([]);\n  const [q, setQ] = React.useState(\"\");\n  const [open, setOpen] = React.useState<string | null>(null);\n  const [email, setEmail] = React.useState(\"\");\n  const [notify, setNotify] = React.useState<\"idle\" | \"loading\" | \"done\" | \"error\">(\"idle\");\n  const [emailErr, setEmailErr] = React.useState(false);\n  const ref = today ?? roles.reduce((m, r) => (r.posted && r.posted > m ? r.posted : m), \"0000-00-00\");\n  const depts = [\"All\", ...Array.from(new Set(roles.map((r) => r.department)))];\n  const query = q.trim().toLowerCase();\n  const matchesBase = (r: OpenRole) => (modes.length === 0 || modes.includes(r.mode)) && (!query || `${r.title} ${r.department} ${r.location} ${r.mode}`.toLowerCase().includes(query));\n  const list = roles.filter((r) => (dept === \"All\" || r.department === dept) && matchesBase(r));\n  const grouped = Array.from(new Set(list.map((r) => r.department))).map((d) => ({ d, items: list.filter((r) => r.department === d) }));\n  const ring = { [\"--tw-ring-color\" as string]: p.ring, [\"--tw-ring-offset-color\" as string]: p.bg } as React.CSSProperties;\n  const focus = \"outline-none focus-visible:ring-2 focus-visible:ring-offset-2\";\n  const filtered = dept !== \"All\" || modes.length > 0 || !!query;\n  const clear = () => {\n    setDept(\"All\");\n    setModes([]);\n    setQ(\"\");\n  };\n\n  const submitNotify = async (e: React.FormEvent) => {\n    e.preventDefault();\n    if (!/^\\S+@\\S+\\.\\S+$/.test(email.trim())) return setEmailErr(true);\n    setNotify(\"loading\");\n    try {\n      await onNotify?.(email.trim(), dept === \"All\" ? [] : [dept]);\n      setNotify(\"done\");\n    } catch {\n      setNotify(\"error\");\n    }\n  };\n\n  return (\n    <section className={cn(\"@container w-full\", className)} style={{ background: p.bg, color: p.text }}>\n      <div className=\"mx-auto max-w-5xl px-6 py-20 @[640px]:py-24\">\n        <div className=\"flex flex-col gap-6 @[760px]:flex-row @[760px]:items-end @[760px]:justify-between\">\n          <div>\n            {eyebrow && <p className=\"m-0 text-[13px] font-medium tracking-[0.12em] uppercase\" style={{ color: p.faint }}>{eyebrow}</p>}\n            <h2 className=\"mt-3 mb-0 flex items-baseline gap-3 text-[34px] leading-[1.08] font-semibold tracking-[-0.03em] @[640px]:text-[48px]\">\n              {title}\n              <span className=\"text-[18px] font-medium tabular-nums @[640px]:text-[22px]\" style={{ color: p.faint }}>\n                {roles.length}\n              </span>\n            </h2>\n            {description && <p className=\"mt-3 mb-0 max-w-[480px] text-[16px] leading-[1.6]\" style={{ color: p.muted }}>{description}</p>}\n          </div>\n          <div className=\"w-full @[760px]:w-[260px]\">\n            <label htmlFor={`${uid}-q`} className=\"sr-only\">\n              Search roles\n            </label>\n            <input id={`${uid}-q`} type=\"search\" value={q} onChange={(e) => setQ(e.target.value)} placeholder=\"Search roles or cities\" className=\"h-11 w-full rounded-full border px-4 text-[16px] outline-none focus-visible:ring-2 @[760px]:text-[14px]\" style={{ background: p.field, borderColor: p.border, color: p.text, ...ring }} />\n          </div>\n        </div>\n\n        <div className=\"mt-8 flex flex-col gap-3 @[760px]:flex-row @[760px]:items-center @[760px]:justify-between\">\n          <div role=\"group\" aria-label=\"Department\" className=\"-mx-6 flex gap-1.5 overflow-x-auto px-6 [scrollbar-width:none] @[760px]:mx-0 @[760px]:flex-wrap @[760px]:px-0 [&::-webkit-scrollbar]:hidden\">\n            {depts.map((d) => {\n              const n = roles.filter((r) => (d === \"All\" || r.department === d) && matchesBase(r)).length;\n              const on = dept === d;\n              return (\n                <button key={d} type=\"button\" aria-pressed={on} onClick={() => setDept(d)} className={cn(\"relative h-9 shrink-0 cursor-pointer rounded-full border px-3.5 text-[13px] font-medium whitespace-nowrap\", focus)} style={{ borderColor: on ? p.on : p.border, background: \"transparent\", color: on ? p.onText : n ? p.muted : p.faint, ...ring }}>\n                  {on && <motion.span layoutId={`${uid}-dept`} className=\"absolute inset-0 rounded-full\" style={{ background: p.on }} transition={reduce ? { duration: 0 } : { type: \"spring\", stiffness: 420, damping: 34 }} />}\n                  <span className=\"relative\">\n                    {d} <span style={{ opacity: 0.55 }}>{n}</span>\n                  </span>\n                </button>\n              );\n            })}\n          </div>\n          <div role=\"group\" aria-label=\"Work mode\" className=\"flex shrink-0 gap-1.5\">\n            {MODES.map((m) => {\n              const on = modes.includes(m);\n              return (\n                <button key={m} type=\"button\" aria-pressed={on} onClick={() => setModes((v) => (on ? v.filter((x) => x !== m) : [...v, m]))} className={cn(\"flex h-9 cursor-pointer items-center gap-1.5 rounded-full border px-3 text-[13px] font-medium\", focus)} style={{ borderColor: on ? p.on : p.border, background: on ? p.chip : \"transparent\", color: on ? p.text : p.muted, ...ring }}>\n                  <span className=\"flex h-3.5 w-3.5 items-center justify-center rounded-[4px] border\" style={{ borderColor: on ? p.on : p.border, background: on ? p.on : \"transparent\", color: p.onText }} aria-hidden=\"true\">\n                    {on && (\n                      <svg width=\"9\" height=\"9\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"3\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n                        <path d=\"m3 8.5 3 3 7-7\" />\n                      </svg>\n                    )}\n                  </span>\n                  {m}\n                </button>\n              );\n            })}\n          </div>\n        </div>\n\n        <p className=\"m-0 mt-6 flex items-center justify-between text-[13px] tabular-nums\" style={{ color: p.faint }}>\n          <span aria-live=\"polite\">\n            {list.length} {list.length === 1 ? \"role\" : \"roles\"}\n            {filtered ? \" match\" : \"\"}\n          </span>\n          {filtered && (\n            <button type=\"button\" onClick={clear} className={cn(\"cursor-pointer rounded border-0 bg-transparent p-0 underline underline-offset-4\", focus)} style={{ color: p.muted, ...ring }}>\n              Clear filters\n            </button>\n          )}\n        </p>\n\n        {list.length === 0 ? (\n          <div className=\"mt-4 rounded-2xl border border-dashed px-6 py-12 text-center\" style={{ borderColor: p.border }}>\n            <p className=\"m-0 text-[17px] font-medium\">No roles match right now</p>\n            <p className=\"m-0 mt-2 text-[14.5px]\" style={{ color: p.muted }}>\n              Try fewer filters, or get an email when something opens below.\n            </p>\n          </div>\n        ) : (\n          <div className=\"mt-4 flex flex-col gap-8\">\n            <AnimatePresence initial={false} mode=\"popLayout\">\n              {grouped.map((g) => (\n                <motion.div key={g.d} layout={!reduce} initial={reduce ? false : { opacity: 0 }} animate={{ opacity: 1 }} exit={reduce ? undefined : { opacity: 0 }}>\n                  <h3 className=\"m-0 mb-2 text-[13px] font-medium tracking-[0.08em] uppercase\" style={{ color: p.faint }}>\n                    {g.d} <span className=\"tabular-nums\">· {g.items.length}</span>\n                  </h3>\n                  <ul className=\"m-0 list-none overflow-hidden rounded-2xl border p-0\" style={{ borderColor: p.border, background: p.card }}>\n                    <AnimatePresence initial={false}>\n                      {g.items.map((r) => {\n                        const isOpen = open === r.id;\n                        const fresh = r.posted && daysBetween(r.posted, ref) <= 7;\n                        return (\n                          <motion.li key={r.id} layout={!reduce} initial={reduce ? false : { opacity: 0, height: 0 }} animate={{ opacity: 1, height: \"auto\" }} exit={reduce ? undefined : { opacity: 0, height: 0 }} className=\"border-t first:border-t-0\" style={{ borderColor: p.border }}>\n                            <h4 className=\"m-0\">\n                              <button type=\"button\" aria-expanded={isOpen} aria-controls={`${uid}-${r.id}`} onClick={() => setOpen(isOpen ? null : r.id)} className={cn(\"group grid w-full cursor-pointer grid-cols-[1fr_auto] items-center gap-3 border-0 bg-transparent px-5 py-4 text-left @[640px]:grid-cols-[1.6fr_1fr_auto] @[640px]:gap-6\", focus)} style={{ color: p.text, ...ring, [\"--tw-ring-offset-color\" as string]: p.card }}>\n                                <span className=\"min-w-0\">\n                                  <span className=\"flex flex-wrap items-center gap-x-2 gap-y-1 @[640px]:flex-nowrap\">\n                                    <span className=\"text-[16px] font-medium @[640px]:truncate\">{r.title}</span>\n                                    {fresh && (\n                                      <span className=\"shrink-0 rounded-full px-2 py-0.5 text-[10.5px] font-semibold\" style={{ background: p.ok, color: \"#0A0A0A\" }}>\n                                        New\n                                      </span>\n                                    )}\n                                  </span>\n                                  <span className=\"mt-0.5 block text-[13px] @[640px]:hidden\" style={{ color: p.faint }}>\n                                    {r.location} · {r.mode}\n                                  </span>\n                                </span>\n                                <span className=\"hidden text-[14px] @[640px]:block\" style={{ color: p.muted }}>\n                                  {r.location} · {r.mode}\n                                </span>\n                                <motion.span aria-hidden=\"true\" className=\"flex h-8 w-8 items-center justify-center rounded-full border\" style={{ borderColor: p.border }} animate={{ rotate: isOpen ? 45 : 0 }} transition={{ duration: reduce ? 0 : 0.2 }}>\n                                  <svg width=\"12\" height=\"12\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\">\n                                    <path d=\"M8 3v10M3 8h10\" />\n                                  </svg>\n                                </motion.span>\n                              </button>\n                            </h4>\n                            <AnimatePresence initial={false}>\n                              {isOpen && (\n                                <motion.div id={`${uid}-${r.id}`} role=\"region\" aria-label={r.title} initial={reduce ? false : { height: 0, opacity: 0 }} animate={{ height: \"auto\", opacity: 1 }} exit={reduce ? undefined : { height: 0, opacity: 0 }} transition={{ duration: 0.25 }} className=\"overflow-hidden\">\n                                  <div className=\"grid gap-5 px-5 pb-5 @[640px]:grid-cols-[1.6fr_1fr] @[640px]:gap-6\">\n                                    <div>\n                                      {r.summary && <p className=\"m-0 text-[15px] leading-[1.6]\" style={{ color: p.muted }}>{r.summary}</p>}\n                                      {r.highlights && r.highlights.length > 0 && (\n                                        <ul className=\"m-0 mt-3 flex list-none flex-wrap gap-1.5 p-0\">\n                                          {r.highlights.map((h) => (\n                                            <li key={h} className=\"rounded-full px-2.5 py-1 text-[12.5px]\" style={{ background: p.chip, color: p.text }}>\n                                              {h}\n                                            </li>\n                                          ))}\n                                        </ul>\n                                      )}\n                                    </div>\n                                    <div className=\"flex flex-col gap-3\">\n                                      <dl className=\"m-0 grid grid-cols-2 gap-2 text-[13px]\">\n                                        {r.type && (\n                                          <div>\n                                            <dt style={{ color: p.faint }}>Type</dt>\n                                            <dd className=\"m-0 mt-0.5\">{r.type}</dd>\n                                          </div>\n                                        )}\n                                        {r.salary && (\n                                          <div>\n                                            <dt style={{ color: p.faint }}>Pay</dt>\n                                            <dd className=\"m-0 mt-0.5 tabular-nums\">{r.salary}</dd>\n                                          </div>\n                                        )}\n                                      </dl>\n                                      {r.href && (\n                                        <a href={r.href} className={cn(\"inline-flex h-10 items-center justify-center gap-2 self-start rounded-full px-4 text-[14px] font-medium no-underline transition-opacity hover:opacity-90\", focus)} style={{ background: p.on, color: p.onText, ...ring, [\"--tw-ring-offset-color\" as string]: p.card }}>\n                                          View and apply<span className=\"sr-only\">: {r.title}</span> →\n                                        </a>\n                                      )}\n                                    </div>\n                                  </div>\n                                </motion.div>\n                              )}\n                            </AnimatePresence>\n                          </motion.li>\n                        );\n                      })}\n                    </AnimatePresence>\n                  </ul>\n                </motion.div>\n              ))}\n            </AnimatePresence>\n          </div>\n        )}\n\n        {onNotify !== null && (\n          <div className=\"mt-10 flex flex-col gap-4 rounded-2xl border p-5 @[760px]:flex-row @[760px]:items-center @[760px]:justify-between @[640px]:p-6\" style={{ borderColor: p.border }}>\n            <div>\n              <p className=\"m-0 text-[16px] font-medium\">Nothing for you yet?</p>\n              <p className=\"m-0 mt-1 text-[14px]\" style={{ color: p.muted }}>\n                Get one email when a {dept === \"All\" ? \"\" : `${dept.toLowerCase()} `}role opens. No newsletter.\n              </p>\n            </div>\n            {notify === \"done\" ? (\n              <p role=\"status\" className=\"m-0 text-[14px]\" style={{ color: p.ok }}>\n                Done. We will email {email.trim()}.\n              </p>\n            ) : (\n              <form noValidate onSubmit={submitNotify} className=\"flex w-full flex-col gap-1 @[760px]:w-auto\">\n                <div className=\"flex gap-2\">\n                  <label htmlFor={`${uid}-n`} className=\"sr-only\">\n                    Email for new roles\n                  </label>\n                  <input\n                    id={`${uid}-n`}\n                    type=\"email\"\n                    autoComplete=\"email\"\n                    placeholder=\"you@example.com\"\n                    value={email}\n                    aria-invalid={emailErr || undefined}\n                    aria-describedby={`${uid}-ne`}\n                    onChange={(e) => {\n                      setEmail(e.target.value);\n                      setEmailErr(false);\n                      setNotify(\"idle\");\n                    }}\n                    className=\"h-10 w-full min-w-0 rounded-full border px-4 text-[16px] outline-none focus-visible:ring-2 @[760px]:w-[220px] @[760px]:text-[14px]\"\n                    style={{ background: p.field, borderColor: emailErr ? p.error : p.border, color: p.text, ...ring }}\n                  />\n                  <button type=\"submit\" disabled={notify === \"loading\"} className={cn(\"h-10 shrink-0 cursor-pointer rounded-full border-0 px-4 text-[14px] font-medium disabled:cursor-wait disabled:opacity-60\", focus)} style={{ background: p.on, color: p.onText, ...ring }}>\n                    {notify === \"loading\" ? \"Saving...\" : \"Notify me\"}\n                  </button>\n                </div>\n                <p id={`${uid}-ne`} role=\"alert\" className=\"m-0 min-h-[18px] px-1 text-[12.5px]\" style={{ color: p.error }}>\n                  {emailErr ? \"Add a valid email address.\" : notify === \"error\" ? \"Could not save that. Please try again.\" : \"\"}\n                </p>\n              </form>\n            )}\n          </div>\n        )}\n      </div>\n    </section>\n  );\n}\n\nexport default OpenRolesBoard;\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}