UNPKG

reka-ui

Version:

Vue port for Radix UI Primitives.

1 lines 1.48 kB
{"version":3,"file":"Arrow.cjs","sources":["../../src/shared/component/Arrow.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { PrimitiveProps } from '@/Primitive'\nimport { useForwardExpose } from '../useForwardExpose'\n\nexport interface ArrowProps extends PrimitiveProps {\n /**\n * The width of the arrow in pixels.\n *\n * @defaultValue 10\n */\n width?: number\n /**\n * The height of the arrow in pixels.\n *\n * @defaultValue 5\n */\n height?: number\n /**\n * When `true`, render the rounded version of arrow. Do not work with `as`/`asChild`\n *\n * @defaultValue false\n */\n rounded?: boolean\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { Primitive } from '@/Primitive'\n\nconst props = withDefaults(defineProps<ArrowProps>(), {\n width: 10,\n height: 5,\n as: 'svg',\n})\n\nuseForwardExpose()\n</script>\n\n<template>\n <Primitive\n v-bind=\"props\"\n :width=\"width\"\n :height=\"height\"\n :viewBox=\"asChild ? undefined : '0 0 12 6'\"\n :preserveAspectRatio=\"asChild ? undefined : 'none'\"\n >\n <slot>\n <path\n v-if=\"!rounded\"\n d=\"M0 0L6 6L12 0\"\n />\n <path\n v-else\n d=\"M0 0L4.58579 4.58579C5.36683 5.36683 6.63316 5.36684 7.41421 4.58579L12 0\"\n />\n </slot>\n </Primitive>\n</template>\n"],"names":["useForwardExpose"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA6BA,IAAA,MAAM,KAAQ,GAAA,OAAA;AAMd,IAAiBA,wCAAA,EAAA;;;;;;;;;;;;;;;;;;;;;"}