@saasmakers/ui 1.5.2 → 1.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,8 +2,10 @@
2
2
  import type { BaseProgress } from '../../types/bases'
3
3
 
4
4
  const props = withDefaults(defineProps<BaseProgress>(), {
5
+ labelFormat: 'fraction',
5
6
  max: 100,
6
7
  showLabel: false,
8
+ size: 'base',
7
9
  value: 0,
8
10
  })
9
11
 
@@ -16,19 +18,29 @@ const percent = computed(() => {
16
18
  })
17
19
 
18
20
  const label = computed(() => {
19
- if (props.max === 100) {
21
+ if (props.labelFormat === 'percent') {
20
22
  return `${Math.round(percent.value)} %`
21
23
  }
22
24
 
23
- return `${props.value}/${props.max}`
25
+ return `${props.value} / ${props.max}`
24
26
  })
25
27
  </script>
26
28
 
27
29
  <template>
28
- <div class="w-full flex items-center gap-2">
30
+ <div
31
+ class="flex items-center"
32
+ :class="{
33
+ 'gap-2.5': size === 'base',
34
+ 'gap-2': !(size === 'base'),
35
+ }"
36
+ >
29
37
  <div
30
38
  role="progressbar"
31
- class="h-1 min-w-0 flex-1 overflow-hidden rounded-full bg-gray-200 dark:bg-gray-800"
39
+ class="min-w-0 flex-1 overflow-hidden rounded-full bg-gray-200 dark:bg-gray-800"
40
+ :class="{
41
+ 'h-1.5': size === 'base',
42
+ 'h-1': !(size === 'base'),
43
+ }"
32
44
  :aria-label="label"
33
45
  :aria-valuemax="max"
34
46
  :aria-valuemin="0"
@@ -43,7 +55,7 @@ const label = computed(() => {
43
55
  <BaseText
44
56
  v-if="showLabel"
45
57
  class="shrink-0 text-indigo-700 dark:text-indigo-300"
46
- size="2xs"
58
+ :size="size === 'base' ? 'xs' : '2xs'"
47
59
  :text="label"
48
60
  />
49
61
  </div>
@@ -243,7 +243,10 @@ watch(visible, (isVisible) => {
243
243
  <div
244
244
  ref="contentRef"
245
245
  class="min-h-0 flex-1 overflow-y-auto px-5"
246
- :class="$slots.footer ? 'pb-4' : 'pb-6'"
246
+ :class="{
247
+ 'pb-4': $slots.footer,
248
+ 'pb-6': !($slots.footer),
249
+ }"
247
250
  @pointercancel="onPointerUp"
248
251
  @pointerdown="onContentPointerDown"
249
252
  @pointermove="onPointerMove"
@@ -282,11 +282,17 @@ export type BasePowerPower
282
282
  export type BasePowerSize = 'base' | 'lg' | 'sm' | 'xs'
283
283
 
284
284
  export interface BaseProgress {
285
+ labelFormat?: BaseProgressLabelFormat
285
286
  max?: number
286
287
  showLabel?: boolean
288
+ size?: BaseProgressSize
287
289
  value?: number
288
290
  }
289
291
 
292
+ export type BaseProgressLabelFormat = 'fraction' | 'percent'
293
+
294
+ export type BaseProgressSize = 'base' | 'sm'
295
+
290
296
  export interface BaseQuote {
291
297
  background?: BaseQuoteBackground
292
298
  character?: BaseCharacterCharacter
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saasmakers/ui",
3
- "version": "1.5.2",
3
+ "version": "1.5.4",
4
4
  "private": false,
5
5
  "description": "Reusable Nuxt UI components for SaaS Makers projects",
6
6
  "license": "MIT",