sprintify-ui 0.6.88 → 0.7.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.
Files changed (34) hide show
  1. package/README.md +11 -11
  2. package/dist/sprintify-ui.es.js +245 -244
  3. package/dist/tailwindcss/theme.js +1 -1
  4. package/dist/types/components/index.d.ts +2 -2
  5. package/dist/types/index.d.ts +2 -1
  6. package/dist/types/stores/snackbars.d.ts +19 -0
  7. package/dist/types/types/index.d.ts +4 -4
  8. package/package.json +1 -1
  9. package/src/components/BaseApp.vue +2 -2
  10. package/src/components/{BaseAppNotifications.vue → BaseAppSnackbars.vue} +9 -9
  11. package/src/components/BaseCropper.stories.js +3 -3
  12. package/src/components/BaseCropperModal.stories.js +3 -3
  13. package/src/components/BaseDataTable.stories.js +3 -3
  14. package/src/components/BaseDataTable.vue +4 -4
  15. package/src/components/BaseFilePicker.stories.js +3 -3
  16. package/src/components/BaseFilePicker.vue +4 -4
  17. package/src/components/BaseFilePickerCrop.stories.js +3 -3
  18. package/src/components/BaseFileUploader.stories.js +3 -3
  19. package/src/components/BaseFileUploader.vue +3 -3
  20. package/src/components/BaseForm.stories.js +3 -0
  21. package/src/components/BaseForm.vue +4 -4
  22. package/src/components/BaseHasMany.stories.js +5 -5
  23. package/src/components/BaseMediaLibrary.vue +3 -3
  24. package/src/components/BaseTagAutocomplete.stories.js +11 -5
  25. package/src/components/BaseTagAutocomplete.vue +3 -3
  26. package/src/components/BaseTagAutocompleteFetch.stories.js +3 -3
  27. package/src/components/index.ts +2 -2
  28. package/src/index.ts +2 -1
  29. package/src/stores/{notifications.ts → snackbars.ts} +15 -13
  30. package/src/stories/List.stories.js +3 -3
  31. package/src/stories/PageShow.vue +4 -4
  32. package/src/types/index.ts +4 -4
  33. package/dist/types/stores/notifications.d.ts +0 -10
  34. /package/dist/types/components/{BaseAppNotifications.vue.d.ts → BaseAppSnackbars.vue.d.ts} +0 -0
@@ -1,7 +1,7 @@
1
1
  import BaseTagAutocompleteFetch from './BaseTagAutocompleteFetch.vue';
2
2
  import ShowValue from '@/../.storybook/components/ShowValue.vue';
3
3
  import { createFieldStory } from '../../.storybook/utils';
4
- import BaseAppNotifications from './BaseAppNotifications.vue';
4
+ import BaseAppSnackbars from './BaseAppSnackbars.vue';
5
5
 
6
6
  const sizes = ['xs', 'sm', 'md'];
7
7
 
