{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "date",
  "files": [
    {
      "path": "ui/date/Date.astro",
      "content": "---\n// Generated from bejamas-juno style registry. Do not edit packages/ui/src/components/date/Date.astro directly.\nimport { cn } from \"@/lib/utils\";\n/**\n * @component Date\n * @description Formats and displays dates and times in human-readable styles.\n * @figmaUrl https://www.figma.com/design/koxai7zw5vIuBzuVxe5T2l/bejamas-ui?node-id=2527-2986&t=YFStJ3V8fXEO8QD8-4\n *\n * @preview\n *\n * <div class=\"grid grid-cols-2 gap-4\">\n *   <div>Default:</div> <Date date=\"2025-06-13T12:00:00Z\" />\n *   <Separator class=\"col-span-2\" />\n *   <div>Short:</div> <Date date=\"2025-06-13T12:00:00Z\" format=\"short\" />\n *   <Separator class=\"col-span-2\" />\n *   <div>Time:</div> <Date date=\"2025-06-13T12:00:00Z\" format=\"time\" />\n *   <Separator class=\"col-span-2\" />\n *   <div>Full:</div> <Date date=\"2025-06-13T12:00:00Z\" format=\"full\" />\n *   <Separator class=\"col-span-2\" />\n *   <div>Long:</div> <Date date=\"2025-06-13T12:00:00Z\" format=\"long\" />\n *   <Separator class=\"col-span-2\" />\n *   <div>Long with time:</div> <Date date=\"2025-06-13T12:00:00Z\" format=\"long\" includeTime />\n * </div>\n *\n * @usage\n *\n * ```astro nocollapse\n * ---\n * import { Date } from '@bejamas/ui/components/date';\n * ---\n *\n * <Date date=\"2025-06-24T12:00:00Z\" />\n * ```\n *\n * @examples\n *\n * ### Custom locale\n *\n * <div class=\"flex gap-2 flex-col\">\n *   <Date date=\"2025-06-24T12:00:00Z\" locale=\"fr-FR\" />\n *   <Date date=\"2025-06-24T12:00:00Z\" locale=\"de-DE\" />\n *   <Date date=\"2025-06-24T12:00:00Z\" locale=\"es-ES\" />\n *   <Date date=\"2025-06-24T12:00:00Z\" locale=\"pl-PL\" />\n * </div>\n */\nconst {\n  date,\n  format = \"long\",\n  includeTime = false,\n  locale = \"en-US\",\n  class: className = \"\",\n  ...props\n} = Astro.props;\n\n// Helper: parse date input\nfunction parseDate(input: string | globalThis.Date | null | undefined) {\n  if (!input) return null;\n  if (input instanceof globalThis.Date) return input;\n  // Try to parse string\n  const d = new globalThis.Date(input);\n  return isNaN(d.getTime()) ? null : d;\n}\n\nconst parsedDate = parseDate(date);\n\n// Precompute separate date and time strings to support custom rendering via slot\nlet dateText = \"\";\nlet timeText = \"\";\nlet formatted = \"\";\nlet html = \"\";\nif (parsedDate) {\n  let dateOptions: Intl.DateTimeFormatOptions | undefined;\n  switch (format) {\n    case \"short\":\n      dateOptions = { dateStyle: \"short\" };\n      break;\n    case \"full\":\n      dateOptions = { dateStyle: \"full\" };\n      break;\n    case \"time\":\n      dateOptions = undefined;\n      break;\n    case \"long\":\n    default:\n      dateOptions = { dateStyle: \"long\" };\n      break;\n  }\n  if (dateOptions) {\n    dateText = new Intl.DateTimeFormat(locale, dateOptions).format(parsedDate);\n  }\n  if (includeTime || format === \"time\") {\n    timeText = new Intl.DateTimeFormat(locale, { timeStyle: \"short\" }).format(\n      parsedDate,\n    );\n  }\n  formatted =\n    format === \"time\"\n      ? timeText\n      : includeTime && timeText\n        ? `${dateText}, ${timeText}`\n        : dateText;\n\n  if (Astro.slots.has(\"default\")) {\n    html = await Astro.slots.render(\"default\", [\n      {\n        date: dateText,\n        time: timeText,\n        formatted,\n        iso: parsedDate.toISOString(),\n        dateObj: parsedDate,\n      },\n    ]);\n  }\n}\n---\n\n{\n  parsedDate ? (\n    Astro.slots.has(\"default\") ? (\n      <Fragment set:html={html} />\n    ) : (\n      <time\n        datetime={parsedDate.toISOString()}\n        class={cn(\"\", className)}\n        {...props}\n      >\n        {formatted}\n      </time>\n    )\n  ) : (\n    <span\n      class={cn(\"text-destructive\", className)}\n      {...props}\n    >\n      Invalid date\n    </span>\n  )\n}\n",
      "type": "registry:ui"
    },
    {
      "path": "ui/date/index.ts",
      "content": "// Generated from bejamas-juno style registry. Do not edit packages/ui/src/components/date/index.ts directly.\nexport { default as Date } from \"./Date.astro\";\n\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}