accordion-content.svelte 695 B

123456789101112131415161718192021222324252627
  1. <script lang="ts">
  2. import { Accordion as AccordionPrimitive } from "bits-ui";
  3. import { cn, type WithoutChild } from "../../lib/utils.js";
  4. let {
  5. ref = $bindable(null),
  6. class: className,
  7. children,
  8. ...restProps
  9. }: WithoutChild<AccordionPrimitive.ContentProps> = $props();
  10. </script>
  11. <AccordionPrimitive.Content
  12. bind:ref
  13. data-slot="accordion-content"
  14. class="data-open:animate-accordion-down data-closed:animate-accordion-up text-sm overflow-hidden"
  15. {...restProps}
  16. >
  17. <div
  18. class={cn(
  19. "pt-0 pb-4 [&_a]:hover:text-foreground [&_a]:underline [&_a]:underline-offset-3 [&_p:not(:last-child)]:mb-4",
  20. className
  21. )}
  22. >
  23. {@render children?.()}
  24. </div>
  25. </AccordionPrimitive.Content>