koval-ui
Version:
React components collection with minimalistic design. Supports theming, layout, and input validation.
1 lines • 1.77 kB
Source Map (JSON)
{"version":3,"file":"Paragraph.cjs","sources":["../../../../src/lib/Text/Paragraph.tsx"],"sourcesContent":["import type {ReactNode} from 'react';\nimport {forwardRef} from 'react';\nimport classNames from 'classnames';\n\nimport type {DataAttributes, LibraryProps} from '@/internal/LibraryAPI';\n\nimport classes from './Text.module.css';\n\nenum Hyphens {\n none = 'none',\n manual = 'manual',\n auto = 'auto',\n}\n\nexport type Props = DataAttributes &\n LibraryProps & {\n children?: ReactNode;\n /**\n * Set hyphenation mode for the text\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/hyphens\n */\n hyphens?: keyof typeof Hyphens;\n };\n\nexport const P = forwardRef<HTMLParagraphElement, Props>(\n ({children, className, hyphens = Hyphens.none, ...nativeProps}, ref) => {\n return (\n <p\n {...nativeProps}\n className={classNames(\n classes.paragraph,\n {[classes.manual]: hyphens === Hyphens.manual},\n {[classes.auto]: hyphens === Hyphens.auto},\n className\n )}\n ref={ref}>\n {children}\n </p>\n );\n }\n);\n\nP.displayName = 'P';\n"],"names":["P","forwardRef","children","className","hyphens","nativeProps","ref","jsx","classNames","classes"],"mappings":"gNAwBaA,EAAIC,EAAAA,WACb,CAAC,CAAC,SAAAC,EAAU,UAAAC,EAAW,QAAAC,EAAU,OAAc,GAAGC,CAAA,EAAcC,IAExDC,EAAAA,IAAC,IAAA,CACI,GAAGF,EACJ,UAAWG,EACPC,EAAAA,QAAQ,UACR,CAAC,CAACA,EAAAA,QAAQ,MAAM,EAAGL,IAAY,QAAA,EAC/B,CAAC,CAACK,EAAAA,QAAQ,IAAI,EAAGL,IAAY,MAAA,EAC7BD,CAAA,EAEJ,IAAAG,EACC,SAAAJ,CAAA,CAAA,CAIjB,EAEAF,EAAE,YAAc"}