{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "model-selector",
  "title": "Model Selector",
  "description": "A button that opens a searchable list of models grouped by provider, with their logos, costs and footer actions.",
  "dependencies": [
    "@kind-ui/agent-ui@0.9.0",
    "@ui-sdk/core@0.1.0-beta.17",
    "@ui-sdk/react@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup",
    "@kind-ui/picker"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/react/model-selector.tsx",
      "content": "\"use client\";\n\nimport { type ModelSelectorOptions, modelSelectorPrimitive } from \"@kind-ui/agent-ui/core\";\nimport { createParts } from \"@ui-sdk/react/primitive\";\nimport type { ComponentProps, ReactElement, ReactNode } from \"react\";\nimport {\n  type PickerContentProps,\n  type PickerFooterAction,\n  type PickerItemProps,\n  type PickerListProps,\n  type PickerRowItemProps,\n  type PickerSectionRowsProps,\n  type PickerTriggerProps,\n  pickerParts,\n} from \"./picker\";\n\nconst parts = createParts(modelSelectorPrimitive, {\n  root: \"div\",\n  trigger: \"button\",\n  content: \"div\",\n  viewport: \"div\",\n  command: \"div\",\n  item: \"span\",\n  note: \"p\",\n});\n\nconst picker = pickerParts(parts, \"ModelSelector\");\n\n/** A model, whose `icon` is an image URL or an element such as an inline `svg`. */\nexport type ModelSelectorModel = Omit<NonNullable<ModelSelectorOptions[\"models\"]>[number], \"icon\"> & {\n  icon?: string | ReactElement;\n};\n\nexport type ModelSelectorProps = Omit<\n  ComponentProps<typeof parts.Root>,\n  \"children\" | \"models\" | \"actions\"\n> & {\n  models?: ModelSelectorModel[];\n  /** Footer rows after the models, like \"More models\". */\n  actions?: PickerFooterAction[];\n  children?: ReactNode;\n};\n\n/**\n * A button that shows the chosen model and its icon, and opens a searchable list of models grouped by provider, with\n * footer `actions`. Any `children` replace the trigger and the list.\n */\nexport function ModelSelector({ children = picker.Default, ...props }: ModelSelectorProps) {\n  return <parts.Root {...props}>{children}</parts.Root>;\n}\n\nexport type ModelSelectorTriggerProps = PickerTriggerProps;\nexport type ModelSelectorContentProps = PickerContentProps;\nexport type ModelSelectorListProps = PickerListProps;\nexport type ModelSelectorSectionRowsProps = PickerSectionRowsProps;\nexport type ModelSelectorRowItemProps = PickerRowItemProps;\nexport type ModelSelectorItemProps = PickerItemProps;\n\n/** Opens the list. Shows the chosen model's icon and name, or the `label` while none is chosen, unless you pass children. */\nexport const ModelSelectorTrigger = picker.Trigger;\n/** The popover: the search field and the list, unless you pass children. Focus moves to the search field. */\nexport const ModelSelectorContent = picker.Content;\n/** UI SDK Command: the search field, the empty text, and every page of rows unless you pass children. */\nexport const ModelSelectorList = picker.List;\n/** A group of rows under its label, or the footer. */\nexport const ModelSelectorSectionRows = picker.SectionRows;\n/** A row: UI SDK's `CommandItem` with the row's props, holding its `ModelSelectorItem` unless you pass children. */\nexport const ModelSelectorRowItem = picker.RowItem;\n/** A row's content: the model's icon, its marked name, its description, and a check when chosen. */\nexport const ModelSelectorItem = picker.Item;\n",
      "type": "registry:ui",
      "target": "@ui/model-selector.tsx"
    }
  ],
  "meta": {
    "layer": "react"
  },
  "type": "registry:ui"
}
