{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "field",
  "title": "Field",
  "dependencies": [
    "solid-js@^1.9.15"
  ],
  "registryDependencies": [
    "@audiocn-solid/core",
    "@audiocn-solid/label",
    "@audiocn-solid/separator"
  ],
  "files": [
    {
      "path": "components/ui/field.tsx",
      "content": "import { children, createMemo, For, Show } from \"solid-js\";\n\nimport { Label } from \"@/components/ui/label\";\nimport type { LabelProps } from \"@/components/ui/label\";\nimport { Separator } from \"@/components/ui/separator\";\nimport type {\n  DivDOMProps,\n  ParagraphDOMProps,\n  FieldSetDOMProps,\n  LegendDOMProps,\n} from \"@/lib/solid/jsx-types\";\nimport { omitProps } from \"@/lib/solid/props\";\nimport { cn } from \"@/lib/utils\";\n\ntype FieldPartProps = DivDOMProps & { className?: string };\n\nexport const FieldSet = (props: FieldSetDOMProps & { className?: string }) => (\n  <fieldset\n    data-slot=\"field-set\"\n    class={cn(\n      \"flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3\",\n      props.class,\n      props.className\n    )}\n    {...omitProps(props, [\"class\", \"className\"])}\n  />\n);\n\nexport const FieldLegend = (\n  props: LegendDOMProps & { className?: string; variant?: \"legend\" | \"label\" }\n) => (\n  <legend\n    data-slot=\"field-legend\"\n    data-variant={props.variant ?? \"legend\"}\n    class={cn(\n      \"mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base\",\n      props.class,\n      props.className\n    )}\n    {...omitProps(props, [\"class\", \"className\", \"variant\"])}\n  />\n);\n\nexport const FieldTitle = (props: FieldPartProps) => (\n  <div\n    data-slot=\"field-label\"\n    class={cn(\n      \"flex w-fit items-center gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50\",\n      props.class,\n      props.className\n    )}\n    {...omitProps(props, [\"class\", \"className\"])}\n  />\n);\n\nexport const FieldSeparator = (props: FieldPartProps) => {\n  const content = children(() => props.children);\n\n  return (\n    <div\n      data-slot=\"field-separator\"\n      data-content={Boolean(content())}\n      class={cn(\n        \"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2\",\n        props.class,\n        props.className\n      )}\n      {...omitProps(props, [\"class\", \"className\", \"children\"])}\n    >\n      <Separator class=\"absolute inset-0 top-1/2\" />\n      <Show when={content()}>\n        <span\n          class=\"bg-background text-muted-foreground relative mx-auto block w-fit px-2\"\n          data-slot=\"field-separator-content\"\n        >\n          {content()}\n        </span>\n      </Show>\n    </div>\n  );\n};\n\nexport const FieldError = (\n  props: FieldPartProps & { errors?: ({ message?: string } | undefined)[] }\n) => {\n  const messages = createMemo(() => [\n    ...new Set(\n      props.errors?.flatMap((error) =>\n        error?.message ? [error.message] : []\n      ) ?? []\n    ),\n  ]);\n\n  const content = children(() => props.children);\n\n  return (\n    <Show when={content() || messages().length > 0}>\n      <div\n        role=\"alert\"\n        data-slot=\"field-error\"\n        class={cn(\n          \"text-destructive text-sm font-normal\",\n          props.class,\n          props.className\n        )}\n        {...omitProps(props, [\"class\", \"className\", \"children\", \"errors\"])}\n      >\n        <Show\n          when={content()}\n          fallback={\n            <Show\n              when={messages().length === 1}\n              fallback={\n                <ul class=\"ml-4 flex list-disc flex-col gap-1\">\n                  <For each={messages()}>{(message) => <li>{message}</li>}</For>\n                </ul>\n              }\n            >\n              {messages()[0]}\n            </Show>\n          }\n        >\n          {content()}\n        </Show>\n      </div>\n    </Show>\n  );\n};\n\nexport const FieldGroup = (props: FieldPartProps) => (\n  <div\n    data-slot=\"field-group\"\n    class={cn(\n      \"group/field-group @container/field-group flex w-full flex-col gap-6 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4\",\n      props.class,\n      props.className\n    )}\n    {...omitProps(props, [\"class\", \"className\"])}\n  />\n);\n\nconst orientations = {\n  horizontal:\n    \"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n  responsive:\n    \"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n  vertical: \"flex-col *:w-full [&>.sr-only]:w-auto\",\n};\n\nexport const Field = (\n  props: FieldPartProps & { orientation?: keyof typeof orientations }\n) => (\n  <div\n    role=\"group\"\n    data-slot=\"field\"\n    data-orientation={props.orientation ?? \"vertical\"}\n    class={cn(\n      \"group/field data-[invalid=true]:text-destructive flex w-full gap-3\",\n      orientations[props.orientation ?? \"vertical\"],\n      props.class,\n      props.className\n    )}\n    {...omitProps(props, [\"class\", \"className\", \"orientation\"])}\n  />\n);\n\nexport const FieldContent = (props: FieldPartProps) => (\n  <div\n    data-slot=\"field-content\"\n    class={cn(\n      \"group/field-content flex flex-1 flex-col gap-1 leading-snug\",\n      props.class,\n      props.className\n    )}\n    {...omitProps(props, [\"class\", \"className\"])}\n  />\n);\n\nexport const FieldLabel = (props: LabelProps) => (\n  <Label\n    data-slot=\"field-label\"\n    class={cn(\n      \"group/field-label peer/field-label has-data-checked:bg-input/30 has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-input/40 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-2xl has-[>[data-slot=field]]:border has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 *:data-[slot=field]:p-4\",\n      props.class,\n      props.className\n    )}\n    {...omitProps(props, [\"class\", \"className\"])}\n  />\n);\n\nexport const FieldDescription = (\n  props: ParagraphDOMProps & { className?: string }\n) => (\n  <p\n    data-slot=\"field-description\"\n    class={cn(\n      \"text-muted-foreground [&>a:hover]:text-primary text-left text-sm leading-normal font-normal group-has-data-horizontal/field:text-balance last:mt-0 nth-last-2:-mt-1 [&>a]:underline [&>a]:underline-offset-4 [[data-variant=legend]+&]:-mt-1.5\",\n      props.class,\n      props.className\n    )}\n    {...omitProps(props, [\"class\", \"className\"])}\n  />\n);\n",
      "type": "registry:ui"
    },
    {
      "path": "lib/audiocn-license.txt",
      "content": "Audio component source adapted from https://github.com/audiocn/ui.\nMIT License — Copyright (c) 2026 OrcDev\n\nRegular SVG icon geometry adapted from @phosphor-icons/react 2.1.10.\nMIT License — Copyright (c) 2020 Phosphor Icons\n\nThe following permission and warranty terms apply to both notices.\nRetain this file with copies or substantial portions of the source.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
      "type": "registry:file",
      "target": "@lib/audiocn-license.txt"
    }
  ],
  "type": "registry:ui"
}
