@zag-js/color-picker 0.36.3 → 0.37.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.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _zag_js_anatomy from '@zag-js/anatomy';
2
- import { RequiredBy, Orientation, PropTypes, CommonProperties, MaybeElement, Context, NormalizeProps } from '@zag-js/types';
2
+ import { RequiredBy, Orientation, PropTypes, CommonProperties, MaybeElement, NormalizeProps } from '@zag-js/types';
3
3
  import { Color, ColorFormat, ColorChannel } from '@zag-js/color-utils';
4
4
  export { Color, ColorAxes, ColorChannel, ColorFormat, ColorType } from '@zag-js/color-utils';
5
5
  import * as _zag_js_core from '@zag-js/core';
@@ -101,7 +101,8 @@ interface PublicContext extends CommonProperties, InteractOutsideHandlers {
101
101
  */
102
102
  closeOnSelect?: boolean;
103
103
  }
104
- type PrivateContext = Context<{}>;
104
+ interface PrivateContext {
105
+ }
105
106
  type ComputedContext = Readonly<{
106
107
  /**
107
108
  * @computed
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _zag_js_anatomy from '@zag-js/anatomy';
2
- import { RequiredBy, Orientation, PropTypes, CommonProperties, MaybeElement, Context, NormalizeProps } from '@zag-js/types';
2
+ import { RequiredBy, Orientation, PropTypes, CommonProperties, MaybeElement, NormalizeProps } from '@zag-js/types';
3
3
  import { Color, ColorFormat, ColorChannel } from '@zag-js/color-utils';
4
4
  export { Color, ColorAxes, ColorChannel, ColorFormat, ColorType } from '@zag-js/color-utils';
5
5
  import * as _zag_js_core from '@zag-js/core';
@@ -101,7 +101,8 @@ interface PublicContext extends CommonProperties, InteractOutsideHandlers {
101
101
  */
102
102
  closeOnSelect?: boolean;
103
103
  }
104
- type PrivateContext = Context<{}>;
104
+ interface PrivateContext {
105
+ }
105
106
  type ComputedContext = Readonly<{
106
107
  /**
107
108
  * @computed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/color-picker",
3
- "version": "0.36.3",
3
+ "version": "0.37.0",
4
4
  "description": "Core logic for the color-picker widget implemented as a state machine",
5
5
  "keywords": [
6
6
  "js",
@@ -28,19 +28,19 @@
28
28
  "url": "https://github.com/chakra-ui/zag/issues"
29
29
  },
30
30
  "dependencies": {
31
- "@zag-js/core": "0.36.3",
32
- "@zag-js/anatomy": "0.36.3",
33
- "@zag-js/dom-query": "0.36.3",
34
- "@zag-js/tabbable": "0.36.3",
35
- "@zag-js/dismissable": "0.36.3",
36
- "@zag-js/dom-event": "0.36.3",
37
- "@zag-js/utils": "0.36.3",
38
- "@zag-js/form-utils": "0.36.3",
39
- "@zag-js/color-utils": "0.36.3",
40
- "@zag-js/visually-hidden": "0.36.3",
41
- "@zag-js/popper": "0.36.3",
42
- "@zag-js/text-selection": "0.36.3",
43
- "@zag-js/types": "0.36.3"
31
+ "@zag-js/core": "0.37.0",
32
+ "@zag-js/anatomy": "0.37.0",
33
+ "@zag-js/dom-query": "0.37.0",
34
+ "@zag-js/tabbable": "0.37.0",
35
+ "@zag-js/dismissable": "0.37.0",
36
+ "@zag-js/dom-event": "0.37.0",
37
+ "@zag-js/utils": "0.37.0",
38
+ "@zag-js/form-utils": "0.37.0",
39
+ "@zag-js/color-utils": "0.37.0",
40
+ "@zag-js/visually-hidden": "0.37.0",
41
+ "@zag-js/popper": "0.37.0",
42
+ "@zag-js/text-selection": "0.37.0",
43
+ "@zag-js/types": "0.37.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "clean-package": "2.2.0"
@@ -0,0 +1,44 @@
1
+ import { createProps } from "@zag-js/types"
2
+ import type {
3
+ AreaProps,
4
+ ChannelProps,
5
+ SwatchProps,
6
+ SwatchTriggerProps,
7
+ TransparencyGridProps,
8
+ UserDefinedContext,
9
+ } from "./color-picker.types"
10
+
11
+ export const props = createProps<UserDefinedContext>()([
12
+ "closeOnSelect",
13
+ "dir",
14
+ "disabled",
15
+ "format",
16
+ "getRootNode",
17
+ "id",
18
+ "ids",
19
+ "initialFocusEl",
20
+ "name",
21
+ "name",
22
+ "onFocusOutside",
23
+ "onFormatChange",
24
+ "onInteractOutside",
25
+ "onOpenChange",
26
+ "onPointerDownOutside",
27
+ "onValueChange",
28
+ "onValueChangeEnd",
29
+ "open.controlled",
30
+ "open",
31
+ "positioning",
32
+ "readOnly",
33
+ "value",
34
+ ])
35
+
36
+ export const areaProps = createProps<AreaProps>()(["xChannel", "yChannel"])
37
+
38
+ export const channelProps = createProps<ChannelProps>()(["channel", "orientation"])
39
+
40
+ export const swatchTriggerProps = createProps<SwatchTriggerProps>()(["value", "disabled"])
41
+
42
+ export const swatchProps = createProps<SwatchProps>()(["value", "respectAlpha"])
43
+
44
+ export const transparencyGridProps = createProps<TransparencyGridProps>()(["size"])
@@ -2,7 +2,7 @@ import type { Color, ColorAxes, ColorChannel, ColorFormat, ColorType } from "@za
2
2
  import type { StateMachine as S } from "@zag-js/core"
3
3
  import type { InteractOutsideHandlers } from "@zag-js/dismissable"
4
4
  import type { PositioningOptions } from "@zag-js/popper"
5
- import type { CommonProperties, Context, MaybeElement, Orientation, PropTypes, RequiredBy } from "@zag-js/types"
5
+ import type { CommonProperties, MaybeElement, Orientation, PropTypes, RequiredBy } from "@zag-js/types"
6
6
  import type { MaybeFunction } from "@zag-js/utils"
7
7
 
8
8
  export type ExtendedColorChannel = ColorChannel | "hex" | "css"
@@ -111,7 +111,7 @@ interface PublicContext extends CommonProperties, InteractOutsideHandlers {
111
111
  closeOnSelect?: boolean
112
112
  }
113
113
 
114
- type PrivateContext = Context<{
114
+ interface PrivateContext {
115
115
  /**
116
116
  * @internal
117
117
  * The id of the thumb that is currently being dragged
@@ -142,7 +142,7 @@ type PrivateContext = Context<{
142
142
  * Whether the color picker should return focus to the trigger when closed
143
143
  */
144
144
  restoreFocus?: boolean
145
- }>
145
+ }
146
146
 
147
147
  type ComputedContext = Readonly<{
148
148
  /**