{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dialog-create-project",
  "type": "registry:component",
  "title": "Create Project Dialog",
  "description": "A form dialog with a live URL preview that checks slug availability as you type, a sliding team switch and visibility cards. It shakes on invalid input, submits with Command Enter and resizes smoothly into a success state.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "modals",
    "form",
    "dialog",
    "validation",
    "create",
    "slug",
    "modal"
  ],
  "docs": "https://hyperblur.dev/effects/dialog-create-project",
  "files": [
    {
      "path": "registry/hyperblur/dialog-create-project.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/dialog-create-project.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface CreateProjectValues {\n  name: string;\n  slug: string;\n  team: string;\n  visibility: \"private\" | \"team\" | \"public\";\n}\n\nexport interface DialogCreateProjectProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"title\" | \"onSubmit\"> {\n  open?: boolean;\n  defaultOpen?: boolean;\n  onOpenChange?: (open: boolean) => void;\n  embedded?: boolean;\n  trigger?: React.ReactNode;\n  title?: string;\n  domain?: string;\n  teams?: string[];\n  takenSlugs?: string[];\n  defaultName?: string;\n  onSubmit?: (values: CreateProjectValues) => void | Promise<void>;\n  accent?: string;\n}\n\nconst visibilities: { id: CreateProjectValues[\"visibility\"]; label: string; hint: string; icon: string }[] = [\n  { id: \"private\", label: \"Private\", hint: \"Only you\", icon: \"M5 8.5V6.5a3 3 0 0 1 6 0v2M4 8.5h8v5H4z\" },\n  { id: \"team\", label: \"Team\", hint: \"Your team\", icon: \"M6 7.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM2.5 13a3.5 3.5 0 0 1 7 0M11 7.5a1.6 1.6 0 1 0 0-3.2M11.5 13H13.5a3 3 0 0 0-2.5-3\" },\n  { id: \"public\", label: \"Public\", hint: \"Anyone\", icon: \"M8 2.5a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11ZM2.5 8h11M8 2.5c1.6 1.6 2.3 3.4 2.3 5.5S9.6 11.9 8 13.5C6.4 11.9 5.7 10.1 5.7 8S6.4 4.1 8 2.5Z\" },\n];\n\nconst css = `\n.hb-xe7 { --hb-xe7-accent: #7c5cff; display: inline-block; box-sizing: border-box; color: #ededed; font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif); }\n.hb-xe7 *, .hb-xe7 *::before, .hb-xe7 *::after { box-sizing: border-box; }\n.hb-xe7[data-embedded] { position: relative; display: grid; place-items: center; width: 100%; height: 100%; min-height: 190px; border-radius: 16px; overflow: hidden; isolation: isolate; background: #0b0b0d; }\n.hb-xe7-trigger { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px 0 11px; border: 0; border-radius: 9px; background: var(--hb-xe7-accent); color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 18px -10px var(--hb-xe7-accent); transition: filter 0.2s ease, transform 0.15s ease; }\n.hb-xe7-trigger:hover { filter: brightness(1.08); }\n.hb-xe7-trigger:active { transform: scale(0.97); }\n.hb-xe7-trigger svg { width: 14px; height: 14px; }\n.hb-xe7 button:focus-visible { outline: 2px solid var(--hb-xe7-accent); outline-offset: 2px; }\n.hb-xe7-layer { position: fixed; inset: 0; z-index: 1000; height: 100dvh; display: grid; place-items: center; padding: 16px; }\n.hb-xe7[data-embedded] .hb-xe7-layer { position: absolute; height: auto; z-index: 2; padding: 10px; }\n.hb-xe7-scrim { position: absolute; inset: 0; background: rgba(5, 4, 10, 0.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: hb-xe7-fade 0.25s ease both; }\n.hb-xe7-layer[data-state=\"closed\"] .hb-xe7-scrim { animation: hb-xe7-fade-out 0.2s ease both; }\n.hb-xe7-panel { position: relative; width: 100%; max-width: 460px; max-height: 100%; overflow: auto; border: 1px solid #27262d; border-radius: 16px; background: linear-gradient(180deg, #16151a, #111014); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 30px 80px -24px rgba(0, 0, 0, 0.9); outline: none; animation: hb-xe7-in 0.34s cubic-bezier(0.2, 0.9, 0.25, 1) both; transition: height 0.38s cubic-bezier(0.2, 0.9, 0.25, 1); }\n.hb-xe7-layer[data-state=\"closed\"] .hb-xe7-panel { animation: hb-xe7-out 0.2s ease both; }\n.hb-xe7-form { display: grid; gap: 14px; padding: 16px 18px 0; }\n.hb-xe7-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }\n.hb-xe7-title { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }\n.hb-xe7-crumb { display: inline-flex; align-items: center; gap: 6px; color: #8a8993; font-size: 12px; }\n.hb-xe7-crumb i { width: 14px; height: 14px; border-radius: 4px; background: linear-gradient(135deg, var(--hb-xe7-accent), #f472b6); font-style: normal; }\n.hb-xe7-label { display: block; margin-bottom: 6px; color: #a09fa8; font-size: 12px; font-weight: 500; }\n.hb-xe7-input { display: block; width: 100%; height: 38px; padding: 0 12px; border: 1px solid #2c2b33; border-radius: 10px; background: #0d0c10; color: #ededed; font: inherit; font-size: 14px; outline: none; transition: border-color 0.18s ease, box-shadow 0.18s ease; }\n.hb-xe7-input::placeholder { color: #55545c; }\n.hb-xe7-input:focus { border-color: var(--hb-xe7-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hb-xe7-accent) 22%, transparent); }\n.hb-xe7-input[aria-invalid=\"true\"] { border-color: #f43f5e; box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.18); }\n.hb-xe7-input[data-shake=\"a\"] { animation: hb-xe7-shake-a 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97); }\n.hb-xe7-input[data-shake=\"b\"] { animation: hb-xe7-shake-b 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97); }\n.hb-xe7-url { display: flex; align-items: center; gap: 6px; min-height: 20px; margin-top: 7px; font-family: var(--font-mono, ui-monospace, monospace); font-size: 11.5px; color: #6e6d76; }\n.hb-xe7-url b { color: #d6d5dd; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.hb-xe7-stat { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-family: var(--font-sans, inherit); font-size: 11.5px; white-space: nowrap; }\n.hb-xe7-stat[data-s=\"ok\"] { color: #4fd18b; }\n.hb-xe7-stat[data-s=\"taken\"] { color: #ff7a8a; }\n.hb-xe7-stat svg { width: 12px; height: 12px; }\n.hb-xe7-spin { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid #3a3942; border-top-color: #a09fa8; animation: hb-xe7-spin 0.7s linear infinite; }\n.hb-xe7-err { margin: 6px 0 0; color: #ff7a8a; font-size: 11.5px; }\n.hb-xe7-seg { position: relative; display: grid; grid-template-columns: repeat(var(--hb-xe7-n), 1fr); padding: 3px; border-radius: 10px; background: #0d0c10; box-shadow: inset 0 0 0 1px #24232a; }\n.hb-xe7-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--hb-xe7-n)); border-radius: 7px; background: linear-gradient(180deg, #2a2932, #222128); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 2px 6px rgba(0, 0, 0, 0.4); transform: translateX(calc(var(--hb-xe7-i) * 100%)); transition: transform 0.36s cubic-bezier(0.3, 0.9, 0.3, 1.05); }\n.hb-xe7-segbtn { position: relative; z-index: 1; height: 30px; border: 0; border-radius: 7px; background: transparent; color: #8a8993; font: inherit; font-size: 12.5px; font-weight: 550; cursor: pointer; transition: color 0.2s ease; }\n.hb-xe7-segbtn[aria-checked=\"true\"] { color: #f4f4f5; }\n.hb-xe7-vis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }\n.hb-xe7-card { display: grid; justify-items: start; gap: 2px; padding: 9px 10px; border: 1px solid #26252c; border-radius: 10px; background: #0f0e12; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease; }\n.hb-xe7-card:hover { border-color: #34333c; }\n.hb-xe7-card:active { transform: scale(0.98); }\n.hb-xe7-card[aria-checked=\"true\"] { border-color: var(--hb-xe7-accent); background: color-mix(in srgb, var(--hb-xe7-accent) 9%, #0f0e12); }\n.hb-xe7-card svg { width: 15px; height: 15px; color: #8a8993; margin-bottom: 3px; }\n.hb-xe7-card[aria-checked=\"true\"] svg { color: var(--hb-xe7-accent); }\n.hb-xe7-card b { font-size: 12.5px; font-weight: 600; }\n.hb-xe7-card span { color: #7a7983; font-size: 11px; }\n.hb-xe7-foot { display: flex; align-items: center; gap: 8px; padding: 16px 18px; }\n.hb-xe7-kbd { margin-right: auto; display: inline-flex; align-items: center; gap: 4px; color: #6e6d76; font-size: 11.5px; }\n.hb-xe7-kbd kbd { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 5px; background: #1c1b21; box-shadow: inset 0 -1px 0 #2e2d35, inset 0 0 0 1px #2a2930; color: #a09fa8; font-family: inherit; font-size: 10.5px; }\n.hb-xe7-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border: 1px solid #2c2b33; border-radius: 9px; background: transparent; color: #cfced6; font: inherit; font-size: 13px; font-weight: 550; white-space: nowrap; cursor: pointer; transition: background-color 0.15s ease, transform 0.15s cubic-bezier(0.3, 0.7, 0.4, 1); }\n.hb-xe7-btn:hover { background: #1c1b21; }\n.hb-xe7-btn:active { transform: scale(0.97); }\n.hb-xe7-btn[data-primary] { min-width: 122px; border-color: transparent; background: var(--hb-xe7-accent); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22); }\n.hb-xe7-btn[data-primary]:hover { background: color-mix(in srgb, var(--hb-xe7-accent) 88%, #fff); }\n.hb-xe7-btn .hb-xe7-spin { border-color: rgba(255, 255, 255, 0.3); border-top-color: #fff; }\n.hb-xe7-success { display: grid; justify-items: center; gap: 6px; padding: 26px 18px 18px; text-align: center; animation: hb-xe7-rise 0.45s cubic-bezier(0.2, 0.9, 0.25, 1) both; }\n.hb-xe7-badge { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 6px; border-radius: 14px; background: linear-gradient(135deg, var(--hb-xe7-accent), #f472b6); color: #fff; font-family: var(--font-grotesk, inherit); font-size: 20px; font-weight: 700; box-shadow: 0 12px 30px -10px var(--hb-xe7-accent), inset 0 1px 0 rgba(255, 255, 255, 0.3); }\n.hb-xe7-success p { margin: 0; color: #9a99a3; font-size: 12.5px; }\n.hb-xe7-success code { font-family: var(--font-mono, ui-monospace, monospace); color: #d6d5dd; font-size: 12px; }\n.hb-xe7-success .hb-xe7-row { display: flex; gap: 8px; margin-top: 12px; }\n.hb-xe7[data-embedded] .hb-xe7-form { gap: 10px; padding-top: 14px; }\n.hb-xe7[data-embedded] .hb-xe7-card span { display: none; }\n.hb-xe7[data-embedded] .hb-xe7-foot { padding: 12px 18px 14px; }\n@keyframes hb-xe7-fade { from { opacity: 0; } to { opacity: 1; } }\n@keyframes hb-xe7-fade-out { from { opacity: 1; } to { opacity: 0; } }\n@keyframes hb-xe7-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }\n@keyframes hb-xe7-out { from { opacity: 1; } to { opacity: 0; transform: scale(0.97); } }\n@keyframes hb-xe7-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }\n@keyframes hb-xe7-spin { to { transform: rotate(360deg); } }\n@keyframes hb-xe7-shake-a { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); } 30%, 50%, 70% { transform: translateX(-4px); } 40%, 60% { transform: translateX(4px); } }\n@keyframes hb-xe7-shake-b { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); } 30%, 50%, 70% { transform: translateX(-4px); } 40%, 60% { transform: translateX(4px); } }\n@media (prefers-reduced-motion: reduce) {\n  .hb-xe7-scrim, .hb-xe7-panel, .hb-xe7-success, .hb-xe7-input[data-shake], .hb-xe7-layer[data-state=\"closed\"] .hb-xe7-panel, .hb-xe7-layer[data-state=\"closed\"] .hb-xe7-scrim { animation: none; }\n  .hb-xe7-layer[data-state=\"closed\"] { opacity: 0; }\n  .hb-xe7-panel, .hb-xe7-thumb, .hb-xe7-segbtn, .hb-xe7-card, .hb-xe7-btn, .hb-xe7-input, .hb-xe7-trigger { transition: none; }\n}\n`;\n\nconst focusable =\n  'a[href],button:not(:disabled),input:not(:disabled),select:not(:disabled),textarea:not(:disabled),[tabindex]:not([tabindex=\"-1\"])';\n\nfunction useLayer(\n  open: boolean,\n  embedded: boolean,\n  panel: React.RefObject<HTMLElement | null>,\n  onClose: () => void,\n  userOpened: React.RefObject<boolean>,\n) {\n  const closeRef = React.useRef(onClose);\n  React.useEffect(() => {\n    closeRef.current = onClose;\n  });\n  React.useEffect(() => {\n    if (!open) return;\n    const node = panel.current;\n    const steal = !embedded || userOpened.current;\n    const previous = document.activeElement as HTMLElement | null;\n    const html = document.documentElement;\n    const overflow = html.style.overflow;\n    if (!embedded) html.style.overflow = \"hidden\";\n    if (steal && node) {\n      const target = node.querySelector<HTMLElement>(\"[data-autofocus]\") ?? node.querySelector<HTMLElement>(focusable) ?? node;\n      target.focus({ preventScroll: true });\n    }\n    const onKey = (e: KeyboardEvent) => {\n      if (!node) return;\n      if (embedded && !node.contains(document.activeElement)) return;\n      if (e.key === \"Escape\") {\n        e.preventDefault();\n        closeRef.current();\n        return;\n      }\n      if (e.key !== \"Tab\") return;\n      const items = Array.from(node.querySelectorAll<HTMLElement>(focusable)).filter((el) => el.getClientRects().length > 0);\n      if (!items.length) {\n        e.preventDefault();\n        node.focus();\n        return;\n      }\n      const first = items[0];\n      const last = items[items.length - 1];\n      const active = document.activeElement;\n      if (!node.contains(active)) {\n        e.preventDefault();\n        first.focus();\n      } else if (e.shiftKey && (active === first || active === node)) {\n        e.preventDefault();\n        last.focus();\n      } else if (!e.shiftKey && active === last) {\n        e.preventDefault();\n        first.focus();\n      }\n    };\n    document.addEventListener(\"keydown\", onKey);\n    return () => {\n      document.removeEventListener(\"keydown\", onKey);\n      if (!embedded) html.style.overflow = overflow;\n      if (steal && previous && previous.isConnected && previous !== document.body) previous.focus({ preventScroll: true });\n    };\n  }, [open, embedded, panel, userOpened]);\n}\n\nfunction slugify(v: string) {\n  return v\n    .toLowerCase()\n    .normalize(\"NFKD\")\n    .replace(/[̀-ͯ]/g, \"\")\n    .replace(/[^a-z0-9]+/g, \"-\")\n    .replace(/^-+|-+$/g, \"\")\n    .slice(0, 40);\n}\n\nexport function DialogCreateProject({\n  open,\n  defaultOpen,\n  onOpenChange,\n  embedded = false,\n  trigger = \"New project\",\n  title = \"Create project\",\n  domain = \"acme.dev\",\n  teams = [\"Design\", \"Engineering\", \"Growth\"],\n  takenSlugs = [\"website\", \"api\", \"mobile-app\"],\n  defaultName = \"Checkout redesign\",\n  onSubmit,\n  accent = \"#7c5cff\",\n  className = \"\",\n  style,\n  ...rest\n}: DialogCreateProjectProps) {\n  const [inner, setInner] = React.useState(defaultOpen ?? embedded);\n  const isOpen = open ?? inner;\n  const [present, setPresent] = React.useState(isOpen);\n  const [name, setName] = React.useState(defaultName);\n  const [team, setTeam] = React.useState(teams[1] ?? teams[0] ?? \"\");\n  const [visibility, setVisibility] = React.useState<CreateProjectValues[\"visibility\"]>(\"team\");\n  const [checked, setChecked] = React.useState(slugify(defaultName));\n  const [error, setError] = React.useState(\"\");\n  const [shake, setShake] = React.useState<\"a\" | \"b\" | undefined>(undefined);\n  const [phase, setPhase] = React.useState<\"form\" | \"busy\" | \"done\">(\"form\");\n  const [height, setHeight] = React.useState<number | undefined>(undefined);\n  const userOpened = React.useRef(false);\n  const panel = React.useRef<HTMLDivElement>(null);\n  const content = React.useRef<HTMLDivElement>(null);\n  const input = React.useRef<HTMLInputElement>(null);\n  const id = React.useId();\n  const slug = slugify(name);\n\n  if (isOpen && !present) setPresent(true);\n\n  const setOpen = React.useCallback(\n    (next: boolean) => {\n      if (next) {\n        userOpened.current = true;\n        setPhase(\"form\");\n        setError(\"\");\n      }\n      if (open === undefined) setInner(next);\n      onOpenChange?.(next);\n    },\n    [open, onOpenChange],\n  );\n  const close = React.useCallback(() => {\n    if (phase !== \"busy\") setOpen(false);\n  }, [phase, setOpen]);\n\n  React.useEffect(() => {\n    if (isOpen || !present) return;\n    const t = setTimeout(() => setPresent(false), 220);\n    return () => clearTimeout(t);\n  }, [isOpen, present]);\n\n  React.useEffect(() => {\n    const t = setTimeout(() => setChecked(slug), 480);\n    return () => clearTimeout(t);\n  }, [slug]);\n\n  React.useEffect(() => {\n    const node = content.current;\n    if (!node || typeof ResizeObserver === \"undefined\") return;\n    const ro = new ResizeObserver(() => setHeight(node.offsetHeight + 2));\n    ro.observe(node);\n    return () => ro.disconnect();\n  }, [present]);\n\n  useLayer(isOpen, embedded, panel, close, userOpened);\n\n  React.useEffect(() => {\n    if (phase === \"done\") panel.current?.querySelector<HTMLElement>(\"[data-autofocus]\")?.focus({ preventScroll: true });\n  }, [phase]);\n\n  const status: \"none\" | \"checking\" | \"ok\" | \"taken\" = !slug ? \"none\" : slug !== checked ? \"checking\" : takenSlugs.includes(slug) ? \"taken\" : \"ok\";\n\n  function fail(message: string) {\n    setError(message);\n    setShake((s) => (s === \"a\" ? \"b\" : \"a\"));\n    input.current?.focus();\n  }\n\n  function submit(e?: React.FormEvent) {\n    e?.preventDefault();\n    if (phase !== \"form\") return;\n    if (name.trim().length < 2) return fail(\"Give the project a name with at least 2 characters.\");\n    if (status === \"taken\") return fail(`${domain}/${slug} is already in use. Try another name.`);\n    setError(\"\");\n    setPhase(\"busy\");\n    const values: CreateProjectValues = { name: name.trim(), slug, team, visibility };\n    const started = performance.now();\n    Promise.resolve()\n      .then(() => onSubmit?.(values))\n      .then(\n        () => {\n          const wait = Math.max(0, 650 - (performance.now() - started));\n          window.setTimeout(() => setPhase(\"done\"), wait);\n        },\n        () => {\n          setPhase(\"form\");\n          fail(\"Could not create the project. Try again.\");\n        },\n      );\n  }\n\n  function onSegKey(e: React.KeyboardEvent<HTMLDivElement>) {\n    if (e.key !== \"ArrowRight\" && e.key !== \"ArrowLeft\") return;\n    e.preventDefault();\n    const i = teams.indexOf(team);\n    const next = teams[(i + (e.key === \"ArrowRight\" ? 1 : -1) + teams.length) % teams.length];\n    setTeam(next);\n    e.currentTarget.querySelector<HTMLElement>(`[data-v=\"${next}\"]`)?.focus();\n  }\n\n  function onVisKey(e: React.KeyboardEvent<HTMLDivElement>) {\n    if (e.key !== \"ArrowRight\" && e.key !== \"ArrowLeft\") return;\n    e.preventDefault();\n    const i = visibilities.findIndex((v) => v.id === visibility);\n    const next = visibilities[(i + (e.key === \"ArrowRight\" ? 1 : -1) + 3) % 3].id;\n    setVisibility(next);\n    e.currentTarget.querySelector<HTMLElement>(`[data-v=\"${next}\"]`)?.focus();\n  }\n\n  const vars = { \"--hb-xe7-accent\": accent, ...style } as React.CSSProperties;\n\n  return (\n    <div className={`hb-xe7 ${className}`} data-embedded={embedded || undefined} style={vars} {...rest}>\n      <style href=\"hb-xe7-css\" precedence=\"default\">{css}</style>\n      {trigger !== null && (\n        <button type=\"button\" className=\"hb-xe7-trigger\" aria-haspopup=\"dialog\" aria-expanded={isOpen} onClick={() => setOpen(true)}>\n          <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden=\"true\"><path d=\"M8 3.5v9M3.5 8h9\" /></svg>\n          {trigger}\n        </button>\n      )}\n      {present && (\n        <div className=\"hb-xe7-layer\" data-state={isOpen ? \"open\" : \"closed\"}>\n          <div className=\"hb-xe7-scrim\" onClick={close} aria-hidden=\"true\" />\n          <div\n            ref={panel}\n            role=\"dialog\"\n            aria-modal=\"true\"\n            aria-labelledby={`${id}-t`}\n            tabIndex={-1}\n            className=\"hb-xe7-panel\"\n            style={height ? { height } : undefined}\n          >\n            <div ref={content}>\n              {phase === \"done\" ? (\n                <div className=\"hb-xe7-success\" role=\"status\">\n                  <span className=\"hb-xe7-badge\" aria-hidden=\"true\">{name.trim().charAt(0).toUpperCase()}</span>\n                  <h2 id={`${id}-t`} className=\"hb-xe7-title\">{name.trim()} is ready</h2>\n                  <p>\n                    Live at <code>{domain}/{slug}</code> for {visibility === \"public\" ? \"everyone\" : visibility === \"team\" ? team : \"you\"}.\n                  </p>\n                  <div className=\"hb-xe7-row\">\n                    <button type=\"button\" className=\"hb-xe7-btn\" onClick={() => setOpen(false)}>Close</button>\n                    <button type=\"button\" className=\"hb-xe7-btn\" data-primary=\"\" data-autofocus=\"\" onClick={() => setOpen(false)}>Open project</button>\n                  </div>\n                </div>\n              ) : (\n                <form\n                  onSubmit={submit}\n                  onKeyDown={(e) => {\n                    if (e.key === \"Enter\" && (e.metaKey || e.ctrlKey)) submit();\n                  }}\n                  noValidate\n                >\n                  <div className=\"hb-xe7-form\">\n                    <div className=\"hb-xe7-head\">\n                      <h2 id={`${id}-t`} className=\"hb-xe7-title\">{title}</h2>\n                      <span className=\"hb-xe7-crumb\"><i aria-hidden=\"true\" />{domain}</span>\n                    </div>\n                    <div>\n                      <label className=\"hb-xe7-label\" htmlFor={`${id}-n`}>Project name</label>\n                      <input\n                        ref={input}\n                        id={`${id}-n`}\n                        className=\"hb-xe7-input\"\n                        value={name}\n                        placeholder=\"Mobile onboarding\"\n                        autoComplete=\"off\"\n                        data-autofocus=\"\"\n                        data-shake={shake}\n                        aria-invalid={error ? true : undefined}\n                        aria-describedby={`${id}-u`}\n                        onChange={(e) => {\n                          setName(e.target.value);\n                          if (error) setError(\"\");\n                        }}\n                      />\n                      <div id={`${id}-u`} className=\"hb-xe7-url\">\n                        <span>{domain}/</span>\n                        <b>{slug || \"your-project\"}</b>\n                        {status === \"checking\" && <span className=\"hb-xe7-stat\"><span className=\"hb-xe7-spin\" aria-hidden=\"true\" />Checking</span>}\n                        {status === \"ok\" && (\n                          <span className=\"hb-xe7-stat\" data-s=\"ok\">\n                            <svg viewBox=\"0 0 12 12\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\"><path d=\"m2.5 6.2 2.2 2.2L9.5 3.6\" /></svg>\n                            Available\n                          </span>\n                        )}\n                        {status === \"taken\" && (\n                          <span className=\"hb-xe7-stat\" data-s=\"taken\">\n                            <svg viewBox=\"0 0 12 12\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden=\"true\"><path d=\"m3.5 3.5 5 5m0-5-5 5\" /></svg>\n                            Taken\n                          </span>\n                        )}\n                      </div>\n                      {error && <p className=\"hb-xe7-err\" role=\"alert\">{error}</p>}\n                    </div>\n                    <div>\n                      <span className=\"hb-xe7-label\" id={`${id}-tm`}>Team</span>\n                      <div\n                        className=\"hb-xe7-seg\"\n                        role=\"radiogroup\"\n                        aria-labelledby={`${id}-tm`}\n                        onKeyDown={onSegKey}\n                        style={{ \"--hb-xe7-n\": teams.length, \"--hb-xe7-i\": Math.max(0, teams.indexOf(team)) } as React.CSSProperties}\n                      >\n                        <span className=\"hb-xe7-thumb\" aria-hidden=\"true\" />\n                        {teams.map((t) => (\n                          <button\n                            key={t}\n                            type=\"button\"\n                            role=\"radio\"\n                            aria-checked={t === team}\n                            tabIndex={t === team ? 0 : -1}\n                            data-v={t}\n                            className=\"hb-xe7-segbtn\"\n                            onClick={() => setTeam(t)}\n                          >\n                            {t}\n                          </button>\n                        ))}\n                      </div>\n                    </div>\n                    <div>\n                      <span className=\"hb-xe7-label\" id={`${id}-v`}>Visibility</span>\n                      <div className=\"hb-xe7-vis\" role=\"radiogroup\" aria-labelledby={`${id}-v`} onKeyDown={onVisKey}>\n                        {visibilities.map((v) => (\n                          <button\n                            key={v.id}\n                            type=\"button\"\n                            role=\"radio\"\n                            aria-checked={v.id === visibility}\n                            tabIndex={v.id === visibility ? 0 : -1}\n                            data-v={v.id}\n                            className=\"hb-xe7-card\"\n                            onClick={() => setVisibility(v.id)}\n                          >\n                            <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\"><path d={v.icon} /></svg>\n                            <b>{v.label}</b>\n                            <span>{v.hint}</span>\n                          </button>\n                        ))}\n                      </div>\n                    </div>\n                  </div>\n                  <div className=\"hb-xe7-foot\">\n                    <span className=\"hb-xe7-kbd\" aria-hidden=\"true\"><kbd>⌘</kbd><kbd>↵</kbd> to create</span>\n                    <button type=\"button\" className=\"hb-xe7-btn\" onClick={close}>Cancel</button>\n                    <button type=\"submit\" className=\"hb-xe7-btn\" data-primary=\"\" aria-busy={phase === \"busy\" || undefined}>\n                      {phase === \"busy\" ? <><span className=\"hb-xe7-spin\" aria-hidden=\"true\" />Creating</> : \"Create project\"}\n                    </button>\n                  </div>\n                </form>\n              )}\n            </div>\n          </div>\n        </div>\n      )}\n    </div>\n  );\n}\n"
    }
  ]
}