{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "Badge",
  "dependencies": [
    "@base-ui/react",
    "cn",
    "rescript-base-ui"
  ],
  "files": [
    {
      "path": "registry/base/ui/Badge.res",
      "content": "@@jsxConfig({version: 4, mode: \"automatic\", module_: \"BaseUi.BaseUiJsxDOM\"})\n\n@module(\"cn\")\nexternal cn: (string, string, option<string>) => string = \"cn\"\n\n@unboxed\ntype dataIcon =\n  | @as(\"inline-start\") InlineStart\n  | @as(\"inline-end\") InlineEnd\n\nmodule Variant = {\n  @unboxed\n  type t =\n    | @as(\"default\") Default\n    | @as(\"secondary\") Secondary\n    | @as(\"destructive\") Destructive\n    | @as(\"outline\") Outline\n    | @as(\"ghost\") Ghost\n    | @as(\"link\") Link\n}\n\nlet badgeVariantClass = (~variant: Variant.t) =>\n  switch variant {\n  | Default => \"bg-primary text-primary-foreground [a]:hover:bg-primary/80\"\n  | Secondary => \"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80\"\n  | Destructive => \"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20\"\n  | Outline => \"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground\"\n  | Ghost => \"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50\"\n  | Link => \"text-primary underline-offset-4 hover:underline\"\n  }\n\nlet base = \"h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none\"\n\ntype state = {slot: string, variant: Variant.t}\n\ntype props = {\n  ...BaseUi.Types.BaseUIComponentProps.t,\n  variant?: Variant.t,\n}\n\nlet toDomProps: props => BaseUi.Types.DomProps.t = %raw(`({className, render, variant, ...props}) => props`)\n\n@react.componentWithProps(props)\nlet make = (props: props) => {\n  let variant = props.variant->Option.getOr(Variant.Default)\n\n  BaseUi.Render.use({\n    defaultTagName: \"span\",\n    props: BaseUi.Render.mergeProps(\n      {className: cn(base, badgeVariantClass(~variant), props.className)},\n      toDomProps(props),\n    ),\n    render: ?props.render,\n    state: {slot: \"badge\", variant},\n  })\n}\n",
      "type": "registry:file",
      "target": "@ui/Badge.res"
    }
  ],
  "type": "registry:ui"
}