@arshiash80/strapi-plugin-iconhub
Version:
Icon picker plugin for Strapi with Iconify integration — search, select, and store icons with raw SVG for high-performance rendering.
52 lines (51 loc) • 1.87 kB
TypeScript
/// <reference types="react" />
import { IntlShape } from 'react-intl';
type IconInputValue = {
iconName: string | null;
iconData: string | null;
width: number | null;
height: number | null;
};
/**
* Props for the IconInput component.
*/
type IconInputProps = {
/** The attribute object with custom field's underlying Strapi type and options */
attribute: {
type: string;
customField: string;
options: any;
};
/** The field description set in configure the view */
description: IntlShape;
/** The field placeholder set in configure the view */
placeholder: IntlShape;
/** The field description set in configure the view along with min/max validation requirements */
hint: string;
/** The field name set in the content-type builder */
name: string;
/** The field name set in the content-type builder or configure the view */
intlLabel: IntlShape;
/** The handler for the input change event. The name argument references the field name. The type argument references the underlying Strapi type */
onChange: (event: {
target: {
name: string;
value: unknown;
type: string;
};
}) => void;
/** The content-type the field belongs to */
contentTypeUID: string;
/** The custom field uid, for example plugin::color-picker.color */
type: string;
/** The input value the underlying Strapi type expects */
value: IconInputValue;
/** Whether or not the field is required */
required: boolean;
/** Error received after validation */
error: IntlShape;
/** Whether or not the input is disabled */
disabled: boolean;
};
declare const IconInput: import("react").ForwardRefExoticComponent<IconInputProps & import("react").RefAttributes<HTMLButtonElement>>;
export default IconInput;