File tree Expand file tree Collapse file tree 4 files changed +58
-0
lines changed
Expand file tree Collapse file tree 4 files changed +58
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ declare module 'vue' {
3333 FaPasswordStrength : typeof import ( './../ui/components/FaPasswordStrength/index.vue' ) [ 'default' ]
3434 FaPinInput : typeof import ( './../ui/components/FaPinInput/index.vue' ) [ 'default' ]
3535 FaPopover : typeof import ( './../ui/components/FaPopover/index.vue' ) [ 'default' ]
36+ FaProgress : typeof import ( './../ui/components/FaProgress/index.vue' ) [ 'default' ]
3637 FaScrollArea : typeof import ( './../ui/components/FaScrollArea/index.vue' ) [ 'default' ]
3738 FaSearchBar : typeof import ( './../ui/components/FaSearchBar/index.vue' ) [ 'default' ]
3839 FaSelect : typeof import ( './../ui/components/FaSelect/index.vue' ) [ 'default' ]
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ import type { HTMLAttributes } from ' vue'
3+ import { Progress } from ' ./progress'
4+
5+ const props = defineProps <{
6+ class? : HTMLAttributes [' class' ]
7+ }>()
8+
9+ const modelValue = defineModel <number >({
10+ default: 0 ,
11+ })
12+ </script >
13+
14+ <template >
15+ <Progress v-bind =" props" :model-value =" modelValue" />
16+ </template >
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ import type { ProgressRootProps } from ' reka-ui'
3+ import type { HTMLAttributes } from ' vue'
4+ import { cn } from ' @/utils'
5+ import {
6+ ProgressIndicator ,
7+ ProgressRoot ,
8+ } from ' reka-ui'
9+ import { computed } from ' vue'
10+
11+ const props = withDefaults (
12+ defineProps <ProgressRootProps & { class? : HTMLAttributes [' class' ] }>(),
13+ {
14+ modelValue: 0 ,
15+ },
16+ )
17+
18+ const delegatedProps = computed (() => {
19+ const { class : _, ... delegated } = props
20+
21+ return delegated
22+ })
23+ </script >
24+
25+ <template >
26+ <ProgressRoot
27+ v-bind =" delegatedProps"
28+ :class ="
29+ cn(
30+ 'relative h-4 w-full overflow-hidden rounded-full bg-secondary',
31+ props.class,
32+ )
33+ "
34+ >
35+ <ProgressIndicator
36+ class =" h-full w-full flex-1 bg-primary transition-all"
37+ :style =" `transform: translateX(-${100 - (props.modelValue ?? 0)}%);`"
38+ />
39+ </ProgressRoot >
40+ </template >
Original file line number Diff line number Diff line change 1+ export { default as Progress } from './Progress.vue'
You can’t perform that action at this time.
0 commit comments