sprintify-ui 0.4.11 → 0.5.2

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 (65) hide show
  1. package/dist/sprintify-ui.es.js +8698 -8659
  2. package/dist/types/src/components/BaseActionItem.vue.d.ts +7 -17
  3. package/dist/types/src/components/BaseActionItemButton.vue.d.ts +3 -3
  4. package/dist/types/src/components/BaseAutocomplete.vue.d.ts +1 -1
  5. package/dist/types/src/components/BaseAutocompleteFetch.vue.d.ts +1 -1
  6. package/dist/types/src/components/BaseBelongsTo.vue.d.ts +1 -1
  7. package/dist/types/src/components/BaseBelongsToFetch.vue.d.ts +1 -1
  8. package/dist/types/src/components/BaseButtonGroup.vue.d.ts +1 -1
  9. package/dist/types/src/components/BaseColor.vue.d.ts +1 -1
  10. package/dist/types/src/components/BaseDataIterator.vue.d.ts +5 -4
  11. package/dist/types/src/components/BaseDataTable.vue.d.ts +8 -7
  12. package/dist/types/src/components/BaseDatePicker.vue.d.ts +9 -9
  13. package/dist/types/src/components/BaseDateSelect.vue.d.ts +1 -1
  14. package/dist/types/src/components/BaseDropdownAutocomplete.vue.d.ts +1 -1
  15. package/dist/types/src/components/BaseField.vue.d.ts +1 -1
  16. package/dist/types/src/components/BaseFieldI18n.vue.d.ts +1 -1
  17. package/dist/types/src/components/BaseHeader.vue.d.ts +2 -1
  18. package/dist/types/src/components/BaseInput.vue.d.ts +1 -1
  19. package/dist/types/src/components/BaseInputPercent.vue.d.ts +1 -1
  20. package/dist/types/src/components/BaseLayoutSidebarConfigurable.vue.d.ts +4 -3
  21. package/dist/types/src/components/BaseLayoutStacked.vue.d.ts +20 -11
  22. package/dist/types/src/components/BaseLayoutStackedConfigurable.vue.d.ts +9 -8
  23. package/dist/types/src/components/BaseMenu.vue.d.ts +7 -7
  24. package/dist/types/src/components/BaseNavbar.vue.d.ts +32 -1
  25. package/dist/types/src/components/BaseNavbarItem.vue.d.ts +1 -1
  26. package/dist/types/src/components/BaseNavbarItemContent.vue.d.ts +1 -1
  27. package/dist/types/src/components/BaseNavbarSideItem.vue.d.ts +1 -10
  28. package/dist/types/src/components/BaseNavbarSideItemContent.vue.d.ts +1 -1
  29. package/dist/types/src/components/BasePassword.vue.d.ts +1 -1
  30. package/dist/types/src/components/BaseRadioGroup.vue.d.ts +1 -1
  31. package/dist/types/src/components/BaseRichText.vue.d.ts +4 -4
  32. package/dist/types/src/components/BaseSelect.vue.d.ts +1 -1
  33. package/dist/types/src/components/BaseShortcut.vue.d.ts +1 -1
  34. package/dist/types/src/components/BaseStatistic.vue.d.ts +1 -1
  35. package/dist/types/src/components/BaseSwitch.vue.d.ts +1 -1
  36. package/dist/types/src/components/BaseSystemAlert.vue.d.ts +1 -1
  37. package/dist/types/src/components/BaseTableColumn.vue.d.ts +1 -1
  38. package/dist/types/src/components/BaseTagAutocomplete.vue.d.ts +1 -1
  39. package/dist/types/src/components/BaseTextarea.vue.d.ts +1 -1
  40. package/dist/types/src/types/ActionItem.d.ts +14 -0
  41. package/dist/types/src/types/index.d.ts +0 -26
  42. package/package.json +1 -1
  43. package/src/components/BaseActionItem.vue +25 -14
  44. package/src/components/BaseActionItemButton.vue +14 -16
  45. package/src/components/BaseDataIterator.stories.js +1 -1
  46. package/src/components/BaseDataIterator.vue +2 -2
  47. package/src/components/BaseDataTable.stories.js +1 -1
  48. package/src/components/BaseDataTable.vue +4 -4
  49. package/src/components/BaseHeader.vue +3 -2
  50. package/src/components/BaseLayoutSidebarConfigurable.stories.js +25 -5
  51. package/src/components/BaseLayoutSidebarConfigurable.vue +23 -27
  52. package/src/components/BaseLayoutStacked.vue +27 -11
  53. package/src/components/BaseLayoutStackedConfigurable.stories.js +6 -2
  54. package/src/components/BaseLayoutStackedConfigurable.vue +11 -10
  55. package/src/components/BaseMenu.vue +3 -3
  56. package/src/components/BaseNavbar.stories.js +8 -7
  57. package/src/components/BaseNavbar.vue +58 -12
  58. package/src/components/BaseNavbarItem.vue +2 -5
  59. package/src/components/BaseNavbarSideItem.vue +22 -17
  60. package/src/components/BaseShortcut.vue +5 -3
  61. package/src/components/BaseSideNavigation.stories.js +1 -1
  62. package/src/components/BaseTabs.stories.js +1 -1
  63. package/src/stories/List.stories.js +1 -1
  64. package/src/types/ActionItem.ts +15 -0
  65. package/src/types/index.ts +0 -29
