CommonDivider.vue 987 B

123456789101112131415161718192021222324252627282930313233343536
  1. <!-- Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import type { DividerOrientation } from './types.ts'
  4. interface Props {
  5. orientation?: DividerOrientation
  6. padding?: boolean
  7. alternativeBackground?: boolean
  8. }
  9. const props = withDefaults(defineProps<Props>(), {
  10. orientation: 'horizontal',
  11. })
  12. </script>
  13. <template>
  14. <div
  15. :class="{
  16. 'w-full': props.orientation === 'horizontal',
  17. 'h-full': props.orientation === 'vertical',
  18. 'px-2.5': props.padding && props.orientation === 'horizontal',
  19. 'py-2.5': props.padding && props.orientation === 'vertical',
  20. }"
  21. >
  22. <hr
  23. class="border-0"
  24. :class="{
  25. 'h-px w-full': props.orientation === 'horizontal',
  26. 'h-full w-px': props.orientation === 'vertical',
  27. 'bg-neutral-100 dark:bg-gray-900': !props.alternativeBackground,
  28. 'bg-white dark:bg-gray-200': props.alternativeBackground,
  29. }"
  30. />
  31. </div>
  32. </template>