design-system-dashboard-devmunity 0.2.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 CHANGED
@@ -1,3 +1,12 @@
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
+
1
10
  # [0.2.0](https://github.com/vicventum/design-system-dashboard-devmunity/compare/v0.1.0...v0.2.0) (2025-11-14)
2
11
 
3
12
 
@@ -0,0 +1 @@
1
+ export default /* ui */ {}
@@ -1,3 +1,4 @@
1
1
  export { default as card } from './components/card.js'
2
2
  export { default as button } from './components/button.js'
3
3
  export { default as modal } from './components/modal.js'
4
+ // export { default as dropdownMenu } from './components/dropdown-menu.js'
@@ -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>
@@ -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>
@@ -9,7 +9,7 @@ const modalDanger = overlay.create(CModalDanger)
9
9
  </script>
10
10
 
11
11
  <template>
12
- <div class="h-screen">
12
+ <div class="mb-16 min-h-full">
13
13
  <UContainer>
14
14
  <BCardInner class="h-full">
15
15
  <BCard :has-footer-divider="false">
@@ -110,6 +110,44 @@ const modalDanger = overlay.create(CModalDanger)
110
110
 
111
111
  <!-- <template #footer> footer </template> -->
112
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>
113
151
  </UContainer>
114
152
  </div>
115
153
  </template>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "design-system-dashboard-devmunity",
3
3
  "type": "module",
4
- "version": "0.2.0",
4
+ "version": "0.3.0",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev",