UNPKG

@guruhotel/aura-ui

Version:

⚛️ React UI library by GuruHotel

1 lines 603 B
import e,{useRef as r}from"react";import{useDateSegment as t}from"@react-aria/datepicker";import{SegmenetSpan as i,SegmentContainer as a}from"./date-field.styles";import{jsx as l}from"react/jsx-runtime";import{jsxs as o}from"react/jsx-runtime";export function DateSegment({segment:e,state:s,rounded:d}){const m=r(),{segmentProps:n}=t(e,s,m);return o(a,{...n,ref:m,style:{...n.style,minWidth:null!=e.maxValue?`${String(e.maxValue).length}ch`:void 0},isEditable:e.isEditable,rounded:d,children:[l(i,{"aria-hidden":"true",isPlaceholder:e.isPlaceholder,children:e.placeholder}),e.isPlaceholder?"":e.text]})}