Skip to content

Commit 69d2945

Browse files
Charfeddine HamrouniCharfeddine Hamrouni
Charfeddine Hamrouni
authored and
Charfeddine Hamrouni
committed
feat(UProgress): add circular variant
1 parent c98a90b commit 69d2945

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

playground/app/pages/components/progress.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,14 @@ onMounted(() => {
109109
variant="circular"
110110
color="secondary"
111111
size="xl"
112-
status-position="inside"
112+
status-position="outside"
113113
status
114114
/>
115115
<UProgress
116116
variant="circular"
117117
color="neutral"
118118
animation="swing"
119+
status-position="inside"
119120
size="2xl"
120121
/>
121122
</div>

src/runtime/components/Progress.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ const ui = computed(() => progress({
233233
/>
234234
</ProgressIndicator>
235235
</svg>
236-
<div v-if="!isIndeterminate && (statusPosition === 'inside') && (status || !!slots.status)" class="absolute inset-0" :class="ui.status({ class: props.ui?.status })">
236+
<div v-if="!isIndeterminate && (statusPosition === 'inside') && (status || !!slots.status)" :class="ui.status({ class: props.ui?.status })">
237237
<slot name="status" :percent="percent">
238238
{{ percent }}%
239239
</slot>

src/theme/progress.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default (options: Required<ModuleOptions>) => ({
66
base: 'relative',
77
track: '',
88
indicator: 'rounded-full size-full transition-transform duration-200 ease-out',
9-
status: 'flex justify-end text-(--ui-text-dimmed) transition-[width] duration-200',
9+
status: 'flex justify-end text-(--ui-text-dimmed) transition-[width] duration-200 absolute inset-0',
1010
steps: 'grid items-end',
1111
step: 'truncate text-end row-start-1 col-start-1 transition-opacity'
1212
},
@@ -140,7 +140,7 @@ export default (options: Required<ModuleOptions>) => ({
140140
orientation: 'horizontal',
141141
size: '2xs',
142142
class: {
143-
base: 'rounded-full w-8 h-8',
143+
base: 'rounded-full size-8',
144144
indicator: 'stroke-[6px]',
145145
track: 'stroke-[6px]',
146146
status: 'text-[8px]'
@@ -151,7 +151,7 @@ export default (options: Required<ModuleOptions>) => ({
151151
orientation: 'horizontal',
152152
size: 'xs',
153153
class: {
154-
base: 'rounded-full w-10 h-10',
154+
base: 'rounded-full size-10',
155155
indicator: 'stroke-[6px]',
156156
track: 'stroke-[6px]',
157157
status: 'text-[9px]'
@@ -162,7 +162,7 @@ export default (options: Required<ModuleOptions>) => ({
162162
orientation: 'horizontal',
163163
size: 'sm',
164164
class: {
165-
base: 'rounded-full w-12 h-12',
165+
base: 'rounded-full size-12',
166166
indicator: 'stroke-[6px]',
167167
track: 'stroke-[6px]',
168168
status: 'text-[9px]'
@@ -173,7 +173,7 @@ export default (options: Required<ModuleOptions>) => ({
173173
orientation: 'horizontal',
174174
size: 'md',
175175
class: {
176-
base: 'rounded-full w-16 h-16',
176+
base: 'rounded-full size-16',
177177
indicator: 'stroke-[6px]',
178178
track: 'stroke-[6px]'
179179
}
@@ -183,7 +183,7 @@ export default (options: Required<ModuleOptions>) => ({
183183
orientation: 'horizontal',
184184
size: 'lg',
185185
class: {
186-
base: 'rounded-full w-20 h-20',
186+
base: 'rounded-full size-20',
187187
indicator: 'stroke-[8px]',
188188
track: 'stroke-[8px]'
189189
}
@@ -193,7 +193,7 @@ export default (options: Required<ModuleOptions>) => ({
193193
orientation: 'horizontal',
194194
size: 'xl',
195195
class: {
196-
base: 'rounded-full w-24 h-24',
196+
base: 'rounded-full size-24',
197197
indicator: 'stroke-[10px]',
198198
track: 'stroke-[8px]'
199199
}
@@ -203,7 +203,7 @@ export default (options: Required<ModuleOptions>) => ({
203203
orientation: 'horizontal',
204204
size: '2xl',
205205
class: {
206-
base: 'rounded-full w-32 h-32',
206+
base: 'rounded-full size-32',
207207
indicator: 'stroke-[12px]',
208208
track: 'stroke-[10px]'
209209
}
@@ -212,7 +212,7 @@ export default (options: Required<ModuleOptions>) => ({
212212
orientation: 'horizontal',
213213
size: '2xs',
214214
class: {
215-
base: 'rounded-full w-8 h-8',
215+
base: 'rounded-full size-8',
216216
indicator: 'stroke-[6px]',
217217
track: 'stroke-[6px]',
218218
status: 'text-[8px]'
@@ -223,7 +223,7 @@ export default (options: Required<ModuleOptions>) => ({
223223
orientation: 'horizontal',
224224
size: 'xs',
225225
class: {
226-
base: 'rounded-full w-10 h-10',
226+
base: 'rounded-full size-10',
227227
indicator: 'stroke-[6px]',
228228
track: 'stroke-[6px]',
229229
status: 'text-[9px]'
@@ -234,7 +234,7 @@ export default (options: Required<ModuleOptions>) => ({
234234
orientation: 'horizontal',
235235
size: 'sm',
236236
class: {
237-
base: 'rounded-full w-12 h-12',
237+
base: 'rounded-full size-12',
238238
indicator: 'stroke-[6px]',
239239
track: 'stroke-[6px]',
240240
status: 'text-[9px]'
@@ -245,7 +245,7 @@ export default (options: Required<ModuleOptions>) => ({
245245
orientation: 'horizontal',
246246
size: 'md',
247247
class: {
248-
base: 'rounded-full w-16 h-16',
248+
base: 'rounded-full size-16',
249249
indicator: 'stroke-[6px]',
250250
track: 'stroke-[6px]'
251251
}
@@ -255,7 +255,7 @@ export default (options: Required<ModuleOptions>) => ({
255255
orientation: 'horizontal',
256256
size: 'lg',
257257
class: {
258-
base: 'rounded-full w-20 h-20',
258+
base: 'rounded-full size-20',
259259
indicator: 'stroke-[8px]',
260260
track: 'stroke-[8px]'
261261
}
@@ -265,7 +265,7 @@ export default (options: Required<ModuleOptions>) => ({
265265
orientation: 'horizontal',
266266
size: 'xl',
267267
class: {
268-
base: 'rounded-full w-24 h-24',
268+
base: 'rounded-full size-24',
269269
indicator: 'stroke-[10px]',
270270
track: 'stroke-8'
271271
}
@@ -275,7 +275,7 @@ export default (options: Required<ModuleOptions>) => ({
275275
orientation: 'horizontal',
276276
size: '2xl',
277277
class: {
278-
base: 'rounded-full w-32 h-32',
278+
base: 'rounded-full size-32',
279279
indicator: 'stroke-[12px]',
280280
track: 'stroke-10'
281281
}

0 commit comments

Comments
 (0)