sprintify-ui 0.0.19 → 0.0.20

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 (41) hide show
  1. package/dist/sprintify-ui.es.js +5552 -4491
  2. package/dist/types/src/components/BaseActionItem.vue.d.ts +121 -0
  3. package/dist/types/src/components/BaseAlert.vue.d.ts +3 -3
  4. package/dist/types/src/components/BaseAppDialogs.vue.d.ts +1 -1
  5. package/dist/types/src/components/BaseBoolean.vue.d.ts +2 -2
  6. package/dist/types/src/components/BaseCounter.vue.d.ts +3 -3
  7. package/dist/types/src/components/BaseDialog.vue.d.ts +4 -4
  8. package/dist/types/src/components/BaseInput.vue.d.ts +1 -1
  9. package/dist/types/src/components/BaseLayoutSidebar.vue.d.ts +114 -0
  10. package/dist/types/src/components/BaseLayoutSidebarConfigurable.vue.d.ts +163 -0
  11. package/dist/types/src/components/BaseLayoutStacked.vue.d.ts +76 -0
  12. package/dist/types/src/components/BaseLayoutStackedConfigurable.vue.d.ts +163 -0
  13. package/dist/types/src/components/BaseMenuItem.vue.d.ts +5 -5
  14. package/dist/types/src/components/BaseNavbar.vue.d.ts +20 -1
  15. package/dist/types/src/components/BaseNavbarItem.vue.d.ts +17 -71
  16. package/dist/types/src/components/BaseNavbarItemContent.vue.d.ts +11 -2
  17. package/dist/types/src/components/BaseNavbarSideItem.vue.d.ts +26 -0
  18. package/dist/types/src/components/BaseNavbarSideItemContent.vue.d.ts +50 -0
  19. package/dist/types/src/components/BaseSwitch.vue.d.ts +3 -3
  20. package/dist/types/src/components/BaseSystemAlert.vue.d.ts +8 -8
  21. package/dist/types/src/components/BaseTableColumn.vue.d.ts +1 -1
  22. package/dist/types/src/components/index.d.ts +5 -1
  23. package/package.json +1 -1
  24. package/src/components/BaseActionItem.vue +68 -0
  25. package/src/components/{HasMany.stories.js → BaseHasMany.stories.js} +0 -0
  26. package/src/components/BaseLayoutSidebar.vue +199 -0
  27. package/src/components/BaseLayoutSidebarConfigurable.stories.js +111 -0
  28. package/src/components/BaseLayoutSidebarConfigurable.vue +115 -0
  29. package/src/components/BaseLayoutStacked.vue +52 -0
  30. package/src/components/BaseLayoutStackedConfigurable.stories.js +92 -0
  31. package/src/components/BaseLayoutStackedConfigurable.vue +124 -0
  32. package/src/components/BaseMediaItem.vue +7 -7
  33. package/src/components/BaseMediaLibrary.vue +3 -3
  34. package/src/components/BaseMediaPreview.vue +1 -1
  35. package/src/components/BaseNavbar.stories.js +18 -14
  36. package/src/components/BaseNavbar.vue +19 -3
  37. package/src/components/BaseNavbarItem.vue +17 -43
  38. package/src/components/BaseNavbarItemContent.vue +36 -16
  39. package/src/components/BaseNavbarSideItem.vue +42 -0
  40. package/src/components/BaseNavbarSideItemContent.vue +77 -0
  41. package/src/components/index.ts +9 -0
@@ -1,28 +1,28 @@
1
1
  <template>
2
- <div class="rounded border border-slate-300 bg-white shadow">
2
+ <div class="rounded bg-white shadow">
3
3
  <div class="relative flex">
4
4
  <div class="shrink-0">
5
- <BaseMediaPreview class="h-14 w-14 rounded-l" :media="media" />
5
+ <BaseMediaPreview class="h-12 w-12 rounded-l" :media="media" />
6
6
  </div>
7
7
  <component
8
8
  :is="url ? 'a' : 'p'"
9
9
  :href="url"