@@ -24,7 +24,7 @@ export default {
24
24
 
25
25
  const Template = (args) => {
26
26
  return {
27
- components: { BaseTagAutocompleteFetch, ShowValue, BaseAppNotifications },
27
+ components: { BaseTagAutocompleteFetch, ShowValue, BaseAppSnackbars },
28
28
  setup() {
29
29
  const value = ref([]);
30
30
  return { args, value };
@@ -35,7 +35,7 @@ const Template = (args) => {
35
35
  v-bind="args"
36
36
  ></BaseTagAutocompleteFetch>
37
37
  <ShowValue :value="value" />
38
- <BaseAppNotifications />
38
+ <BaseAppSnackbars />
39
39
  `,
40
40
  };
41
41
  };
@@ -3,7 +3,7 @@ import BaseAddressForm from './BaseAddressForm.vue';
3
3
  import BaseAlert from './BaseAlert.vue';
4
4
  import BaseApp from './BaseApp.vue';
5
5
  import BaseAppDialogs from './BaseAppDialogs.vue';
6
- import BaseAppNotifications from './BaseAppNotifications.vue';
6
+ import BaseAppSnackbars from './BaseAppSnackbars.vue';
7
7
  import BaseAutocomplete from './BaseAutocomplete.vue';
8
8
  import BaseAutocompleteFetch from './BaseAutocompleteFetch.vue';
9
9
  import BaseAvatar from './BaseAvatar.vue';
@@ -109,7 +109,7 @@ export {
109
109
  BaseAlert,
110
110
  BaseApp,
111
111
  BaseAppDialogs,
112
- BaseAppNotifications,
112
+ BaseAppSnackbars,
113
113
  BaseAutocomplete,
114
114
  BaseAutocompleteFetch,
115
115
  BaseAvatar,
package/src/index.ts CHANGED
@@ -5,7 +5,7 @@ import QueryString from 'qs';
5
5
  import en from '@/lang/en.json';
6
6
  import fr from '@/lang/fr.json';
7
7
  import { useDialogsStore } from './stores/dialogs';
8
- import { useNotificationsStore } from './stores/notifications';
8
+ import { useSnackbarsStore, useNotificationsStore } from './stores/snackbars';
9
9
  import { useSystemAlertStore } from './stores/systemAlerts';
10
10
  import { useClickOutside } from './composables/clickOutside';
11
11
  import { useField } from './composables/field';
@@ -124,6 +124,7 @@ export { messages };
124
124
  export { config };
125
125
 
126
126
  export { useDialogsStore };
127
+ export { useSnackbarsStore };
127
128
  export { useNotificationsStore };
128
129
  export { useSystemAlertStore };
129
130
  export { useClickOutside };
@@ -1,21 +1,21 @@
1
1
  import { defineStore } from 'pinia';
2
- import { Notification, NotificationOptions } from '../types';
2
+ import { Snackbar, SnackbarOptions } from '../types';
3
3
 
4
- export const useNotificationsStore = defineStore('notifications', {
4
+ export const useSnackbarsStore = defineStore('notifications', {
5
5
  state: () => {
6
6
  return {
7
7
  count: 0,
8
- notifications: [] as Notification[],
8
+ snackbars: [] as Snackbar[],
9
9
  timeouts: {} as Record<number, number>,
10
10
  };
11
11
  },
12
12
  actions: {
13
- push(options: NotificationOptions) {
13
+ push(options: SnackbarOptions) {
14
14
  this.count++;
15
15
 
16
16
  const id = this.count;
17
17
 
18
- const notification = {
18
+ const snackbar = {
19
19
  id: id,
20
20
  color: options.color ?? 'info',
21
21
  title: options.title,
@@ -23,21 +23,21 @@ export const useNotificationsStore = defineStore('notifications', {
23
23
  duration: options.duration ?? 3000,
24
24
  };
25
25
 
26
- this.notifications.push(notification);
26
+ this.snackbars.push(snackbar);
27
27
 
28
28
  this.timeouts[id] = setTimeout(() => {
29
- this.remove(notification);
30
- }, notification.duration);
29
+ this.remove(snackbar);
30
+ }, snackbar.duration);
31
31
  },
32
- remove(notification: Notification) {
33
- this.notifications.splice(
34
- this.notifications.findIndex((n) => n.id === notification.id),
32
+ remove(snackbar: Snackbar) {
33
+ this.snackbars.splice(
34
+ this.snackbars.findIndex((n) => n.id === snackbar.id),
35
35
  1
36
36
  );
37
- clearTimeout(this.timeouts[notification.id]);
37
+ clearTimeout(this.timeouts[snackbar.id]);
38
38
  },
39
39
  clear() {
40
- this.notifications = [];
40
+ this.snackbars = [];
41
41
  Object.values(this.timeouts).forEach((timeout) => {
42
42
  clearTimeout(timeout);
43
43
  });
@@ -45,3 +45,5 @@ export const useNotificationsStore = defineStore('notifications', {
45
45
  },
46
46
  },
47
47
  });
48
+
49
+ export const useNotificationsStore = useSnackbarsStore;
@@ -7,7 +7,7 @@ import BaseBoolean from '../components/BaseBoolean.vue';
7
7
  import BaseSelect from '../components/BaseSelect.vue';
8
8
  import BaseBadge from '../components/BaseBadge.vue';
9
9
  import BaseCounter from '../components/BaseCounter.vue';
10
- import BaseAppNotifications from '../components/BaseAppNotifications.vue';
10
+ import BaseAppSnackbars from '../components/BaseAppSnackbars.vue';
11
11
  import BaseAppDialogs from '../components/BaseAppDialogs.vue';
12
12
  import BaseContainer from '../components/BaseContainer.vue';
13
13
  import { DateTime } from 'luxon';
@@ -83,7 +83,7 @@ const templateComponents = {
83
83
  BaseBoolean,
84
84
  BaseSelect,
85
85
  BaseBadge,
86
- BaseAppNotifications,
86
+ BaseAppSnackbars,
87
87
  BaseAppDialogs,
88
88
  BaseCounter,
89
89
  BaseContainer,
@@ -111,7 +111,7 @@ const template = `
111
111
 
112
112
  ${templateDataTable}
113
113
 
114
- <BaseAppNotifications></BaseAppNotifications>
114
+ <BaseAppSnackbars></BaseAppSnackbars>
115
115
  <BaseAppDialogs></BaseAppDialogs>
116
116
  </BaseContainer>
117
117
  </div>
@@ -361,13 +361,13 @@
361
361
  </div>
362
362
  </BaseContainer>
363
363
 
364
- <BaseAppNotifications />
364
+ <BaseAppSnackbars />
365
365
  <BaseAppDialogs />
366
366
  </div>
367
367
  </template>
368
368
 
369
369
  <script lang="ts" setup>
370
- import { useNotificationsStore } from '..';
370
+ import { useSnackbarsStore } from '..';
371
371
 
372
372
  import BaseCard from '@/components/BaseCard.vue';
373
373
  import BaseCardRow from '@/components/BaseCardRow.vue';
@@ -380,7 +380,7 @@ import BaseTimeline from '@/components/BaseTimeline.vue';
380
380
  import { BaseIcon } from '../components/index';
381
381
  import BaseContainer from '@/components/BaseContainer.vue';
382
382
  import BaseClipboard from '@/components/BaseClipboard.vue';
383
- import BaseAppNotifications from '@/components/BaseAppNotifications.vue';
383
+ import BaseAppSnackbars from '@/components/BaseAppSnackbars.vue';
384
384
  import BaseAppDialogs from '@/components/BaseAppDialogs.vue';
385
385
 
386
386
  const timelineItems = [
@@ -415,7 +415,7 @@ const timelineItems = [
415
415
  ];
416
416
 
417
417
  function showAlert(text: string) {
418
- useNotificationsStore().push({
418
+ useSnackbarsStore().push({
419
419
  title: text,
420
420
  text: text,
421
421
  color: 'success'
@@ -170,17 +170,17 @@ export interface Dialog {
170
170
  }
171
171
 
172
172
  /**
173
- * Notification
173
+ * Snackbar
174
174
  */
175
175
 
176
- export interface NotificationOptions {
176
+ export interface SnackbarOptions {
177
177
  title: string;
178
178
  text: string;
179
179
  color?: 'info' | 'success' | 'danger' | 'warning';
180
180
  duration?: number;
181
181
  }
182
182
 
183
- export interface Notification {
183
+ export interface Snackbar {
184
184
  id: number;
185
185
  title: string;
186
186
  text: string;
@@ -189,7 +189,7 @@ export interface Notification {
189
189
  }
190
190
 
191
191
  /**
192
- * App Notification
192
+ * Notification
193
193
  */
194
194
 
195
195
  export interface NotificationsConfig {
@@ -1,10 +0,0 @@
1
- import { Notification, NotificationOptions } from '../types';
2
- export declare const useNotificationsStore: import("pinia").StoreDefinition<"notifications", {
3
- count: number;
4
- notifications: Notification[];
5
- timeouts: Record<number, number>;
6
- }, {}, {
7
- push(options: NotificationOptions): void;
8
- remove(notification: Notification): void;
9
- clear(): void;
10
- }>;