UNPKG

carbon-react

Version:

A library of reusable React components for easily building user interfaces.

2 lines (1 loc) 861 B
import{jsxs as e,jsx as o}from"react/jsx-runtime";import"react";import t from"./button.style.js";import n from"./navbar.style.js";import r from"../../../icon/icon.component.js";import i from"../../../../__internal__/utils/helpers/events/events.js";import a from"../../../../hooks/__internal__/useLocale/useLocale.js";const l=({onPreviousClick:l,onNextClick:s,className:c})=>{const m=a(),{previousMonthButton:p,nextMonthButton:u}=m.date.ariaLabels,h=e=>{(i.isLeftKey(e)||i.isRightKey(e)||i.isUpKey(e)||i.isDownKey(e))&&(e.stopPropagation(),e.preventDefault())};return e(n,{className:c,"data-role":"date-navbar",children:[o(t,{"aria-label":p(),onClick:e=>{null==l||l(e)},onKeyDown:h,children:o(r,{type:"chevron_left"})}),o(t,{"aria-label":u(),onClick:e=>null==s?void 0:s(e),onKeyDown:h,children:o(r,{type:"chevron_right"})})]})};export{l as Navbar,l as default};