{"version":3,"sources":["../src/components/fp.tsx"],"names":["React","FP","as","styles","classes","children","defaultStyles","props","ref","Component","styleObj","fp_default"],"mappings":"AAAA,OAAOA,MAAW,QA6HlB,IAAMC,EAAKD,EAAM,WACf,CACE,CAAE,GAAAE,EAAI,OAAAC,EAAQ,QAAAC,EAAS,SAAAC,EAAU,cAAAC,EAAe,GAAGC,CAAM,EACzDC,IACG,CACH,IAAMC,EAAYP,GAAM,MAElBQ,EAAW,CAAE,GAAGJ,EAAe,GAAGH,CAAO,EAE/C,OACEH,EAAA,cAACS,EAAA,CAAU,IAAKD,EAAK,MAAOE,EAAU,UAAWN,EAAU,GAAGG,GAC3DF,CACH,CAEJ,CACF,EAEAJ,EAAG,YAAc,KAUjB,IAAOU,EAAQV","sourcesContent":["import React from 'react'\nimport { ComponentProps } from '../types'\n\n/**\n * @deprecated This type is deprecated. Use `PolymorphicRef` from './ui.tsx' instead.\n * The UI component provides better type safety and accessibility features.\n */\ntype PolymorphicRef<C extends React.ElementType> = React.Ref<\n  React.ElementRef<C>\n>\n\n/**\n * @deprecated This type is deprecated. Use `AsProp` from './ui.tsx' instead.\n * The UI component provides better type safety and accessibility features.\n */\ntype AsProp<C extends React.ElementType> = {\n  as?: C\n}\n\n/**\n * @deprecated This type is deprecated. Use `PropsToOmit` from './ui.tsx' instead.\n * The UI component provides better type safety and accessibility features.\n */\ntype PropsToOmit<C extends React.ElementType, P> = keyof (AsProp<C> & P)\n\n/**\n * @deprecated This type is deprecated. Use `PolymorphicComponentProp` from './ui.tsx' instead.\n * The UI component provides better type safety and accessibility features.\n */\ntype PolymorphicComponentProp<\n  C extends React.ElementType,\n  // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n  Props = {},\n> = React.PropsWithChildren<Props & AsProp<C>> &\n  Omit<React.ComponentPropsWithoutRef<C>, PropsToOmit<C, Props>>\n\n/**\n * @deprecated This type is deprecated. Use `PolymorphicComponentPropWithRef` from './ui.tsx' instead.\n * The UI component provides better type safety and accessibility features.\n */\ntype PolymorphicComponentPropWithRef<\n  C extends React.ElementType,\n  // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n  Props = {},\n> = PolymorphicComponentProp<C, Props> & {\n  ref?: PolymorphicRef<C> | React.ForwardedRef<React.ElementRef<C>>\n}\n\n/**\n * @deprecated This type is deprecated. Use `UIProps` from './ui.tsx' instead.\n * The UI component provides better type safety and accessibility features.\n */\ntype FPProps<C extends React.ElementType> = PolymorphicComponentPropWithRef<\n  C,\n  {\n    renderStyles?: boolean\n    styles?: React.CSSProperties\n    classes?: string\n  }\n>\n\n/**\n * FPComponent type definition\n *\n * @deprecated This type is deprecated. Use the `UI` component from './ui.tsx' instead.\n * The UI component provides enhanced accessibility documentation, better type safety,\n * and comprehensive WCAG 2.1 AA compliance guidance.\n *\n * @typeParam C - The HTML element type to render\n * @param props - The component props\n * @returns React component\n *\n * @example\n * ```typescript\n * // Migration from FP to UI\n * // Before:\n * import FP from '@fpkit/acss/components/fp';\n * <FP as=\"button\" styles={{ padding: '1rem' }}>Click me</FP>\n *\n * // After:\n * import UI from '@fpkit/acss/components/ui';\n * <UI as=\"button\" styles={{ padding: '1rem' }}>Click me</UI>\n * ```\n */\ntype FPComponent = {\n  <C extends React.ElementType = 'span'>(\n    props: FPProps<C>,\n  ): React.ReactElement | null\n  displayName?: string\n}\n\n/**\n * @deprecated **DEPRECATED:** This component is deprecated and will be removed in a future version.\n * Please use the `UI` component from `./ui.tsx` instead.\n *\n * The UI component is a drop-in replacement with the same API but provides:\n * - Enhanced accessibility documentation and WCAG 2.1 AA compliance guidance\n * - Better TypeScript type safety with detailed JSDoc comments\n * - Comprehensive examples for accessible component patterns\n * - More robust style merging with defaultStyles support\n *\n * @example\n * ```typescript\n * // Migration Guide\n * // Before:\n * import FP from '@fpkit/acss/components/fp';\n * <FP as=\"button\" styles={{ padding: '1rem' }} classes=\"btn\">\n *   Click me\n * </FP>\n *\n * // After:\n * import UI from '@fpkit/acss/components/ui';\n * <UI as=\"button\" styles={{ padding: '1rem' }} classes=\"btn\">\n *   Click me\n * </UI>\n * ```\n *\n * @param {Object} props - Component props\n * @param {React.ElementType} props.as - The HTML element to render. Defaults to 'div'.\n * @param {boolean} props.renderStyles - Whether to render styles or not. Defaults to true.\n * @param {Object} props.styles - The styles to apply to the component.\n * @param {Object} props.defaultStyles - The default styles to apply to the component.\n * @param {React.ReactNode} props.children - The children to render inside the component.\n * @returns {React.ReactElement} - A React component that renders an HTML element with optional styles.\n */\nconst FP = React.forwardRef(\n  <C extends React.ElementType>(\n    { as, styles, classes, children, defaultStyles, ...props }: FPProps<C>,\n    ref?: PolymorphicRef<C>,\n  ) => {\n    const Component = as || 'div'\n\n    const styleObj = { ...defaultStyles, ...styles } as React.CSSProperties\n\n    return (\n      <Component ref={ref} style={styleObj} className={classes} {...props}>\n        {children}\n      </Component>\n    )\n  },\n) as FPComponent\n\nFP.displayName = 'FP'\n\n/**\n * @deprecated This interface is deprecated. Use the `UI` component from './ui.tsx' instead.\n * The UI component provides better type safety and accessibility features.\n */\nexport interface BoxProps extends ComponentProps {\n  renderStyles: true\n}\n\nexport default FP\n"]}