{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "fieldset",
  "title": "Fieldset",
  "description": "A titled group of related fields, such as an address, rendered as a `<fieldset>` named by its legend.",
  "dependencies": [
    "@base-ui/react@^1.8.0"
  ],
  "registryDependencies": [
    "@ouro/field",
    "@ouro/lib-class-name-check",
    "@ouro/lib-cn",
    "@ouro/lib-env",
    "@ouro/lib-use-dev-messages"
  ],
  "files": [
    {
      "path": "registry/ouro/components/ouro/field/fieldset.tsx",
      "content": "\"use client\";\n\nimport { Fieldset as BaseFieldset } from \"@base-ui/react/fieldset\";\nimport { useId, type JSX, type ReactNode } from \"react\";\nimport { useAppearanceClassNameCheck } from \"@/registry/ouro/lib/ouro/class-name-check\";\nimport { cn } from \"@/registry/ouro/lib/ouro/cn\";\nimport { useDevWarnings } from \"@/registry/ouro/lib/ouro/use-dev-messages\";\nimport { descriptionClass, fieldHint, legendClass } from \"@/registry/ouro/components/ouro/field/field-styles\";\n\n/** Props for {@link Fieldset}. Groups take `legend` where a single control takes `label`. */\nexport interface FieldsetProps {\n  /**\n   * What the group is, shown above it and read as the group's name. Required: a group of\n   * controls needs a name. To hide it visually, keep it and add `hideLegend`.\n   */\n  legend: string;\n  /** Hides the legend visually; screen readers still read it as the group's name. */\n  hideLegend?: boolean | undefined;\n  /** Supporting text under the legend, read after it through `aria-describedby`. */\n  description?: ReactNode | undefined;\n  /**\n   * Disables every native control and every `Field` inside it, and fades the legend.\n   *\n   * @claim \"Disables every native control and every\" registry/ouro/components/ouro/field/fieldset.test.tsx verify:testExists(registry/ouro/components/ouro/field/fieldset.test.tsx::Fieldset > disables every nested control with disabled)\n   * @claim \"Disables every native control and every\" registry/ouro/components/ouro/field/fieldset.test.tsx verify:testExists(registry/ouro/components/ouro/field/fieldset.test.tsx::Fieldset > disables a Base UI control in a FieldRoot, which is not a native control)\n   */\n  disabled?: boolean | undefined;\n  /** The fields and controls in the group. */\n  children: ReactNode;\n  /** Layout only: margins, width, grid placement (`mt-6`). Appearance classes warn in development. */\n  className?: string | undefined;\n\n  /** Not a prop. Groups take `legend`: `<Fieldset legend=\"Shipping address\">`. */\n  label?: { 'Use <Fieldset legend=\"Shipping address\">': never };\n}\n\n/**\n * A titled group of related fields, such as an address, rendered as a `<fieldset>` named\n * by its legend. `disabled` disables every native control and every `Field` inside it at once.\n *\n * Use `Field` instead for a single control. A group of checkboxes or radios that make one\n * choice uses their group component, which takes the same `legend`.\n *\n * @group Forms\n * @see https://ui.ouroboros.bot/docs/fieldset\n *\n * @example\n * <Fieldset legend=\"Shipping address\" description=\"Where we send your order.\">\n *   <Field label=\"Street\" name=\"street\"><FieldControl autoComplete=\"street-address\" /></Field>\n *   <Field label=\"City\" name=\"city\"><FieldControl autoComplete=\"address-level2\" /></Field>\n * </Fieldset>\n * @claim \"`disabled` disables every native control and\" registry/ouro/components/ouro/field/fieldset.test.tsx verify:testExists(registry/ouro/components/ouro/field/fieldset.test.tsx::Fieldset > disables every nested control with disabled)\n * @claim \"`disabled` disables every native control and\" registry/ouro/components/ouro/field/fieldset.test.tsx verify:testExists(registry/ouro/components/ouro/field/fieldset.test.tsx::Fieldset > disables a Base UI control in a FieldRoot, which is not a native control)\n */\nexport function Fieldset(props: FieldsetProps): JSX.Element {\n  const { legend, hideLegend, description, disabled, children, className, label } = props;\n  const id = useId();\n  const legendId = `${id}-legend`;\n  const descriptionId = `${id}-description`;\n  const hasDescription = description !== undefined && description !== null && description !== false && description !== \"\";\n  useAppearanceClassNameCheck(\n    \"Fieldset\",\n    className,\n    process.env.NODE_ENV !== \"production\" ? fieldHint : /* istanbul ignore next @preserve -- production only */ \"\",\n  );\n  useDevWarnings(\n    \"Fieldset\",\n    process.env.NODE_ENV !== \"production\"\n      ? () => [\n          legend === \"\" && [\n            \"legend is empty, so the group has no name\",\n            '<Fieldset legend=\"Shipping address\" hideLegend> to hide a legend you still need',\n          ],\n          label !== undefined && [\"label is not a prop\", `<Fieldset legend=\"${String(label)}\">`],\n        ]\n      : /* istanbul ignore next @preserve -- production only */ undefined,\n  );\n\n  // Ids are set here, not left to Base UI's effects, so the server HTML names and\n  // describes the group before hydration.\n  const legendElement = (\n    <BaseFieldset.Legend id={legendId} className={cn(legendClass, hideLegend && \"sr-only\")}>\n      {legend}\n    </BaseFieldset.Legend>\n  );\n  return (\n    <BaseFieldset.Root\n      disabled={disabled}\n      aria-labelledby={legendId}\n      aria-describedby={hasDescription ? descriptionId : undefined}\n      data-ouro=\"fieldset\"\n      className={cn(\"[@layer_ouro-reset]:m-0 box-border grid min-w-0 content-start gap-4 border-0 p-0\", className)}\n    >\n      {hasDescription ? (\n        <div className=\"grid gap-1\">\n          {legendElement}\n          <p id={descriptionId} className={descriptionClass}>\n            {description}\n          </p>\n        </div>\n      ) : (\n        legendElement\n      )}\n      {children}\n    </BaseFieldset.Root>\n  );\n}\n",
      "type": "registry:ui",
      "target": "@components/ouro/field/fieldset.tsx"
    }
  ],
  "docs": "A titled group of related fields, such as an address, rendered as a `<fieldset>` named by its legend. Import: import { Fieldset } from \"@/components/ouro/field/fieldset\", with @/components replaced by your components alias (aliases.components in components.json, such as ~/components). Also installed: field, the helpers they import in lib/ouro. Needs ouro-base in your stylesheet: add that item once per app, from the same place as this one, if you have not. Docs: https://ui.ouroboros.bot/docs/fieldset.md Ouro UI v1.3.257.",
  "type": "registry:ui"
}