@zag-js/color-picker 0.57.0 → 0.58.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.
@@ -1,5 +1,5 @@
1
1
  import type { Color, ColorAxes, ColorChannel, ColorFormat, ColorType } from "@zag-js/color-utils"
2
- import type { StateMachine as S } from "@zag-js/core"
2
+ import type { Machine, 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
5
  import type { CommonProperties, DirectionProperty, Orientation, PropTypes, RequiredBy } from "@zag-js/types"
@@ -45,9 +45,12 @@ export type ElementIds = Partial<{
45
45
  trigger: string
46
46
  label: string
47
47
  input: string
48
+ hiddenInput: string
48
49
  content: string
49
50
  area: string
50
51
  areaGradient: string
52
+ positioner: string
53
+ formatSelect: string
51
54
  areaThumb: string
52
55
  channelInput(id: string): string
53
56
  channelSliderTrack(id: ColorChannel): string
@@ -72,6 +75,10 @@ interface PublicContext extends CommonProperties, DirectionProperty, InteractOut
72
75
  * Whether the color picker is read-only
73
76
  */
74
77
  readOnly?: boolean
78
+ /**
79
+ * Whether the color picker is required
80
+ */
81
+ required?: boolean
75
82
  /**
76
83
  * Handler that is called when the value changes, as the user drags.
77
84
  */
@@ -194,6 +201,8 @@ export type State = S.State<MachineContext, MachineState>
194
201
 
195
202
  export type Send = S.Send<S.AnyEventObject>
196
203
 
204
+ export type Service = Machine<MachineContext, MachineState, S.AnyEventObject>
205
+
197
206
  /* -----------------------------------------------------------------------------
198
207
  * Component API
199
208
  * -----------------------------------------------------------------------------*/
package/src/index.ts CHANGED
@@ -24,4 +24,5 @@ export type {
24
24
  SwatchTriggerState,
25
25
  TransparencyGridProps,
26
26
  ValueChangeDetails,
27
+ Service,
27
28
  } from "./color-picker.types"