@nexxtmove/ui 0.1.72 → 0.1.73
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/dist/index.d.ts +2 -1
- package/dist/index.js +809 -804
- package/package.json +1 -1
- package/src/components/Button/Button.vue +12 -3
package/package.json
CHANGED
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
import NexxtIcon from '../Icon/Icon.vue'
|
|
3
3
|
|
|
4
4
|
interface NexxtButtonProps {
|
|
5
|
-
variant?: 'primary' | 'secondary' | 'success' | 'danger' | 'link'
|
|
5
|
+
variant?: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'link'
|
|
6
6
|
icon?: InstanceType<typeof NexxtIcon>['name']
|
|
7
7
|
iconRight?: boolean
|
|
8
8
|
disabled?: boolean
|
|
9
9
|
loading?: boolean
|
|
10
10
|
buttonType?: 'button' | 'submit' | 'reset'
|
|
11
|
+
rounded?: boolean
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
defineOptions({
|
|
@@ -18,6 +19,7 @@ const {
|
|
|
18
19
|
variant = 'primary',
|
|
19
20
|
buttonType = 'button',
|
|
20
21
|
loading = false,
|
|
22
|
+
rounded = false,
|
|
21
23
|
} = defineProps<NexxtButtonProps>()
|
|
22
24
|
</script>
|
|
23
25
|
|
|
@@ -26,7 +28,8 @@ const {
|
|
|
26
28
|
:type="buttonType"
|
|
27
29
|
:disabled="disabled"
|
|
28
30
|
:class="[
|
|
29
|
-
'button relative flex h-10 cursor-pointer items-center justify-center overflow-hidden
|
|
31
|
+
'button relative flex h-10 cursor-pointer items-center justify-center overflow-hidden transition-colors duration-200 focus-visible:outline-3 disabled:cursor-not-allowed',
|
|
32
|
+
rounded ? 'rounded-full' : 'rounded-lg',
|
|
30
33
|
`button-${variant}`,
|
|
31
34
|
$slots.default ?? 'w-10',
|
|
32
35
|
!$slots.default && icon ? 'aspect-square px-0' : '',
|
|
@@ -59,7 +62,13 @@ const {
|
|
|
59
62
|
leave-from-class="opacity-100"
|
|
60
63
|
leave-to-class="opacity-0"
|
|
61
64
|
>
|
|
62
|
-
<div
|
|
65
|
+
<div
|
|
66
|
+
v-if="loading"
|
|
67
|
+
:class="[
|
|
68
|
+
'absolute inset-0 flex items-center justify-center',
|
|
69
|
+
rounded ? 'rounded-full' : 'rounded-lg',
|
|
70
|
+
]"
|
|
71
|
+
>
|
|
63
72
|
<NexxtIcon name="spinner-third" type="light" class="fa-spin absolute text-sm" />
|
|
64
73
|
</div>
|
|
65
74
|
</Transition>
|