UNPKG

@nexusui/components

Version:

These are custom components specially-developed for NexusUI applications. They will make your life easier by giving you out-of-the-box implementations for various high-level UI elements that you can drop directly into your application.

2 lines (1 loc) 919 B
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{forwardRef as o}from"react";import r from"@mui/material/MenuItem";import a from"country-flag-icons/react/3x2";import m from"@mui/material/Box";import n from"clsx";import i from"./PhoneNumber.styles.js";const s="NexusCountryItem";var u=o(((o,u)=>{const{name:c,iso2:d,dialCode:l,localization:N,...f}=o,x=a[d.toUpperCase()];return e(r,{ref:u,className:n(`${s}-root`,"country"),"data-testid":`${s}-root`,"data-dial-code":"1","data-country-code":d,...f,children:[Boolean(x)&&t(m,{sx:i.flagIcon,"data-testid":"NexusPhoneNumber-country-flag",children:t(x,{"data-testid":`NexusPhoneNumber-country-flag-${d}`})}),t(m,{className:n(`${s}-countryName`,"NexusPhoneNumber-country-name"),"data-testid":"NexusPhoneNumber-country-name",children:N||c}),e(m,{sx:i.dialCode,"data-testid":"NexusPhoneNumber-country-dial-code",children:["(",`+${l}`,")"]})]})}));export{u as default};