{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "unsaved-bar",
  "title": "Unsaved Bar",
  "description": "Bar with save and discard that appears while a form has unsaved changes.",
  "registryDependencies": [
    "@ikas/button",
    "@ikas/utils"
  ],
  "files": [
    {
      "path": "registry/ikas/unsaved-bar.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\ntype UnsavedBarProps = Omit<React.ComponentProps<\"div\">, \"onSubmit\"> & {\n  /** Show the bar. Usually `form.formState.isDirty`. */\n  open: boolean\n  message?: React.ReactNode\n  onSave: () => void\n  onDiscard: () => void\n  /** Spinner on Save and disables Discard while saving. */\n  saving?: boolean\n  saveLabel?: string\n  discardLabel?: string\n  /**\n   * \"fixed\" pins to the viewport bottom (full app pages).\n   * \"sticky\" sticks inside the scroll container (embedded iframes, panels).\n   */\n  position?: \"fixed\" | \"sticky\"\n}\n\n/**\n * Appears when a form has unsaved changes. Never put Save buttons at the\n * bottom of long settings forms; use this instead.\n */\nfunction UnsavedBar({\n  className,\n  open,\n  message = \"Kaydedilmemiş değişiklikler\",\n  onSave,\n  onDiscard,\n  saving = false,\n  saveLabel = \"Kaydet\",\n  discardLabel = \"Vazgeç\",\n  position = \"fixed\",\n  ...props\n}: UnsavedBarProps) {\n  if (!open) return null\n\n  return (\n    <div\n      data-slot=\"unsaved-bar\"\n      role=\"region\"\n      aria-label=\"Kaydedilmemiş değişiklikler\"\n      className={cn(\n        \"z-40 flex justify-center px-4 pb-4\",\n        position === \"fixed\" ? \"fixed inset-x-0 bottom-0\" : \"sticky bottom-0\",\n        \"animate-in duration-200 fade-in-0 slide-in-from-bottom-2\",\n        className\n      )}\n      {...props}\n    >\n      <div className=\"flex w-full max-w-xl items-center justify-between gap-4 rounded-xl bg-foreground py-2 pr-2 pl-4 text-background shadow-overlay\">\n        <p className=\"truncate text-sm font-medium\">{message}</p>\n        <div className=\"flex shrink-0 items-center gap-2\">\n          <Button\n            size=\"sm\"\n            variant=\"ghost\"\n            onClick={onDiscard}\n            disabled={saving}\n            className=\"text-background hover:bg-background/10 hover:text-background active:bg-background/15\"\n          >\n            {discardLabel}\n          </Button>\n          {/* Inverted like the bar: a neutral solid would be dark on dark (light) and white on white (dark). */}\n          <Button size=\"sm\" onClick={onSave} loading={saving} className=\"[--c-fg:var(--foreground)] [--c:var(--background)]\">\n            {saveLabel}\n          </Button>\n        </div>\n      </div>\n    </div>\n  )\n}\n\nexport { UnsavedBar, type UnsavedBarProps }\n",
      "type": "registry:component",
      "target": "@components/ikas/unsaved-bar.tsx"
    }
  ],
  "docs": "https://builders.ikas.com/tr/docs/app-development/ui-kit/components/unsaved-bar",
  "categories": [
    "forms",
    "feedback"
  ],
  "type": "registry:component"
}