diff --git a/docs/src/app/(docs)/react/components/otp-field/demos/custom-sanitize/css-modules/index.module.css b/docs/src/app/(docs)/react/components/otp-field/demos/custom-sanitize/css-modules/index.module.css index 89b23f66487..6b0d480f505 100644 --- a/docs/src/app/(docs)/react/components/otp-field/demos/custom-sanitize/css-modules/index.module.css +++ b/docs/src/app/(docs)/react/components/otp-field/demos/custom-sanitize/css-modules/index.module.css @@ -72,11 +72,6 @@ color: var(--color-gray-600); } -.Code { - font-family: - ui-monospace, SFMono-Regular, 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace; -} - .ScreenReaderOnly { position: absolute; width: 1px; diff --git a/docs/src/app/(docs)/react/components/otp-field/demos/custom-sanitize/css-modules/index.tsx b/docs/src/app/(docs)/react/components/otp-field/demos/custom-sanitize/css-modules/index.tsx index 1245015033f..6051b802d1e 100644 --- a/docs/src/app/(docs)/react/components/otp-field/demos/custom-sanitize/css-modules/index.tsx +++ b/docs/src/app/(docs)/react/components/otp-field/demos/custom-sanitize/css-modules/index.tsx @@ -6,8 +6,8 @@ import styles from './index.module.css'; const CODE_LENGTH = 6; -function sanitizeTierCode(value: string) { - return value.replace(/[^0-3]/g, ''); +function normalizeRecoveryCode(value: string) { + return value.toUpperCase(); } function getInvalidClassName(invalidPulse: number, evenClassName: string, oddClassName: string) { @@ -18,7 +18,7 @@ function getInvalidClassName(invalidPulse: number, evenClassName: string, oddCla return invalidPulse % 2 === 0 ? evenClassName : oddClassName; } -export default function OTPFieldCustomSanitizeDemo() { +export default function OTPFieldCustomNormalizeDemo() { const id = React.useId(); const descriptionId = `${id}-description`; @@ -40,14 +40,13 @@ export default function OTPFieldCustomSanitizeDemo() { return (
- Digits 0-3 only. + Letters and digits only. Letters are converted to uppercase.
{statusMessage} diff --git a/docs/src/app/(docs)/react/components/otp-field/demos/custom-sanitize/index.ts b/docs/src/app/(docs)/react/components/otp-field/demos/custom-sanitize/index.ts index 83dcddc8729..6593c6878cd 100644 --- a/docs/src/app/(docs)/react/components/otp-field/demos/custom-sanitize/index.ts +++ b/docs/src/app/(docs)/react/components/otp-field/demos/custom-sanitize/index.ts @@ -1,6 +1,6 @@ import { createDemoWithVariants } from 'docs/src/utils/createDemo'; import CssModules from './css-modules'; -export const DemoOTPFieldCustomSanitize = createDemoWithVariants(import.meta.url, { +export const DemoOTPFieldCustomNormalize = createDemoWithVariants(import.meta.url, { CssModules, }); diff --git a/docs/src/app/(docs)/react/components/otp-field/page.mdx b/docs/src/app/(docs)/react/components/otp-field/page.mdx index 7220cbf6bf7..aaf9046465b 100644 --- a/docs/src/app/(docs)/react/components/otp-field/page.mdx +++ b/docs/src/app/(docs)/react/components/otp-field/page.mdx @@ -106,16 +106,18 @@ import { DemoOTPFieldFocusedPlaceholder } from './demos/focused-placeholder';