<script lang="ts">
import type { HTMLAttributes } from 'vue'
import type { PolymorphicProps } from '../factory.ts'

export interface SwitchThumbBaseProps extends PolymorphicProps {}
export interface SwitchThumbProps
  extends
    SwitchThumbBaseProps,
    /**
     * @vue-ignore
     */
    HTMLAttributes {}
</script>

<script setup lang="ts">
import { ark } from '../factory.ts'
import { useSwitchContext } from './use-switch-context.ts'
import { useForwardExpose } from '../../utils/use-forward-expose.ts'

defineProps<SwitchThumbProps>()
const context = useSwitchContext()

useForwardExpose()
</script>

<template>
  <ark.span v-bind="context.getThumbProps()" :as-child="asChild">
    <slot />
  </ark.span>
</template>
