@yamada-ui/react
Version:
React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion
54 lines (50 loc) • 2.15 kB
JavaScript
"use client";
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
const require_factory = require('../../core/system/factory.cjs');
const require_create_component = require('../../core/components/create-component.cjs');
const require_format_number_style = require('./format-number.style.cjs');
const require_use_format_number = require('./use-format-number.cjs');
let react_jsx_runtime = require("react/jsx-runtime");
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
//#region src/components/format/format-number.tsx
const { PropsContext: FormatNumberPropsContext, usePropsContext: useFormatNumberPropsContext, withContext } = require_create_component.createComponent("format-number", require_format_number_style.formatNumberStyle);
/**
* `Format` is used to format dates, numbers, and bytes according to a specific locale.
*
* @see https://yamada-ui.com/docs/components/format
*/
const FormatNumber = withContext(({ style, compactDisplay, currency, currencyDisplay, currencySign, locale, localeMatcher, maximumFractionDigits, maximumSignificantDigits, minimumFractionDigits, minimumIntegerDigits, minimumSignificantDigits, notation, numberingSystem, roundingIncrement, roundingMode, roundingPriority, signDisplay, trailingZeroDisplay, unit, unitDisplay, useGrouping, value,...rest }) => {
const text = require_use_format_number.useFormatNumber(value, {
style,
compactDisplay,
currency,
currencyDisplay,
currencySign,
locale,
localeMatcher,
maximumFractionDigits,
maximumSignificantDigits,
minimumFractionDigits,
minimumIntegerDigits,
minimumSignificantDigits,
notation,
numberingSystem,
roundingIncrement,
roundingMode,
roundingPriority,
signDisplay,
trailingZeroDisplay,
unit,
unitDisplay,
useGrouping
});
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.styled.span, {
...rest,
children: text
});
})();
//#endregion
exports.FormatNumber = FormatNumber;
exports.FormatNumberPropsContext = FormatNumberPropsContext;
exports.useFormatNumberPropsContext = useFormatNumberPropsContext;
//# sourceMappingURL=format-number.cjs.map