2022-12-27 20:38:38 +03:00
|
|
|
<script setup lang="ts">
|
2023-02-15 13:34:23 +03:00
|
|
|
const { disabled = false } = defineProps<{
|
2022-12-27 20:38:38 +03:00
|
|
|
icon?: string
|
|
|
|
text?: string
|
|
|
|
checked: boolean
|
2023-02-15 13:34:23 +03:00
|
|
|
disabled?: boolean
|
2022-12-27 20:38:38 +03:00
|
|
|
}>()
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<button
|
|
|
|
exact-active-class="text-primary"
|
2023-02-05 16:00:25 +03:00
|
|
|
block w-full group focus:outline-none text-start
|
2023-08-10 13:18:35 +03:00
|
|
|
role="checkbox" :aria-checked="checked"
|
2023-02-15 13:34:23 +03:00
|
|
|
:disabled="disabled"
|
|
|
|
:class="disabled ? 'opacity-50 cursor-not-allowed' : ''"
|
2022-12-27 20:38:38 +03:00
|
|
|
>
|
2024-05-29 06:42:58 +03:00
|
|
|
<span
|
2024-04-05 12:16:11 +03:00
|
|
|
w-full flex px5 py3 md:gap2 gap4 items-center
|
2023-02-15 13:34:23 +03:00
|
|
|
transition-250
|
|
|
|
:class="disabled ? '' : 'group-hover:bg-active'"
|
2022-12-27 20:38:38 +03:00
|
|
|
group-focus-visible:ring="2 current"
|
|
|
|
>
|
2024-05-29 06:42:58 +03:00
|
|
|
<span flex-1 flex items-center md:gap2 gap4>
|
|
|
|
<span
|
2023-02-05 16:00:25 +03:00
|
|
|
v-if="icon" flex items-center justify-center
|
|
|
|
flex-shrink-0
|
2022-12-27 20:38:38 +03:00
|
|
|
:class="$slots.description ? 'w-12 h-12' : ''"
|
|
|
|
>
|
|
|
|
<slot name="icon">
|
2024-05-29 06:42:58 +03:00
|
|
|
<span v-if="icon" :class="icon" md:text-size-inherit text-xl />
|
2022-12-27 20:38:38 +03:00
|
|
|
</slot>
|
2024-05-29 06:42:58 +03:00
|
|
|
</span>
|
|
|
|
<span space-y-1>
|
|
|
|
<span :class="checked ? 'text-base' : 'text-secondary'">
|
2022-12-27 20:38:38 +03:00
|
|
|
<slot>
|
|
|
|
<span>{{ text }}</span>
|
|
|
|
</slot>
|
2024-05-29 06:42:58 +03:00
|
|
|
</span>
|
|
|
|
<span v-if="$slots.description" block text-sm text-secondary>
|
2022-12-27 20:38:38 +03:00
|
|
|
<slot name="description" />
|
2024-05-29 06:42:58 +03:00
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
<span text-lg :class="checked ? 'i-ri-checkbox-line text-primary' : 'i-ri-checkbox-blank-line text-secondary'" />
|
|
|
|
</span>
|
2022-12-27 20:38:38 +03:00
|
|
|
</button>
|
|
|
|
</template>
|