Skip to content

Commit 94651c5

Browse files
Charfeddine HamrouniCharfeddine Hamrouni
authored andcommitted
fix: improve status position theme
1 parent 984fc78 commit 94651c5

File tree

3 files changed

+27
-16
lines changed

3 files changed

+27
-16
lines changed

docs/content/3.components/progress.md

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,20 @@ props:
5757
---
5858
::
5959

60+
### Variant
61+
62+
Use the `variant` prop to change the style of the Progress. Defaults to `linear`.
63+
64+
::component-code
65+
---
66+
external:
67+
- modelValue
68+
props:
69+
modelValue: 50
70+
variant: linear
71+
---
72+
::
73+
6074
### Status
6175

6276
Use the `status` prop to display the current Progress value above the bar.
@@ -78,11 +92,12 @@ Use the `statusPosition` prop to define where the status text is displayed. Defa
7892
::component-code
7993
---
8094
external:
81-
- modelValue
82-
props:
95+
- modelValue
96+
props:
8397
modelValue: 50
98+
variant: circular
8499
status: true
85-
statusPosition: inside
100+
statusPosition: 'inside'
86101
---
87102
::
88103

@@ -132,11 +147,11 @@ Use the `variant` prop to change the style of the Progress. Defaults to `linear`
132147
---
133148
prettier: true
134149
ignore:
135-
- modelValue
136-
- max
137-
external:
138-
- modelValue
139-
props:
150+
- modelValue
151+
- max
152+
external:
153+
- modelValue
154+
props:
140155
variant: circular
141156
modelValue: 50
142157
max: 100

src/runtime/components/Progress.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.progress ||
201201

202202
<template>
203203
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
204-
<div v-if="!isIndeterminate && (statusPosition === 'outside') && (status || !!slots.status)" :class="ui.status({ class: props.ui?.status })" :style="statusStyle">
204+
<div v-if="!isIndeterminate && (variant !== 'circular' || statusPosition === 'outside') && (status || !!slots.status)" :class="ui.status({ class: props.ui?.status })" :style="statusStyle">
205205
<slot name="status" :percent="percent">
206206
{{ percent }}%
207207
</slot>
@@ -231,7 +231,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.progress ||
231231
/>
232232
</ProgressIndicator>
233233
</svg>
234-
<div v-if="!isIndeterminate && (statusPosition === 'inside') && (status || !!slots.status)" :class="ui.status({ class: props.ui?.status })">
234+
<div v-if="!isIndeterminate && variant === 'circular' && statusPosition === 'inside' && (status || !!slots.status)" :class="ui.status({ class: props.ui?.status })">
235235
<slot name="status" :percent="percent">
236236
{{ percent }}%
237237
</slot>

src/theme/progress.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,8 @@ export default (options: Required<ModuleOptions>) => ({
2424
}
2525
},
2626
statusPosition: {
27-
inside: {
28-
status: 'absolute inset-0'
29-
},
30-
outside: {
31-
status: ''
32-
}
27+
inside: {},
28+
outside: {}
3329
},
3430
animation: {
3531
'carousel': '',

0 commit comments

Comments
 (0)