Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export picker props #96

Merged
merged 3 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 1 addition & 27 deletions src/components/index.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export type {
ColorsProps,
LocalesProps,
GradientProps,
ColorPickerProps
} from './shared/types.js'

export default ColorPicker
26 changes: 26 additions & 0 deletions src/shared/types.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading