{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "careers-roles",
  "type": "registry:block",
  "title": "Careers, open roles",
  "description": "Open roles grouped by team: a heading per team, and under it one row per role with its title, location, type and a Remote word where it applies, and a link that names its role. Each team is a labelled section.",
  "categories": [
    "careers"
  ],
  "dependencies": [
    "zod@^4.6.5"
  ],
  "registryDependencies": [
    "https://ui.klarhimmel.com/r/badge.json",
    "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/kit-c-proof.json",
    "https://ui.klarhimmel.com/r/text-link.json",
    "https://ui.klarhimmel.com/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/careers-roles/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/careers-roles/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, t } from '../_shared/schema';\n\nconst role = z.object({\n  title: t(80),\n  location: t(40),\n  /** \"Full-time\", \"Part-time\", \"Contract\". */\n  type: t(20),\n  /** True shows the remote word beside the location. */\n  remote: z.boolean(),\n  href: t(300),\n});\n\nconst schema = z.object({\n  eyebrow: t(60),\n  title: t(120),\n  description: t(300),\n  /** The line under the heading: \"7 open roles\". The count is yours to keep right. */\n  summary: t(40),\n  /** The word shown for a remote role. */\n  remoteLabel: t(20),\n  /** The link's text on every role; the role's title follows it for screen readers. */\n  viewLabel: t(30),\n  groups: z.array(z.object({ team: t(30), roles: z.array(role).min(1).max(6) })).min(1).max(4),\n});\n\nexport const spec = defineSpec({\n  type: 'careers-roles',\n  aliases: ['careers/roles'],\n  name: 'Careers, open roles',\n  category: 'careers',\n  role: 'body',\n  description: 'Open roles grouped by team: a heading per team, and under it one row per role with its title, location, type and a Remote word where it applies, and a link that names its role. Each team is a labelled section.',\n  schema,\n  defaults: {\n    eyebrow: 'Name a topic',\n    title: 'Invite people to join the team',\n    description: 'Say in one or two sentences what the team cares about and that roles are open now.',\n    summary: '0 open roles',\n    remoteLabel: 'Remote',\n    viewLabel: 'Role details',\n    groups: [\n      {\n        team: 'First team',\n        roles: [\n          { title: 'Name the first role', location: 'Name a place', type: 'Type of role', remote: true, href: '#senior-fullstack' },\n          { title: 'Name the second role', location: 'Name a place', type: 'Type of role', remote: false, href: '#integrations' },\n        ],\n      },\n      {\n        team: 'Second team',\n        roles: [\n          { title: 'Name the third role', location: 'Name a place', type: 'Type of role', remote: false, href: '#onboarding' },\n          { title: 'Name the fourth role', location: 'Name a place', type: 'Type of role', remote: true, href: '#support' },\n        ],\n      },\n      {\n        team: 'Third team',\n        roles: [{ title: 'Name the fifth role', location: 'Name a place', type: 'Type of role', remote: true, href: '#designer' }],\n      },\n    ],\n  },\n});\n"
    },
    {
      "path": "src/blocks/careers-roles/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/careers-roles/index.tsx",
      "content": "import { useId } from 'react';\nimport { Text, withHeadingLevel } from '../../editing';\nimport { cn } from '../../lib/utils';\nimport { Badge } from '../../ui/badge';\nimport { safeHref } from '../../ui/button';\nimport { linkClass } from '../../ui/text-link';\nimport { Container, Section, useEditing } from '../_shared/kit';\nimport { Heading, useHeadingId } from '../_shared/c-proof-kit';\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 CareersRoles({ props }: BlockProps<Props>) {\n  const id = useHeadingId(props.title);\n  const uid = useId();\n  const editing = useEditing();\n  return (\n    <Section labelledBy={id}>\n      <Container>\n        <Heading id={id} eyebrow={props.eyebrow} title={props.title} description={props.description} />\n        <p className=\"mt-6 text-kh-small font-medium text-kh-muted\">\n          <Text path={['summary']} value={props.summary} as=\"span\" />\n        </p>\n        <div className=\"mt-8 flex flex-col gap-12\">\n          {props.groups.map((g, gi) => (\n            <section key={gi} aria-labelledby={g.team || editing ? `${uid}-${gi}` : undefined}>\n              {(g.team || editing) && (\n                <h3 id={`${uid}-${gi}`} className=\"border-b border-kh-line pb-3 text-kh-heading font-semibold\">\n                  <Text path={['groups', gi, 'team']} value={g.team} as=\"span\" />\n                </h3>\n              )}\n              <ul className=\"divide-y divide-kh-line\">\n                {g.roles.map((r, ri) => (\n                  <li key={ri} className=\"grid items-center gap-x-6 gap-y-1 py-2 @2xl:grid-cols-[1fr_auto]\">\n                    <div className=\"min-w-0\">\n                      <Text path={['groups', gi, 'roles', ri, 'title']} value={r.title} as=\"p\" className=\"text-kh-body font-medium\" />\n                      <p className=\"flex flex-wrap items-center gap-x-3 gap-y-1 text-kh-small text-kh-muted\">\n                        <Text path={['groups', gi, 'roles', ri, 'location']} value={r.location} as=\"span\" />\n                        <Text path={['groups', gi, 'roles', ri, 'type']} value={r.type} as=\"span\" />\n                        {(r.remote || editing) && (\n                          <Badge tone={r.remote ? 'accent' : 'outline'}>\n                            <Text path={['remoteLabel']} value={props.remoteLabel} as=\"span\" />\n                          </Badge>\n                        )}\n                      </p>\n                    </div>\n                    {(props.viewLabel || editing) && (\n                      <a href={safeHref(r.href)} className={cn(linkClass(), 'inline-flex min-h-11 items-center text-kh-small font-medium')}>\n                        <Text path={['viewLabel']} value={props.viewLabel} as=\"span\" placeholder=\"Label\" />\n                        {' '}\n                        <span className=\"sr-only\">{r.title}</span>\n                      </a>\n                    )}\n                  </li>\n                ))}\n              </ul>\n            </section>\n          ))}\n        </div>\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(CareersRoles);\n"
    }
  ]
}
