sprintify-ui 0.0.20 → 0.0.22
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/sprintify-ui.es.js +6411 -4859
- package/dist/types/src/components/BaseLayoutNotificationDropdown.vue.d.ts +24 -0
- package/dist/types/src/components/BaseLayoutNotificationItem.vue.d.ts +14 -0
- package/dist/types/src/components/BaseLayoutSidebarConfigurable.vue.d.ts +21 -2
- package/dist/types/src/components/BaseLayoutStackedConfigurable.vue.d.ts +21 -2
- package/dist/types/src/components/BaseMenu.vue.d.ts +17 -15
- package/dist/types/src/components/index.d.ts +2 -1
- package/dist/types/src/index.d.ts +12 -0
- package/dist/types/src/types/Notification.d.ts +8 -0
- package/dist/types/src/types/types.d.ts +9 -1
- package/package.json +6 -3
- package/src/components/BaseLayoutNotificationDropdown.vue +101 -0
- package/src/components/BaseLayoutNotificationItem.vue +58 -0
- package/src/components/BaseLayoutSidebarConfigurable.stories.js +18 -0
- package/src/components/BaseLayoutSidebarConfigurable.vue +13 -10
- package/src/components/BaseLayoutStackedConfigurable.stories.js +18 -1
- package/src/components/BaseLayoutStackedConfigurable.vue +16 -11
- package/src/components/BaseMenu.vue +12 -4
- package/src/components/BaseNavbar.stories.js +0 -3
- package/src/components/index.ts +2 -0
- package/src/lang/en.json +3 -0
- package/src/lang/fr.json +3 -0
- package/src/types/Notification.ts +10 -0
- package/src/types/types.ts +11 -1
|
@@ -33,20 +33,18 @@
|
|
|
33
33
|
</div>
|
|
34
34
|
|
|
35
35
|
<div class="ml-4 flex items-center md:ml-6">
|
|
36
|
-
<!--
|
|
36
|
+
<!-- Notification dropdown -->
|
|
37
|
+
<BaseLayoutNotificationDropdown
|
|
38
|
+
v-if="notifications"
|
|
39
|
+
:notifications-config="notifications"
|
|
40
|
+
class="mr-1 sm:mr-2"
|
|
41
|
+
></BaseLayoutNotificationDropdown>
|
|
37
42
|
|
|
38
43
|
<!-- Profile dropdown -->
|
|
39
44
|
<div class="relative ml-3 mr-3">
|
|
40
45
|
<BaseMenu :items="userMenu">
|
|
41
46
|
<template #button="{ open }">
|
|
42
|
-
<div
|
|
43
|
-
class="flex"
|
|
44
|
-
:class="[
|
|
45
|
-
open
|
|
46
|
-
? 'ring-2 ring-blue-500 ring-offset-2 ring-offset-white'
|
|
47
|
-
: '',
|
|
48
|
-
]"
|
|
49
|
-
>
|
|
47
|
+
<div class="flex" :class="[open ? '' : '']">
|
|
50
48
|
<BaseAvatar :user="user" show-details />
|
|
51
49
|
</div>
|
|
52
50
|
</template>
|
|
@@ -65,8 +63,9 @@
|
|
|
65
63
|
<script setup lang="ts">
|
|
66
64
|
import { User } from '@/types/User';
|
|
67
65
|
import { PropType } from 'vue';
|
|
68
|
-
import { ActionItem, ActionSection } from '../types/types';
|
|
66
|
+
import { ActionItem, ActionSection, NotificationsConfig } from '../types/types';
|
|
69
67
|
import BaseAvatar from './BaseAvatar.vue';
|
|
68
|
+
import BaseLayoutNotificationDropdown from './BaseLayoutNotificationDropdown.vue';
|
|
70
69
|
import BaseLayoutSidebar from './BaseLayoutSidebar.vue';
|
|
71
70
|
import BaseMenu from './BaseMenu.vue';
|
|
72
71
|
import BaseNavbarSideItem from './BaseNavbarSideItem.vue';
|
|
@@ -92,6 +91,10 @@ const props = defineProps({
|
|
|
92
91
|
required: true,
|
|
93
92
|
type: Object as PropType<User>,
|
|
94
93
|
},
|
|
94
|
+
notifications: {
|
|
95
|
+
default: undefined,
|
|
96
|
+
type: Object as PropType<NotificationsConfig>,
|
|
97
|
+
},
|
|
95
98
|
dark: {
|
|
96
99
|
default: false,
|
|
97
100
|
type: Boolean,
|
|
@@ -22,7 +22,6 @@ export default {
|
|
|
22
22
|
label: 'Products',
|
|
23
23
|
to: '/',
|
|
24
24
|
count: 234,
|
|
25
|
-
type: 'RouterLink',
|
|
26
25
|
},
|
|
27
26
|
{
|
|
28
27
|
label: 'Users',
|
|
@@ -51,6 +50,24 @@ export default {
|
|
|
51
50
|
icon: 'heroicons:arrow-left-on-rectangle',
|
|
52
51
|
},
|
|
53
52
|
],
|
|
53
|
+
notifications: {
|
|
54
|
+
footerTo: '/',
|
|
55
|
+
footerLabel: 'See all notifications',
|
|
56
|
+
items: [
|
|
57
|
+
{
|
|
58
|
+
id: '1',
|
|
59
|
+
text: 'You have a new message',
|
|
60
|
+
to: '/',
|
|
61
|
+
created_at: '2022-12-08T19:16:10Z',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: '2',
|
|
65
|
+
text: 'Your inbox is now full. Please empty your inbox before it goes bang.',
|
|
66
|
+
to: '/',
|
|
67
|
+
created_at: '2022-01-01T00:00:00',
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
},
|
|
54
71
|
},
|
|
55
72
|
};
|
|
56
73
|
|
|
@@ -22,19 +22,19 @@
|
|
|
22
22
|
</div>
|
|
23
23
|
|
|
24
24
|
<!-- Right -->
|
|
25
|
+
<div class="flex items-center md:ml-6">
|
|
26
|
+
<!-- Notification dropdown -->
|
|
27
|
+
<BaseLayoutNotificationDropdown
|
|
28
|
+
v-if="notifications"
|
|
29
|
+
class="mr-4 md:mr-5"
|
|
30
|
+
:dark="dark"
|
|
31
|
+
:notifications-config="notifications"
|
|
32
|
+
></BaseLayoutNotificationDropdown>
|
|
25
33
|
|
|
26
|
-
<div class="hidden md:ml-6 md:flex md:items-center">
|
|
27
34
|
<!-- Profile dropdown -->
|
|
28
|
-
<BaseMenu menu-class="w-52" :items="userMenu">
|
|
35
|
+
<BaseMenu menu-class="w-52" class="hidden md:block" :items="userMenu">
|
|
29
36
|
<template #button="{ open }">
|
|
30
|
-
<div
|
|
31
|
-
class="flex rounded-full"
|
|
32
|
-
:class="[
|
|
33
|
-
open
|
|
34
|
-
? 'bg-slate-700 ring-2 ring-blue-500 ring-offset-2 ring-offset-slate-700'
|
|
35
|
-
: '',
|
|
36
|
-
]"
|
|
37
|
-
>
|
|
37
|
+
<div class="flex rounded-full" :class="[open ? '' : '']">
|
|
38
38
|
<BaseAvatar :class="dark ? 'text-white' : ''" :user="user" />
|
|
39
39
|
</div>
|
|
40
40
|
</template>
|
|
@@ -88,12 +88,13 @@
|
|
|
88
88
|
<script lang="ts" setup>
|
|
89
89
|
import { User } from '@/types/User';
|
|
90
90
|
import { PropType } from 'vue';
|
|
91
|
-
import { ActionItem } from '../types/types';
|
|
91
|
+
import { ActionItem, NotificationsConfig } from '../types/types';
|
|
92
92
|
import BaseAvatar from './BaseAvatar.vue';
|
|
93
93
|
import BaseLayoutStacked from './BaseLayoutStacked.vue';
|
|
94
94
|
import BaseMenu from './BaseMenu.vue';
|
|
95
95
|
import BaseNavbarItem from './BaseNavbarItem.vue';
|
|
96
96
|
import BaseNavbarSideItem from './BaseNavbarSideItem.vue';
|
|
97
|
+
import BaseLayoutNotificationDropdown from './BaseLayoutNotificationDropdown.vue';
|
|
97
98
|
|
|
98
99
|
defineProps({
|
|
99
100
|
appName: {
|
|
@@ -116,6 +117,10 @@ defineProps({
|
|
|
116
117
|
required: true,
|
|
117
118
|
type: Object as PropType<User>,
|
|
118
119
|
},
|
|
120
|
+
notifications: {
|
|
121
|
+
default: undefined,
|
|
122
|
+
type: Object as PropType<NotificationsConfig>,
|
|
123
|
+
},
|
|
119
124
|
dark: {
|
|
120
125
|
default: false,
|
|
121
126
|
type: Boolean,
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Menu
|
|
2
|
+
<Menu
|
|
3
|
+
v-slot="{ open }"
|
|
4
|
+
as="div"
|
|
5
|
+
class="text-left"
|
|
6
|
+
:class="[position == 'custom' ? 'static' : 'relative']"
|
|
7
|
+
>
|
|
3
8
|
<div>
|
|
4
9
|
<MenuButton class="flex">
|
|
5
10
|
<slot name="button" :open="open" />
|
|
@@ -18,7 +23,7 @@
|
|
|
18
23
|
:class="[menuClass, menuPositionClass]"
|
|
19
24
|
class="absolute z-menu mt-2 rounded-md bg-white p-1 shadow-lg ring-1 ring-black ring-opacity-10 focus:outline-none"
|
|
20
25
|
>
|
|
21
|
-
<slot name="items">
|
|
26
|
+
<slot name="items" :items="items">
|
|
22
27
|
<template v-for="item in items" :key="item.label + 'link'">
|
|
23
28
|
<div v-if="item.line" class="my-1 -mx-1 flex h-px bg-gray-200" />
|
|
24
29
|
|
|
@@ -95,15 +100,18 @@ const props = defineProps({
|
|
|
95
100
|
},
|
|
96
101
|
menuClass: {
|
|
97
102
|
default: 'w-48',
|
|
98
|
-
type: String,
|
|
103
|
+
type: [String, Array, Object],
|
|
99
104
|
},
|
|
100
105
|
position: {
|
|
101
106
|
default: 'bottom-left',
|
|
102
|
-
type: String as PropType<'bottom-left' | 'bottom-right'>,
|
|
107
|
+
type: String as PropType<'bottom-left' | 'bottom-right' | 'custom'>,
|
|
103
108
|
},
|
|
104
109
|
});
|
|
105
110
|
|
|
106
111
|
const menuPositionClass = computed(() => {
|
|
112
|
+
if (props.position == 'custom') {
|
|
113
|
+
return '';
|
|
114
|
+
}
|
|
107
115
|
if (props.position == 'bottom-left') {
|
|
108
116
|
return 'origin-top-right right-0';
|
|
109
117
|
}
|
|
@@ -37,18 +37,15 @@ const Template = (args) => ({
|
|
|
37
37
|
{
|
|
38
38
|
label: 'Home',
|
|
39
39
|
to: '/',
|
|
40
|
-
type: 'RouterLink',
|
|
41
40
|
},
|
|
42
41
|
{
|
|
43
42
|
label: 'Products',
|
|
44
43
|
to: '/setup',
|
|
45
44
|
count: 234,
|
|
46
|
-
type: 'RouterLink',
|
|
47
45
|
},
|
|
48
46
|
{
|
|
49
47
|
label: 'Settings',
|
|
50
48
|
to: '/settings',
|
|
51
|
-
type: 'RouterLink',
|
|
52
49
|
},
|
|
53
50
|
];
|
|
54
51
|
|
package/src/components/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import BaseActionItem from './BaseActionItem.vue';
|
|
1
2
|
import BaseAlert from './BaseAlert.vue';
|
|
2
3
|
import BaseApp from './BaseApp.vue';
|
|
3
4
|
import BaseAppDialogs from './BaseAppDialogs.vue';
|
|
@@ -66,6 +67,7 @@ import BaseLayoutSidebar from './BaseLayoutSidebar.vue';
|
|
|
66
67
|
import BaseLayoutSidebarConfigurable from './BaseLayoutSidebarConfigurable.vue';
|
|
67
68
|
|
|
68
69
|
export {
|
|
70
|
+
BaseActionItem,
|
|
69
71
|
BaseAlert,
|
|
70
72
|
BaseApp,
|
|
71
73
|
BaseAppDialogs,
|
package/src/lang/en.json
CHANGED
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"next_month": "Next month",
|
|
26
26
|
"none": "None",
|
|
27
27
|
"nothing_found": "Nothing found",
|
|
28
|
+
"notifications_empty": "You have no new notifications",
|
|
28
29
|
"or": "or",
|
|
29
30
|
"pagination_detail": "{page} records of {total}",
|
|
30
31
|
"previous": "Previous",
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
"remove": "Remove",
|
|
34
35
|
"remove_file": "Remove file?",
|
|
35
36
|
"remove_file_description": "Are you sure you want to remove the file? This action is irreversible.",
|
|
37
|
+
"see_all_notifications": "See all notifications",
|
|
36
38
|
"select_an_item": "Select an item",
|
|
37
39
|
"select_an_option": "Select an option",
|
|
38
40
|
"success": "Success",
|
|
@@ -49,6 +51,7 @@
|
|
|
49
51
|
"up_to_x": "Up to {x}",
|
|
50
52
|
"upload_failed": "Upload failed",
|
|
51
53
|
"whoops": "Whoops",
|
|
54
|
+
"x_ago": "{duration} ago",
|
|
52
55
|
"x_rows_selected": "1 item selected | {count} items selected",
|
|
53
56
|
"year": "Year",
|
|
54
57
|
"yes_delete": "Yes, delete",
|
package/src/lang/fr.json
CHANGED
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"next_month": "Mois prochain",
|
|
26
26
|
"none": "Aucun",
|
|
27
27
|
"nothing_found": "Rien n'a été trouvé",
|
|
28
|
+
"notifications_empty": "Vous n'avez aucune nouvelle notification",
|
|
28
29
|
"or": "ou",
|
|
29
30
|
"pagination_detail": "{page} items de {total}",
|
|
30
31
|
"previous": "Précédent",
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
"remove": "Retirer",
|
|
34
35
|
"remove_file": "Retirer le fichier?",
|
|
35
36
|
"remove_file_description": "Voulez-vous vraiment supprimer le fichier ? \nCette action est irréversible.",
|
|
37
|
+
"see_all_notifications": "Voir toutes les notifications",
|
|
36
38
|
"select_an_item": "Sélectionner un élément",
|
|
37
39
|
"select_an_option": "Sélectionner une option",
|
|
38
40
|
"success": "Succès",
|
|
@@ -49,6 +51,7 @@
|
|
|
49
51
|
"up_to_x": "Jusqu'à {x}",
|
|
50
52
|
"upload_failed": "Le téléchargement a échoué",
|
|
51
53
|
"whoops": "Oups",
|
|
54
|
+
"x_ago": "il y a {durée}",
|
|
52
55
|
"x_rows_selected": "1 item sélectionné | \n{count} items sélectionnés",
|
|
53
56
|
"year": "Année",
|
|
54
57
|
"yes_delete": "Oui, supprimer",
|
package/src/types/types.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { RouteLocationRaw } from 'vue-router';
|
|
4
4
|
import { UploadedFile } from './UploadedFile';
|
|
5
|
+
import { Notification as AppNotification } from './Notification';
|
|
5
6
|
|
|
6
7
|
export interface Breadcrumb {
|
|
7
8
|
icon?: string;
|
|
@@ -70,7 +71,6 @@ export interface MenuItemInterface {
|
|
|
70
71
|
|
|
71
72
|
export interface ActionItem {
|
|
72
73
|
label: string;
|
|
73
|
-
type: 'RouterLink' | 'a' | 'button';
|
|
74
74
|
href?: string;
|
|
75
75
|
to?: RouteLocationRaw;
|
|
76
76
|
action?: () => Promise<void> | void;
|
|
@@ -177,3 +177,13 @@ export interface Notification {
|
|
|
177
177
|
color: 'info' | 'success' | 'danger' | 'warning';
|
|
178
178
|
duration: number;
|
|
179
179
|
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* App Notification
|
|
183
|
+
*/
|
|
184
|
+
|
|
185
|
+
export interface NotificationsConfig {
|
|
186
|
+
items: AppNotification[];
|
|
187
|
+
footerLabel?: string;
|
|
188
|
+
footerTo?: RouteLocationRaw;
|
|
189
|
+
}
|