UNPKG

@hitachivantara/uikit-react-core

Version:

Core React components for the NEXT Design System.

57 lines (56 loc) 1.73 kB
import { jsxs, jsx } from "react/jsx-runtime"; import { setId } from "../../../utils/setId.js"; import { getMonthNamesList } from "../../utils.js"; import { useClasses } from "./ComposedNavigation.styles.js"; import { staticClasses } from "./ComposedNavigation.styles.js"; import { Navigation } from "../Navigation/Navigation.js"; const HvComposedNavigation = ({ classes: classesProp, id, locale, onChange, onViewModeChange, visibleYear, visibleMonth, ...others }) => { const { classes } = useClasses(classesProp); const listMonthNamesLong = getMonthNamesList(locale, "long"); const monthName = listMonthNamesLong[visibleMonth - 1]; return /* @__PURE__ */ jsxs("div", { className: classes.navigationContainer, ...others, children: [ /* @__PURE__ */ jsx("div", { className: classes.navigationMonth, children: /* @__PURE__ */ jsx( Navigation, { id: setId(id, "navigation-month"), navigationText: monthName, onNavigatePrevious: (event) => { onChange?.(event, "previous_month"); }, onNavigateNext: (event) => { onChange?.(event, "next_month"); }, onTextClick: () => { onViewModeChange("monthly"); }, className: classes.navigationMonth } ) }), /* @__PURE__ */ jsx( Navigation, { id: setId(id, "navigation-year"), navigationText: visibleYear.toString(), onNavigatePrevious: (event) => { onChange?.(event, "previous_year"); }, onNavigateNext: (event) => { onChange?.(event, "next_year"); } } ) ] }); }; export { HvComposedNavigation, staticClasses as composedNavigationClasses };