tethys.backend/resources/js/Components/Icons/Wizard.vue

51 lines
2.1 KiB
Vue
Raw Normal View History

2023-03-17 15:13:37 +00:00
<template>
<div class="flex items-center relative">
<!-- The main circular icon with dynamic classes based on the state of the step -->
<div class="text-gray-500 rounded-full transition duration-500 ease-in-out h-12 w-12 py-3 border-2"
:class="[
isCurrent ? 'text-white bg-teal-600 border-teal-600' : 'border-gray-300',
isChecked && 'text-teal-600 border-teal-600',
]">
<!-- Slot for custom content inside the circle -->
2023-03-17 15:13:37 +00:00
<slot></slot>
<!-- Label displayed above the icon, visibility controlled by isCurrent and isDark -->
<div class="absolute top-0 -ml-10 text-center mt-16 w-32 text-xs font-medium uppercase invisible sm:visible"
:class="[!isDark && isCurrent ? 'font-black text-green-600' : '']">
2023-03-17 15:13:37 +00:00
{{ label }}
</div>
</div>
</div>
<!-- Divider line between steps, only visible if this is not the last step -->
<div v-if="!isLastStep" class="flex-auto border-t-2 transition duration-500 ease-in-out invisible sm:visible"
:class="[isChecked ? 'border-teal-600' : 'border-gray-300']"></div>
2023-03-17 15:13:37 +00:00
</template>
<script lang="ts">
import { StyleService } from '@/Stores/style.service';
const styleService = StyleService();
2023-03-17 15:13:37 +00:00
export default {
name: 'Icon_Multistep',
props: {
isCurrent: Boolean, // Indicates if this step is the current one
isChecked: Boolean, // Indicates if this step has been checked
isLastStep: Boolean, // Indicates if this step is the last one
label: String, // Label to display above the icon
2023-03-17 15:13:37 +00:00
},
data() {
return {
mode: 'light', // Light mode setting
checkedClass: 'border-teal-600', // Class for checked state
uncheckedClass: 'border-gray-300', // Class for unchecked state
2023-03-17 15:13:37 +00:00
};
},
computed: {
// Computed property to determine if dark mode is enabled
isDark() {
return styleService.darkMode === true; // Return true if dark mode is active
}
},
2023-03-17 15:13:37 +00:00
};
</script>