{
  "$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\">\nimport { variants } from \"../utils\";\n\n/** MediaFrame: the classes of each value (shadcn/cva style). */\nexport 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\nexport 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 setup lang=\"ts\">\nimport { computed } from \"vue\";\nimport Box from \"../compose/Box.vue\";\nimport Image from \"../compose/Image.vue\";\nimport { at, cn, urlOf } from \"../utils\";\nimport { PLACEHOLDER } from \"./media-frame.assets\";\n\nconst { alt, src, darkSrc, ratio = \"16/9\", class: className } = defineProps<MediaFrameProps>();\nconst lightSrc = computed(() => src ? src : at(PLACEHOLDER, \"light\"));\nconst nightSrc = computed(() => darkSrc ? darkSrc : (src ? src : at(PLACEHOLDER, \"dark\")));\nconst shownAlt = computed(() => src ? alt : \"\");\nconst loadHint = computed(() => src ? \"lazy\" : undefined);\nconst decodeHint = computed(() => src ? \"async\" : undefined);\n</script>\n\n<template>\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</template>\n",
      "path": "components/media-frame.vue",
      "target": "components/media-frame.vue"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "vue",
      "component"
    ]
  },
  "name": "media-frame",
  "registryDependencies": [
    "box",
    "image",
    "utils"
  ],
  "runtime": "vue",
  "title": "Media Frame",
  "type": "registry:component"
}
