{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "time-off-request-panel",
  "title": "Time Off Request Panel",
  "description": "A time-off request screen: vacation / sick / personal balance cards that preview the request, a month calendar for picking a range that skips weekends and holidays, existing requests and teammates who are off marked on the days, half-day options, overlap and balance warnings, a note, and a requests list with pending items you can cancel.",
  "dependencies": [
    "motion",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/time-off-request-panel/time-off-request-panel.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\ntype Kind = \"vacation\" | \"sick\" | \"personal\";\n\nexport interface TimeOffRequest {\n  id: string;\n  kind: Kind;\n  start: string; // YYYY-MM-DD\n  end: string;\n  days: number;\n  status: \"approved\" | \"pending\" | \"declined\";\n  note?: string;\n}\n\nexport interface TimeOffRequestPanelProps {\n  balances?: Record<Kind, { used: number; total: number }>;\n  requests?: TimeOffRequest[];\n  approver?: string;\n  /** First month shown, as YYYY-MM. */\n  month?: string;\n  holidays?: Record<string, string>;\n  teamOff?: Record<string, string[]>;\n  onSubmit?: (r: Omit<TimeOffRequest, \"id\" | \"status\">) => void | Promise<void>;\n  theme?: \"dark\" | \"light\";\n  className?: string;\n}\n\nconst PALETTES = {\n  dark: { bg: \"#0A0A0A\", text: \"#F5F4F1\", muted: \"rgba(245,244,241,0.62)\", faint: \"rgba(245,244,241,0.34)\", card: \"#121212\", well: \"rgba(255,255,255,0.04)\", hover: \"rgba(255,255,255,0.06)\", border: \"rgba(255,255,255,0.08)\", input: \"#0D0D0D\", track: \"rgba(255,255,255,0.08)\", on: \"#F5F4F1\", onText: \"#0A0A0A\", green: \"#4ADE80\", amber: \"#FBBF24\", red: \"#F87171\", ring: \"rgba(245,244,241,0.6)\" },\n  light: { bg: \"#FAFAF8\", text: \"#0A0A0A\", muted: \"rgba(10,10,10,0.62)\", faint: \"rgba(10,10,10,0.38)\", card: \"#FFFFFF\", well: \"rgba(10,10,10,0.03)\", hover: \"rgba(10,10,10,0.05)\", border: \"rgba(10,10,10,0.09)\", input: \"#FAFAF8\", track: \"rgba(10,10,10,0.08)\", on: \"#0A0A0A\", onText: \"#FAFAF8\", green: \"#15803D\", amber: \"#B45309\", red: \"#DC2626\", ring: \"rgba(10,10,10,0.5)\" },\n};\nconst KINDS: Record<Kind, { label: string; color: string }> = {\n  vacation: { label: \"Vacation\", color: \"#60A5FA\" },\n  sick: { label: \"Sick leave\", color: \"#F472B6\" },\n  personal: { label: \"Personal\", color: \"#A78BFA\" },\n};\nconst BALANCES: Record<Kind, { used: number; total: number }> = { vacation: { used: 11, total: 25 }, sick: { used: 2, total: 10 }, personal: { used: 1, total: 3 } };\nconst REQUESTS: TimeOffRequest[] = [\n  { id: \"r1\", kind: \"vacation\", start: \"2026-12-28\", end: \"2026-12-31\", days: 4, status: \"approved\", note: \"Family trip\" },\n  { id: \"r2\", kind: \"personal\", start: \"2026-11-13\", end: \"2026-11-13\", days: 1, status: \"pending\" },\n  { id: \"r3\", kind: \"vacation\", start: \"2026-08-10\", end: \"2026-08-21\", days: 10, status: \"approved\" },\n  { id: \"r4\", kind: \"sick\", start: \"2026-10-05\", end: \"2026-10-06\", days: 2, status: \"approved\" },\n];\nconst HOLIDAYS: Record<string, string> = { \"2026-12-24\": \"Christmas Eve\", \"2026-12-25\": \"Christmas Day\", \"2026-12-26\": \"Boxing Day\", \"2026-12-31\": \"New Year's Eve\", \"2027-01-01\": \"New Year's Day\" };\nconst TEAM_OFF: Record<string, string[]> = { \"2026-11-23\": [\"Amara\"], \"2026-11-24\": [\"Amara\", \"Ben\"], \"2026-11-25\": [\"Amara\", \"Ben\"], \"2026-11-26\": [\"Ben\"] };\nconst MONTHS = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\nconst DOW = [\"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\", \"Su\"];\n\nconst pad = (n: number) => String(n).padStart(2, \"0\");\nconst iso = (y: number, m: number, d: number) => `${y}-${pad(m + 1)}-${pad(d)}`;\nconst parse = (s: string) => {\n  const [y, m, d] = s.split(\"-\").map(Number);\n  return { y, m: m - 1, d };\n};\nconst dow = (s: string) => {\n  const { y, m, d } = parse(s);\n  return (new Date(Date.UTC(y, m, d)).getUTCDay() + 6) % 7; // Mon = 0\n};\nconst addDays = (s: string, n: number) => {\n  const { y, m, d } = parse(s);\n  const t = new Date(Date.UTC(y, m, d + n));\n  return iso(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate());\n};\nconst short = (s: string) => {\n  const { m, d } = parse(s);\n  return `${MONTHS[m].slice(0, 3)} ${d}`;\n};\nconst range = (a: string, b: string) => (a === b ? short(a) : parse(a).m === parse(b).m ? `${short(a)}–${parse(b).d}` : `${short(a)} – ${short(b)}`);\n\nexport function TimeOffRequestPanel({ balances = BALANCES, requests: initial = REQUESTS, approver = \"Lena Hartmann\", month = \"2026-11\", holidays = HOLIDAYS, teamOff = TEAM_OFF, onSubmit, theme = \"dark\", className }: TimeOffRequestPanelProps) {\n  const p = PALETTES[theme];\n  const reduce = !!useReducedMotion();\n  const uid = React.useId();\n  const [view, setView] = React.useState(() => ({ y: Number(month.slice(0, 4)), m: Number(month.slice(5, 7)) - 1 }));\n  const [dir, setDir] = React.useState(1);\n  const [kind, setKind] = React.useState<Kind>(\"vacation\");\n  const [start, setStart] = React.useState<string | null>(null);\n  const [end, setEnd] = React.useState<string | null>(null);\n  const [hover, setHover] = React.useState<string | null>(null);\n  const [halfStart, setHalfStart] = React.useState(false);\n  const [halfEnd, setHalfEnd] = React.useState(false);\n  const [note, setNote] = React.useState(\"\");\n  const [requests, setRequests] = React.useState(initial);\n  const [sending, setSending] = React.useState(false);\n  const [sent, setSent] = React.useState<string | null>(null);\n\n  const taken = React.useMemo(() => {\n    const map: Record<string, TimeOffRequest> = {};\n    requests.filter((r) => r.status !== \"declined\").forEach((r) => {\n      for (let d = r.start; d <= r.end; d = addDays(d, 1)) map[d] = r;\n    });\n    return map;\n  }, [requests]);\n\n  const lo = start && (end ?? hover) ? (start < (end ?? hover)! ? start : (end ?? hover)!) : start;\n  const hi = start && (end ?? hover) ? (start < (end ?? hover)! ? (end ?? hover)! : start) : start;\n  const workDays: string[] = [];\n  if (lo && hi) for (let d = lo; d <= hi; d = addDays(d, 1)) if (dow(d) < 5 && !holidays[d]) workDays.push(d);\n  const single = lo === hi;\n  const days = Math.max(0, workDays.length - (halfStart && workDays.length ? 0.5 : 0) - (halfEnd && !single && workDays.length > 1 ? 0.5 : 0));\n  const bal = balances[kind];\n  const pendingUsed = requests.filter((r) => r.kind === kind && r.status === \"pending\").reduce((a, r) => a + r.days, 0);\n  const left = bal.total - bal.used - pendingUsed;\n  const after = left - days;\n  const overlaps = lo && hi ? Array.from(new Set(workDays.flatMap((d) => teamOff[d] ?? []))) : [];\n  const clash = lo && hi ? workDays.some((d) => taken[d]) : false;\n  const ready = !!(start && end) && days > 0 && after >= 0 && !clash;\n\n  const first = iso(view.y, view.m, 1);\n  const lead = dow(first);\n  const dim = new Date(Date.UTC(view.y, view.m + 1, 0)).getUTCDate();\n  const cells = [...Array(lead).fill(null), ...Array.from({ length: dim }, (_, i) => iso(view.y, view.m, i + 1))];\n  while (cells.length % 7) cells.push(null);\n\n  const shift = (n: number) => {\n    setDir(n);\n    setView((v) => {\n      const m = v.m + n;\n      return { y: v.y + Math.floor(m / 12), m: ((m % 12) + 12) % 12 };\n    });\n  };\n  const pick = (d: string) => {\n    setSent(null);\n    if (!start || end) {\n      setStart(d);\n      setEnd(null);\n      setHalfStart(false);\n      setHalfEnd(false);\n    } else if (d < start) {\n      setEnd(start);\n      setStart(d);\n    } else setEnd(d);\n  };\n  const submit = async () => {\n    if (!ready || !start || !end || sending) return;\n    setSending(true);\n    const r = { kind, start, end, days, note: note.trim() || undefined };\n    try {\n      await (onSubmit ? onSubmit(r) : new Promise((res) => setTimeout(res, reduce ? 0 : 800)));\n      const id = `n${requests.length + 1}`;\n      setRequests((list) => [{ ...r, id, status: \"pending\" }, ...list]);\n      setSent(id);\n      setStart(null);\n      setEnd(null);\n      setNote(\"\");\n    } finally {\n      setSending(false);\n    }\n  };\n\n  const ring = { [\"--tw-ring-color\" as string]: p.ring, [\"--tw-ring-offset-color\" as string]: p.card } as React.CSSProperties;\n  const focus = \"outline-none focus-visible:ring-2 focus-visible:ring-offset-2\";\n  const kc = KINDS[kind].color;\n  const statusColor = { approved: p.green, pending: p.amber, declined: p.red };\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-4 py-10 @[640px]:px-6\">\n        <div className=\"flex flex-wrap items-end justify-between gap-3\">\n          <div>\n            <h2 className=\"m-0 text-[22px] font-semibold tracking-[-0.01em]\">Time off</h2>\n            <p className=\"m-0 mt-1 text-[13.5px]\" style={{ color: p.muted }}>\n              Requests go to {approver} for approval.\n            </p>\n          </div>\n        </div>\n\n        {/* Balances */}\n        <div className=\"mt-5 grid grid-cols-1 gap-2.5 @[560px]:grid-cols-3\">\n          {(Object.keys(KINDS) as Kind[]).map((k) => {\n            const b = balances[k];\n            const pend = requests.filter((r) => r.kind === k && r.status === \"pending\").reduce((a, r) => a + r.days, 0);\n            const preview = k === kind ? days : 0;\n            const avail = b.total - b.used - pend;\n            return (\n              <button key={k} type=\"button\" onClick={() => setKind(k)} aria-pressed={kind === k} className={cn(\"cursor-pointer rounded-xl border p-3.5 text-left transition-colors\", focus)} style={{ borderColor: kind === k ? `${KINDS[k].color}88` : p.border, background: kind === k ? `${KINDS[k].color}0F` : p.card, color: p.text, ...ring }}>\n                <span className=\"flex items-center justify-between text-[12.5px]\" style={{ color: p.muted }}>\n                  <span className=\"flex items-center gap-1.5\">\n                    <span className=\"h-2 w-2 rounded-full\" style={{ background: KINDS[k].color }} />\n                    {KINDS[k].label}\n                  </span>\n                  <span className=\"tabular-nums\" style={{ color: p.faint }}>\n                    of {b.total}\n                  </span>\n                </span>\n                <span className=\"mt-1.5 block text-[22px] font-semibold tabular-nums\">\n                  {avail - preview}\n                  <span className=\"ml-1 text-[12.5px] font-normal\" style={{ color: p.faint }}>\n                    {avail - preview === 1 ? \"day\" : \"days\"} left\n                  </span>\n                </span>\n                <span className=\"mt-2 flex h-1.5 overflow-hidden rounded-full\" style={{ background: p.track }} aria-hidden=\"true\">\n                  <span className=\"h-full\" style={{ width: `${(b.used / b.total) * 100}%`, background: KINDS[k].color }} />\n                  <span className=\"h-full opacity-50\" style={{ width: `${(pend / b.total) * 100}%`, background: KINDS[k].color }} />\n                  <motion.span className=\"h-full\" initial={false} animate={{ width: `${(preview / b.total) * 100}%` }} transition={{ duration: reduce ? 0 : 0.3 }} style={{ background: `repeating-linear-gradient(135deg, ${KINDS[k].color} 0 3px, transparent 3px 6px)` }} />\n                </span>\n              </button>\n            );\n          })}\n        </div>\n\n        <div className=\"mt-4 grid grid-cols-1 gap-4 @[760px]:grid-cols-[minmax(0,1fr)_300px]\">\n          {/* Calendar + form */}\n          <div className=\"rounded-2xl border p-4 @[480px]:p-5\" style={{ background: p.card, borderColor: p.border }}>\n            <div className=\"flex items-center justify-between\">\n              <h3 className=\"m-0 text-[14px] font-semibold\" aria-live=\"polite\">\n                {MONTHS[view.m]} {view.y}\n              </h3>\n              <div className=\"flex gap-1\">\n                {[-1, 1].map((n) => (\n                  <button key={n} type=\"button\" onClick={() => shift(n)} aria-label={n < 0 ? \"Previous month\" : \"Next month\"} className={cn(\"grid h-7 w-7 cursor-pointer place-items-center rounded-md border bg-transparent\", focus)} style={{ borderColor: p.border, color: p.text, ...ring }}>\n                    <svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\" aria-hidden=\"true\">\n                      <path d={n < 0 ? \"M15 18 9 12l6-6\" : \"m9 18 6-6-6-6\"} />\n                    </svg>\n                  </button>\n                ))}\n              </div>\n            </div>\n            <div className=\"mt-3 grid grid-cols-7 text-center text-[11px] font-medium\" style={{ color: p.faint }} aria-hidden=\"true\">\n              {DOW.map((d) => (\n                <span key={d} className=\"py-1\">\n                  {d}\n                </span>\n              ))}\n            </div>\n            <div className=\"overflow-hidden\">\n              <motion.div key={`${view.y}-${view.m}`} initial={reduce ? false : { opacity: 0, x: dir * 24 }} animate={{ opacity: 1, x: 0 }} transition={{ duration: 0.25, ease: [0.22, 1, 0.36, 1] }} role=\"grid\" aria-label={`${MONTHS[view.m]} ${view.y}`} className=\"grid grid-cols-7 gap-y-1\" onMouseLeave={() => setHover(null)}>\n                {cells.map((d, i) => {\n                  if (!d) return <span key={`e${i}`} />;\n                  const weekend = dow(d) >= 5;\n                  const hol = holidays[d];\n                  const mine = taken[d];\n                  const team = teamOff[d];\n                  const inRange = !!(lo && hi && d >= lo && d <= hi);\n                  const edge = d === lo || d === hi;\n                  const disabled = weekend || !!hol || !!mine;\n                  const label = `${short(d)}${hol ? `, ${hol}` : \"\"}${mine ? `, ${KINDS[mine.kind].label} ${mine.status}` : \"\"}${team ? `, off: ${team.join(\", \")}` : \"\"}`;\n                  return (\n                    <span key={d} role=\"gridcell\" className=\"relative flex h-10 items-center justify-center\">\n                      {inRange && !edge && <span className=\"absolute inset-x-0 inset-y-1\" style={{ background: `${kc}22` }} />}\n                      {inRange && edge && !single && <span className={cn(\"absolute inset-y-1 w-1/2\", d === lo ? \"right-0\" : \"left-0\")} style={{ background: `${kc}22` }} />}\n                      <button\n                        type=\"button\"\n                        disabled={disabled}\n                        onClick={() => pick(d)}\n                        onMouseEnter={() => start && !end && setHover(d)}\n                        onFocus={() => start && !end && setHover(d)}\n                        aria-label={label}\n                        aria-pressed={edge && inRange}\n                        className={cn(\"relative grid h-9 w-9 place-items-center rounded-full border-0 text-[13px] tabular-nums transition-colors disabled:cursor-not-allowed\", !disabled && \"cursor-pointer\", focus)}\n                        style={{\n                          background: edge && inRange ? kc : mine ? `${KINDS[mine.kind].color}${mine.status === \"pending\" ? \"22\" : \"33\"}` : \"transparent\",\n                          color: edge && inRange ? \"#0A0A0A\" : weekend || hol ? p.faint : mine ? KINDS[mine.kind].color : p.text,\n                          fontWeight: edge && inRange ? 600 : 400,\n                          textDecoration: hol ? \"line-through\" : undefined,\n                          outline: mine?.status === \"pending\" ? `1px dashed ${KINDS[mine.kind].color}` : undefined,\n                          ...ring,\n                        }}\n                      >\n                        {parse(d).d}\n                        {team && !(edge && inRange) && (\n                          <span className=\"absolute bottom-0.5 flex gap-px\" aria-hidden=\"true\">\n                            {team.map((n) => (\n                              <span key={n} className=\"h-1 w-1 rounded-full\" style={{ background: p.amber }} />\n                            ))}\n                          </span>\n                        )}\n                      </button>\n                    </span>\n                  );\n                })}\n              </motion.div>\n            </div>\n            <div className=\"mt-3 flex flex-wrap gap-x-4 gap-y-1 text-[11.5px]\" style={{ color: p.faint }}>\n              <span className=\"flex items-center gap-1.5\">\n                <span className=\"h-1.5 w-1.5 rounded-full\" style={{ background: p.amber }} /> Teammate off\n              </span>\n              <span>\n                <span className=\"line-through\">25</span> Holiday\n              </span>\n              <span className=\"flex items-center gap-1.5\">\n                <span className=\"h-2.5 w-2.5 rounded-full\" style={{ outline: `1px dashed ${p.muted}` }} /> Pending\n              </span>\n            </div>\n\n            <AnimatePresence initial={false}>\n              {start && (\n                <motion.div key=\"form\" initial={reduce ? false : { height: 0, opacity: 0 }} animate={{ height: \"auto\", opacity: 1 }} exit={reduce ? undefined : { height: 0, opacity: 0 }} className=\"overflow-hidden\">\n                  <div className=\"mt-4 flex flex-col gap-3 border-t pt-4\" style={{ borderColor: p.border }}>\n                    <div className=\"flex flex-wrap items-center justify-between gap-2\">\n                      <p className=\"m-0 text-[14px] font-semibold\" aria-live=\"polite\">\n                        {KINDS[kind].label} · {lo && hi ? range(lo, hi) : short(start)}\n                        <span className=\"ml-2 font-normal tabular-nums\" style={{ color: p.muted }}>\n                          {days} {days === 1 ? \"work day\" : \"work days\"}\n                        </span>\n                      </p>\n                      {!end && (\n                        <span className=\"text-[12px]\" style={{ color: p.faint }}>\n                          Pick an end date\n                        </span>\n                      )}\n                    </div>\n                    {end && (\n                      <div className=\"flex flex-wrap gap-2\">\n                        {[\n                          { on: halfStart, set: setHalfStart, label: single ? \"Half day\" : `Half day on ${short(lo!)}` },\n                          ...(single ? [] : [{ on: halfEnd, set: setHalfEnd, label: `Half day on ${short(hi!)}` }]),\n                        ].map((h) => (\n                          <button key={h.label} type=\"button\" aria-pressed={h.on} onClick={() => h.set(!h.on)} className={cn(\"h-7 cursor-pointer rounded-full border px-2.5 text-[12px]\", focus)} style={{ borderColor: h.on ? kc : p.border, background: h.on ? `${kc}1A` : \"transparent\", color: h.on ? p.text : p.muted, ...ring }}>\n                            {h.on ? \"✓ \" : \"\"}\n                            {h.label}\n                          </button>\n                        ))}\n                      </div>\n                    )}\n                    {overlaps.length > 0 && (\n                      <p className=\"m-0 rounded-lg px-3 py-2 text-[12.5px]\" style={{ background: `${p.amber}14`, color: p.amber }}>\n                        {overlaps.join(\" and \")} {overlaps.length === 1 ? \"is\" : \"are\"} also off during this time.\n                      </p>\n                    )}\n                    {(after < 0 || clash) && (\n                      <p className=\"m-0 rounded-lg px-3 py-2 text-[12.5px]\" role=\"alert\" style={{ background: `${p.red}14`, color: p.red }}>\n                        {clash ? \"These dates overlap a request you already made.\" : `That's ${-after} ${-after === 1 ? \"day\" : \"days\"} more than your ${KINDS[kind].label.toLowerCase()} balance.`}\n                      </p>\n                    )}\n                    <div>\n                      <label htmlFor={`${uid}-note`} className=\"mb-1.5 block text-[12.5px]\" style={{ color: p.muted }}>\n                        Note for {approver.split(\" \")[0]} <span style={{ color: p.faint }}>(optional)</span>\n                      </label>\n                      <input id={`${uid}-note`} value={note} onChange={(e) => setNote(e.target.value)} placeholder=\"e.g. Visiting family\" className=\"h-9 w-full rounded-lg border px-3 text-[13px] outline-none focus-visible:ring-2\" style={{ borderColor: p.border, background: p.input, color: p.text, ...ring }} />\n                    </div>\n                    <div className=\"flex flex-wrap items-center justify-between gap-2\">\n                      <span className=\"text-[12.5px] tabular-nums\" style={{ color: after < 0 ? p.red : p.muted }}>\n                        Balance after: <span style={{ color: after < 0 ? p.red : p.text }}>{after}</span> {after === 1 ? \"day\" : \"days\"}\n                      </span>\n                      <span className=\"flex gap-2\">\n                        <button\n                          type=\"button\"\n                          onClick={() => {\n                            setStart(null);\n                            setEnd(null);\n                          }}\n                          className={cn(\"h-9 cursor-pointer rounded-lg border bg-transparent px-3.5 text-[13px] font-medium\", focus)}\n                          style={{ borderColor: p.border, color: p.text, ...ring }}\n                        >\n                          Cancel\n                        </button>\n                        <button type=\"button\" onClick={submit} disabled={!ready} className={cn(\"flex h-9 min-w-[128px] cursor-pointer items-center justify-center gap-2 rounded-lg border-0 px-3.5 text-[13px] font-medium disabled:cursor-not-allowed disabled:opacity-40\", focus)} style={{ background: p.on, color: p.onText, ...ring }}>\n                          {sending ? (\n                            <>\n                              <motion.span className=\"h-3.5 w-3.5 rounded-full border-2 border-current border-t-transparent\" animate={reduce ? undefined : { rotate: 360 }} transition={{ repeat: Infinity, duration: 0.7, ease: \"linear\" }} aria-hidden=\"true\" />\n                              Sending…\n                            </>\n                          ) : (\n                            \"Send request\"\n                          )}\n                        </button>\n                      </span>\n                    </div>\n                  </div>\n                </motion.div>\n              )}\n            </AnimatePresence>\n            {!start && (\n              <p className=\"m-0 mt-4 border-t pt-4 text-[12.5px]\" style={{ color: sent ? p.green : p.faint, borderColor: p.border }} role={sent ? \"status\" : undefined}>\n                {sent ? `✓ Request sent to ${approver}. You'll get an email when it's reviewed.` : \"Pick a start date to begin a request.\"}\n              </p>\n            )}\n          </div>\n\n          {/* Requests */}\n          <div className=\"rounded-2xl border p-4\" style={{ background: p.card, borderColor: p.border }}>\n            <h3 className=\"m-0 text-[14px] font-semibold\">Your requests</h3>\n            <ul className=\"m-0 mt-3 flex list-none flex-col gap-1.5 p-0\">\n              <AnimatePresence initial={false}>\n                {[...requests]\n                  .sort((a, b) => (a.status === \"pending\" ? -1 : 0) - (b.status === \"pending\" ? -1 : 0) || b.start.localeCompare(a.start))\n                  .map((r) => (\n                    <motion.li key={r.id} initial={reduce ? false : { opacity: 0, y: -6, backgroundColor: `${KINDS[r.kind].color}26` }} animate={{ opacity: 1, y: 0, backgroundColor: \"rgba(0,0,0,0)\" }} exit={reduce ? undefined : { opacity: 0, height: 0 }} transition={{ duration: 0.5 }} className=\"flex items-center gap-3 overflow-hidden rounded-lg px-2 py-2\">\n                      <span className=\"h-8 w-1 shrink-0 rounded-full\" style={{ background: KINDS[r.kind].color }} />\n                      <span className=\"min-w-0 flex-1\">\n                        <span className=\"block text-[13px] font-medium\">{range(r.start, r.end)}</span>\n                        <span className=\"block truncate text-[11.5px]\" style={{ color: p.faint }}>\n                          {KINDS[r.kind].label} · {r.days} {r.days === 1 ? \"day\" : \"days\"}\n                          {r.note ? ` · ${r.note}` : \"\"}\n                        </span>\n                      </span>\n                      {r.status === \"pending\" ? (\n                        <span className=\"flex items-center gap-1.5\">\n                          <span className=\"rounded-full px-2 py-0.5 text-[11px] font-medium\" style={{ background: `${p.amber}1A`, color: p.amber }}>\n                            Pending\n                          </span>\n                          <button type=\"button\" onClick={() => setRequests((l) => l.filter((x) => x.id !== r.id))} aria-label={`Cancel request for ${range(r.start, r.end)}`} className={cn(\"grid h-6 w-6 cursor-pointer place-items-center rounded-md border-0 bg-transparent text-[14px]\", focus)} style={{ color: p.faint, ...ring }}>\n                            ×\n                          </button>\n                        </span>\n                      ) : (\n                        <span className=\"rounded-full px-2 py-0.5 text-[11px] font-medium capitalize\" style={{ background: `${statusColor[r.status]}1A`, color: statusColor[r.status] }}>\n                          {r.status}\n                        </span>\n                      )}\n                    </motion.li>\n                  ))}\n              </AnimatePresence>\n            </ul>\n            <div className=\"mt-3 rounded-lg p-3 text-[12px]\" style={{ background: p.well, color: p.muted }}>\n              <p className=\"m-0 font-medium\" style={{ color: p.text }}>\n                Coming up\n              </p>\n              <ul className=\"m-0 mt-1.5 flex list-none flex-col gap-1 p-0\">\n                {Object.entries(holidays)\n                  .slice(0, 3)\n                  .map(([d, n]) => (\n                    <li key={d} className=\"flex justify-between gap-2\">\n                      <span>{n}</span>\n                      <span className=\"tabular-nums\" style={{ color: p.faint }}>\n                        {short(d)}\n                      </span>\n                    </li>\n                  ))}\n              </ul>\n            </div>\n          </div>\n        </div>\n      </div>\n    </section>\n  );\n}\n\nexport default TimeOffRequestPanel;\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}