10
10
  target="_blank"
11
- class="grow overflow-hidden px-3 pt-3"
11
+ class="flex grow items-center overflow-hidden px-3"
12
12
  >
13
13
  <div class="text-left leading-tight">
14
- <p class="grow truncate text-sm font-medium">
14
+ <p class="mb-px grow truncate text-[13px] font-medium">
15
15
  {{ name }}
16
16
  </p>
17
- <p class="shrink-0 text-[10px] font-medium text-slate-400">
17
+ <p class="shrink-0 text-[10px] text-slate-400">
18
18
  {{ size }}
19
19
  </p>
20
20
  </div>
21
21
  </component>
22
- <div v-if="showRemove" class="shrink-0 p-2">
22
+ <div v-if="showRemove" class="shrink-0 p-0.5">
23
23
  <button
24
24
  type="button"
25
- class="rounded-full bg-slate-400 p-1 text-white hover:bg-slate-500"
25
+ class="rounded-full bg-white p-1 text-slate-400 hover:bg-slate-100"
26
26
  @click="$emit('remove')"
27
27
  >
28
28
  <BaseIcon icon="heroicons:x-mark-20-solid" class="h-4 w-4"></BaseIcon>
@@ -22,16 +22,16 @@
22
22
  <div
23
23
  class="rounded border border-dashed p-6 duration-150"
24
24
  :class="[
25
- baseFileUploaderProps.dragging ? 'bg-blue-100' : 'bg-slate-100',
25
+ baseFileUploaderProps.dragging ? 'bg-blue-100' : 'bg-white',
26
26
  baseFileUploaderProps.disabled
27
27
  ? 'cursor-not-allowed border-slate-300'
28
- : 'border-slate-300 hover:bg-slate-50',
28
+ : 'border-slate-300 hover:bg-slate-100',
29
29
  ]"
30
30
  >
31
31
  <div :class="[baseFileUploaderProps.disabled ? 'opacity-30' : '']">
32
32
  <BaseIcon
33
33
  icon="heroicons:arrow-up-on-square"
34
- class="mx-auto mb-3 h-6 w-6 text-primary-500"
34
+ class="mx-auto mb-3 h-6 w-6 text-slate-500"
35
35
  />
36
36
  <div class="text-center">
37
37
  <p class="mb-0 text-sm font-medium leading-tight">
@@ -20,7 +20,7 @@
20
20
  />
21
21
  <div
22
22
  v-else
23
- class="flex h-full w-full items-center justify-center bg-slate-200"
23
+ class="flex h-full w-full items-center justify-center bg-slate-100"
24
24
  >
25
25
  <BaseIcon
26
26
  v-if="extension == 'pdf'"
@@ -1,5 +1,6 @@
1
1
  import BaseNavbar from './BaseNavbar.vue';
2
2
  import BaseNavbarItem from './BaseNavbarItem.vue';
3
+ import BaseNavbarSideItem from './BaseNavbarSideItem.vue';
3
4
  import BaseAvatar from './BaseAvatar.vue';
4
5
  import BaseMenu from './BaseMenu.vue';
5
6
  import { Icon as BaseIcon } from '@iconify/vue';
@@ -8,12 +9,16 @@ export default {
8
9
  title: 'Layout/BaseNavbar',
9
10
  component: BaseNavbar,
10
11
  args: {},
12
+ parameters: {
13
+ layout: 'fullscreen',
14
+ },
11
15
  };
12
16
 
