@wordpress/components
Version:
UI components for WordPress.
1 lines • 2.12 kB
Source Map (JSON)
{"version":3,"file":"deprecated.cjs","names":["InternalCustomGradientPicker"],"sources":["../../src/custom-gradient-picker/deprecated.tsx"],"sourcesContent":["import deprecated from '@wordpress/deprecated';\nimport { CustomGradientPicker as InternalCustomGradientPicker } from '.';\nimport type { CustomGradientPickerProps } from './types';\n\n/**\n * CustomGradientPicker is a React component that renders a UI for specifying\n * linear or radial gradients. Radial gradients are displayed in the picker as\n * a slice of the gradient from the center to the outside.\n *\n * This component is deprecated. Use `GradientPicker` with `clearable={ false }`\n * instead. Without the `gradients` prop, it renders the same gradient editor\n * without presets or a Clear button.\n *\n * `GradientPicker` types its `onChange` argument as `string | undefined`.\n * Without presets or a Clear button it only passes a string, but a callback\n * that accepts only a string needs to narrow the value first.\n *\n * @deprecated Use `GradientPicker` with `clearable={ false }` instead.\n *\n * ```jsx\n * import { GradientPicker } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyGradientEditor = () => {\n * const [ gradient, setGradient ] = useState();\n *\n * return (\n * <GradientPicker\n * clearable={ false }\n * value={ gradient }\n * onChange={ setGradient }\n * />\n * );\n * };\n * ```\n */\nexport function CustomGradientPicker( props: CustomGradientPickerProps ) {\n\tdeprecated( 'wp.components.CustomGradientPicker', {\n\t\tsince: '7.3',\n\t\talternative: 'wp.components.GradientPicker',\n\t\thint: 'Set `clearable={ false }` to render only the custom gradient editor.',\n\t} );\n\n\treturn <InternalCustomGradientPicker { ...props } />;\n}\n\nexport default CustomGradientPicker;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,SAAgB,qBAAsB,OAAmC;CACxE,CAAA,GAAA,sBAAA,QAAA,CAAY,sCAAsC;EACjD,OAAO;EACP,aAAa;EACb,MAAM;CACP,CAAE;CAEF,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACA,YAAAA,sBAAD,EAA8B,GAAK,MAAS,CAAA;AACpD"}