{"version":3,"file":"Text.cjs","names":[],"sources":["../../../../../src/components/Form/Controls/Text/Text.tsx"],"sourcesContent":["/*\nCopyright 2025 New Vector Ltd.\nCopyright 2023 The Matrix.org Foundation C.I.C.\nCopyright 2023 New Vector Ltd\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, {\n  forwardRef,\n  type ComponentProps,\n  type ComponentRef,\n} from \"react\";\nimport { Control } from \"@radix-ui/react-form\";\n\nimport styles from \"./Text.module.css\";\nimport classNames from \"classnames\";\n\ntype TextProps = {\n  /**\n   * The CSS class name.\n   */\n  className?: string;\n\n  /**\n   * Enable contextual alternate ligatures on input text\n   * For example on an in-place editing field\n   * https://github.com/rsms/inter/issues/222\n   * https://github.com/rsms/inter/blob/master/src/features/calt.fea\n   */\n  enableLigatures?: boolean;\n} & ComponentProps<\"input\">;\n\n/**\n * A styled text input, for standalone use.\n */\nexport const TextInput = forwardRef<HTMLInputElement, TextProps>(\n  function TextInput({ className, enableLigatures, ...props }, ref) {\n    const classes = classNames(styles.control, className, {\n      [styles[\"enable-ligatures\"]]: enableLigatures,\n    });\n    return <input ref={ref} {...props} className={classes} />;\n  },\n);\n\n/**\n * A styled text input wrapped in a `Control` component, for use in Radix forms.\n */\nexport const TextControl = forwardRef<\n  ComponentRef<typeof TextInput>,\n  ComponentProps<typeof TextInput>\n>(function TextControl(props, ref) {\n  return (\n    <Control asChild>\n      <TextInput ref={ref} {...props} />\n    </Control>\n  );\n});\n"],"mappings":";;;;;;;;;;;;AAqCA,IAAa,aAAA,GAAA,MAAA,YACX,SAAS,UAAU,EAAE,WAAW,iBAAiB,GAAG,SAAS,KAAK;CAChE,MAAM,WAAA,GAAA,WAAA,SAAqB,oBAAA,QAAO,SAAS,WAAW,GACnD,oBAAA,QAAO,sBAAsB,iBAC/B,CAAC;AACF,QAAO,iBAAA,GAAA,kBAAA,KAAC,SAAD;EAAY;EAAK,GAAI;EAAO,WAAW;EAAW,CAAA;EAE5D;;;;AAKD,IAAa,eAAA,GAAA,MAAA,YAGX,SAAS,YAAY,OAAO,KAAK;AACjC,QACE,iBAAA,GAAA,kBAAA,KAAC,qBAAA,SAAD;EAAS,SAAA;YACP,iBAAA,GAAA,kBAAA,KAAC,WAAD;GAAgB;GAAK,GAAI;GAAS,CAAA;EAC1B,CAAA;EAEZ"}