@zag-js/color-picker 0.10.2 → 0.10.4

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.
Files changed (54) hide show
  1. package/dist/color-picker.anatomy.d.ts +3 -6
  2. package/dist/color-picker.anatomy.js +10 -33
  3. package/dist/color-picker.anatomy.mjs +19 -8
  4. package/dist/color-picker.connect.d.ts +4 -8
  5. package/dist/color-picker.connect.js +56 -436
  6. package/dist/color-picker.connect.mjs +368 -14
  7. package/dist/color-picker.dom.d.ts +27 -32
  8. package/dist/color-picker.dom.js +12 -34
  9. package/dist/color-picker.dom.mjs +33 -6
  10. package/dist/color-picker.machine.d.ts +3 -8
  11. package/dist/color-picker.machine.js +46 -163
  12. package/dist/color-picker.machine.mjs +335 -8
  13. package/dist/color-picker.types.d.ts +14 -16
  14. package/dist/index.d.ts +4 -8
  15. package/dist/index.js +8 -1085
  16. package/dist/index.mjs +3 -21
  17. package/dist/utils/generate-format-background.d.ts +9 -11
  18. package/dist/utils/generate-format-background.js +22 -53
  19. package/dist/utils/generate-format-background.mjs +120 -21
  20. package/dist/utils/get-channel-details.d.ts +3 -7
  21. package/dist/utils/get-channel-details.js +15 -37
  22. package/dist/utils/get-channel-details.mjs +53 -6
  23. package/dist/utils/get-channel-display-color.d.ts +3 -5
  24. package/dist/utils/get-channel-display-color.js +8 -30
  25. package/dist/utils/get-channel-display-color.mjs +22 -6
  26. package/dist/utils/get-channel-input-value.d.ts +5 -10
  27. package/dist/utils/get-channel-input-value.js +6 -30
  28. package/dist/utils/get-channel-input-value.mjs +21 -8
  29. package/dist/utils/get-color-area-gradient.d.ts +6 -10
  30. package/dist/utils/get-color-area-gradient.js +14 -158
  31. package/dist/utils/get-color-area-gradient.mjs +61 -7
  32. package/dist/utils/get-slider-background.d.ts +2 -8
  33. package/dist/utils/get-slider-background.js +6 -29
  34. package/dist/utils/get-slider-background.mjs +38 -5
  35. package/package.json +11 -16
  36. package/src/color-picker.connect.ts +1 -1
  37. package/src/color-picker.dom.ts +1 -1
  38. package/src/color-picker.types.ts +3 -1
  39. package/src/index.ts +2 -0
  40. package/src/utils/get-channel-details.ts +2 -2
  41. package/src/utils/get-channel-display-color.ts +1 -1
  42. package/src/utils/get-color-area-gradient.ts +1 -1
  43. package/dist/chunk-2ERX54SV.mjs +0 -25
  44. package/dist/chunk-3XH465XT.mjs +0 -42
  45. package/dist/chunk-5QSFKCT5.mjs +0 -393
  46. package/dist/chunk-75JXJMB5.mjs +0 -22
  47. package/dist/chunk-JNBNPPMF.mjs +0 -24
  48. package/dist/chunk-KLLIOTK6.mjs +0 -55
  49. package/dist/chunk-KO4TBUXB.mjs +0 -74
  50. package/dist/chunk-ML3WX6YS.mjs +0 -345
  51. package/dist/chunk-OY3B7NXA.mjs +0 -132
  52. package/dist/chunk-SPSDVZCT.mjs +0 -35
  53. package/dist/color-picker.types.js +0 -18
  54. package/dist/color-picker.types.mjs +0 -0
