design-system-dashboard-devmunity 0.1.0 → 0.3.0
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/CHANGELOG.md +18 -0
- package/app/assets/css/themes/components/dropdown-menu.js +1 -0
- package/app/assets/css/themes/components/modal.js +14 -0
- package/app/assets/css/themes/index.js +2 -0
- package/app/components/a/button/a-button-avatar-dropdown.vue +41 -0
- package/app/components/a/{a-button-back.vue → button/a-button-back.vue} +3 -3
- package/app/components/a/dropdown/a-dropdown-avatar.vue +65 -0
- package/app/components/a/pill/a-pill.vue +104 -0
- package/app/components/b/card/b-card-header.vue +2 -13
- package/app/components/b/modal/b-modal.vue +47 -68
- package/app/components/c/modal/c-modal-danger.vue +67 -0
- package/app/components/d/d-action-buttons.vue +99 -0
- package/app/pages/test.vue +103 -9
- package/commitlint.config.js +8 -1
- package/package.json +1 -1
- package/public/media/img/user-unknown.png +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
# [0.3.0](https://github.com/vicventum/design-system-dashboard-devmunity/compare/v0.2.0...v0.3.0) (2025-11-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **components:** :sparkles: Crea componente `ADropdownAvatar` ([0aa9677](https://github.com/vicventum/design-system-dashboard-devmunity/commit/0aa96779530ed7c16389db6fb1ea9ead99e495ca))
|
|
7
|
+
* **components:** :sparkles: Crea componente `APill` ([5ed606e](https://github.com/vicventum/design-system-dashboard-devmunity/commit/5ed606e86f0e29d8c1d09e55d9e6d803e496bcd1))
|
|
8
|
+
* **components:** :sparkles: Crea componente AButtonAvatarDropdown ([d9e283d](https://github.com/vicventum/design-system-dashboard-devmunity/commit/d9e283dc20d3f70e214c56d9b26c55d688bec254))
|
|
9
|
+
|
|
10
|
+
# [0.2.0](https://github.com/vicventum/design-system-dashboard-devmunity/compare/v0.1.0...v0.2.0) (2025-11-14)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **components:** :sparkles: Crea componente BModal ([6218f3a](https://github.com/vicventum/design-system-dashboard-devmunity/commit/6218f3aeeeb0695b05c00c64da6c3212b07afa08))
|
|
16
|
+
* **components:** :sparkles: Crea componente CModalDanger ([1e3f7bb](https://github.com/vicventum/design-system-dashboard-devmunity/commit/1e3f7bb8778f970268b08043d70fef0fb0e7b10e))
|
|
17
|
+
* **components:** :sparkles: Crea componente DActionButtons ([f7725cb](https://github.com/vicventum/design-system-dashboard-devmunity/commit/f7725cb5812b77628981abfb351b64e086e190c4))
|
|
18
|
+
|
|
1
19
|
# [0.1.0](https://github.com/vicventum/design-system-dashboard-devmunity/compare/v0.0.6...v0.1.0) (2025-11-12)
|
|
2
20
|
|
|
3
21
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default /* ui */ {}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script lang="jsx" setup>
|
|
2
|
+
const props = defineProps({
|
|
3
|
+
src: {
|
|
4
|
+
type: String,
|
|
5
|
+
default: '/media/img/user-unknown.png',
|
|
6
|
+
required: false,
|
|
7
|
+
},
|
|
8
|
+
buttonSize: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: 'md',
|
|
11
|
+
required: false,
|
|
12
|
+
},
|
|
13
|
+
avatarSize: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: 'sm',
|
|
16
|
+
required: false,
|
|
17
|
+
},
|
|
18
|
+
})
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<!-- <UButton
|
|
23
|
+
class="bg-color-primary-100 flex items-center gap-2 rounded-full py-1 pr-2 pl-1 text-neutral-800 hover:text-neutral-50"
|
|
24
|
+
>
|
|
25
|
+
<UAvatar :src="src" size="sm" />
|
|
26
|
+
<UIcon name="heroicons:chevron-down-20-solid" class="size-5" />
|
|
27
|
+
</UButton> -->
|
|
28
|
+
<UButton
|
|
29
|
+
:avatar="{
|
|
30
|
+
src,
|
|
31
|
+
size: avatarSize,
|
|
32
|
+
}"
|
|
33
|
+
:size="buttonSize"
|
|
34
|
+
trailing-icon="heroicons:chevron-down-20-solid"
|
|
35
|
+
color="primary"
|
|
36
|
+
variant="ghost"
|
|
37
|
+
class="rounded-full"
|
|
38
|
+
>
|
|
39
|
+
<slot />
|
|
40
|
+
</UButton>
|
|
41
|
+
</template>
|
|
@@ -10,10 +10,10 @@ const props = defineProps({
|
|
|
10
10
|
default: '',
|
|
11
11
|
required: false,
|
|
12
12
|
},
|
|
13
|
-
|
|
13
|
+
hasBackAction: {
|
|
14
14
|
type: Boolean,
|
|
15
15
|
default: false,
|
|
16
|
-
required:
|
|
16
|
+
required: false,
|
|
17
17
|
},
|
|
18
18
|
})
|
|
19
19
|
|
|
@@ -22,7 +22,7 @@ const router = useRouter()
|
|
|
22
22
|
|
|
23
23
|
function handleClickLeftButtonIcon() {
|
|
24
24
|
emit('on-click')
|
|
25
|
-
if (props.
|
|
25
|
+
if (props.hasBackAction && !props.to && props.icon.includes('arrow-left')) {
|
|
26
26
|
router.back()
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<script lang="jsx" setup>
|
|
2
|
+
const props = defineProps({
|
|
3
|
+
items: {
|
|
4
|
+
type: Array,
|
|
5
|
+
default: () => [],
|
|
6
|
+
required: true,
|
|
7
|
+
},
|
|
8
|
+
userName: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: '',
|
|
11
|
+
required: true,
|
|
12
|
+
},
|
|
13
|
+
userEmail: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: '',
|
|
16
|
+
required: false,
|
|
17
|
+
},
|
|
18
|
+
userTo: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: '',
|
|
21
|
+
required: false,
|
|
22
|
+
},
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
const uiStyles = computed(() => {
|
|
26
|
+
if (props.userTo) return {}
|
|
27
|
+
return {
|
|
28
|
+
item: 'data-highlighted:first:before:bg-transparent data-[state=open]:first:before:bg-transparent',
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
const itemsComputed = computed(() => [
|
|
33
|
+
{
|
|
34
|
+
userName: props.userName,
|
|
35
|
+
userEmail: props.userEmail,
|
|
36
|
+
slot: 'user',
|
|
37
|
+
onSelect: () => {
|
|
38
|
+
const path = props.userTo
|
|
39
|
+
if (path) navigateTo(path)
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
...props.items,
|
|
43
|
+
])
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<template>
|
|
47
|
+
<UDropdownMenu :items="itemsComputed" :ui="uiStyles">
|
|
48
|
+
<slot />
|
|
49
|
+
|
|
50
|
+
<template #user="{ item }">
|
|
51
|
+
<div class="text-start">
|
|
52
|
+
<span class="text-highlighted block text-lg font-bold">
|
|
53
|
+
{{ item.userName }}
|
|
54
|
+
</span>
|
|
55
|
+
<span v-if="item?.userEmail" class="text-muted block truncate font-medium">
|
|
56
|
+
{{ item?.userEmail }}
|
|
57
|
+
</span>
|
|
58
|
+
</div>
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<template v-for="(_, name) in $slots" v-slot:[name]="slotData">
|
|
62
|
+
<slot :name="name" v-bind="slotData" />
|
|
63
|
+
</template>
|
|
64
|
+
</UDropdownMenu>
|
|
65
|
+
</template>
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<script lang="jsx" setup>
|
|
2
|
+
const props = defineProps({
|
|
3
|
+
src: {
|
|
4
|
+
type: String,
|
|
5
|
+
default: '/media/img/user-unknown.png',
|
|
6
|
+
required: false,
|
|
7
|
+
},
|
|
8
|
+
label: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: '',
|
|
11
|
+
required: false,
|
|
12
|
+
},
|
|
13
|
+
color: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: 'neutral',
|
|
16
|
+
required: false,
|
|
17
|
+
},
|
|
18
|
+
variant: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: 'outline',
|
|
21
|
+
required: false,
|
|
22
|
+
validator: (value) => ['solid', 'outline', 'soft', 'subtle'].includes(value),
|
|
23
|
+
},
|
|
24
|
+
size: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: 'sm',
|
|
27
|
+
required: false,
|
|
28
|
+
validator: (value) => ['xs', 'sm', 'md', 'lg', 'xl'].includes(value),
|
|
29
|
+
},
|
|
30
|
+
hasAvatar: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: true,
|
|
33
|
+
required: false,
|
|
34
|
+
},
|
|
35
|
+
isClosable: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: true,
|
|
38
|
+
required: false,
|
|
39
|
+
},
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
const emit = defineEmits('on-close')
|
|
43
|
+
|
|
44
|
+
const trailingIconSize = computed(() => {
|
|
45
|
+
const sizeMap = {
|
|
46
|
+
xs: 'size-3.5 ',
|
|
47
|
+
sm: 'size-3.5 ',
|
|
48
|
+
md: 'size-3.5 ',
|
|
49
|
+
lg: 'size-3.5 ',
|
|
50
|
+
xl: 'size-4 ',
|
|
51
|
+
}
|
|
52
|
+
return sizeMap[props.size] || 'md'
|
|
53
|
+
})
|
|
54
|
+
const textSize = computed(() => {
|
|
55
|
+
const sizeMap = {
|
|
56
|
+
xs: 'text-xs p-1 gap-1.5',
|
|
57
|
+
sm: 'text-xs p-1 gap-1.5',
|
|
58
|
+
md: 'text-sm p-1 gap-1.5',
|
|
59
|
+
lg: 'text-sm p-1 gap-2',
|
|
60
|
+
xl: 'text-base p-1 gap-2 ',
|
|
61
|
+
}
|
|
62
|
+
return sizeMap[props.size] || 'md'
|
|
63
|
+
})
|
|
64
|
+
</script>
|
|
65
|
+
|
|
66
|
+
<template>
|
|
67
|
+
<div class="flex gap-2">
|
|
68
|
+
<UBadge
|
|
69
|
+
:avatar="
|
|
70
|
+
hasAvatar
|
|
71
|
+
? {
|
|
72
|
+
src,
|
|
73
|
+
size,
|
|
74
|
+
}
|
|
75
|
+
: null
|
|
76
|
+
"
|
|
77
|
+
:label="label"
|
|
78
|
+
:trailing-icon="isClosable ? 'heroicons:x-mark' : ''"
|
|
79
|
+
:size="size"
|
|
80
|
+
:ui="{
|
|
81
|
+
base: textSize,
|
|
82
|
+
}"
|
|
83
|
+
:color="color"
|
|
84
|
+
:variant="variant"
|
|
85
|
+
class="rounded-full font-normal"
|
|
86
|
+
>
|
|
87
|
+
<template #trailing>
|
|
88
|
+
<UButton
|
|
89
|
+
v-if="isClosable"
|
|
90
|
+
:size="size"
|
|
91
|
+
:ui="{
|
|
92
|
+
leadingIcon: trailingIconSize,
|
|
93
|
+
icon: trailingIconSize,
|
|
94
|
+
}"
|
|
95
|
+
:color="color"
|
|
96
|
+
:variant="variant === 'solid' ? 'solid' : 'icon'"
|
|
97
|
+
icon="heroicons:x-mark"
|
|
98
|
+
class="rounded-full p-0.5 font-normal"
|
|
99
|
+
@click="emit('on-close')"
|
|
100
|
+
/>
|
|
101
|
+
</template>
|
|
102
|
+
</UBadge>
|
|
103
|
+
</div>
|
|
104
|
+
</template>
|
|
@@ -12,21 +12,11 @@ const props = defineProps({
|
|
|
12
12
|
default: '',
|
|
13
13
|
required: false,
|
|
14
14
|
},
|
|
15
|
-
hasBorder: {
|
|
16
|
-
type: Boolean,
|
|
17
|
-
default: false,
|
|
18
|
-
required: false,
|
|
19
|
-
},
|
|
20
15
|
variant: {
|
|
21
16
|
type: String,
|
|
22
17
|
default: 'main', // main, secondary
|
|
23
18
|
required: false,
|
|
24
19
|
},
|
|
25
|
-
variantSubtitle: {
|
|
26
|
-
type: String,
|
|
27
|
-
default: 'main',
|
|
28
|
-
required: false,
|
|
29
|
-
},
|
|
30
20
|
hasLeftButtonIcon: {
|
|
31
21
|
type: Boolean,
|
|
32
22
|
default: false,
|
|
@@ -68,8 +58,7 @@ function handleClickLeftButtonIcon() {
|
|
|
68
58
|
<BCardInner
|
|
69
59
|
:class="[
|
|
70
60
|
'flex items-center justify-between',
|
|
71
|
-
{ 'bg-neutral-
|
|
72
|
-
{ 'border-y border-neutral-200': hasBorder && variant === 'secondary' },
|
|
61
|
+
{ 'bg-muted border-y border-neutral-200': variant === 'secondary' },
|
|
73
62
|
]"
|
|
74
63
|
>
|
|
75
64
|
<div class="space-y-1">
|
|
@@ -99,7 +88,7 @@ function handleClickLeftButtonIcon() {
|
|
|
99
88
|
v-if="subtitle"
|
|
100
89
|
class="text-sm font-medium"
|
|
101
90
|
:class="{
|
|
102
|
-
'text-
|
|
91
|
+
'text-dimmed': variant === 'secondary',
|
|
103
92
|
}"
|
|
104
93
|
>
|
|
105
94
|
{{ subtitle }}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script lang="
|
|
1
|
+
<script lang="jsx" setup>
|
|
2
2
|
import { resolveComponent } from 'vue'
|
|
3
3
|
import { twMerge } from 'tailwind-merge'
|
|
4
4
|
|
|
@@ -20,6 +20,11 @@ const props = defineProps({
|
|
|
20
20
|
default: '',
|
|
21
21
|
required: true,
|
|
22
22
|
},
|
|
23
|
+
description: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: '',
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
23
28
|
text: {
|
|
24
29
|
type: String,
|
|
25
30
|
default: '',
|
|
@@ -32,7 +37,7 @@ const props = defineProps({
|
|
|
32
37
|
},
|
|
33
38
|
primaryButtonColor: {
|
|
34
39
|
type: String,
|
|
35
|
-
default: '
|
|
40
|
+
default: 'primary',
|
|
36
41
|
required: true,
|
|
37
42
|
},
|
|
38
43
|
secondaryButtonText: {
|
|
@@ -45,34 +50,19 @@ const props = defineProps({
|
|
|
45
50
|
default: true,
|
|
46
51
|
required: false,
|
|
47
52
|
},
|
|
48
|
-
width: {
|
|
49
|
-
type: String,
|
|
50
|
-
default: '',
|
|
51
|
-
required: false,
|
|
52
|
-
},
|
|
53
|
-
widthButtons: {
|
|
54
|
-
type: String,
|
|
55
|
-
default: 'w-40',
|
|
56
|
-
required: false,
|
|
57
|
-
},
|
|
58
53
|
isPrimaryButtonDisabled: {
|
|
59
54
|
type: Boolean,
|
|
60
55
|
default: false,
|
|
61
56
|
required: false,
|
|
62
57
|
},
|
|
63
|
-
|
|
58
|
+
hasButtonsBlock: {
|
|
64
59
|
type: Boolean,
|
|
65
60
|
default: false,
|
|
66
61
|
required: false,
|
|
67
62
|
},
|
|
68
|
-
|
|
63
|
+
classButtons: {
|
|
69
64
|
type: String,
|
|
70
|
-
default: '
|
|
71
|
-
required: false,
|
|
72
|
-
},
|
|
73
|
-
hasBodyExpanded: {
|
|
74
|
-
type: Boolean,
|
|
75
|
-
default: false,
|
|
65
|
+
default: '',
|
|
76
66
|
required: false,
|
|
77
67
|
},
|
|
78
68
|
})
|
|
@@ -92,11 +82,18 @@ const formRef = defineModel('formRef', {
|
|
|
92
82
|
required: false,
|
|
93
83
|
})
|
|
94
84
|
|
|
95
|
-
//
|
|
85
|
+
// Computed
|
|
96
86
|
|
|
97
|
-
const uiStyles =
|
|
87
|
+
// const uiStyles = computed(() => {
|
|
88
|
+
// const baseStyles = {}
|
|
98
89
|
|
|
99
|
-
//
|
|
90
|
+
// // Apply width styles
|
|
91
|
+
// if (props.width) {
|
|
92
|
+
// baseStyles.width = `${props.width}`
|
|
93
|
+
// }
|
|
94
|
+
|
|
95
|
+
// return baseStyles
|
|
96
|
+
// })
|
|
100
97
|
|
|
101
98
|
const formProps = computed(() => {
|
|
102
99
|
// return props.data ? { ref: 'form', state: props.data, onSubmit: handleSubmit } : {}
|
|
@@ -115,55 +112,37 @@ function handleClickSecondaryButton() {
|
|
|
115
112
|
isOpen.value = false
|
|
116
113
|
emit('on-click-secondary-button')
|
|
117
114
|
}
|
|
118
|
-
|
|
119
|
-
// Watch
|
|
120
|
-
|
|
121
|
-
watch(
|
|
122
|
-
() => props.width,
|
|
123
|
-
(width) => {
|
|
124
|
-
if (!width) return null
|
|
125
|
-
|
|
126
|
-
Object.assign(uiStyles, { width: `${props.width}` })
|
|
127
|
-
},
|
|
128
|
-
{ immediate: true }
|
|
129
|
-
)
|
|
130
115
|
</script>
|
|
131
116
|
|
|
132
117
|
<template>
|
|
133
|
-
<UModal v-model="isOpen" :
|
|
134
|
-
<
|
|
135
|
-
<
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
</template>
|
|
142
|
-
</BCardHeader>
|
|
143
|
-
</template>
|
|
144
|
-
|
|
145
|
-
<BCardInner v-if="text" class="p-6">
|
|
118
|
+
<UModal v-model:open="isOpen" :title="title" :description="description">
|
|
119
|
+
<template #header>
|
|
120
|
+
<slot v-if="$slots.header" name="header" />
|
|
121
|
+
</template>
|
|
122
|
+
|
|
123
|
+
<template #body>
|
|
124
|
+
<component :is="state ? UForm : 'section'" v-bind="formProps" @submit="handleSubmit">
|
|
125
|
+
<p v-if="text">
|
|
146
126
|
{{ text }}
|
|
147
|
-
</
|
|
127
|
+
</p>
|
|
148
128
|
<slot v-else />
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
</component>
|
|
129
|
+
</component>
|
|
130
|
+
</template>
|
|
131
|
+
|
|
132
|
+
<template v-if="hasFooter" #footer>
|
|
133
|
+
<slot v-if="$slots.footer" name="footer" />
|
|
134
|
+
<DActionButtons
|
|
135
|
+
v-else
|
|
136
|
+
:primary-button-color="primaryButtonColor"
|
|
137
|
+
:primary-button-text="primaryButtonText"
|
|
138
|
+
:secondary-button-text="secondaryButtonText"
|
|
139
|
+
:is-buttons-block="hasButtonsBlock"
|
|
140
|
+
:is-primary-button-disabled="isPrimaryButtonDisabled"
|
|
141
|
+
:class="twMerge('flex w-full justify-end gap-x-2', classButtons)"
|
|
142
|
+
class-buttons="w-40"
|
|
143
|
+
@on-click-primary-button="handleClickPrimaryButton"
|
|
144
|
+
@on-click-secondary-button="handleClickSecondaryButton"
|
|
145
|
+
/>
|
|
146
|
+
</template>
|
|
168
147
|
</UModal>
|
|
169
148
|
</template>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<script lang="jsx" setup>
|
|
2
|
+
const props = defineProps({
|
|
3
|
+
state: {
|
|
4
|
+
type: Object,
|
|
5
|
+
default: null,
|
|
6
|
+
required: false,
|
|
7
|
+
},
|
|
8
|
+
schema: {
|
|
9
|
+
type: Object,
|
|
10
|
+
default: null,
|
|
11
|
+
required: false,
|
|
12
|
+
},
|
|
13
|
+
title: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: '',
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
description: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: '',
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
text: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: '',
|
|
26
|
+
required: false,
|
|
27
|
+
},
|
|
28
|
+
primaryButtonText: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: 'Eliminar',
|
|
31
|
+
required: false,
|
|
32
|
+
},
|
|
33
|
+
secondaryButtonText: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: 'Cancelar',
|
|
36
|
+
required: false,
|
|
37
|
+
},
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
const emit = defineEmits(['on-click-primary-button', 'on-click-secondary-button'])
|
|
41
|
+
|
|
42
|
+
// Model
|
|
43
|
+
|
|
44
|
+
const isOpen = defineModel({
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false,
|
|
47
|
+
required: true,
|
|
48
|
+
})
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<template>
|
|
52
|
+
<BModal
|
|
53
|
+
v-model="isOpen"
|
|
54
|
+
:title="title"
|
|
55
|
+
:text="text"
|
|
56
|
+
:primary-button-text="primaryButtonText"
|
|
57
|
+
:secondary-button-text="secondaryButtonText"
|
|
58
|
+
:state="state"
|
|
59
|
+
:schema="schema"
|
|
60
|
+
primary-button-color="error"
|
|
61
|
+
is-block-buttons
|
|
62
|
+
@on-click-primary-button="emit('on-click-primary-button')"
|
|
63
|
+
@on-click-secondary-button="emit('on-click-secondary-button')"
|
|
64
|
+
>
|
|
65
|
+
<slot v-if="!text" />
|
|
66
|
+
</BModal>
|
|
67
|
+
</template>
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<script lang="jsx" setup>
|
|
2
|
+
import { twMerge } from 'tailwind-merge'
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
class: {
|
|
6
|
+
type: [String, Object, Array],
|
|
7
|
+
default: () => '',
|
|
8
|
+
required: false,
|
|
9
|
+
},
|
|
10
|
+
classButtons: {
|
|
11
|
+
type: [String, Object, Array],
|
|
12
|
+
default: () => '',
|
|
13
|
+
required: false,
|
|
14
|
+
},
|
|
15
|
+
primaryButtonText: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: '',
|
|
18
|
+
required: false,
|
|
19
|
+
},
|
|
20
|
+
primaryButtonIcon: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: '',
|
|
23
|
+
required: false,
|
|
24
|
+
},
|
|
25
|
+
primaryButtonTo: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: '',
|
|
28
|
+
required: false,
|
|
29
|
+
},
|
|
30
|
+
primaryButtonColor: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: 'primary',
|
|
33
|
+
required: false,
|
|
34
|
+
},
|
|
35
|
+
secondaryButtonText: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: '',
|
|
38
|
+
required: false,
|
|
39
|
+
},
|
|
40
|
+
secondaryButtonTo: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: '',
|
|
43
|
+
required: false,
|
|
44
|
+
},
|
|
45
|
+
hasButtonsBlock: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: false,
|
|
48
|
+
required: false,
|
|
49
|
+
},
|
|
50
|
+
isReverse: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: false,
|
|
53
|
+
required: false,
|
|
54
|
+
},
|
|
55
|
+
isPrimaryButtonDisabled: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: false,
|
|
58
|
+
required: false,
|
|
59
|
+
},
|
|
60
|
+
isSecondaryButtonDisabled: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: false,
|
|
63
|
+
required: false,
|
|
64
|
+
},
|
|
65
|
+
})
|
|
66
|
+
const emit = defineEmits(['on-click-primary-button', 'on-click-secondary-button'])
|
|
67
|
+
|
|
68
|
+
const classCard = computed(() => twMerge('flex gap-x-4', props.class, props.isReverse && 'flex-row-reverse'))
|
|
69
|
+
const classButtonsComputed = computed(() =>
|
|
70
|
+
twMerge('justify-center w-[150px]', props.hasButtonsBlock && 'flex-auto', props.classButtons)
|
|
71
|
+
)
|
|
72
|
+
</script>
|
|
73
|
+
|
|
74
|
+
<template>
|
|
75
|
+
<footer :class="classCard">
|
|
76
|
+
<UButton
|
|
77
|
+
v-if="secondaryButtonText"
|
|
78
|
+
:to="secondaryButtonTo"
|
|
79
|
+
:label="secondaryButtonText"
|
|
80
|
+
:disabled="isSecondaryButtonDisabled"
|
|
81
|
+
:class="classButtonsComputed"
|
|
82
|
+
variant="outline"
|
|
83
|
+
color="neutral"
|
|
84
|
+
@click="$emit('on-click-secondary-button')"
|
|
85
|
+
/>
|
|
86
|
+
<UButton
|
|
87
|
+
v-if="primaryButtonText"
|
|
88
|
+
:label="primaryButtonText"
|
|
89
|
+
:to="primaryButtonTo"
|
|
90
|
+
:icon="primaryButtonIcon"
|
|
91
|
+
:color="primaryButtonColor"
|
|
92
|
+
:disabled="isPrimaryButtonDisabled"
|
|
93
|
+
:class="classButtonsComputed"
|
|
94
|
+
type="submit"
|
|
95
|
+
trailing
|
|
96
|
+
@click="$emit('on-click-primary-button')"
|
|
97
|
+
/>
|
|
98
|
+
</footer>
|
|
99
|
+
</template>
|
package/app/pages/test.vue
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
<script lang="
|
|
1
|
+
<script lang="jsx" setup>
|
|
2
|
+
import { CModalDanger } from '#components'
|
|
3
|
+
|
|
4
|
+
const modelIsOpenModal = ref(false)
|
|
5
|
+
const overlay = useOverlay()
|
|
6
|
+
|
|
7
|
+
// Abriendo modal de forma programática (mientras no sea necesario pasar slots)
|
|
8
|
+
const modalDanger = overlay.create(CModalDanger)
|
|
9
|
+
</script>
|
|
2
10
|
|
|
3
11
|
<template>
|
|
4
|
-
<div class="h-
|
|
12
|
+
<div class="mb-16 min-h-full">
|
|
5
13
|
<UContainer>
|
|
6
14
|
<BCardInner class="h-full">
|
|
7
15
|
<BCard :has-footer-divider="false">
|
|
@@ -23,7 +31,12 @@
|
|
|
23
31
|
<template #header>
|
|
24
32
|
<BCardHeader title="Crear una nueva actividad" subtitle="Subtitle" has-left-button-icon>
|
|
25
33
|
<template #actions>
|
|
26
|
-
<
|
|
34
|
+
<DActionButtons
|
|
35
|
+
primary-button-text="Guardar"
|
|
36
|
+
secondary-button-text="Cancelar"
|
|
37
|
+
secondary-button-icon="heroicons:pencil"
|
|
38
|
+
is-block-buttons
|
|
39
|
+
/>
|
|
27
40
|
</template>
|
|
28
41
|
</BCardHeader>
|
|
29
42
|
</template>
|
|
@@ -38,22 +51,103 @@
|
|
|
38
51
|
title="Crear una nueva actividad"
|
|
39
52
|
subtitle="Subtitle"
|
|
40
53
|
variant="secondary"
|
|
41
|
-
variant-subtitle="secondary"
|
|
42
54
|
class="my-6"
|
|
43
55
|
class-title=""
|
|
44
|
-
has-border
|
|
45
56
|
>
|
|
46
57
|
<template #actions>
|
|
47
58
|
<UButton label="Action" />
|
|
48
59
|
</template>
|
|
49
60
|
</BCardHeader>
|
|
50
61
|
|
|
51
|
-
<BCardInner>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
62
|
+
<BCardInner class="space-y-2">
|
|
63
|
+
<p>
|
|
64
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci eos perspiciatis
|
|
65
|
+
asperiores suscipit voluptate magni excepturi. Doloribus in fugit quam voluptatibus,
|
|
66
|
+
molestiae maxime illum explicabo ut corrupti, distinctio atque dolor.
|
|
67
|
+
</p>
|
|
68
|
+
|
|
69
|
+
<DActionButtons
|
|
70
|
+
primary-button-text="Guardar"
|
|
71
|
+
secondary-button-text="Cancelar"
|
|
72
|
+
secondary-button-icon="heroicons:pencil"
|
|
73
|
+
class-buttons="w-[200px]"
|
|
74
|
+
has-buttons-block
|
|
75
|
+
/>
|
|
55
76
|
</BCardInner>
|
|
56
77
|
</BCard>
|
|
78
|
+
|
|
79
|
+
<hr class="my-6" />
|
|
80
|
+
|
|
81
|
+
<UButton label="Open modal" @click="modelIsOpenModal = !modelIsOpenModal" />
|
|
82
|
+
<!-- <UButton label="Open modal danger" @click="modelIsOpenModalDanger = !modelIsOpenModalDanger" /> -->
|
|
83
|
+
<UButton
|
|
84
|
+
label="Open modal danger"
|
|
85
|
+
color="error"
|
|
86
|
+
@click="
|
|
87
|
+
modalDanger.open({
|
|
88
|
+
title: 'Title Danger',
|
|
89
|
+
text: 'Lorem ipsum, dolor sit amet consectetur adipisicing elit. Qui aut exercitationem necessitatibus, perspiciatis vel suscipit nam. Facilis, placeat! Dicta quo eveniet rerum officiis quibusdam laborum error necessitatibus sequi itaque praesentium.',
|
|
90
|
+
onOnClickSecondaryButton: () => {
|
|
91
|
+
modalDanger.close()
|
|
92
|
+
},
|
|
93
|
+
})
|
|
94
|
+
"
|
|
95
|
+
/>
|
|
96
|
+
|
|
97
|
+
<BModal
|
|
98
|
+
v-model="modelIsOpenModal"
|
|
99
|
+
title="Marcar como completada"
|
|
100
|
+
class-button="justify-end"
|
|
101
|
+
class="w-[700px]"
|
|
102
|
+
>
|
|
103
|
+
<!-- <template #header> header </template> -->
|
|
104
|
+
|
|
105
|
+
<p class="h-screen">
|
|
106
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam pariatur, suscipit
|
|
107
|
+
veritatis delectus architecto hic non quidem ducimus, cum ex alias obcaecati enim maiores
|
|
108
|
+
animi nesciunt, perferendis commodi in quae.
|
|
109
|
+
</p>
|
|
110
|
+
|
|
111
|
+
<!-- <template #footer> footer </template> -->
|
|
112
|
+
</BModal>
|
|
113
|
+
|
|
114
|
+
<hr class="my-6" />
|
|
115
|
+
|
|
116
|
+
<ADropdownAvatar
|
|
117
|
+
:items="[
|
|
118
|
+
{
|
|
119
|
+
label: 'Configuraciones',
|
|
120
|
+
icon: 'i-heroicons-cog-8-tooth',
|
|
121
|
+
onSelect: () => {
|
|
122
|
+
navigateTo('/')
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
test: 'test',
|
|
127
|
+
slot: 'test',
|
|
128
|
+
},
|
|
129
|
+
]"
|
|
130
|
+
user-name="Victor Alvarez"
|
|
131
|
+
user-email="test@test.com"
|
|
132
|
+
user-to="/"
|
|
133
|
+
>
|
|
134
|
+
<AButtonAvatarDropdown />
|
|
135
|
+
|
|
136
|
+
<template #test="{ item }">
|
|
137
|
+
{{ item.test }}
|
|
138
|
+
</template>
|
|
139
|
+
</ADropdownAvatar>
|
|
140
|
+
|
|
141
|
+
<hr class="my-6" />
|
|
142
|
+
|
|
143
|
+
<!-- <APillAvatar text="test 1" /> -->
|
|
144
|
+
<p>
|
|
145
|
+
<APillAvatar label="xs" size="xs" />
|
|
146
|
+
<APillAvatar label="sm" size="sm" color="warning" variant="subtle" />
|
|
147
|
+
<APillAvatar label="md" size="md" color="error" />
|
|
148
|
+
<APillAvatar label="lg" size="lg" color="success" />
|
|
149
|
+
<APillAvatar label="xl" size="xl" />
|
|
150
|
+
</p>
|
|
57
151
|
</UContainer>
|
|
58
152
|
</div>
|
|
59
153
|
</template>
|
package/commitlint.config.js
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
-
export default {
|
|
1
|
+
export default {
|
|
2
|
+
extends: ['@commitlint/config-conventional'],
|
|
3
|
+
rules: {
|
|
4
|
+
// 'body-max-line-length': [0],
|
|
5
|
+
'body-max-line-length': [2, 'always', 500],
|
|
6
|
+
'header-max-length': [2, 'always', 120],
|
|
7
|
+
},
|
|
8
|
+
}
|
package/package.json
CHANGED
|
Binary file
|