@zag-js/color-picker 0.0.0-dev-20230605141821 → 0.0.0-dev-20230605145913
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.
- package/dist/color-picker.connect.d.ts +1 -1
- package/dist/color-picker.dom.d.ts +1 -1
- package/dist/color-picker.types.d.ts +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/utils/get-channel-details.d.ts +1 -1
- package/dist/utils/get-channel-display-color.d.ts +1 -1
- package/dist/utils/get-color-area-gradient.d.ts +1 -1
- package/package.json +10 -10
- package/src/color-picker.connect.ts +1 -1
- package/src/color-picker.dom.ts +1 -1
- package/src/color-picker.types.ts +3 -1
- package/src/index.ts +2 -0
- package/src/utils/get-channel-details.ts +2 -2
- package/src/utils/get-channel-display-color.ts +1 -1
- package/src/utils/get-color-area-gradient.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Color, ColorChannel, ColorFormat } from "@zag-js/color-utils";
|
|
1
|
+
import { Color, type ColorChannel, type ColorFormat } from "@zag-js/color-utils";
|
|
2
2
|
import { NormalizeProps, type PropTypes } from "@zag-js/types";
|
|
3
3
|
import { ColorAreaProps, ColorChannelInputProps, ColorChannelProps, ColorSwatchProps, Send, State } from "./color-picker.types";
|
|
4
4
|
export declare function connect<T extends PropTypes>(state: State, send: Send, normalize: NormalizeProps<T>): {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Color, ColorAxes, ColorChannel } from "@zag-js/color-utils";
|
|
1
|
+
import { Color, type ColorAxes, type ColorChannel, type ColorFormat } from "@zag-js/color-utils";
|
|
2
2
|
import type { StateMachine as S } from "@zag-js/core";
|
|
3
3
|
import type { CommonProperties, Context, Orientation, RequiredBy } from "@zag-js/types";
|
|
4
4
|
export type ColorChannelProps = {
|
|
@@ -96,4 +96,4 @@ export type MachineState = {
|
|
|
96
96
|
};
|
|
97
97
|
export type State = S.State<MachineContext, MachineState>;
|
|
98
98
|
export type Send = S.Send<S.AnyEventObject>;
|
|
99
|
-
export {};
|
|
99
|
+
export type { Color, ColorChannel, ColorFormat };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { anatomy } from "./color-picker.anatomy";
|
|
2
2
|
export { connect } from "./color-picker.connect";
|
|
3
3
|
export { machine } from "./color-picker.machine";
|
|
4
|
-
export type { ColorAreaProps, ColorChannelProps, ColorSwatchProps, UserDefinedContext as Context, } from "./color-picker.types";
|
|
4
|
+
export type { Color, ColorAreaProps, ColorChannel, ColorChannelProps, ColorSwatchProps, UserDefinedContext as Context, } from "./color-picker.types";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ColorAxes, Color, ColorChannel } from '@zag-js/color-utils';
|
|
1
|
+
import type { ColorAxes, Color, type ColorChannel } from '@zag-js/color-utils';
|
|
2
2
|
export declare function getChannelDetails(color: Color, xChannel: ColorChannel, yChannel: ColorChannel): {
|
|
3
3
|
channels: ColorAxes;
|
|
4
4
|
xChannelStep: number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Color, ColorChannel } from "@zag-js/color-utils";
|
|
1
|
+
import { Color, type ColorChannel } from "@zag-js/color-utils";
|
|
2
2
|
export declare function getChannelDisplayColor(color: Color, channel: ColorChannel): Color;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { JSX } from '@zag-js/types';
|
|
2
|
-
import { ColorChannel } from "@zag-js/color-utils";
|
|
2
|
+
import { type ColorChannel } from "@zag-js/color-utils";
|
|
3
3
|
import { MachineContext } from "../color-picker.types";
|
|
4
4
|
export declare function getColorAreaGradient(ctx: MachineContext, xChannel: ColorChannel, yChannel: ColorChannel): {
|
|
5
5
|
areaStyles: JSX.CSSProperties;
|
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-20230605145913",
|
|
4
4
|
"description": "Core logic for the color-picker widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -28,15 +28,15 @@
|
|
|
28
28
|
"url": "https://github.com/chakra-ui/zag/issues"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@zag-js/core": "0.0.0-dev-
|
|
32
|
-
"@zag-js/anatomy": "0.0.0-dev-
|
|
33
|
-
"@zag-js/dom-query": "0.0.0-dev-
|
|
34
|
-
"@zag-js/dom-event": "0.0.0-dev-
|
|
35
|
-
"@zag-js/utils": "0.0.0-dev-
|
|
36
|
-
"@zag-js/color-utils": "0.0.0-dev-
|
|
37
|
-
"@zag-js/numeric-range": "0.0.0-dev-
|
|
38
|
-
"@zag-js/text-selection": "0.0.0-dev-
|
|
39
|
-
"@zag-js/types": "0.0.0-dev-
|
|
31
|
+
"@zag-js/core": "0.0.0-dev-20230605145913",
|
|
32
|
+
"@zag-js/anatomy": "0.0.0-dev-20230605145913",
|
|
33
|
+
"@zag-js/dom-query": "0.0.0-dev-20230605145913",
|
|
34
|
+
"@zag-js/dom-event": "0.0.0-dev-20230605145913",
|
|
35
|
+
"@zag-js/utils": "0.0.0-dev-20230605145913",
|
|
36
|
+
"@zag-js/color-utils": "0.0.0-dev-20230605145913",
|
|
37
|
+
"@zag-js/numeric-range": "0.0.0-dev-20230605145913",
|
|
38
|
+
"@zag-js/text-selection": "0.0.0-dev-20230605145913",
|
|
39
|
+
"@zag-js/types": "0.0.0-dev-20230605145913"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"clean-package": "2.2.0"
|
package/src/color-picker.dom.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColorChannel } from "@zag-js/color-utils"
|
|
1
|
+
import { type ColorChannel } from "@zag-js/color-utils"
|
|
2
2
|
import { getRelativePoint, type Point } from "@zag-js/dom-event"
|
|
3
3
|
import { createScope, queryAll } from "@zag-js/dom-query"
|
|
4
4
|
import type { MachineContext as Ctx } from "./color-picker.types"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Color, ColorAxes, ColorChannel } from "@zag-js/color-utils"
|
|
1
|
+
import { Color, type ColorAxes, type ColorChannel, type ColorFormat } from "@zag-js/color-utils"
|
|
2
2
|
import type { StateMachine as S } from "@zag-js/core"
|
|
3
3
|
import type { CommonProperties, Context, Orientation, RequiredBy } from "@zag-js/types"
|
|
4
4
|
|
|
@@ -111,3 +111,5 @@ export type MachineState = {
|
|
|
111
111
|
export type State = S.State<MachineContext, MachineState>
|
|
112
112
|
|
|
113
113
|
export type Send = S.Send<S.AnyEventObject>
|
|
114
|
+
|
|
115
|
+
export type { Color, ColorChannel, ColorFormat }
|
package/src/index.ts
CHANGED
|
@@ -2,7 +2,9 @@ export { anatomy } from "./color-picker.anatomy"
|
|
|
2
2
|
export { connect } from "./color-picker.connect"
|
|
3
3
|
export { machine } from "./color-picker.machine"
|
|
4
4
|
export type {
|
|
5
|
+
Color,
|
|
5
6
|
ColorAreaProps,
|
|
7
|
+
ColorChannel,
|
|
6
8
|
ColorChannelProps,
|
|
7
9
|
ColorSwatchProps,
|
|
8
10
|
UserDefinedContext as Context,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Color, ColorChannel } from "@zag-js/color-utils"
|
|
2
|
-
import {
|
|
1
|
+
import { Color, type ColorChannel } from "@zag-js/color-utils"
|
|
2
|
+
import { getPercentValue, snapValueToStep } from "@zag-js/numeric-range"
|
|
3
3
|
|
|
4
4
|
export function getChannelDetails(color: Color, xChannel: ColorChannel, yChannel: ColorChannel) {
|
|
5
5
|
const channels = color.getColorSpaceAxes({ xChannel, yChannel })
|