UNPKG

@yamada-ui/react

Version:

React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion

31 lines (27 loc) 1.02 kB
"use client"; import { styled } from "../../core/system/factory.js"; import { createComponent } from "../../core/components/create-component.js"; import { formatByteStyle } from "./format-byte.style.js"; import { useFormatByte } from "./use-format-byte.js"; import { jsx } from "react/jsx-runtime"; //#region src/components/format/format-byte.tsx const { PropsContext: FormatBytePropsContext, usePropsContext: useFormatBytePropsContext, withContext } = createComponent("format-byte", formatByteStyle); /** * `Format` is used to format dates, numbers, and bytes according to a specific locale. * * @see https://yamada-ui.com/docs/components/format */ const FormatByte = withContext(({ locale, unit, unitDisplay, value,...rest }) => { const text = useFormatByte(value, { locale, unit, unitDisplay }); return /* @__PURE__ */ jsx(styled.span, { ...rest, children: text }); })(); //#endregion export { FormatByte, FormatBytePropsContext, useFormatBytePropsContext }; //# sourceMappingURL=format-byte.js.map