diff --git a/src/components/index.tsx b/src/components/index.tsx index d9570e0..41cee09 100644 --- a/src/components/index.tsx +++ b/src/components/index.tsx @@ -1,37 +1,11 @@ import React, { useRef } from 'react' import PickerContextWrapper from '../context.js' import Picker from './Picker.js' -import { LocalesProps } from '../shared/types.js' +import { ColorPickerProps } from '../shared/types.js' import { defaultLocales } from '../constants.js' import { objectToString } from '../utils/utils.js' import coreCss from '../core.module.css' -type ColorPickerProps = { - value?: string - onChange: (value: string) => void - hideControls?: boolean - hideInputs?: boolean - hideOpacity?: boolean - hidePresets?: boolean - hideHue?: boolean - presets?: string[] - hideEyeDrop?: boolean - hideAdvancedSliders?: boolean - hideColorGuide?: boolean - hideInputType?: boolean - hideColorTypeBtns?: boolean - hideGradientType?: boolean - hideGradientAngle?: boolean - hideGradientStop?: boolean - hideGradientControls?: boolean - width?: number - height?: number - style?: {} - className?: any - locales?: LocalesProps - disableDarkMode?: boolean -} - export function ColorPicker({ value = 'rgba(175, 51, 242, 1)', onChange, diff --git a/src/index.ts b/src/index.ts index e89cf00..16d738f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,6 +5,7 @@ export type { ColorsProps, LocalesProps, GradientProps, + ColorPickerProps } from './shared/types.js' export default ColorPicker diff --git a/src/shared/types.ts b/src/shared/types.ts index 588989f..ec826be 100644 --- a/src/shared/types.ts +++ b/src/shared/types.ts @@ -1,3 +1,29 @@ +export type ColorPickerProps = { + value?: string + onChange: (value: string) => void + hideControls?: boolean + hideInputs?: boolean + hideOpacity?: boolean + hidePresets?: boolean + hideHue?: boolean + presets?: string[] + hideEyeDrop?: boolean + hideAdvancedSliders?: boolean + hideColorGuide?: boolean + hideInputType?: boolean + hideColorTypeBtns?: boolean + hideGradientType?: boolean + hideGradientAngle?: boolean + hideGradientStop?: boolean + hideGradientControls?: boolean + width?: number + height?: number + style?: {} + className?: any + locales?: LocalesProps + disableDarkMode?: boolean +} + export type ColorsProps = { value: string index?: number