{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "Media Frame component",
  "devDependencies": [],
  "digest": "0.1.0",
  "files": [
    {
      "content": "// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.\n// Data of MediaFrame: long values (pictures as data URIs) kept out of the component file.\n\nexport const PLACEHOLDER: Record<string, string> = {\n  \"light\": \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MDAgMzAwIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCBzbGljZSI+PHJlY3Qgd2lkdGg9IjQwMCIgaGVpZ2h0PSIzMDAiIGZpbGw9IiNlMmU4ZjAiLz48Y2lyY2xlIGN4PSIyOTYiIGN5PSI5NiIgcj0iMzAiIGZpbGw9IiNjYmQ1ZTEiLz48cGF0aCBkPSJNMCAzMDBWMjE0bDk2LTc2IDg4IDcwIDY0LTQ4IDE1MiA5NnY0NHoiIGZpbGw9IiNjYmQ1ZTEiLz48cGF0aCBkPSJNMCAzMDB2LTUybDEyMC02MCAxMTAgNjIgNjAtMzAgMTEwIDgwdjB6IiBmaWxsPSIjOTRhM2I4IiBvcGFjaXR5PSIwLjU1Ii8+PC9zdmc+\",\n  \"dark\": \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MDAgMzAwIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCBzbGljZSI+PHJlY3Qgd2lkdGg9IjQwMCIgaGVpZ2h0PSIzMDAiIGZpbGw9IiMxZTI5M2IiLz48Y2lyY2xlIGN4PSIyOTYiIGN5PSI5NiIgcj0iMzAiIGZpbGw9IiMzMzQxNTUiLz48cGF0aCBkPSJNMCAzMDBWMjE0bDk2LTc2IDg4IDcwIDY0LTQ4IDE1MiA5NnY0NHoiIGZpbGw9IiMzMzQxNTUiLz48cGF0aCBkPSJNMCAzMDB2LTUybDEyMC02MCAxMTAgNjIgNjAtMzAgMTEwIDgwdjB6IiBmaWxsPSIjNDc1NTY5IiBvcGFjaXR5PSIwLjU1Ii8+PC9zdmc+\",\n};\n",
      "path": "components/media-frame.assets.ts",
      "target": "components/media-frame.assets.ts"
    },
    {
      "content": "<!-- Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT. -->\n<!--\n  A picture in a fixed ratio that follows the theme. `src` is the picture of the light theme, `darkSrc` the one\n  of the dark theme (without it the dark theme shows `src`). Without both (an empty string counts as none) it\n  shows the built-in neutral placeholders (base64 data URIs, one light and one dark), so a page can be laid out\n  before it has pictures; the placeholder is decorative (`alt` is empty), stands in for a real `src` and is\n  switched by the theme token. A real picture gets `alt` and loads lazily. `ratio` comes from the recipe; the\n  corners are the plain theme radius.\n-->\n<script lang=\"ts\" module>\n  import type { Snippet } from \"svelte\";\n  import { variants } from \"../utils\";\n\n  /** MediaFrame: the classes of each value (shadcn/cva style). */\n  export const mediaFrameVariants = variants({\n    base: \"relative w-full overflow-hidden bg-muted text-muted-foreground inset-ring inset-ring-border rounded\",\n    variants: {\n      ratio: {\n        \"16/9\": \"aspect-video\",\n        \"4/3\": \"aspect-4/3\",\n        \"1/1\": \"aspect-square\",\n        \"3/4\": \"aspect-3/4\",\n        \"21/9\": \"aspect-21/9\",\n      },\n    },\n    defaultVariants: { ratio: \"16/9\" },\n  });\n\n  export type MediaFrameProps = {\n    alt: string;\n    src?: string;\n    darkSrc?: string;\n    ratio?: \"16/9\" | \"4/3\" | \"1/1\" | \"3/4\" | \"21/9\";\n    class?: string;\n  };\n</script>\n\n<script lang=\"ts\">\n  import Box from \"../compose/Box.svelte\";\n  import Image from \"../compose/Image.svelte\";\n  import { at, cn, urlOf } from \"../utils\";\n  import { PLACEHOLDER } from \"./media-frame.assets\";\n\n  let { alt, src, darkSrc, ratio = \"16/9\", class: className }: MediaFrameProps = $props();\n  const lightSrc = $derived(src ? src : at(PLACEHOLDER, \"light\"));\n  const nightSrc = $derived(darkSrc ? darkSrc : (src ? src : at(PLACEHOLDER, \"dark\")));\n  const shownAlt = $derived(src ? alt : \"\");\n  const loadHint = $derived(src ? \"lazy\" : undefined);\n  const decodeHint = $derived(src ? \"async\" : undefined);\n</script>\n\n<Box\n  class={cn(mediaFrameVariants({ ratio: ratio }), className)}\n  data-slot=\"media-frame\"\n  data-placeholder={(src ? \"false\" : \"true\")}\n>\n  <Image\n    src={urlOf(lightSrc, true)}\n    alt={shownAlt}\n    loading={loadHint}\n    decoding={decodeHint}\n    class=\"absolute inset-0 size-full object-cover dark:hidden\"\n    data-theme-src=\"light\"\n  />\n  <Image\n    src={urlOf(nightSrc, true)}\n    alt={shownAlt}\n    loading={loadHint}\n    decoding={decodeHint}\n    class=\"absolute inset-0 hidden size-full object-cover dark:block\"\n    data-theme-src=\"dark\"\n  />\n</Box>\n",
      "path": "components/media-frame.svelte",
      "target": "components/media-frame.svelte"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "svelte",
      "component"
    ]
  },
  "name": "media-frame",
  "registryDependencies": [
    "box",
    "image",
    "utils"
  ],
  "runtime": "svelte",
  "title": "Media Frame",
  "type": "registry:component"
}
