From e46ba8127dd215a7dba73d7fe9681a0166f58754 Mon Sep 17 00:00:00 2001 From: Paul Valerie GOMA Date: Wed, 30 Jul 2025 10:43:18 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=B7=EF=B8=8F=20=20Menu=20bar=20compone?= =?UTF-8?q?nt=20interface=20file=20added?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/menu/IVMenuBar.type.ts | 91 +++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 src/components/menu/IVMenuBar.type.ts diff --git a/src/components/menu/IVMenuBar.type.ts b/src/components/menu/IVMenuBar.type.ts new file mode 100644 index 0000000..cd86ae2 --- /dev/null +++ b/src/components/menu/IVMenuBar.type.ts @@ -0,0 +1,91 @@ +import type { HTMLAttributes } from "vue" +import type { RouteLocationRaw } from "vue-router" +import type { MenuItem } from "primevue/menuitem" +/** + * Describes a link or button item in a menu bar. + */ +export interface IVMenuBarLinks { + /** Whether the item should be rendered as a button */ + button?: boolean; + + /** Name of the icon to display on the left */ + icon?: string; + + /** Whether the icon appears on the right side */ + iconRight?: boolean; + + /** Text label for the item */ + label?: string; + + /** Target URL if rendered as an anchor () */ + target?: string; + + /** Callback executed when the item is clicked */ + onClick?: ($event: MouseEvent) => void; + + /** Navigation route */ + to?: RouteLocationRaw; +} + +/** + * Extends PrimeVue's MenuItem with optional routing capabilities. + * Excludes 'style' and 'class' to avoid conflicts with Vue attributes. + */ +export interface IVMenuItem + extends Partial>, + Partial> {} + +/** + * Interface for configuring a customizable menu bar component. + */ +export default interface IVMenuBar { + /** HTML id for the searchbar input */ + searchbarId?: string; + + /** Title of the service or application */ + serviceTitle?: string; + + /** Description of the service */ + serviceDescription?: string; + + /** Text displayed beside the logo (can be multiline) */ + logoText?: string | string[]; + + /** Whether to show the logo */ + logo?: boolean; + + /** Bound model value for the search input */ + modelValue?: string; + + /** Placeholder text for the search input */ + placeholder?: string; + + /** List of quick link items with additional HTML attributes */ + quickLinks?: (IVMenuItem & HTMLAttributes)[]; + + /** Label for the search input (accessibility) */ + searchLabel?: string; + + /** ARIA label for the quick links section */ + quickLinksAriaLabel?: string; + + /** Whether to display the search bar */ + showSearch?: boolean; + + /** Label describing the search bar visibility */ + showSearchLabel?: string; + + /** Label for the main menu toggle button */ + menuLabel?: string; + + /** Label used in modal menus */ + menuModalLabel?: string; + + /** Label for closing the modal menu */ + closeMenuModalLabel?: string; + + /** Responsive breakpoints (e.g. Tailwind-style classes) */ + breakpoints?: string; +} + +