@zag-js/color-picker 1.44.0 → 1.45.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.
@@ -593,7 +593,8 @@ var machine = (0, import_core.createMachine)({
593
593
  root: dom.getContentEl(scope),
594
594
  getInitialEl: prop("initialFocusEl")
595
595
  });
596
- element?.focus({ preventScroll: true });
596
+ if (!element) return;
597
+ element.focus({ preventScroll: true });
597
598
  });
598
599
  },
599
600
  setReturnFocus({ scope }) {
@@ -567,7 +567,8 @@ var machine = createMachine({
567
567
  root: dom.getContentEl(scope),
568
568
  getInitialEl: prop("initialFocusEl")
569
569
  });
570
- element?.focus({ preventScroll: true });
570
+ if (!element) return;
571
+ element.focus({ preventScroll: true });
571
572
  });
572
573
  },
573
574
  setReturnFocus({ scope }) {
@@ -102,8 +102,9 @@ interface ColorPickerProps extends CommonProperties, DirectionProperty, Interact
102
102
  positioning?: PositioningOptions | undefined;
103
103
  /**
104
104
  * The initial focus element when the color picker is opened.
105
+ * Return `false` to skip moving focus, or `null` to use the default.
105
106
  */
106
- initialFocusEl?: (() => HTMLElement | null) | undefined;
107
+ initialFocusEl?: (() => HTMLElement | null | false) | undefined;
107
108
  /**
108
109
  * The controlled open state of the color picker
109
110
  */
@@ -102,8 +102,9 @@ interface ColorPickerProps extends CommonProperties, DirectionProperty, Interact
102
102
  positioning?: PositioningOptions | undefined;
103
103
  /**
104
104
  * The initial focus element when the color picker is opened.
105
+ * Return `false` to skip moving focus, or `null` to use the default.
105
106
  */
106
- initialFocusEl?: (() => HTMLElement | null) | undefined;
107
+ initialFocusEl?: (() => HTMLElement | null | false) | undefined;
107
108
  /**
108
109
  * The controlled open state of the color picker
109
110
  */
@@ -1,6 +1,5 @@
1
- import * as _zag_js_color_utils from '@zag-js/color-utils';
2
1
  import { Color, ColorChannel } from '@zag-js/color-utils';
3
2
 
4
- declare function getChannelDisplayColor(color: Color, channel: ColorChannel): _zag_js_color_utils.ColorType;
3
+ declare function getChannelDisplayColor(color: Color, channel: ColorChannel): Color;
5
4
 
6
5
  export { getChannelDisplayColor };
@@ -1,6 +1,5 @@
1
- import * as _zag_js_color_utils from '@zag-js/color-utils';
2
1
  import { Color, ColorChannel } from '@zag-js/color-utils';
3
2
 
4
- declare function getChannelDisplayColor(color: Color, channel: ColorChannel): _zag_js_color_utils.ColorType;
3
+ declare function getChannelDisplayColor(color: Color, channel: ColorChannel): Color;
5
4
 
6
5
  export { getChannelDisplayColor };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/color-picker",
3
- "version": "1.44.0",
3
+ "version": "1.45.0",
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": "1.44.0",
34
- "@zag-js/anatomy": "1.44.0",
35
- "@zag-js/dom-query": "1.44.0",
36
- "@zag-js/dismissable": "1.44.0",
37
- "@zag-js/utils": "1.44.0",
38
- "@zag-js/color-utils": "1.44.0",
39
- "@zag-js/popper": "1.44.0",
40
- "@zag-js/types": "1.44.0"
33
+ "@zag-js/core": "1.45.0",
34
+ "@zag-js/anatomy": "1.45.0",
35
+ "@zag-js/dom-query": "1.45.0",
36
+ "@zag-js/dismissable": "1.45.0",
37
+ "@zag-js/utils": "1.45.0",
38
+ "@zag-js/color-utils": "1.45.0",
39
+ "@zag-js/popper": "1.45.0",
40
+ "@zag-js/types": "1.45.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "clean-package": "2.2.0"