@zag-js/color-picker 2.0.0-next.1 → 2.0.0-next.2
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.types.d.mts +21 -20
- package/dist/color-picker.types.d.ts +21 -20
- package/package.json +10 -10
|
@@ -5,7 +5,7 @@ import { Service, EventObject, Machine } from '@zag-js/core';
|
|
|
5
5
|
import { InteractOutsideHandlers, LayerSnapshot } from '@zag-js/dismissable';
|
|
6
6
|
import { PositioningOptions, Placement, PlacementSide } from '@zag-js/popper';
|
|
7
7
|
export { PositioningOptions } from '@zag-js/popper';
|
|
8
|
-
import {
|
|
8
|
+
import { CommonProperties, DirectionProperty, Orientation, PropTypes } from '@zag-js/types';
|
|
9
9
|
|
|
10
10
|
type ExtendedColorChannel = ColorChannel | "hex" | "css";
|
|
11
11
|
interface EyeDropper {
|
|
@@ -33,23 +33,23 @@ interface OpenChangeDetails {
|
|
|
33
33
|
interface FormatChangeDetails {
|
|
34
34
|
format: ColorFormat;
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
root
|
|
38
|
-
control
|
|
39
|
-
trigger
|
|
40
|
-
label
|
|
41
|
-
input
|
|
42
|
-
hiddenInput
|
|
43
|
-
content
|
|
44
|
-
area
|
|
45
|
-
areaGradient
|
|
46
|
-
positioner
|
|
47
|
-
formatSelect
|
|
48
|
-
areaThumb
|
|
49
|
-
channelInput
|
|
50
|
-
channelSliderTrack
|
|
51
|
-
channelSliderThumb
|
|
52
|
-
}
|
|
36
|
+
interface ElementIds {
|
|
37
|
+
root?: string | undefined;
|
|
38
|
+
control?: string | undefined;
|
|
39
|
+
trigger?: string | undefined;
|
|
40
|
+
label?: string | undefined;
|
|
41
|
+
input?: string | undefined;
|
|
42
|
+
hiddenInput?: string | undefined;
|
|
43
|
+
content?: string | undefined;
|
|
44
|
+
area?: string | undefined;
|
|
45
|
+
areaGradient?: string | undefined;
|
|
46
|
+
positioner?: string | undefined;
|
|
47
|
+
formatSelect?: string | undefined;
|
|
48
|
+
areaThumb?: string | undefined;
|
|
49
|
+
channelInput?: ((id: string) => string) | undefined;
|
|
50
|
+
channelSliderTrack?: ((id: ColorChannel) => string) | undefined;
|
|
51
|
+
channelSliderThumb?: ((id: ColorChannel) => string) | undefined;
|
|
52
|
+
}
|
|
53
53
|
interface ColorPickerProps extends CommonProperties, DirectionProperty, InteractOutsideHandlers {
|
|
54
54
|
/**
|
|
55
55
|
* The ids of the elements in the color picker. Useful for composition.
|
|
@@ -104,7 +104,7 @@ interface ColorPickerProps extends CommonProperties, DirectionProperty, Interact
|
|
|
104
104
|
/**
|
|
105
105
|
* The initial focus element when the color picker is opened.
|
|
106
106
|
*/
|
|
107
|
-
initialFocusEl?: (() => HTMLElement | null) | undefined;
|
|
107
|
+
initialFocusEl?: (() => HTMLElement | null) | null | undefined;
|
|
108
108
|
/**
|
|
109
109
|
* The controlled open state of the color picker
|
|
110
110
|
*/
|
|
@@ -147,7 +147,8 @@ type PropsWithDefault = "defaultFormat" | "defaultValue" | "openAutoFocus" | "di
|
|
|
147
147
|
type ColorPickerSchema = {
|
|
148
148
|
tag: "open" | "closed" | "dragging" | "focused";
|
|
149
149
|
state: "idle" | "focused" | "open" | "open.idle" | "open.dragging";
|
|
150
|
-
props:
|
|
150
|
+
props: ColorPickerProps;
|
|
151
|
+
defaultPropKey: PropsWithDefault;
|
|
151
152
|
computed: {
|
|
152
153
|
disabled: boolean;
|
|
153
154
|
rtl: boolean;
|
|
@@ -5,7 +5,7 @@ import { Service, EventObject, Machine } from '@zag-js/core';
|
|
|
5
5
|
import { InteractOutsideHandlers, LayerSnapshot } from '@zag-js/dismissable';
|
|
6
6
|
import { PositioningOptions, Placement, PlacementSide } from '@zag-js/popper';
|
|
7
7
|
export { PositioningOptions } from '@zag-js/popper';
|
|
8
|
-
import {
|
|
8
|
+
import { CommonProperties, DirectionProperty, Orientation, PropTypes } from '@zag-js/types';
|
|
9
9
|
|
|
10
10
|
type ExtendedColorChannel = ColorChannel | "hex" | "css";
|
|
11
11
|
interface EyeDropper {
|
|
@@ -33,23 +33,23 @@ interface OpenChangeDetails {
|
|
|
33
33
|
interface FormatChangeDetails {
|
|
34
34
|
format: ColorFormat;
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
root
|
|
38
|
-
control
|
|
39
|
-
trigger
|
|
40
|
-
label
|
|
41
|
-
input
|
|
42
|
-
hiddenInput
|
|
43
|
-
content
|
|
44
|
-
area
|
|
45
|
-
areaGradient
|
|
46
|
-
positioner
|
|
47
|
-
formatSelect
|
|
48
|
-
areaThumb
|
|
49
|
-
channelInput
|
|
50
|
-
channelSliderTrack
|
|
51
|
-
channelSliderThumb
|
|
52
|
-
}
|
|
36
|
+
interface ElementIds {
|
|
37
|
+
root?: string | undefined;
|
|
38
|
+
control?: string | undefined;
|
|
39
|
+
trigger?: string | undefined;
|
|
40
|
+
label?: string | undefined;
|
|
41
|
+
input?: string | undefined;
|
|
42
|
+
hiddenInput?: string | undefined;
|
|
43
|
+
content?: string | undefined;
|
|
44
|
+
area?: string | undefined;
|
|
45
|
+
areaGradient?: string | undefined;
|
|
46
|
+
positioner?: string | undefined;
|
|
47
|
+
formatSelect?: string | undefined;
|
|
48
|
+
areaThumb?: string | undefined;
|
|
49
|
+
channelInput?: ((id: string) => string) | undefined;
|
|
50
|
+
channelSliderTrack?: ((id: ColorChannel) => string) | undefined;
|
|
51
|
+
channelSliderThumb?: ((id: ColorChannel) => string) | undefined;
|
|
52
|
+
}
|
|
53
53
|
interface ColorPickerProps extends CommonProperties, DirectionProperty, InteractOutsideHandlers {
|
|
54
54
|
/**
|
|
55
55
|
* The ids of the elements in the color picker. Useful for composition.
|
|
@@ -104,7 +104,7 @@ interface ColorPickerProps extends CommonProperties, DirectionProperty, Interact
|
|
|
104
104
|
/**
|
|
105
105
|
* The initial focus element when the color picker is opened.
|
|
106
106
|
*/
|
|
107
|
-
initialFocusEl?: (() => HTMLElement | null) | undefined;
|
|
107
|
+
initialFocusEl?: (() => HTMLElement | null) | null | undefined;
|
|
108
108
|
/**
|
|
109
109
|
* The controlled open state of the color picker
|
|
110
110
|
*/
|
|
@@ -147,7 +147,8 @@ type PropsWithDefault = "defaultFormat" | "defaultValue" | "openAutoFocus" | "di
|
|
|
147
147
|
type ColorPickerSchema = {
|
|
148
148
|
tag: "open" | "closed" | "dragging" | "focused";
|
|
149
149
|
state: "idle" | "focused" | "open" | "open.idle" | "open.dragging";
|
|
150
|
-
props:
|
|
150
|
+
props: ColorPickerProps;
|
|
151
|
+
defaultPropKey: PropsWithDefault;
|
|
151
152
|
computed: {
|
|
152
153
|
disabled: boolean;
|
|
153
154
|
rtl: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/color-picker",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.2",
|
|
4
4
|
"description": "Core logic for the color-picker widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
"url": "https://github.com/chakra-ui/zag/issues"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@zag-js/core": "2.0.0-next.
|
|
34
|
-
"@zag-js/anatomy": "2.0.0-next.
|
|
35
|
-
"@zag-js/dom-query": "2.0.0-next.
|
|
36
|
-
"@zag-js/dismissable": "2.0.0-next.
|
|
37
|
-
"@zag-js/utils": "2.0.0-next.
|
|
38
|
-
"@zag-js/color-utils": "2.0.0-next.
|
|
39
|
-
"@zag-js/popper": "2.0.0-next.
|
|
40
|
-
"@zag-js/types": "2.0.0-next.
|
|
33
|
+
"@zag-js/core": "2.0.0-next.2",
|
|
34
|
+
"@zag-js/anatomy": "2.0.0-next.2",
|
|
35
|
+
"@zag-js/dom-query": "2.0.0-next.2",
|
|
36
|
+
"@zag-js/dismissable": "2.0.0-next.2",
|
|
37
|
+
"@zag-js/utils": "2.0.0-next.2",
|
|
38
|
+
"@zag-js/color-utils": "2.0.0-next.2",
|
|
39
|
+
"@zag-js/popper": "2.0.0-next.2",
|
|
40
|
+
"@zag-js/types": "2.0.0-next.2"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"clean-package": "2.2.0"
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|
|
72
72
|
"build": "tsup",
|
|
73
|
-
"lint": "
|
|
73
|
+
"lint": "oxlint src",
|
|
74
74
|
"typecheck": "tsc --noEmit"
|
|
75
75
|
}
|
|
76
76
|
}
|