This commit is contained in:
Nadar
2026-03-17 13:24:22 +03:00
commit 82e5ac9d81
554 changed files with 29637 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<template>
<div :class="[cn.b(), cn.m(type)]">
<div
:class="cn.e('bar')"
:style="{ width: `${progress}%` }"
/>
</div>
</template>
<script setup lang="ts">
defineOptions({
name: 'UiProgressBar',
})
const props = withDefaults(defineProps<ProgressBarProps>(), {
progress: 0,
})
export interface ProgressBarProps {
progress: number
}
const cn = useClassname('ui-progress-bar')
const type = computed(() => {
if (props.progress <= 75)
return 'normal'
else if (props.progress > 75 && props.progress < 95)
return 'middle'
else
return 'high'
})
</script>
<style lang="scss">
@use 'styles';
</style>

View File

@@ -0,0 +1,33 @@
@use '../../styles/mixins' as *;
@use '../../styles/variables' as *;
.ui-progress-bar {
background-color: var(--progress-bar-background-color);
border-radius: 2px;
height: 4px;
overflow: hidden;
&__bar {
height: 100%;
background-color: var(--progress-bar-color);
transition: ease-out;
transition-property: width, background-color;
transition-duration: .1s, .2s;
}
@include element-variant('progress-bar', 'normal', (
'background-color': $clr-grey-300,
'color': $clr-cyan-500,
));
@include element-variant('progress-bar', 'middle', (
'background-color': $clr-warn-200,
'color': $clr-warn-500,
));
@include element-variant('progress-bar', 'high', (
'background-color': $clr-red-100,
'color': $clr-red-500,
));
}