@zag-js/color-picker 0.49.0 → 0.51.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,7 +1,7 @@
1
1
  import { InteractOutsideHandlers } from '@zag-js/dismissable';
2
2
  export { FocusOutsideEvent, InteractOutsideEvent, PointerDownOutsideEvent } from '@zag-js/dismissable';
3
3
  import * as _zag_js_anatomy from '@zag-js/anatomy';
4
- import { RequiredBy, Orientation, PropTypes, CommonProperties, MaybeElement, NormalizeProps } from '@zag-js/types';
4
+ import { RequiredBy, Orientation, PropTypes, CommonProperties, DirectionProperty, NormalizeProps } from '@zag-js/types';
5
5
  import { Color, ColorFormat, ColorChannel } from '@zag-js/color-utils';
6
6
  export { Color, ColorAxes, ColorChannel, ColorFormat, ColorType } from '@zag-js/color-utils';
7
7
  import * as _zag_js_core from '@zag-js/core';
@@ -50,17 +50,14 @@ type ElementIds = Partial<{
50
50
  channelSliderTrack(id: ColorChannel): string;
51
51
  channelSliderThumb(id: ColorChannel): string;
52
52
  }>;
53
- interface PublicContext extends CommonProperties, InteractOutsideHandlers {
53
+ interface PublicContext extends CommonProperties, DirectionProperty, InteractOutsideHandlers {
54
54
  /**
55
55
  * The ids of the elements in the color picker. Useful for composition.
56
56
  */
57
57
  ids?: ElementIds;
58
- /**
59
- * The direction of the color picker
60
- */
61
- dir: "ltr" | "rtl";
62
58
  /**
63
59
  * The current color value
60
+ * @default #000000
64
61
  */
65
62
  value: Color;
66
63
  /**
@@ -94,7 +91,7 @@ interface PublicContext extends CommonProperties, InteractOutsideHandlers {
94
91
  /**
95
92
  * The initial focus element when the color picker is opened.
96
93
  */
97
- initialFocusEl?: MaybeElement | (() => MaybeElement);
94
+ initialFocusEl?: () => HTMLElement | null;
98
95
  /**
99
96
  * Whether the color picker is open
100
97
  */
@@ -105,6 +102,7 @@ interface PublicContext extends CommonProperties, InteractOutsideHandlers {
105
102
  "open.controlled"?: boolean;
106
103
  /**
107
104
  * The color format to use
105
+ * @default "rgba"
108
106
  */
109
107
  format: ColorFormat;
110
108
  /**
@@ -113,6 +111,7 @@ interface PublicContext extends CommonProperties, InteractOutsideHandlers {
113
111
  onFormatChange?: (details: FormatChangeDetails) => void;
114
112
  /**
115
113
  * Whether to close the color picker when a swatch is selected
114
+ * @default false
116
115
  */
117
116
  closeOnSelect?: boolean;
118
117
  }
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { InteractOutsideHandlers } from '@zag-js/dismissable';
2
2
  export { FocusOutsideEvent, InteractOutsideEvent, PointerDownOutsideEvent } from '@zag-js/dismissable';
3
3
  import * as _zag_js_anatomy from '@zag-js/anatomy';
4
- import { RequiredBy, Orientation, PropTypes, CommonProperties, MaybeElement, NormalizeProps } from '@zag-js/types';
4
+ import { RequiredBy, Orientation, PropTypes, CommonProperties, DirectionProperty, NormalizeProps } from '@zag-js/types';
5
5
  import { Color, ColorFormat, ColorChannel } from '@zag-js/color-utils';
6
6
  export { Color, ColorAxes, ColorChannel, ColorFormat, ColorType } from '@zag-js/color-utils';
7
7
  import * as _zag_js_core from '@zag-js/core';
@@ -50,17 +50,14 @@ type ElementIds = Partial<{
50
50
  channelSliderTrack(id: ColorChannel): string;
51
51
  channelSliderThumb(id: ColorChannel): string;
52
52
  }>;
53
- interface PublicContext extends CommonProperties, InteractOutsideHandlers {
53
+ interface PublicContext extends CommonProperties, DirectionProperty, InteractOutsideHandlers {
54
54
  /**
55
55
  * The ids of the elements in the color picker. Useful for composition.
56
56
  */
57
57
  ids?: ElementIds;
58
- /**
59
- * The direction of the color picker
60
- */
61
- dir: "ltr" | "rtl";
62
58
  /**
63
59
  * The current color value
60
+ * @default #000000
64
61
  */
65
62
  value: Color;
66
63
  /**
@@ -94,7 +91,7 @@ interface PublicContext extends CommonProperties, InteractOutsideHandlers {
94
91
  /**
95
92
  * The initial focus element when the color picker is opened.
96
93
  */
97
- initialFocusEl?: MaybeElement | (() => MaybeElement);
94
+ initialFocusEl?: () => HTMLElement | null;
98
95
  /**
99
96
  * Whether the color picker is open
100
97
  */
@@ -105,6 +102,7 @@ interface PublicContext extends CommonProperties, InteractOutsideHandlers {
105
102
  "open.controlled"?: boolean;
106
103
  /**
107
104
  * The color format to use
105
+ * @default "rgba"
108
106
  */
109
107
  format: ColorFormat;
110
108
  /**
@@ -113,6 +111,7 @@ interface PublicContext extends CommonProperties, InteractOutsideHandlers {
113
111
  onFormatChange?: (details: FormatChangeDetails) => void;
114
112
  /**
115
113
  * Whether to close the color picker when a swatch is selected
114
+ * @default false
116
115
  */
117
116
  closeOnSelect?: boolean;
118
117
  }