@@ -1,6 +1,3 @@
1
- import * as _zag_js_anatomy from '@zag-js/anatomy';
2
-
3
- declare const anatomy: _zag_js_anatomy.Anatomy<"area" | "areaThumb" | "areaGradient" | "channelSliderTrack" | "channelSliderTrackBg" | "channelSliderThumb" | "channelInput" | "swatch" | "swatchBg" | "content" | "label" | "eyeDropTrigger">;
4
- declare const parts: Record<"area" | "areaThumb" | "areaGradient" | "channelSliderTrack" | "channelSliderTrackBg" | "channelSliderThumb" | "channelInput" | "swatch" | "swatchBg" | "content" | "label" | "eyeDropTrigger", _zag_js_anatomy.AnatomyPart>;
5
-
6
- export { anatomy, parts };
1
+ import { Anatomy, AnatomyPart } from '@zag-js/anatomy';
2
+ export declare const anatomy: Anatomy<"area" | "areaThumb" | "areaGradient" | "channelSliderTrack" | "channelSliderTrackBg" | "channelSliderThumb" | "channelInput" | "swatch" | "swatchBg" | "content" | "label" | "eyeDropTrigger">;
3
+ export declare const parts: Record<"area" | "areaThumb" | "areaGradient" | "channelSliderTrack" | "channelSliderTrackBg" | "channelSliderThumb" | "channelInput" | "swatch" | "swatchBg" | "content" | "label" | "eyeDropTrigger", AnatomyPart>;
@@ -1,31 +1,10 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ 'use strict';
19
2
 
20
- // src/color-picker.anatomy.ts
21
- var color_picker_anatomy_exports = {};
22
- __export(color_picker_anatomy_exports, {
23
- anatomy: () => anatomy,
24
- parts: () => parts
25
- });
26
- module.exports = __toCommonJS(color_picker_anatomy_exports);
27
- var import_anatomy = require("@zag-js/anatomy");
28
- var anatomy = (0, import_anatomy.createAnatomy)("color-picker", [
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const anatomy$1 = require('@zag-js/anatomy');
6
+
7
+ const anatomy = anatomy$1.createAnatomy("color-picker", [
29
8
  "area",
30
9
  "areaThumb",
31
10
  "areaGradient",
@@ -39,9 +18,7 @@ var anatomy = (0, import_anatomy.createAnatomy)("color-picker", [
39
18
  "label",
40
19
  "eyeDropTrigger"
41
20
  ]);
42
- var parts = anatomy.build();
43
- // Annotate the CommonJS export names for ESM import in node:
44
- 0 && (module.exports = {
45
- anatomy,
46
- parts
47
- });
21
+ const parts = anatomy.build();
22
+
23
+ exports.anatomy = anatomy;
24
+ exports.parts = parts;
@@ -1,8 +1,19 @@
1
- import {
2
- anatomy,
3
- parts
4
- } from "./chunk-75JXJMB5.mjs";
5
- export {
6
- anatomy,
7
- parts
8
- };
1
+ import { createAnatomy } from '@zag-js/anatomy';
2
+
3
+ const anatomy = createAnatomy("color-picker", [
4
+ "area",
5
+ "areaThumb",
6
+ "areaGradient",
7
+ "channelSliderTrack",
8
+ "channelSliderTrackBg",
9
+ "channelSliderThumb",
10
+ "channelInput",
11
+ "swatch",
12
+ "swatchBg",
13
+ "content",
14
+ "label",
15
+ "eyeDropTrigger"
16
+ ]);
17
+ const parts = anatomy.build();
18
+
19
+ export { anatomy, parts };
@@ -1,9 +1,7 @@
1
- import { Color, ColorChannel, ColorFormat } from '@zag-js/color-utils';
2
- import { PropTypes, NormalizeProps } from '@zag-js/types';
3
- import { State, Send, ColorAreaProps, ColorChannelProps, ColorChannelInputProps, ColorSwatchProps } from './color-picker.types.js';
4
- import '@zag-js/core';
5
-
6
- declare function connect<T extends PropTypes>(state: State, send: Send, normalize: NormalizeProps<T>): {
1
+ import { Color, type ColorChannel, type ColorFormat } from "@zag-js/color-utils";
2
+ import { NormalizeProps, type PropTypes } from "@zag-js/types";
3
+ import { ColorAreaProps, ColorChannelInputProps, ColorChannelProps, ColorSwatchProps, Send, State } from "./color-picker.types";
4
+ export declare function connect<T extends PropTypes>(state: State, send: Send, normalize: NormalizeProps<T>): {
7
5
  /**
8
6
  * Whether the color picker is being dragged
9
7
  */
@@ -44,5 +42,3 @@ declare function connect<T extends PropTypes>(state: State, send: Send, normaliz
44
42
  getSwatchBackgroundProps(props: ColorSwatchProps): T["element"];
45
43
  getSwatchProps(props: ColorSwatchProps): T["element"];
46
44
  };
47
-
48
- export { connect };