@aures5g/vue-component-library 0.1.2 → 0.2.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.
@@ -31,7 +31,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
31
31
  /**
32
32
  * Severity type of the badge.
33
33
  */
34
- badgeSeverity?: HintedString<"success" | "secondary" | "info" | "warning" | "danger" | "contrast">;
34
+ badgeSeverity?: HintedString<"success" | "info" | "warning" | "secondary" | "danger" | "contrast">;
35
35
  /**
36
36
  * Whether the button is in loading state.
37
37
  * @defaultValue false
@@ -49,7 +49,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
49
49
  /**
50
50
  * Defines the style of the button.
51
51
  */
52
- severity?: HintedString<"success" | "help" | "secondary" | "info" | "warning" | "danger" | "contrast">;
52
+ severity?: HintedString<"success" | "info" | "warning" | "help" | "secondary" | "danger" | "contrast">;
53
53
  /**
54
54
  * Add a shadow to indicate elevation.
55
55
  * @defaultValue false
@@ -123,7 +123,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
123
123
  /**
124
124
  * Severity type of the badge.
125
125
  */
126
- badgeSeverity?: HintedString<"success" | "secondary" | "info" | "warning" | "danger" | "contrast">;
126
+ badgeSeverity?: HintedString<"success" | "info" | "warning" | "secondary" | "danger" | "contrast">;
127
127
  /**
128
128
  * Whether the button is in loading state.
129
129
  * @defaultValue false
@@ -141,7 +141,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
141
141
  /**
142
142
  * Defines the style of the button.
143
143
  */
144
- severity?: HintedString<"success" | "help" | "secondary" | "info" | "warning" | "danger" | "contrast">;
144
+ severity?: HintedString<"success" | "info" | "warning" | "help" | "secondary" | "danger" | "contrast">;
145
145
  /**
146
146
  * Add a shadow to indicate elevation.
147
147
  * @defaultValue false
@@ -0,0 +1,45 @@
1
+ import { type RouteRecordName } from 'vue-router';
2
+ import type { Icon, MenuItems } from './menu.types';
3
+ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
4
+ mainMenuItems: MenuItems;
5
+ branding: [string, string];
6
+ brandLogo?: Icon;
7
+ landingRoute?: RouteRecordName;
8
+ expandedRoutes?: RouteRecordName[];
9
+ }>, {
10
+ brandLogo: () => import("@fortawesome/fontawesome-common-types").IconDefinition;
11
+ landingRoute: any;
12
+ expandedRoutes: () => any[];
13
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
14
+ mainMenuItems: MenuItems;
15
+ branding: [string, string];
16
+ brandLogo?: Icon;
17
+ landingRoute?: RouteRecordName;
18
+ expandedRoutes?: RouteRecordName[];
19
+ }>, {
20
+ brandLogo: () => import("@fortawesome/fontawesome-common-types").IconDefinition;
21
+ landingRoute: any;
22
+ expandedRoutes: () => any[];
23
+ }>>>, {
24
+ brandLogo: Icon;
25
+ landingRoute: RouteRecordName;
26
+ expandedRoutes: RouteRecordName[];
27
+ }, {}>;
28
+ export default _default;
29
+ type __VLS_WithDefaults<P, D> = {
30
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
31
+ default: D[K];
32
+ }> : P[K];
33
+ };
34
+ type __VLS_Prettify<T> = {
35
+ [K in keyof T]: T[K];
36
+ } & {};
37
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
38
+ type __VLS_TypePropsToOption<T> = {
39
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
40
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
41
+ } : {
42
+ type: import('vue').PropType<T[K]>;
43
+ required: true;
44
+ };
45
+ };
@@ -0,0 +1,13 @@
1
+ import type { IconDefinition } from '@fortawesome/fontawesome-common-types';
2
+ export type Icon = object | string[] | string | IconDefinition;
3
+ export type MenuItem = {
4
+ name: string;
5
+ title: string;
6
+ faIcon: Icon;
7
+ navbarBadge?: string;
8
+ href?: string;
9
+ };
10
+ export type MenuItemWithSubmenu = MenuItem & {
11
+ subMenuItems?: MenuItem[];
12
+ };
13
+ export type MenuItems = MenuItemWithSubmenu[];
@@ -0,0 +1,52 @@
1
+ import { type Ref } from 'vue';
2
+ import type { MenuItemWithSubmenu, MenuItems } from './menu.types';
3
+ import { type RouteRecordName } from 'vue-router';
4
+ /**
5
+ * Keep track of navbar expanded state, append corresponding classes.
6
+ * Expand navbar by default for provided routes.
7
+ */
8
+ export declare function useExpandableMenu(expandedRoutes?: RouteRecordName[]): {
9
+ isNavbarExpandedByDefault: import("vue").ComputedRef<boolean>;
10
+ isMenuOpen: import("vue").ComputedRef<boolean>;
11
+ onToggle: () => void;
12
+ navbarClasses: import("vue").ComputedRef<string>;
13
+ };
14
+ /**
15
+ * Keep track of menu categories and submenu visibility state, append corresponding classes.
16
+ * Watch route and automatically open/close active category.
17
+ */
18
+ export declare function useMenuCategories(mainMenuItems: MenuItems, landingRoute?: RouteRecordName | null): {
19
+ menuCategories: Ref<Record<string, boolean>>;
20
+ openMenuCategory: (category: string) => void;
21
+ onCategoryClick: (menu: MenuItemWithSubmenu) => void;
22
+ menuCategoryClasses: import("vue").ComputedRef<Record<string, {
23
+ 'submenu--visible': boolean;
24
+ }>>;
25
+ };
26
+ /**
27
+ * Handle everything around floating menu
28
+ */
29
+ export declare function useFloatingMenu(mainMenuItems: MenuItems, menuCategories: Ref<Record<string, boolean>>): {
30
+ activeFloatingMenuIndex: Ref<number>;
31
+ menuItemRefs: Ref<HTMLLIElement[]>;
32
+ navbarRef: Ref<HTMLDivElement>;
33
+ enterFloatingTrigger: (index: number, category: string) => void;
34
+ leaveFloatingTrigger: (index: number) => Promise<void>;
35
+ activeFloatingMenu: import("vue").ComputedRef<MenuItemWithSubmenu>;
36
+ floatingMenuWrapperRef: Ref<HTMLDivElement>;
37
+ resetFloatingMenu: () => Promise<void>;
38
+ focusFloatingMenu: () => Promise<void>;
39
+ blurFloatingMenu: () => Promise<void>;
40
+ };
41
+ /**
42
+ * Create routing elements for navbar. If route is external "a" tag otherwise "router-link" tag is used.
43
+ */
44
+ export declare function useCategoryLink(): {
45
+ getCategoryLinkComponent: (menu: MenuItemWithSubmenu) => "a" | "router-link";
46
+ getCategoryLinkProps: (menu: MenuItemWithSubmenu) => {
47
+ readonly [x: string]: string | {
48
+ name: string;
49
+ };
50
+ readonly target: "_blank";
51
+ };
52
+ };
package/dist/index.d.ts CHANGED
@@ -2,4 +2,5 @@ import './assets/primevue/themes/acbs/theme.scss';
2
2
  import HelloWorld from './components/HelloWorld/HelloWorld.vue';
3
3
  import PrimeVue from './config/primevue';
4
4
  import UIButton from './components/button/UIButton.vue';
5
- export { HelloWorld, PrimeVue, UIButton };
5
+ import UIMenu from './components/menu/UIMenu.vue';
6
+ export { HelloWorld, PrimeVue, UIButton, UIMenu };