@wordpress/components
Version:
UI components for WordPress.
1 lines • 1.49 kB
Source Map (JSON)
{"version":3,"file":"deprecated.mjs","names":[],"sources":["../../src/button/deprecated.tsx"],"sourcesContent":["import type { ForwardedRef } from 'react';\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef } from '@wordpress/element';\nimport Button from '.';\nimport type { DeprecatedIconButtonProps } from './types';\n\nfunction UnforwardedIconButton(\n\t{\n\t\tlabel,\n\t\tlabelPosition,\n\t\tsize,\n\t\ttooltip,\n\t\t...props\n\t}: React.ComponentPropsWithoutRef< typeof Button > &\n\t\tDeprecatedIconButtonProps,\n\tref: ForwardedRef< any >\n) {\n\tdeprecated( 'wp.components.IconButton', {\n\t\tsince: '5.4',\n\t\talternative: 'wp.components.Button',\n\t\tversion: '6.2',\n\t} );\n\n\treturn (\n\t\t// Disable reason: the parent component is taking care of the __next40pxDefaultSize prop.\n\t\t// eslint-disable-next-line @wordpress/components-no-missing-40px-size-prop\n\t\t<Button\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t\ttooltipPosition={ labelPosition }\n\t\t\ticonSize={ size }\n\t\t\tshowTooltip={ tooltip !== undefined ? !! tooltip : undefined }\n\t\t\tlabel={ tooltip || label }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( UnforwardedIconButton );\n"],"mappings":";;;;;AAMA,SAAS,sBACR,EACC,OACA,eACA,MACA,SACA,GAAG,SAGJ,KACC;CACD,WAAY,4BAA4B;EACvC,OAAO;EACP,aAAa;EACb,SAAS;CACV,CAAE;CAEF,OAGC,oBAAC,QAAD;EACC,GAAK;EACC;EACN,iBAAkB;EAClB,UAAW;EACX,aAAc,YAAY,KAAA,IAAY,CAAC,CAAE,UAAU,KAAA;EACnD,OAAQ,WAAW;CACnB,CAAA;AAEH;AAEA,IAAA,qBAAe,WAAY,qBAAsB"}