13
17
  const Template = (args) => ({
14
18
  components: {
15
19
  BaseNavbar,
16
20
  BaseNavbarItem,
21
+ BaseNavbarSideItem,
17
22
  BaseIcon,
18
23
  BaseAvatar,
19
24
  BaseMenu,
@@ -36,13 +41,13 @@ const Template = (args) => ({
36
41
  },
37
42
  {
38
43
  label: 'Products',
39
- to: '/',
44
+ to: '/setup',
40
45
  count: 234,
41
46
  type: 'RouterLink',
42
47
  },
43
48
  {
44
49
  label: 'Settings',
45
- to: '/',
50
+ to: '/settings',
46
51
  type: 'RouterLink',
47
52
  },
48
53
  ];
@@ -66,28 +71,29 @@ const Template = (args) => ({
66
71
  return { args, menu, userMenu, user };
67
72
  },
68
73
  template: `
69
- <div class="mb-40">
74
+ <div class="sticky top-0 left-0 w-full shadow">
70
75
  <BaseNavbar v-bind="args">
71
76
  <template #navbar>
72
77
  <div class="flex h-16 justify-between">
73
78
  <!-- Left -->
74
79
 
75
- <div class="flex items-center justify-center">
80
+ <div class="flex justify-center">
76
81
  <!-- Logo -->
77
82
  <router-link to="/" class="flex flex-shrink-0 grow items-center p-2 pl-0">
78
83
  <img
79
84
  class="block h-8 w-auto"
80
- src="https://sprintify.witify.io/img/logo/logo-side-dark.svg"
85
+ src="https://sprintify.witify.io/img/logo/logo-side.svg"
81
86
  alt="Sprintify"
82
87
  />
83
88
  </router-link>
84
89
 
85
90
  <!-- Links (desktop) -->
86
- <div class="ml-10 hidden items-center space-x-4 md:flex">
91
+ <div class="ml-10 hidden space-x-4 md:flex">
87
92
  <BaseNavbarItem
88
93
  v-for="item in menu"
89
94
  :key="item.label"
90
95
  :item="item"
96
+ item-class="flex"
91
97
  />
92
98
  </div>
93
99
  </div>
@@ -102,7 +108,7 @@ const Template = (args) => ({
102
108
  class="flex rounded-full"
103
109
  :class="[open ? 'bg-slate-700 ring-2 ring-blue-500 ring-offset-2 ring-offset-slate-700' : '']"
104
110
  >
105
- <BaseAvatar class="text-white" :user="user" />
111
+ <BaseAvatar :user="user" />
106
112
  </div>
107
113
  </template>
108
114
  </BaseMenu>
@@ -112,16 +118,15 @@ const Template = (args) => ({
112
118
 
113
119
  <template #mobile>
114
120
  <!-- Links mobile -->
115
- <div class="space-y-1 p-2">
116
- <BaseNavbarItem
121
+ <div class="space-y-1 p-2 pt-0">
122
+ <BaseNavbarSideItem
117
123
  v-for="item in menu"
118
124
  :key="item.label"
119
125
  :item="item"
120
- class="flex w-full"
121
126
  />
122
127
  </div>
123
128
 
124
- <hr class="my-4 border-slate-700" />
129
+ <hr class="mb-4 mt-2 border-slate-200" />
125
130
 
126
131
  <!-- Profile links -->
127
132
  <div class="p-2 pb-6">
@@ -129,14 +134,13 @@ const Template = (args) => ({
129
134
  :user="user"
130
135
  show-details
131
136
  size="base"
132
- class="px-3 text-white"
137
+ class="px-3"
133
138
  />
134
139
  <div class="mt-4 space-y-1">
135
- <BaseNavbarItem
140
+ <BaseNavbarSideItem
136
141
  v-for="item in userMenu"
137
142
  :key="item.label"
138
143
  :item="item"
139
- class="flex w-full"
140
144
  />
141
145
  </div>
142
146
  </div>
@@ -1,5 +1,8 @@
1
1
  <template>
2
- <nav class="bg-slate-800">
2
+ <nav
3
+ class="border-t-[3px] border-primary-500"
4
+ :class="[dark ? 'bg-slate-900' : 'bg-white']"
5
+ >
3
6
  <BaseContainer :size="size">
4
7
  <div class="flex h-16 justify-between">
5
8
  <!-- Navbar (desktop and mobile) -->
@@ -11,7 +14,12 @@
11
14
  <div class="-mr-2 flex items-center md:hidden">
12
15
  <button
13
16
  type="button"
14
- class="inline-flex items-center justify-center rounded-md bg-slate-800 p-2 text-slate-400 hover:bg-slate-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 focus:ring-offset-slate-800"
17
+ class="inline-flex items-center justify-center rounded-md p-2 focus:outline-none focus:ring-2 focus:ring-offset-2"
18
+ :class="[
19
+ dark
20
+ ? 'text-slate-200 hover:bg-slate-800 hover:text-white focus:ring-slate-700 focus:ring-offset-slate-900'
21
+ : 'text-slate-500 hover:bg-slate-100 hover:text-slate-900 focus:ring-slate-300 focus:ring-offset-white',
22
+ ]"
15
23
  @click="toggleMenu()"
16
24
  >
17
25
  <span class="sr-only">Open main menu</span>
@@ -33,7 +41,11 @@
33
41
  </BaseContainer>
34
42
 
35
43
  <!-- Mobile -->
36
- <div v-if="showMobileMenu" class="absolute w-full bg-slate-800 md:hidden">
44
+ <div
45
+ v-if="showMobileMenu"
46
+ class="absolute w-full md:hidden"
47
+ :class="[dark ? 'bg-slate-900' : 'bg-white']"
48
+ >
37
49
  <slot
38
50
  name="mobile"
39
51
  :toggle-menu="toggleMenu"
@@ -53,6 +65,10 @@ defineProps({
53
65
  default: '7xl',
54
66
  type: String,
55
67
  },
68
+ dark: {
69
+ default: false,
70
+ type: Boolean,
71
+ },
56
72
  });
57
73
 
58
74
  const showMobileMenu = ref(false);
@@ -1,57 +1,28 @@
1
1
  <template>
2
- <div>
3
- <RouterLink
4
- v-if="item.to"
5
- v-slot="{ isActive, href: slotHref, navigate }"
6
- custom
7
- :to="item.to"
2
+ <div class="flex">
3
+ <BaseActionItem
4
+ :item="item"
5
+ :dark="dark"
6
+ item-class="flex w-full"
7
+ @click="onClick"
8
8
  >
9
- <a
10
- :active="isActive"
11
- :href="slotHref"
12
- :aria-current="isActive ? 'page' : undefined"
13
- class="block w-full"
14
- @click.prevent="onClick(navigate)"
15
- >
16
- <slot :active="isActive">
17
- <BaseNavbarItemContent
18
- :label="item.label"
19
- :icon="item.icon"
20
- :active="isActive"
21
- :count="item.count"
22
- />
23
- </slot>
24
- </a>
25
- </RouterLink>
26
- <button
27
- v-else-if="item.action"
28
- type="button"
29
- class="block w-full"
30
- @click="item.action"
31
- >
32
- <slot :active="false">
9
+ <template #default="{ active }">
33
10
  <BaseNavbarItemContent
34
11
  :label="item.label"
35
12
  :icon="item.icon"
13
+ :active="active"
36
14
  :count="item.count"
15
+ :dark="dark"
37
16
  />
38
- </slot>
39
- </button>
40
- <a v-else-if="item.href" :href="item.href" class="block w-full">
41
- <slot :active="false">
42
- <BaseNavbarItemContent
43
- :label="item.label"
44
- :icon="item.icon"
45
- :count="item.count"
46
- />
47
- </slot>
48
- </a>
17
+ </template>
18
+ </BaseActionItem>
49
19
  </div>
50
20
  </template>
51
21
 
52
22
  <script setup lang="ts">
53
23
  import { PropType } from 'vue';
54
24
  import { ActionItem } from '@/types/types';
25
+ import BaseActionItem from './BaseActionItem.vue';
55
26
  import BaseNavbarItemContent from './BaseNavbarItemContent.vue';
56
27
 
57
28
  defineProps({
@@ -59,14 +30,17 @@ defineProps({
59
30
  required: true,
60
31
  type: Object as PropType<ActionItem>,
61
32
  },
33
+ dark: {
34
+ default: false,
35
+ type: Boolean,
36
+ },
62
37
  });
63
38
 
64
39
  const closeMenu = inject('closeMenu') as () => void;
65
40
 
66
41
  const emit = defineEmits(['click']);
67
42
 
68
- function onClick(navigate: () => void) {
69
- navigate();
43
+ async function onClick() {
70
44
  emit('click');
71
45
  closeMenu();
72
46
  }
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div :class="classes">
3
- <div class="flex grow items-center">
3
+ <div class="group flex grow items-center">
4
4
  <BaseIcon v-if="icon" :icon="icon" :class="iconClasses" />
5
5
  {{ label }}
6
6
  </div>
@@ -14,12 +14,6 @@
14
14
  import { Icon as BaseIcon } from '@iconify/vue';
15
15
  import BaseCounter from './BaseCounter.vue';
16
16
 
17
- const buttonClasses =
18
- 'px-3 py-2 text-left rounded-md md:text-sm flex text-base font-normal w-full';
19
- const buttonInactiveClasses =
20
- 'hover:bg-slate-700 hover:text-white text-slate-300';
21
- const buttonActiveClasses = 'bg-slate-900 text-white';
22
-
23
17
  const props = defineProps({
24
18
  label: {
25
19
  default: undefined,
@@ -37,24 +31,50 @@ const props = defineProps({
37
31
  default: undefined,
38
32
  type: Number,
39
33
  },
34
+ dark: {
35
+ default: false,
36
+ type: Boolean,
37
+ },
40
38
  });
41
39
 
42
40
  const classes = computed(() => {
43
- return [
44
- buttonClasses,
45
- props.active ? buttonActiveClasses : buttonInactiveClasses,
41
+ const classList = [
42
+ 'text-left border-b-2 px-2 flex items-center text-base font-medium w-full',
46
43
  ];
47
- });
48
44
 
49
- const iconClasses = computed((): string => {
50
- let baseClasses = ' w-5 h-5 shrink-0 mr-2 leading-none inline-block';
45
+ if (props.dark) {
46
+ classList.push('');
47
+ } else {
48
+ classList.push('');
49
+ }
51
50
 
52
51
  if (props.active) {
53
- baseClasses += ' text-white';
52
+ if (props.dark) {
53
+ classList.push('border-white text-white');
54
+ } else {
55
+ classList.push('border-primary-500 text-slate-900');
56
+ }
54
57
  } else {
55
- baseClasses += ' text-slate-300';
58
+ classList.push('border-transparent');
59
+ if (props.dark) {
60
+ classList.push('hover:border-white hover:text-white text-slate-200');
61
+ } else {
62
+ classList.push(
63
+ 'hover:border-primary-500 hover:text-slate-900 text-slate-800'
64
+ );
65
+ }
56
66
  }
57
67
 
58
- return baseClasses;
68
+ return classList;
69
+ });
70
+
71
+ const iconClasses = computed((): string[] => {
72
+ const classList = ['w-5 h-5 shrink-0 mr-2 leading-none inline-block'];
73
+ if (props.active) {
74
+ classList.push('opacity-100');
75
+ } else {
76
+ classList.push('opacity-70 group-hover:opacity-100');
77
+ }
78
+ return classList;
59
79
  });
60
80
  </script>
@@ -0,0 +1,42 @@
1
+ <template>
2
+ <BaseActionItem
3
+ :item="item"
4
+ :dark="dark"
5
+ item-class="flex w-full"
6
+ @click="onClick"
7
+ >
8
+ <template #default="{ active }">
9
+ <BaseNavbarSideItemContent
10
+ :label="item.label"
11
+ :icon="item.icon"
12
+ :active="active"
13
+ :count="item.count"
14
+ :dark="dark"
15
+ />
16
+ </template>
17
+ </BaseActionItem>
18
+ </template>
19
+
20
+ <script setup lang="ts">
21
+ import { PropType } from 'vue';
22
+ import { ActionItem } from '@/types/types';
23
+ import BaseActionItem from './BaseActionItem.vue';
24
+ import BaseNavbarSideItemContent from './BaseNavbarSideItemContent.vue';
25
+
26
+ defineProps({
27
+ item: {
28
+ required: true,
29
+ type: Object as PropType<ActionItem>,
30
+ },
31
+ dark: {
32
+ default: false,
33
+ type: Boolean,
34
+ },
35
+ });
36
+
37
+ const emit = defineEmits(['click']);
38
+
39
+ async function onClick() {
40
+ emit('click');
41
+ }
42
+ </script>
@@ -0,0 +1,77 @@
1
+ <template>
2
+ <div :class="classes">
3
+ <div class="group flex grow items-center">
4
+ <BaseIcon v-if="icon" :icon="icon" :class="iconClasses" />
5
+ {{ label }}
6
+ </div>
7
+ <div v-if="count" class="relative -top-px ml-[5px]">
8
+ <BaseCounter :count="count" :max-digit="2" :color="'primary'" />
9
+ </div>
10
+ </div>
11
+ </template>
12
+
13
+ <script lang="ts" setup>
14
+ import { Icon as BaseIcon } from '@iconify/vue';
15
+ import BaseCounter from './BaseCounter.vue';
16
+
17
+ const props = defineProps({
18
+ label: {
19
+ default: undefined,
20
+ type: String,
21
+ },
22
+ icon: {
23
+ default: undefined,
24
+ type: String,
25
+ },
26
+ active: {
27
+ default: false,
28
+ type: Boolean,
29
+ },
30
+ count: {
31
+ default: undefined,
32
+ type: Number,
33
+ },
34
+ dark: {
35
+ default: false,
36
+ type: Boolean,
37
+ },
38
+ });
39
+
40
+ const classes = computed(() => {
41
+ const classList = [
42
+ 'text-left px-3 py-2 rounded-md flex text-base font-medium w-full',
43
+ ];
44
+
45
+ if (props.dark) {
46
+ classList.push('');
47
+ } else {
48
+ classList.push('');
49
+ }
50
+
51
+ if (props.active) {
52
+ if (props.dark) {
53
+ classList.push('bg-slate-700 text-white');
54
+ } else {
55
+ classList.push('bg-slate-100 text-slate-900');
56
+ }
57
+ } else {
58
+ if (props.dark) {
59
+ classList.push('hover:bg-slate-800 hover:text-white text-slate-300');
60
+ } else {
61
+ classList.push('hover:bg-slate-50 hover:text-slate-900 text-slate-800');
62
+ }
63
+ }
64
+
65
+ return classList;
66
+ });
67
+
68
+ const iconClasses = computed((): string[] => {
69
+ const classList = ['w-5 h-5 shrink-0 mr-2 leading-none inline-block'];
70
+ if (props.active) {
71
+ classList.push('opacity-100');
72
+ } else {
73
+ classList.push('opacity-70 group-hover:opacity-100');
74
+ }
75
+ return classList;
76
+ });
77
+ </script>
@@ -60,6 +60,11 @@ import BaseTableColumn from './BaseTableColumn.vue';
60
60
  import BaseTextarea from './BaseTextarea.vue';
61
61
  import BaseTextareaAutoresize from './BaseTextareaAutoresize.vue';
62
62
 
63
+ import BaseLayoutStacked from './BaseLayoutStacked.vue';
64
+ import BaseLayoutStackedConfigurable from './BaseLayoutStackedConfigurable.vue';
65
+ import BaseLayoutSidebar from './BaseLayoutSidebar.vue';
66
+ import BaseLayoutSidebarConfigurable from './BaseLayoutSidebarConfigurable.vue';
67
+
63
68
  export {
64
69
  BaseAlert,
65
70
  BaseApp,
@@ -122,4 +127,8 @@ export {
122
127
  BaseTableColumn,
123
128
  BaseTextarea,
124
129
  BaseTextareaAutoresize,
130
+ BaseLayoutStacked,
131
+ BaseLayoutStackedConfigurable,
132
+ BaseLayoutSidebar,
133
+ BaseLayoutSidebarConfigurable,
125
134
  };