{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "error-maintenance",
  "type": "registry:block",
  "title": "Error, maintenance",
  "description": "A planned-downtime page: a status pill, headline, when we are back, and a short log of timed updates. Centred, calm, no error code. Empty updates hide the log.",
  "categories": [
    "error"
  ],
  "dependencies": [
    "zod@^4.6.5"
  ],
  "registryDependencies": [
    "https://ui.klarhimmel.com/r/block-kit.json",
    "https://ui.klarhimmel.com/r/button.json",
    "https://ui.klarhimmel.com/r/editing.json",
    "https://ui.klarhimmel.com/r/text-link.json",
    "https://ui.klarhimmel.com/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/error-maintenance/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/error-maintenance/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, t } from '../_shared/schema';\n\nconst schema = z.object({\n  status: t(40),\n  title: t(100),\n  description: t(300),\n  back: t(80),\n  updatesTitle: t(60),\n  updates: z.array(z.object({ time: t(20), text: t(140) })).max(4),\n  contact: link,\n});\n\nexport const spec = defineSpec({\n  type: 'error-maintenance',\n  aliases: ['error/maintenance'],\n  name: 'Error, maintenance',\n  category: 'error',\n  role: 'body',\n  description: 'A planned-downtime page: a status pill, headline, when we are back, and a short log of timed updates. Centred, calm, no error code. Empty updates hide the log.',\n  schema,\n  defaults: {\n    status: 'Name what is happening',\n    title: 'Say what is being worked on',\n    description: 'Say in two sentences what is paused, that what exists is safe, and that nothing needs doing on their side.',\n    back: 'Say when it will be back',\n    updatesTitle: 'Name the updates',\n    updates: [\n      { time: '00:00', text: 'Say what happened at this time' },\n      { time: '00:00', text: 'Say what happened at this time' },\n      { time: '00:00', text: 'Say what happened at this time' },\n    ],\n    contact: { label: 'Say who to contact if urgent', href: 'tel:+46000000000' },\n  },\n});\n"
    },
    {
      "path": "src/blocks/error-maintenance/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/error-maintenance/index.tsx",
      "content": "import { useId } from 'react';\nimport { Text, withHeadingLevel } from '../../editing';\nimport { safeHref } from '../../ui/button';\nimport { linkClass } from '../../ui/text-link';\nimport { Container, Opt, Section, useEditing } from '../_shared/kit';\nimport { cn } from '../../lib/utils';\nimport { spec } from './spec';\nimport type { BlockProps } from '../types';\nimport type { z } from 'zod';\n\nexport { spec };\ntype Props = z.infer<typeof spec.schema>;\n\nfunction ErrorMaintenance({ props }: BlockProps<Props>) {\n  const id = useId();\n  const editing = useEditing();\n  return (\n    <Section labelledBy={id} className=\"py-20 @3xl:py-28\">\n      <Container width=\"narrow\" className=\"text-center\">\n        {(props.status || editing) && (\n          <p className=\"inline-flex items-center gap-2 rounded-kh-pill border border-kh-line bg-kh-surface px-3 py-1 text-kh-small font-medium\">\n            <span aria-hidden className=\"size-2 rounded-kh-pill bg-kh-accent\" />\n            <Text path={['status']} value={props.status} as=\"span\" placeholder=\"Status\" />\n          </p>\n        )}\n        <div id={id}>\n          <Text path={['title']} value={props.title} as=\"h1\" className=\"mt-6 text-kh-title font-semibold\" />\n        </div>\n        <Opt path={['description']} value={props.description} multiline className=\"mx-auto mt-5 max-w-kh-lead text-kh-lead text-kh-muted\" placeholder=\"Description\" />\n        <Opt path={['back']} value={props.back} className=\"mt-6 text-kh-heading font-semibold text-kh-accent-ink\" placeholder=\"When we are back\" />\n        {(props.updates.length > 0 || editing) && (\n          <div className=\"mx-auto mt-12 max-w-kh-prose rounded-kh-xl border border-kh-line bg-kh-surface p-6 text-left\">\n            <Text path={['updatesTitle']} value={props.updatesTitle} as=\"h2\" className=\"text-kh-small font-medium text-kh-muted\" />\n            <ol className=\"mt-4 divide-y divide-kh-line\">\n              {props.updates.map((u, i) => (\n                <li key={i} className=\"grid grid-cols-[4.5rem_1fr] gap-4 py-3 text-kh-small\">\n                  <Text path={['updates', i, 'time']} value={u.time} as=\"span\" className=\"font-kh-mono tabular-nums text-kh-muted\" />\n                  <Text path={['updates', i, 'text']} value={u.text} as=\"span\" />\n                </li>\n              ))}\n            </ol>\n          </div>\n        )}\n        {(props.contact.label || editing) && (\n          <p className=\"mt-8\">\n            <a href={safeHref(props.contact.href)} className={cn(linkClass(), 'inline-flex min-h-11 items-center text-kh-small font-medium')}>\n              <Text path={['contact', 'label']} value={props.contact.label} as=\"span\" placeholder=\"Label\" />\n            </a>\n          </p>\n        )}\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(ErrorMaintenance);\n"
    }
  ]
}
