@saasmakers/ui 2.0.63 → 2.0.64
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.
|
@@ -143,7 +143,7 @@ function processGoogleCallback(event: MessageEvent) {
|
|
|
143
143
|
:alt="t('appleLogo')"
|
|
144
144
|
class="dark:invert"
|
|
145
145
|
:class="{
|
|
146
|
-
'mr-2 w-4': size === '
|
|
146
|
+
'mr-2 w-4': size === 'sm',
|
|
147
147
|
'mr-2.5 w-4.5': size === 'base',
|
|
148
148
|
'mr-2.5 w-5': size === 'lg',
|
|
149
149
|
}"
|
|
@@ -154,7 +154,7 @@ function processGoogleCallback(event: MessageEvent) {
|
|
|
154
154
|
v-else-if="provider === 'google'"
|
|
155
155
|
:alt="t('googleLogo')"
|
|
156
156
|
:class="{
|
|
157
|
-
'mr-2 w-4': size === '
|
|
157
|
+
'mr-2 w-4': size === 'sm',
|
|
158
158
|
'mr-2.5 w-4.5': size === 'base',
|
|
159
159
|
'mr-2.5 w-5': size === 'lg',
|
|
160
160
|
}"
|
|
@@ -45,9 +45,6 @@ const contentSize = computed((): BaseSize => {
|
|
|
45
45
|
case 'sm': {
|
|
46
46
|
return 'xs'
|
|
47
47
|
}
|
|
48
|
-
case 'xs': {
|
|
49
|
-
return '2xs'
|
|
50
|
-
}
|
|
51
48
|
default: {
|
|
52
49
|
return 'sm'
|
|
53
50
|
}
|
|
@@ -86,7 +83,6 @@ function onClick(event: MouseEvent) {
|
|
|
86
83
|
'shadow-sm': !light,
|
|
87
84
|
'rounded-lg': shape !== 'circle',
|
|
88
85
|
'rounded-full': shape === 'circle',
|
|
89
|
-
'h-8 w-8': size === 'xs' && hasFixedSize && !confirming,
|
|
90
86
|
'h-10 w-10': size === 'sm' && hasFixedSize && !confirming,
|
|
91
87
|
'h-12 w-12': size === 'base' && hasFixedSize && !confirming,
|
|
92
88
|
'h-14 w-14': size === 'lg' && hasFixedSize && !confirming,
|
|
@@ -113,7 +109,6 @@ function onClick(event: MouseEvent) {
|
|
|
113
109
|
'border-white dark:border-gray-900 text-white dark:text-black': color === 'white' && light,
|
|
114
110
|
'hover:border-black dark:hover:border-white hover:text-black dark:hover:text-white': color !== 'white' && light && !disabled && !loading,
|
|
115
111
|
'hover:bg-white dark:hover:bg-gray-900 hover:text-gray-800 dark:hover:text-gray-200': color === 'white' && light && !disabled && !loading,
|
|
116
|
-
'h-8 px-4': size === 'xs' && (!hasFixedSize || confirming),
|
|
117
112
|
'h-10 px-5': size === 'sm' && (!hasFixedSize || confirming),
|
|
118
113
|
'h-12 px-6': size === 'base' && (!hasFixedSize || confirming),
|
|
119
114
|
'h-14 px-6.5': size === 'lg' && (!hasFixedSize || confirming),
|
|
@@ -6,6 +6,7 @@ const props = withDefaults(defineProps<BaseRing>(), {
|
|
|
6
6
|
completed: 0,
|
|
7
7
|
dashed: false,
|
|
8
8
|
format: 'count',
|
|
9
|
+
revealLabelOnHover: false,
|
|
9
10
|
size: 'base',
|
|
10
11
|
total: 0,
|
|
11
12
|
transitionColors: false,
|
|
@@ -18,7 +19,7 @@ const emit = defineEmits<{
|
|
|
18
19
|
const sizes = {
|
|
19
20
|
base: {
|
|
20
21
|
inset: 1,
|
|
21
|
-
size:
|
|
22
|
+
size: 30,
|
|
22
23
|
strokeWidth: 3,
|
|
23
24
|
},
|
|
24
25
|
lg: {
|
|
@@ -26,6 +27,11 @@ const sizes = {
|
|
|
26
27
|
size: 36,
|
|
27
28
|
strokeWidth: 4,
|
|
28
29
|
},
|
|
30
|
+
sm: {
|
|
31
|
+
inset: 1,
|
|
32
|
+
size: 24,
|
|
33
|
+
strokeWidth: 2.5,
|
|
34
|
+
},
|
|
29
35
|
} as const
|
|
30
36
|
|
|
31
37
|
const geometry = computed(() => {
|
|
@@ -66,28 +72,6 @@ const centerLabel = computed(() => {
|
|
|
66
72
|
return String(clampedCompleted.value)
|
|
67
73
|
})
|
|
68
74
|
|
|
69
|
-
const progressColor = computed(() => {
|
|
70
|
-
const progressPercentage = percentage.value
|
|
71
|
-
|
|
72
|
-
if (progressPercentage === 100) {
|
|
73
|
-
return 'var(--indigo-800)'
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (progressPercentage >= 75) {
|
|
77
|
-
return 'var(--indigo-700)'
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
if (progressPercentage >= 50) {
|
|
81
|
-
return 'var(--indigo-500)'
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (progressPercentage >= 25) {
|
|
85
|
-
return 'var(--indigo-400)'
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return 'var(--indigo-300)'
|
|
89
|
-
})
|
|
90
|
-
|
|
91
75
|
// Visual gap (in viewBox units) between segments, widened for fewer steps.
|
|
92
76
|
function gapForTotal(total: number) {
|
|
93
77
|
if (total <= 4) {
|
|
@@ -164,7 +148,7 @@ function onClick(event: MouseEvent) {
|
|
|
164
148
|
<template>
|
|
165
149
|
<component
|
|
166
150
|
:is="clickable ? 'button' : 'div'"
|
|
167
|
-
class="inline-flex"
|
|
151
|
+
class="group inline-flex"
|
|
168
152
|
:aria-expanded="expanded"
|
|
169
153
|
:aria-label="label"
|
|
170
154
|
:class="{ 'cursor-pointer': clickable }"
|
|
@@ -183,14 +167,17 @@ function onClick(event: MouseEvent) {
|
|
|
183
167
|
v-for="(arc, index) in ringArcs"
|
|
184
168
|
:key="index"
|
|
185
169
|
:class="{
|
|
186
|
-
'stroke-gray-
|
|
170
|
+
'stroke-gray-200 dark:stroke-gray-800': !arc.filled,
|
|
171
|
+
'stroke-indigo-400 dark:stroke-indigo-600': arc.filled && percentage < 25,
|
|
172
|
+
'stroke-indigo-500 dark:stroke-indigo-500': arc.filled && percentage >= 25 && percentage < 50,
|
|
173
|
+
'stroke-indigo-600 dark:stroke-indigo-400': arc.filled && percentage >= 50 && percentage < 75,
|
|
174
|
+
'stroke-indigo-700 dark:stroke-indigo-300': arc.filled && percentage >= 75,
|
|
187
175
|
'transition-[stroke] duration-150 motion-reduce:transition-none': transitionColors,
|
|
188
176
|
}"
|
|
189
177
|
:cx="geometry.center"
|
|
190
178
|
:cy="geometry.center"
|
|
191
179
|
fill="none"
|
|
192
180
|
:r="geometry.radius"
|
|
193
|
-
:stroke="arc.filled ? progressColor : undefined"
|
|
194
181
|
:stroke-dasharray="arc.dashArray"
|
|
195
182
|
:stroke-dashoffset="arc.dashOffset"
|
|
196
183
|
stroke-linecap="butt"
|
|
@@ -202,8 +189,10 @@ function onClick(event: MouseEvent) {
|
|
|
202
189
|
v-if="centerLabel"
|
|
203
190
|
class="fill-gray-600 font-bold tabular-nums dark:fill-gray-400"
|
|
204
191
|
:class="{
|
|
205
|
-
'text-2xs': size === 'base',
|
|
192
|
+
'text-2xs': size === 'base' || size === 'sm',
|
|
206
193
|
'text-3xs': size === 'lg',
|
|
194
|
+
'opacity-0 transition-opacity duration-150 motion-reduce:transition-none group-hover:opacity-100 group-focus-visible:opacity-100': revealLabelOnHover && !expanded,
|
|
195
|
+
'opacity-100': !revealLabelOnHover || expanded,
|
|
207
196
|
}"
|
|
208
197
|
dominant-baseline="central"
|
|
209
198
|
text-anchor="middle"
|
package/app/types/bases.d.ts
CHANGED
|
@@ -74,7 +74,6 @@ export type BaseButtonSize
|
|
|
74
74
|
= | 'base'
|
|
75
75
|
| 'lg'
|
|
76
76
|
| 'sm'
|
|
77
|
-
| 'xs'
|
|
78
77
|
|
|
79
78
|
export type BaseButtonType = 'button' | 'reset' | 'submit'
|
|
80
79
|
|
|
@@ -304,6 +303,7 @@ export interface BaseRing {
|
|
|
304
303
|
expanded?: boolean
|
|
305
304
|
format?: BaseRingFormat
|
|
306
305
|
label?: string
|
|
306
|
+
revealLabelOnHover?: boolean
|
|
307
307
|
size?: BaseRingSize
|
|
308
308
|
total?: number
|
|
309
309
|
transitionColors?: boolean
|
|
@@ -317,7 +317,7 @@ export interface BaseRingArc {
|
|
|
317
317
|
|
|
318
318
|
export type BaseRingFormat = 'count' | 'none' | 'percent'
|
|
319
319
|
|
|
320
|
-
export type BaseRingSize = 'base' | 'lg'
|
|
320
|
+
export type BaseRingSize = 'base' | 'lg' | 'sm'
|
|
321
321
|
|
|
322
322
|
export interface BaseShortcut {
|
|
323
323
|
active?: boolean
|