@zag-js/color-picker 0.0.0-dev-20230414153403 → 0.0.0-dev-20230420095643
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Color, ColorChannel, ColorFormat } from '@zag-js/color-utils';
|
|
2
2
|
import { PropTypes, NormalizeProps } from '@zag-js/types';
|
|
3
|
-
import { State, Send,
|
|
3
|
+
import { State, Send, ColorAreaProps, ColorChannelProps, ColorChannelInputProps, ColorSwatchProps } from './color-picker.types.js';
|
|
4
4
|
import '@zag-js/core';
|
|
5
5
|
|
|
6
6
|
declare function connect<T extends PropTypes>(state: State, send: Send, normalize: NormalizeProps<T>): {
|
|
@@ -33,16 +33,16 @@ declare function connect<T extends PropTypes>(state: State, send: Send, normaliz
|
|
|
33
33
|
*/
|
|
34
34
|
setFormat(format: ColorFormat): void;
|
|
35
35
|
contentProps: T["element"];
|
|
36
|
-
getAreaProps(props:
|
|
37
|
-
getAreaGradientProps(props:
|
|
38
|
-
getAreaThumbProps(props:
|
|
39
|
-
getChannelSliderTrackProps(props:
|
|
40
|
-
getChannelSliderBackgroundProps(props:
|
|
41
|
-
getChannelSliderThumbProps(props:
|
|
42
|
-
getChannelInputProps(props:
|
|
36
|
+
getAreaProps(props: ColorAreaProps): T["element"];
|
|
37
|
+
getAreaGradientProps(props: ColorAreaProps): T["element"];
|
|
38
|
+
getAreaThumbProps(props: ColorAreaProps): T["element"];
|
|
39
|
+
getChannelSliderTrackProps(props: ColorChannelProps): T["element"];
|
|
40
|
+
getChannelSliderBackgroundProps(props: ColorChannelProps): T["element"];
|
|
41
|
+
getChannelSliderThumbProps(props: ColorChannelProps): T["element"];
|
|
42
|
+
getChannelInputProps(props: ColorChannelInputProps): T["input"];
|
|
43
43
|
eyeDropperTriggerProps: T["button"];
|
|
44
|
-
getSwatchBackgroundProps(props:
|
|
45
|
-
getSwatchProps(props:
|
|
44
|
+
getSwatchBackgroundProps(props: ColorSwatchProps): T["element"];
|
|
45
|
+
getSwatchProps(props: ColorSwatchProps): T["element"];
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
export { connect };
|
|
@@ -2,20 +2,20 @@ import { ColorChannel, Color, ColorAxes } from '@zag-js/color-utils';
|
|
|
2
2
|
import { StateMachine } from '@zag-js/core';
|
|
3
3
|
import { Orientation, RequiredBy, CommonProperties, Context } from '@zag-js/types';
|
|
4
4
|
|
|
5
|
-
type
|
|
5
|
+
type ColorChannelProps = {
|
|
6
6
|
channel: ColorChannel;
|
|
7
7
|
orientation?: Orientation;
|
|
8
8
|
};
|
|
9
9
|
type ExtendedColorChannel = ColorChannel | "hex" | "css";
|
|
10
|
-
type
|
|
10
|
+
type ColorChannelInputProps = {
|
|
11
11
|
channel: ExtendedColorChannel;
|
|
12
12
|
orientation?: Orientation;
|
|
13
13
|
};
|
|
14
|
-
type
|
|
14
|
+
type ColorAreaProps = {
|
|
15
15
|
xChannel: ColorChannel;
|
|
16
16
|
yChannel: ColorChannel;
|
|
17
17
|
};
|
|
18
|
-
type
|
|
18
|
+
type ColorSwatchProps = {
|
|
19
19
|
readOnly?: boolean;
|
|
20
20
|
value: string | Color;
|
|
21
21
|
};
|
|
@@ -85,4 +85,4 @@ type MachineState = {
|
|
|
85
85
|
type State = StateMachine.State<MachineContext, MachineState>;
|
|
86
86
|
type Send = StateMachine.Send<StateMachine.AnyEventObject>;
|
|
87
87
|
|
|
88
|
-
export {
|
|
88
|
+
export { ColorAreaProps, ColorChannelInputProps, ColorChannelProps, ColorSwatchProps, ExtendedColorChannel, MachineContext, MachineState, Send, State, UserDefinedContext };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { connect } from './color-picker.connect.js';
|
|
2
2
|
export { machine } from './color-picker.machine.js';
|
|
3
|
-
export { UserDefinedContext as Context } from './color-picker.types.js';
|
|
3
|
+
export { ColorAreaProps, ColorChannelProps, ColorSwatchProps, UserDefinedContext as Context } from './color-picker.types.js';
|
|
4
4
|
import '@zag-js/color-utils';
|
|
5
5
|
import '@zag-js/types';
|
|
6
6
|
import '@zag-js/core';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { MachineContext,
|
|
1
|
+
import { MachineContext, ColorChannelProps } from '../color-picker.types.js';
|
|
2
2
|
import '@zag-js/color-utils';
|
|
3
3
|
import '@zag-js/core';
|
|
4
4
|
import '@zag-js/types';
|
|
5
5
|
|
|
6
|
-
declare const getSliderBgImage: (ctx: MachineContext, props: Required<
|
|
6
|
+
declare const getSliderBgImage: (ctx: MachineContext, props: Required<ColorChannelProps>) => string;
|
|
7
7
|
|
|
8
8
|
export { getSliderBgImage };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/color-picker",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20230420095643",
|
|
4
4
|
"description": "Core logic for the color-picker widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"@zag-js/core": "0.5.0",
|
|
31
31
|
"@zag-js/anatomy": "0.1.4",
|
|
32
32
|
"@zag-js/dom-query": "0.1.4",
|
|
33
|
-
"@zag-js/dom-event": "0.
|
|
33
|
+
"@zag-js/dom-event": "0.6.0",
|
|
34
34
|
"@zag-js/utils": "0.3.4",
|
|
35
|
-
"@zag-js/color-utils": "0.
|
|
35
|
+
"@zag-js/color-utils": "0.6.0",
|
|
36
36
|
"@zag-js/number-utils": "0.2.3",
|
|
37
37
|
"@zag-js/numeric-range": "0.1.1",
|
|
38
38
|
"@zag-js/text-selection": "0.0.1",
|