@saasmakers/ui 1.5.3 → 1.5.5

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,6 +2,7 @@
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,
7
8
  size: 'base',
@@ -17,7 +18,7 @@ const percent = computed(() => {
17
18
  })
18
19
 
19
20
  const label = computed(() => {
20
- if (props.max === 100) {
21
+ if (props.labelFormat === 'percent') {
21
22
  return `${Math.round(percent.value)} %`
22
23
  }
23
24
 
@@ -28,12 +29,18 @@ const label = computed(() => {
28
29
  <template>
29
30
  <div
30
31
  class="flex items-center"
31
- :class="size === 'base' ? 'gap-2.5' : 'gap-2'"
32
+ :class="{
33
+ 'gap-2.5': size === 'base',
34
+ 'gap-2': !(size === 'base'),
35
+ }"
32
36
  >
33
37
  <div
34
38
  role="progressbar"
35
39
  class="min-w-0 flex-1 overflow-hidden rounded-full bg-gray-200 dark:bg-gray-800"
36
- :class="size === 'base' ? 'h-1.5' : 'h-1'"
40
+ :class="{
41
+ 'h-1.5': size === 'base',
42
+ 'h-1': !(size === 'base'),
43
+ }"
37
44
  :aria-label="label"
38
45
  :aria-valuemax="max"
39
46
  :aria-valuemin="0"
@@ -47,7 +47,7 @@ function onClose(event: KeyboardEvent | MouseEvent) {
47
47
 
48
48
  <button
49
49
  v-if="action"
50
- class="ml-2 min-h-6 inline-flex items-center justify-center gap-1.25 rounded-md px-2 py-0.5 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-white dark:focus-visible:ring-offset-gray-800"
50
+ class="ml-2 min-h-6 inline-flex items-center justify-center gap-1.25 rounded-md px-2 py-0.5 uppercase transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-white dark:focus-visible:ring-offset-gray-800"
51
51
  :class="{
52
52
  'bg-red-100 text-red-700 hover:bg-red-200 focus-visible:ring-red-500 dark:bg-red-400/15 dark:text-red-400 dark:hover:bg-red-400/25': status === 'error',
53
53
  'bg-indigo-100 text-indigo-700 hover:bg-indigo-200 focus-visible:ring-indigo-500 dark:bg-indigo-400/15 dark:text-indigo-400 dark:hover:bg-indigo-400/25': status === 'info',
@@ -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,12 +282,15 @@ 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
287
288
  size?: BaseProgressSize
288
289
  value?: number
289
290
  }
290
291
 
292
+ export type BaseProgressLabelFormat = 'fraction' | 'percent'
293
+
291
294
  export type BaseProgressSize = 'base' | 'sm'
292
295
 
293
296
  export interface BaseQuote {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saasmakers/ui",
3
- "version": "1.5.3",
3
+ "version": "1.5.5",
4
4
  "private": false,
5
5
  "description": "Reusable Nuxt UI components for SaaS Makers projects",
6
6
  "license": "MIT",