@sanity/color-input 3.1.1 → 4.0.0-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,90 @@
1
+ import type {Color} from 'react-color'
2
+ import type {HSLColor} from 'react-color'
3
+ import type {HSVColor} from 'react-color'
4
+ import {JSX as JSX_2} from 'react'
5
+ import {ObjectDefinition} from 'sanity'
6
+ import {ObjectInputProps} from 'sanity'
7
+ import {ObjectOptions} from 'sanity'
8
+ import {ObjectSchemaType} from 'sanity'
9
+ import {Plugin as Plugin_2} from 'sanity'
10
+ import {PreviewConfig} from 'sanity'
11
+ import type {RGBColor} from 'react-color'
12
+
13
+ export declare const color: {
14
+ type: 'object'
15
+ name: 'color'
16
+ } & Omit<ObjectDefinition, 'preview'> & {
17
+ preview?:
18
+ | PreviewConfig<
19
+ {
20
+ title: string
21
+ alpha: string
22
+ hex: string
23
+ hsl: string
24
+ },
25
+ Record<'title' | 'hex' | 'hsl' | 'alpha', any>
26
+ >
27
+ | undefined
28
+ }
29
+
30
+ /**
31
+ * @public
32
+ */
33
+ export declare interface ColorDefinition
34
+ extends Omit<ObjectDefinition, 'type' | 'fields' | 'options'> {
35
+ type: typeof colorTypeName
36
+ options?: ColorOptions
37
+ }
38
+
39
+ export declare function ColorInput(props: ObjectInputProps): JSX_2.Element
40
+
41
+ export declare const colorInput: Plugin_2<void>
42
+
43
+ export declare type ColorInputProps = ObjectInputProps<ColorValue, ColorSchemaType>
44
+
45
+ export declare interface ColorOptions extends Omit<ObjectOptions, 'columns'> {
46
+ disableAlpha?: boolean
47
+ colorList?: Array<Color>
48
+ }
49
+
50
+ export declare type ColorSchemaType = Omit<ObjectSchemaType, 'options'> & {
51
+ options?: ColorOptions
52
+ }
53
+
54
+ declare const colorTypeName: 'color'
55
+
56
+ export declare interface ColorValue {
57
+ hex: string
58
+ hsl: HSLColor
59
+ hsv: HSVColor
60
+ rgb: RGBColor
61
+ }
62
+
63
+ export declare const hslaColor: {
64
+ type: 'object'
65
+ name: 'hslaColor'
66
+ } & Omit<ObjectDefinition, 'preview'> & {
67
+ preview?: PreviewConfig<Record<string, string>, Record<never, any>> | undefined
68
+ }
69
+
70
+ export declare const hsvaColor: {
71
+ type: 'object'
72
+ name: 'hsvaColor'
73
+ } & Omit<ObjectDefinition, 'preview'> & {
74
+ preview?: PreviewConfig<Record<string, string>, Record<never, any>> | undefined
75
+ }
76
+
77
+ export declare const rgbaColor: {
78
+ type: 'object'
79
+ name: 'rgbaColor'
80
+ } & Omit<ObjectDefinition, 'preview'> & {
81
+ preview?: PreviewConfig<Record<string, string>, Record<never, any>> | undefined
82
+ }
83
+
84
+ export {}
85
+
86
+ declare module '@sanity/types' {
87
+ interface IntrinsicDefinitions {
88
+ color: ColorDefinition
89
+ }
90
+ }
package/lib/index.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- import {Color} from 'react-color'
2
- import {HSLColor} from 'react-color'
3
- import {HSVColor} from 'react-color'
4
- import {JSX as JSX_2} from 'react/jsx-runtime'
1
+ import type {Color} from 'react-color'
2
+ import type {HSLColor} from 'react-color'
3
+ import type {HSVColor} from 'react-color'
4
+ import {JSX as JSX_2} from 'react'
5
5
  import {ObjectDefinition} from 'sanity'
6
6
  import {ObjectInputProps} from 'sanity'
7
7
  import {ObjectOptions} from 'sanity'
8
8
  import {ObjectSchemaType} from 'sanity'
9
9
  import {Plugin as Plugin_2} from 'sanity'
10
10
  import {PreviewConfig} from 'sanity'
11
- import {RGBColor} from 'react-color'
11
+ import type {RGBColor} from 'react-color'
12
12
 
13
13
  export declare const color: {
14
14
  type: 'object'
@@ -22,7 +22,7 @@ export declare const color: {
22
22
  hex: string
23
23
  hsl: string
24
24
  },
25
- Record<'hsl' | 'hex' | 'title' | 'alpha', any>
25
+ Record<'title' | 'hex' | 'hsl' | 'alpha', any>
26
26
  >
27
27
  | undefined
28
28
  }