UNPKG

@crossed/ui

Version:

A universal & performant styling library for React Native, Next.js & React

37 lines (36 loc) 1.04 kB
import { jsx } from "react/jsx-runtime"; import { memo, useId } from "react"; import { Headline } from "../../typography"; import { widthCell } from "./styles"; import { capFirstLetter } from "./utils"; import { XBox } from "../../layout"; import { composeStyles, inlineStyle } from "@crossed/styled"; const WeekDay = memo( ({ days, locale, style }) => { const id = useId(); const formatter = new Intl.DateTimeFormat(locale, { weekday: "short" }); return /* @__PURE__ */ jsx(XBox, { space: "xxs", justifyContent: "between", style, children: days.map((day) => /* @__PURE__ */ jsx( Headline, { color: "secondary", size: "md", textAlign: "center", numberOfLines: 1, style: composeStyles( widthCell, inlineStyle(() => ({ base: { fontWeight: "500" } })) ), children: capFirstLetter(formatter.format(day.date)) }, `${id}-${day.date.getDate()}` )) }); } ); export { WeekDay }; //# sourceMappingURL=WeekDay.js.map