analytica-frontend-lib
Version:
Repositório público dos componentes utilizados nas plataformas da Analytica Ensino
49 lines (46 loc) • 2.23 kB
TypeScript
import * as react_jsx_runtime from 'react/jsx-runtime';
import * as react from 'react';
import { HTMLAttributes, ReactNode } from 'react';
import { StoreApi } from 'zustand';
type MenuVariant = 'menu' | 'menu2' | 'menu-overflow' | 'breadcrumb';
interface MenuStore {
value: string;
setValue: (value: string) => void;
onValueChange?: (value: string) => void;
}
type MenuStoreApi = StoreApi<MenuStore>;
declare const useMenuStore: (externalStore?: MenuStoreApi) => MenuStoreApi;
interface MenuProps extends HTMLAttributes<HTMLDivElement> {
children: ReactNode;
defaultValue: string;
value?: string;
variant?: MenuVariant;
onValueChange?: (value: string) => void;
}
declare const Menu: react.ForwardRefExoticComponent<MenuProps & react.RefAttributes<HTMLDivElement>>;
interface MenuContentProps extends HTMLAttributes<HTMLUListElement> {
children: ReactNode;
variant?: MenuVariant;
}
declare const MenuContent: react.ForwardRefExoticComponent<MenuContentProps & react.RefAttributes<HTMLUListElement>>;
interface MenuItemProps extends HTMLAttributes<HTMLLIElement> {
value: string;
disabled?: boolean;
store?: MenuStoreApi;
variant?: MenuVariant;
separator?: boolean;
}
declare const MenuItem: react.ForwardRefExoticComponent<MenuItemProps & react.RefAttributes<HTMLLIElement>>;
declare const MenuItemIcon: ({ className, icon, ...props }: HTMLAttributes<HTMLSpanElement> & {
icon: ReactNode;
}) => react_jsx_runtime.JSX.Element;
declare const internalScroll: (container: HTMLUListElement | null, direction: "left" | "right") => void;
declare const internalCheckScroll: (container: HTMLUListElement | null, setShowLeftArrow: (v: boolean) => void, setShowRightArrow: (v: boolean) => void) => void;
interface MenuOverflowProps extends HTMLAttributes<HTMLDivElement> {
children: ReactNode;
defaultValue: string;
value?: string;
onValueChange?: (value: string) => void;
}
declare const MenuOverflow: ({ children, className, defaultValue, value, onValueChange, ...props }: MenuOverflowProps) => react_jsx_runtime.JSX.Element;
export { Menu, MenuContent, MenuItem, MenuItemIcon, MenuOverflow, Menu as default, internalCheckScroll, internalScroll, useMenuStore };