@cerberus-design/react
Version:
The Cerberus Design React component library.
1 lines • 1.61 kB
Source Map (JSON)
{"version":3,"sources":["../../../../src/components/deprecated/FieldMessage.tsx"],"sourcesContent":["'use client'\n\nimport type { HTMLAttributes } from 'react'\nimport { cx } from 'styled-system/css'\nimport {\n fieldMessage,\n type FieldMessageVariantProps,\n} from 'styled-system/recipes'\nimport { useFieldContext } from '@ark-ui/react/field'\n\n/**\n * This module contains the FieldMessage component.\n * @module\n */\nexport interface FieldMessageBaseProps\n extends HTMLAttributes<HTMLParagraphElement> {\n /**\n * The id of the FieldMessage element describing the field. Required for accessibility. It is considered best practice to use the `help` or `error` prefix to help screen readers identify the type of message.\n *\n * @example For help messages: `help:field_id`\n * @example For error messages: `error:field_id`\n */\n id: string\n}\nexport type FieldMessageProps = FieldMessageBaseProps & FieldMessageVariantProps\n\n/**\n * @deprecated use FieldHelperText, FieldErrorText, or FieldParts instead\n */\nexport function FieldMessage(props: FieldMessageProps) {\n const { invalid } = useFieldContext()\n return (\n <small\n {...props}\n {...(invalid && { 'aria-invalid': true })}\n className={cx(props.className, fieldMessage())}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,iBAAmB;AACnB,qBAGO;AACP,mBAAgC;AAwB5B;AAHG,SAAS,aAAa,OAA0B;AACrD,QAAM,EAAE,QAAQ,QAAI,8BAAgB;AACpC,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAI,WAAW,EAAE,gBAAgB,KAAK;AAAA,MACvC,eAAW,eAAG,MAAM,eAAW,6BAAa,CAAC;AAAA;AAAA,EAC/C;AAEJ;","names":[]}