{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "Account settings: picture, name, email, bio and notifications.",
  "devDependencies": [],
  "digest": "0.1.0",
  "files": [
    {
      "content": "// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.\n/**\n * An account settings form: a picture with a change button, name, email, bio and two notification switches, with\n * save and cancel. Axes: layout (stacked, split), avatar (show, hide), prefs (show, hide), tone (default,\n * muted).\n */\nimport { type ReactNode } from \"react\";\nimport { Block, Button, Container, Form, Grid, Group, Input, Label, Stack, Switch, Textarea, Title } from \"../compose\";\nimport { Field } from \"../components/field\";\nimport { MediaFrame } from \"../components/media-frame\";\nimport { Panel } from \"../components/panel\";\nimport { cn, tpl } from \"../utils\";\nimport type { ProfileLabels } from \"./profile-form.types\";\n\nexport type ProfileFormProps = {\n  id: string;\n  title: string;\n  text: string;\n  labels: ProfileLabels;\n  layout?: \"stacked\" | \"split\";\n  avatar?: \"show\" | \"hide\";\n  prefs?: \"show\" | \"hide\";\n  tone?: \"default\" | \"muted\";\n  landmarkLabel?: string;\n};\n\nexport function ProfileForm({\n  id,\n  title,\n  text,\n  labels,\n  layout = \"stacked\",\n  avatar = \"show\",\n  prefs = \"show\",\n  tone = \"default\",\n  landmarkLabel,\n}: ProfileFormProps) {\n  return (\n    <Block\n      tag=\"section\"\n      aria-labelledby={(landmarkLabel ? undefined : ((title && id) ? tpl(\"{0}-t\", id) : undefined))}\n      aria-label={landmarkLabel}\n      data-slot=\"panel-section\"\n    >\n      <Container className=\"mx-auto w-full max-w-6xl px-4 py-8\" data-slot=\"container\">\n        <Panel\n          title={title}\n          description={text}\n          id={id}\n          className={cn((((tone as string) === \"muted\") ? \"bg-muted\" : \"\"))}\n        >\n          <Form method=\"dialog\" className=\"gap-6\" data-slot=\"profile-form\">\n            <Grid cols={(((layout as string) === \"split\") ? \"1-2\" : \"1\")} className=\"items-start gap-8\">\n              <Stack gap=\"4\" align=\"stretch\">\n                {((avatar as string) === \"show\") ? (\n                  <Group gap=\"4\" align=\"center\" data-slot=\"avatar\">\n                    <MediaFrame alt={labels.picture} ratio=\"1/1\" className=\"size-16 shrink-0 rounded-full\" />\n                    <Button variant=\"outline\" size=\"sm\" type=\"button\">\n                      {labels.change}\n                    </Button>\n                  </Group>\n                ) : null}\n                <Field label={labels.name} htmlFor={tpl(\"{0}-name\", id)}>\n                  <Input type=\"text\" name=\"name\" autoComplete=\"name\" id={tpl(\"{0}-name\", id)} data-slot=\"field\" />\n                </Field>\n                <Field label={labels.email} htmlFor={tpl(\"{0}-email\", id)}>\n                  <Input type=\"email\" name=\"email\" autoComplete=\"email\" id={tpl(\"{0}-email\", id)} data-slot=\"field\" />\n                </Field>\n                <Field label={labels.bio} htmlFor={tpl(\"{0}-bio\", id)}>\n                  <Textarea rows={4} name=\"bio\" id={tpl(\"{0}-bio\", id)} data-slot=\"field\" />\n                </Field>\n              </Stack>\n              {((prefs as string) === \"show\") ? (\n                <Stack gap=\"4\" align=\"stretch\" data-slot=\"prefs\">\n                  <Title as={3} size=\"base\" weight=\"bold\">\n                    {labels.prefs}\n                  </Title>\n                  <Group gap=\"4\" align=\"center\" justify=\"between\">\n                    <Label htmlFor={tpl(\"{0}-updates\", id)} className=\"text-sm\" id={tpl(\"{0}-updates-label\", id)}>\n                      {labels.updates}\n                    </Label>\n                    <Switch name=\"updates\" id={tpl(\"{0}-updates\", id)} aria-labelledby={tpl(\"{0}-updates-label\", id)} />\n                  </Group>\n                  <Group gap=\"4\" align=\"center\" justify=\"between\">\n                    <Label htmlFor={tpl(\"{0}-alerts\", id)} className=\"text-sm\" id={tpl(\"{0}-alerts-label\", id)}>\n                      {labels.alerts}\n                    </Label>\n                    <Switch name=\"alerts\" id={tpl(\"{0}-alerts\", id)} aria-labelledby={tpl(\"{0}-alerts-label\", id)} />\n                  </Group>\n                </Stack>\n              ) : null}\n            </Grid>\n            <Group gap=\"2\" className=\"flex-wrap\">\n              <Button variant=\"default\" size=\"default\" type=\"submit\">\n                {labels.save}\n              </Button>\n              <Button variant=\"outline\" size=\"default\" type=\"button\">\n                {labels.cancel}\n              </Button>\n            </Group>\n          </Form>\n        </Panel>\n      </Container>\n    </Block>\n  );\n}\n",
      "path": "blocks/profile-form.tsx",
      "target": "blocks/profile-form.tsx"
    },
    {
      "content": "// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.\n\nexport type ProfileLabels = {\n  picture: string;\n  change: string;\n  name: string;\n  email: string;\n  bio: string;\n  prefs: string;\n  updates: string;\n  alerts: string;\n  save: string;\n  cancel: string;\n};\n",
      "path": "blocks/profile-form.types.ts",
      "target": "blocks/profile-form.types.ts"
    }
  ],
  "meta": {
    "category": "account",
    "group": "settings",
    "kind": "block",
    "tags": [
      "react",
      "block"
    ]
  },
  "name": "profile-form",
  "registryDependencies": [
    "compose",
    "field",
    "media-frame",
    "panel",
    "utils"
  ],
  "runtime": "react",
  "title": "Profile Form",
  "type": "registry:block"
}