@@ -12,7 +12,7 @@ declare const _default: import("vue").DefineComponent<{
12
12
  default: string;
13
13
  };
14
14
  toolbar: {
15
- type: PropType<string | unknown[] | Record<string, any> | undefined>;
15
+ type: PropType<string | Record<string, any> | unknown[] | undefined>;
16
16
  default(): string[];
17
17
  };
18
18
  placeholder: {
@@ -51,7 +51,7 @@ declare const _default: import("vue").DefineComponent<{
51
51
  default: string;
52
52
  };
53
53
  toolbar: {
54
- type: PropType<string | unknown[] | Record<string, any> | undefined>;
54
+ type: PropType<string | Record<string, any> | unknown[] | undefined>;
55
55
  default(): string[];
56
56
  };
57
57
  placeholder: {
@@ -81,14 +81,14 @@ declare const _default: import("vue").DefineComponent<{
81
81
  }>> & {
82
82
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
83
83
  }, {
84
- name: string;
85
84
  required: boolean;
85
+ name: string;
86
86
  theme: "" | "snow" | "bubble";
87
87
  modelValue: string | Delta | null | undefined;
88
88
  placeholder: string;
89
89
  disabled: boolean;
90
90
  hasError: boolean;
91
91
  enable: boolean;
92
- toolbar: string | unknown[] | Record<string, any> | undefined;
92
+ toolbar: string | Record<string, any> | unknown[] | undefined;
93
93
  }, {}>;
94
94
  export default _default;
@@ -80,8 +80,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
80
80
  }>> & {
81
81
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
82
82
  }, {
83
- name: string;
84
83
  required: boolean;
84
+ name: string;
85
85
  modelValue: SelectOption | undefined;
86
86
  placeholder: string;
87
87
  disabled: boolean;
@@ -77,10 +77,10 @@ declare const _default: import("vue").DefineComponent<{
77
77
  }>>, {
78
78
  to: RouteLocationRaw | undefined;
79
79
  href: string | undefined;
80
- action: () => Promise<void> | undefined;
81
80
  color: string;
82
81
  description: string;
83
82
  contrast: "high" | "low";
83
+ action: () => Promise<void> | undefined;
84
84
  linkText: string;
85
85
  }, {}>;
86
86
  export default _default;
@@ -47,8 +47,8 @@ declare const _default: import("vue").DefineComponent<{
47
47
  type: PropType<string | null>;
48
48
  };
49
49
  }>>, {
50
- caption: string | null;
51
50
  label: string | null;
51
+ caption: string | null;
52
52
  secondaryValue: string | null;
53
53
  trend: "up" | "down" | null;
54
54
  }, {}>;
@@ -70,9 +70,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
70
70
  }>> & {
71
71
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
72
72
  }, {
73
+ required: boolean;
73
74
  name: string;
74
75
  color: "dark" | "light" | "danger" | "success" | "warning" | "primary" | "info";
75
- required: boolean;
76
76
  modelValue: string | number | boolean | null | undefined;
77
77
  hasError: boolean;
78
78
  size: "base" | "xs" | "sm" | "lg" | "xl";
@@ -40,8 +40,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
40
40
  onClose?: ((...args: any[]) => any) | undefined;
41
41
  }, {
42
42
  to: RouteLocationRaw | undefined;
43
- action: () => void | Promise<void>;
44
43
  color: "danger" | "success" | "warning" | "info";
44
+ action: () => void | Promise<void>;
45
45
  closable: boolean;
46
46
  }, {}>, {
47
47
  default?(_: {}): any;
@@ -154,7 +154,7 @@ declare const _default: import("vue").DefineComponent<{
154
154
  };
155
155
  }>>, {
156
156
  label: string;
157
- meta: unknown[] | Record<string, any>;
157
+ meta: Record<string, any> | unknown[];
158
158
  width: number;
159
159
  toggle: boolean;
160
160
  field: string;
@@ -163,8 +163,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
163
163
  onOpen?: ((...args: any[]) => any) | undefined;
164
164
  }, {
165
165
  filter: (option: NormalizedOption) => boolean;
166
- name: string;
167
166
  required: boolean;
167
+ name: string;
168
168
  inline: boolean;
169
169
  placeholder: string;
170
170
  disabled: boolean;
@@ -92,8 +92,8 @@ declare const _default: import("vue").DefineComponent<{
92
92
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
93
93
  }, {
94
94
  type: string;
95
- name: string;
96
95
  required: boolean;
96
+ name: string;
97
97
  modelValue: string | null | undefined;
98
98
  autocomplete: boolean;
99
99
  preventSubmit: boolean;
@@ -0,0 +1,14 @@
1
+ import { RouteLocationRaw } from "vue-router";
2
+ import { ActionColors } from ".";
3
+ export interface ActionItem {
4
+ label?: string;
5
+ href?: string;
6
+ to?: RouteLocationRaw;
7
+ action?: () => Promise<void> | void;
8
+ icon?: string;
9
+ count?: number;
10
+ color?: ActionColors;
11
+ disabled?: boolean;
12
+ meta?: Record<string, any>;
13
+ actions?: ActionItem[];
14
+ }
@@ -52,32 +52,6 @@ export interface PaginatedCollection extends PaginationMetadata {
52
52
  data: Collection;
53
53
  }
54
54
  export type ActionColors = 'dark' | 'light' | 'danger' | 'success' | 'warning' | 'primary' | 'secondary';
55
- export interface MenuItemInterface {
56
- label?: string;
57
- href?: string;
58
- to?: RouteLocationRaw;
59
- action?: () => Promise<void> | void;
60
- icon?: string;
61
- count?: number;
62
- color?: ActionColors;
63
- line?: boolean;
64
- }
65
- export interface ActionItem {
66
- label: string;
67
- href?: string;
68
- to?: RouteLocationRaw;
69
- action?: () => Promise<void> | void;
70
- icon?: string;
71
- count?: number;
72
- color?: ActionColors;
73
- disabled?: boolean;
74
- meta?: Record<string, any>;
75
- actions?: ActionItem[];
76
- }
77
- export interface ActionSection {
78
- title: string;
79
- actions: ActionItem[];
80
- }
81
55
  export type Row = Record<string, any>;
82
56
  export interface BaseTableColumn {
83
57
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.4.11",
3
+ "version": "0.5.2",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "build-fast": "rimraf dist && vite build",
@@ -1,14 +1,14 @@
1
1
  <template>
2
2
  <RouterLink
3
- v-if="to"
3
+ v-if="item.to"
4
4
  v-slot="{ isActive, href: slotHref, navigate }"
5
5
  custom
6
- :to="to"
6
+ :to="item.to"
7
7
  >
8
8
  <a
9
9
  :active="isActive"
10
10
  :href="slotHref"
11
- :class="props.class"
11
+ :class="classInternal"
12
12
  :aria-current="isActive ? 'page' : undefined"
13
13
  @click.prevent="onClick(navigate)"
14
14
  >
@@ -16,22 +16,27 @@
16
16
  </a>
17
17
  </RouterLink>
18
18
  <button
19
- v-else-if="action"
19
+ v-else-if="item.action"
20
20
  type="button"
21
- class="text-left"
22
- :class="props.class"
23
- @click="onClick(action)"
21
+ :class="classInternal"
22
+ @click="onClick(item.action)"
24
23
  >
25
24
  <slot :active="false" />
26
25
  </button>
27
26
  <a
28
- v-else-if="href"
29
- :href="href"
30
- :class="props.class"
27
+ v-else-if="item.href"
28
+ :href="item.href"
29
+ :class="classInternal"
31
30
  @click="onClick()"
32
31
  >
33
32
  <slot :active="false" />
34
33
  </a>
34
+ <div
35
+ v-else
36
+ :class="classInternal"
37
+ >
38
+ <slot :active="false" />
39
+ </div>
35
40
  </template>
36
41
 
37
42
  <script lang="ts">
@@ -41,15 +46,21 @@ export default {
41
46
  </script>
42
47
 
43
48
  <script setup lang="ts">
44
- import { RouteLocationRaw } from 'vue-router';
49
+ import { ActionItem } from '@/types/ActionItem';
50
+ import { twMerge } from 'tailwind-merge';
45
51
 
46
52
  const props = defineProps<{
47
- to?: RouteLocationRaw;
48
- href?: string;
49
- action?: (() => Promise<void>) | (() => void);
53
+ item: ActionItem,
50
54
  class?: string | string[] | null;
51
55
  }>();
52
56
 
57
+ const classInternal = computed(() => {
58
+ return twMerge(
59
+ 'block text-left',
60
+ props.class,
61
+ );
62
+ });
63
+
53
64
  const closeMenu = inject('closeMenu', () => {
54
65
  return;
55
66
  }) as () => void;
@@ -1,31 +1,29 @@
1
1
  <template>
2
2
  <BaseActionItem
3
- :to="action.to"
4
- :href="action.href"
5
- :action="action.action"
3
+ :item="item"
6
4
  :class="classes"
7
5
  class="flex items-center justify-center"
8
6
  >
9
7
  <BaseIcon
10
- v-if="action.icon"
11
- :icon="action.icon"
8
+ v-if="item.icon"
9
+ :icon="item.icon"
12
10
  :class="iconClasses"
13
11
  class="mr-2"
14
12
  />
15
13
  <span
16
- :class="[action.icon ? 'pr-1' : '']"
17
- >{{ action.label }}</span>
14
+ :class="[item.icon ? 'pr-1' : '']"
15
+ >{{ item.label }}</span>
18
16
  </BaseActionItem>
19
17
  </template>
20
18
 
21
19
  <script lang="ts" setup>
22
- import { ActionItem } from '@/types';
23
20
  import { BaseIcon } from '..';
21
+ import { ActionItem } from '@/types/ActionItem';
24
22
  import BaseActionItem from './BaseActionItem.vue';
25
23
 
26
24
  const props = withDefaults(
27
25
  defineProps<{
28
- action: ActionItem;
26
+ item: ActionItem;
29
27
  size: 'sm' | 'md' | 'lg';
30
28
  }>(),
31
29
  {
@@ -36,19 +34,19 @@ const props = withDefaults(
36
34
  const classes = computed(() => {
37
35
  const classList = ['btn'];
38
36
 
39
- if (props.action.color == 'primary') {
37
+ if (props.item.color == 'primary') {
40
38
  classList.push('btn-primary');
41
- } else if (props.action.color == 'secondary') {
39
+ } else if (props.item.color == 'secondary') {
42
40
  classList.push('btn-secondary-outline');
43
- } else if (props.action.color == 'danger') {
41
+ } else if (props.item.color == 'danger') {
44
42
  classList.push('btn-danger');
45
- } else if (props.action.color == 'warning') {
43
+ } else if (props.item.color == 'warning') {
46
44
  classList.push('btn-warning');
47
- } else if (props.action.color == 'success') {
45
+ } else if (props.item.color == 'success') {
48
46
  classList.push('btn-success');
49
- } else if (props.action.color == 'light') {
47
+ } else if (props.item.color == 'light') {
50
48
  classList.push('');
51
- } else if (props.action.color == 'dark') {
49
+ } else if (props.item.color == 'dark') {
52
50
  classList.push('btn-black');
53
51
  }
54
52
 
@@ -133,7 +133,7 @@ Demo.args = {
133
133
  icon: 'heroicons:table-cells',
134
134
  action: () => alert('export!'),
135
135
  },
136
- { line: true },
136
+ { meta: { line: true } },
137
137
  {
138
138
  label: 'Delete all',
139
139
  icon: 'heroicons:trash',
@@ -228,10 +228,10 @@ import {
228
228
  Collection,
229
229
  DataIteratorSection,
230
230
  DataTableQuery,
231
- MenuItemInterface,
232
231
  PaginatedCollection,
233
232
  ResourceCollection,
234
233
  } from '@/types';
234
+ import { ActionItem } from '@/types/ActionItem';
235
235
 
236
236
  import BaseMenu from './BaseMenu.vue';
237
237
  import BasePagination from './BasePagination.vue';
@@ -285,7 +285,7 @@ const props = defineProps({
285
285
  */
286
286
  actions: {
287
287
  default: undefined,
288
- type: Array as PropType<MenuItemInterface[]>,
288
+ type: Array as PropType<ActionItem[]>,
289
289
  },
290
290
 
291
291
  /**
@@ -98,7 +98,7 @@ Demo.args = {
98
98
  icon: 'heroicons:arrow-down-tray',
99
99
  action: () => alert('export!'),
100
100
  },
101
- { line: true },
101
+ { meta: { line: true } },
102
102
  {
103
103
  label: 'Delete all',
104
104
  icon: 'heroicons:trash',
@@ -242,7 +242,6 @@ import {
242
242
  CollectionItem,
243
243
  DataIteratorSection,
244
244
  DataTableQuery,
245
- MenuItemInterface,
246
245
  PaginatedCollection,
247
246
  ResourceCollection,
248
247
  RowAction,
@@ -261,6 +260,7 @@ import BaseEmptyState from '../svg/BaseEmptyState.vue';
261
260
  import { RouteLocationRaw } from 'vue-router';
262
261
  import BaseMenu from './BaseMenu.vue';
263
262
  import BaseDataTableRowAction from './BaseDataTableRowAction.vue';
263
+ import { ActionItem } from '@/types/ActionItem';
264
264
 
265
265
  const router = useRouter();
266
266
 
@@ -372,7 +372,7 @@ const props = defineProps({
372
372
  */
373
373
  checkableActions: {
374
374
  default: undefined,
375
- type: Array as PropType<MenuItemInterface[]>,
375
+ type: Array as PropType<ActionItem[]>,
376
376
  },
377
377
 
378
378
  /**
@@ -416,7 +416,7 @@ const props = defineProps({
416
416
  */
417
417
  actions: {
418
418
  default: undefined,
419
- type: Array as PropType<MenuItemInterface[]>,
419
+ type: Array as PropType<ActionItem[]>,
420
420
  },
421
421
 
422
422
  /**
@@ -654,7 +654,7 @@ const showRowActionMenu = computed<boolean>(() => {
654
654
  return rowActionsInternal.value.length > props.numberOfVisibleRowActions;
655
655
  });
656
656
 
657
- function rowActionMenuItems(row: CollectionItem): MenuItemInterface[] {
657
+ function rowActionMenuItems(row: CollectionItem): ActionItem[] {
658
658
  return rowActionsInternal.value.map((action) => {
659
659
  return {
660
660
  label: action.label,
@@ -71,7 +71,7 @@
71
71
  <BaseActionItemButton
72
72
  v-for="(primaryAction, i) in primaryActions"
73
73
  :key="i"
74
- :action="primaryAction"
74
+ :item="primaryAction"
75
75
  size="sm"
76
76
  />
77
77
  <BaseMenu
@@ -99,7 +99,8 @@
99
99
  </template>
100
100
 
101
101
  <script setup lang="ts">
102
- import { ActionItem, Breadcrumb } from '@/types';
102
+ import { Breadcrumb } from '@/types';
103
+ import { ActionItem } from '@/types/ActionItem';
103
104
  import { useResizeObserver } from '@vueuse/core';
104
105
  import { BaseBreadcrumbs, BaseIcon } from '..';
105
106
  import BaseActionItemButton from './BaseActionItemButton.vue';
@@ -19,13 +19,32 @@ export default {
19
19
  },
20
20
  menu: [
21
21
  {
22
- title: 'General',
22
+ label: 'Dashboard',
23
+ to: '/dashboard',
24
+ icon: 'heroicons:home-20-solid',
25
+ count: 1,
26
+ meta: {
27
+ showSubItems: 'always',
28
+ },
23
29
  actions: [
24
30
  {
25
- label: 'Dashboard',
26
- to: '/',
27
- icon: 'heroicons:home-20-solid',
31
+ label: 'Sales',
32
+ to: '/dashboard/1',
33
+ count: 10,
34
+ },
35
+ {
36
+ label: 'Performance',
37
+ to: '/dashboard/2',
28
38
  },
39
+ {
40
+ label: 'Workload',
41
+ to: '/dashboard/3',
42
+ },
43
+ ],
44
+ },
45
+ {
46
+ label: 'General',
47
+ actions: [
29
48
  {
30
49
  label: 'Articles',
31
50
  to: '/articles',
@@ -35,6 +54,7 @@ export default {
35
54
  {
36
55
  label: 'Articles',
37
56
  to: '/articles/1',
57
+ count: 10,
38
58
  },
39
59
  {
40
60
  label: 'Videos',
@@ -59,7 +79,7 @@ export default {
59
79
  ],
60
80
  },
61
81
  {
62
- title: 'Settings',
82
+ label: 'Settings',
63
83
  actions: [
64
84
  {
65
85
  label: 'Account',
@@ -9,17 +9,20 @@
9
9
  <div class="px-3 py-6">
10
10
  <div class="space-y-8">
11
11
  <div
12
- v-for="section in actionSections"
13
- :key="section.title"
12
+ v-for="section in menu"
13
+ :key="section.label"
14
14
  >
15
- <h2
16
- v-if="section.title"
17
- class="pl-3"
18
- :class="sectionTitleClasses"
15
+ <div
16
+ v-if="section.label && !section.href && !section.to && !section.action"
17
+ :key="section.label"
19
18
  >
20
- {{ section.title }}
21
- </h2>
22
- <div>
19
+ <h2
20
+ class="pl-3"
21
+ :class="sectionLabelClasses"
22
+ >
23
+ {{ section.label }}
24
+ </h2>
25
+
23
26
  <div :class="[size == 'md' ? 'space-y-1' : 'space-y-0.5']">
24
27
  <BaseNavbarSideItem
25
28
  v-for="item in section.actions"
@@ -30,6 +33,13 @@
30
33
  />
31
34
  </div>
32
35
  </div>
36
+
37
+ <BaseNavbarSideItem
38
+ v-else
39
+ :item="section"
40
+ :dark="dark"
41
+ :size="size"
42
+ />
33
43
  </div>
34
44
  </div>
35
45
  </div>
@@ -92,7 +102,8 @@
92
102
  <script setup lang="ts">
93
103
  import { User } from '@/types/User';
94
104
  import { PropType } from 'vue';
95
- import { ActionItem, ActionSection, NotificationsConfig } from '../types';
105
+ import { NotificationsConfig } from '../types';
106
+ import { ActionItem } from '@/types/ActionItem';
96
107
  import BaseAvatar from './BaseAvatar.vue';
97
108
  import BaseLayoutNotificationDropdown from './BaseLayoutNotificationDropdown.vue';
98
109
  import BaseLayoutSidebar from './BaseLayoutSidebar.vue';
@@ -112,7 +123,7 @@ const props = defineProps({
112
123
  },
113
124
  menu: {
114
125
  required: true,
115
- type: Array as PropType<ActionItem[] | ActionSection[]>,
126
+ type: Array as PropType<ActionItem[]>,
116
127
  },
117
128
  userMenu: {
118
129
  required: true,
@@ -136,22 +147,7 @@ const props = defineProps({
136
147
  },
137
148
  });
138
149
 
139
- const actionSections = computed((): ActionSection[] => {
140
- const isActionSections = props.menu.length > 0 && 'actions' in props.menu[0];
141
-
142
- if (isActionSections) {
143
- return props.menu as ActionSection[];
144
- }
145
-
146
- return [
147
- {
148
- title: '',
149
- actions: props.menu as ActionItem[],
150
- },
151
- ];
152
- });
153
-
154
- const sectionTitleClasses = computed((): string[] => {
150
+ const sectionLabelClasses = computed((): string[] => {
155
151
  const classList = ['mb-3 font-semibold uppercase tracking-widest'];
156
152
 
157
153
  if (props.dark) {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="sticky top-0 z-20 w-full shadow-sm">
2
+ <div :class="classInternal">
3
3
  <BaseSystemAlert
4
4
  v-for="systemAlert in systemAlerts"
5
5
  :key="systemAlert.id"
@@ -12,13 +12,19 @@
12
12
  {{ systemAlert.message }}
13
13
  </BaseSystemAlert>
14
14
 
15
- <BaseNavbar :dark="dark">
16
- <template #navbar>
17
- <slot name="navbar" />
15
+ <BaseNavbar v-bind="navbar">
16
+ <template #navbar="navbarProps">
17
+ <slot
18
+ name="navbar"
19
+ v-bind="navbarProps"
20
+ />
18
21
  </template>
19
22
 
20
- <template #mobile>
21
- <slot name="mobile" />
23
+ <template #mobile="mobileProps">
24
+ <slot
25
+ name="mobile"
26
+ v-bind="mobileProps"
27
+ />
22
28
  </template>
23
29
  </BaseNavbar>
24
30
  </div>
@@ -29,17 +35,27 @@
29
35
  </template>
30
36
 
31
37
  <script lang="ts" setup>
38
+ import { twMerge } from 'tailwind-merge';
32
39
  import { useSystemAlertStore } from '../stores/systemAlerts';
33
40
  import BaseNavbar from './BaseNavbar.vue';
34
41
  import BaseSystemAlert from './BaseSystemAlert.vue';
35
42
 
36
- defineProps({
37
- dark: {
38
- default: false,
39
- type: Boolean,
40
- },
43
+ defineOptions({
44
+ inheritAttrs: false
41
45
  });
42
46
 
47
+ const props = defineProps<{
48
+ class?: string | string[];
49
+ navbar?: Record<string, unknown>;
50
+ }>();
51
+
52
+ const classInternal = computed(() => {
53
+ return twMerge(
54
+ 'sticky top-0 z-20 w-full shadow-sm',
55
+ props.class,
56
+ )
57
+ })
58
+
43
59
  /**
44
60
  * System Alerts
45
61
  */
@@ -98,12 +98,16 @@ const Template = (args) => ({
98
98
 
99
99
  export const Light = Template.bind({});
100
100
  Light.args = {
101
- dark: false,
101
+ navbar: {
102
+ dark: false,
103
+ },
102
104
  logoUrl: 'https://sprintify.witify.io/img/logo/logo-side.svg',
103
105
  };
104
106
 
105
107
  export const Dark = Template.bind({});
106
108
  Dark.args = {
107
- dark: true,
109
+ navbar: {
110
+ dark: true,
111
+ },
108
112
  logoUrl: 'https://sprintify.witify.io/img/logo/logo-side-dark.svg',
109
113
  };