@saasmakers/ui 2.0.65 → 2.0.67
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.
- package/app/components/bases/BaseRing.vue +7 -23
- package/app/types/bases.d.ts +0 -3
- package/package.json +1 -1
- package/uno.config.ts +3 -0
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import type { BaseRing } from '../../types/bases'
|
|
3
3
|
|
|
4
4
|
const props = withDefaults(defineProps<BaseRing>(), {
|
|
5
|
-
clickable: false,
|
|
6
5
|
completed: 0,
|
|
7
6
|
dashed: false,
|
|
8
7
|
format: 'count',
|
|
@@ -11,10 +10,6 @@ const props = withDefaults(defineProps<BaseRing>(), {
|
|
|
11
10
|
transitionColors: false,
|
|
12
11
|
})
|
|
13
12
|
|
|
14
|
-
const emit = defineEmits<{
|
|
15
|
-
click: [event: MouseEvent]
|
|
16
|
-
}>()
|
|
17
|
-
|
|
18
13
|
const sizes = {
|
|
19
14
|
base: {
|
|
20
15
|
inset: 1,
|
|
@@ -71,8 +66,11 @@ const centerLabel = computed(() => {
|
|
|
71
66
|
return String(clampedCompleted.value)
|
|
72
67
|
})
|
|
73
68
|
|
|
74
|
-
// Visual gap (in viewBox units) between segments, widened for fewer steps.
|
|
75
69
|
function gapForTotal(total: number) {
|
|
70
|
+
if (total <= 1) {
|
|
71
|
+
return 0
|
|
72
|
+
}
|
|
73
|
+
|
|
76
74
|
if (total <= 4) {
|
|
77
75
|
return 3
|
|
78
76
|
}
|
|
@@ -136,24 +134,10 @@ const ringArcs = computed(() => {
|
|
|
136
134
|
|
|
137
135
|
return arcs
|
|
138
136
|
})
|
|
139
|
-
|
|
140
|
-
function onClick(event: MouseEvent) {
|
|
141
|
-
if (props.clickable) {
|
|
142
|
-
emit('click', event)
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
137
|
</script>
|
|
146
138
|
|
|
147
139
|
<template>
|
|
148
|
-
<
|
|
149
|
-
:is="clickable ? 'button' : 'div'"
|
|
150
|
-
class="inline-flex"
|
|
151
|
-
:aria-expanded="expanded"
|
|
152
|
-
:aria-label="label"
|
|
153
|
-
:class="{ 'cursor-pointer': clickable }"
|
|
154
|
-
:type="clickable ? 'button' : undefined"
|
|
155
|
-
@click="onClick"
|
|
156
|
-
>
|
|
140
|
+
<div class="inline-flex">
|
|
157
141
|
<svg
|
|
158
142
|
class="size-full"
|
|
159
143
|
:height="geometry.size"
|
|
@@ -185,7 +169,7 @@ function onClick(event: MouseEvent) {
|
|
|
185
169
|
/>
|
|
186
170
|
|
|
187
171
|
<text
|
|
188
|
-
v-if="centerLabel
|
|
172
|
+
v-if="centerLabel"
|
|
189
173
|
class="fill-gray-600 font-bold tabular-nums dark:fill-gray-400"
|
|
190
174
|
:class="{
|
|
191
175
|
'text-2xs': size === 'base' || size === 'sm',
|
|
@@ -199,5 +183,5 @@ function onClick(event: MouseEvent) {
|
|
|
199
183
|
{{ centerLabel }}
|
|
200
184
|
</text>
|
|
201
185
|
</svg>
|
|
202
|
-
</
|
|
186
|
+
</div>
|
|
203
187
|
</template>
|
package/app/types/bases.d.ts
CHANGED
|
@@ -297,12 +297,9 @@ export type BaseQuoteBackground = 'gray' | 'gray-light' | 'white'
|
|
|
297
297
|
export type BaseQuoteSize = 'base' | 'sm' | 'xs'
|
|
298
298
|
|
|
299
299
|
export interface BaseRing {
|
|
300
|
-
clickable?: boolean
|
|
301
300
|
completed?: number
|
|
302
301
|
dashed?: boolean
|
|
303
|
-
expanded?: boolean
|
|
304
302
|
format?: BaseRingFormat
|
|
305
|
-
label?: string
|
|
306
303
|
size?: BaseRingSize
|
|
307
304
|
total?: number
|
|
308
305
|
transitionColors?: boolean
|
package/package.json
CHANGED
package/uno.config.ts
CHANGED
|
@@ -38,6 +38,9 @@ export const shortcuts: Record<string, string> = {
|
|
|
38
38
|
'base-box': 'border shadow-sm base-border rounded-lg',
|
|
39
39
|
'base-highlight-indigo': 'border border-indigo-600/35 bg-indigo-600/[0.08] shadow-indigo-600/15 dark:border-indigo-400/35 dark:bg-indigo-400/[0.08] dark:shadow-indigo-400/15',
|
|
40
40
|
'base-surface': 'border base-border base-bg shadow-sm',
|
|
41
|
+
'base-text-border': 'text-gray-200 dark:text-gray-800',
|
|
42
|
+
'base-text-border-group-hover': 'group-hover:text-gray-300 dark:group-hover:text-gray-700',
|
|
43
|
+
'base-text-border-hover': 'hover:text-gray-300 dark:hover:text-gray-700',
|
|
41
44
|
'field-disabled': 'opacity-50 cursor-not-allowed',
|
|
42
45
|
'field-uppercase': 'uppercase [&_*]:uppercase [&_input::placeholder]:uppercase',
|
|
43
46
|
'scroll-y-stable': 'overflow-y-auto [scrollbar-gutter:stable]',
|