@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,21 +1,20 @@
1
- import { ColorChannel, Color, ColorAxes } from '@zag-js/color-utils';
2
- import { StateMachine } from '@zag-js/core';
3
- import { Orientation, RequiredBy, CommonProperties, Context } from '@zag-js/types';
4
-
5
- type ColorChannelProps = {
1
+ import { Color, type ColorAxes, type ColorChannel, type ColorFormat } from "@zag-js/color-utils";
2
+ import type { StateMachine as S } from "@zag-js/core";
3
+ import type { CommonProperties, Context, Orientation, RequiredBy } from "@zag-js/types";
4
+ export type ColorChannelProps = {
6
5
  channel: ColorChannel;
7
6
  orientation?: Orientation;
8
7
  };
9
- type ExtendedColorChannel = ColorChannel | "hex" | "css";
10
- type ColorChannelInputProps = {
8
+ export type ExtendedColorChannel = ColorChannel | "hex" | "css";
9
+ export type ColorChannelInputProps = {
11
10
  channel: ExtendedColorChannel;
12
11
  orientation?: Orientation;
13
12
  };
14
- type ColorAreaProps = {
13
+ export type ColorAreaProps = {
15
14
  xChannel: ColorChannel;
16
15
  yChannel: ColorChannel;
17
16
  };
18
- type ColorSwatchProps = {
17
+ export type ColorSwatchProps = {
19
18
  readOnly?: boolean;
20
19
  value: string | Color;
21
20
  };
@@ -90,12 +89,11 @@ type ComputedContext = Readonly<{
90
89
  */
91
90
  isInteractive: boolean;
92
91
  }>;
93
- type UserDefinedContext = RequiredBy<PublicContext, "id">;
94
- type MachineContext = PublicContext & PrivateContext & ComputedContext;
95
- type MachineState = {
92
+ export type UserDefinedContext = RequiredBy<PublicContext, "id">;
93
+ export type MachineContext = PublicContext & PrivateContext & ComputedContext;
94
+ export type MachineState = {
96
95
  value: "idle" | "focused" | "dragging";
97
96
  };
98
- type State = StateMachine.State<MachineContext, MachineState>;
99
- type Send = StateMachine.Send<StateMachine.AnyEventObject>;
100
-
101
- export { ColorAreaProps, ColorChannelInputProps, ColorChannelProps, ColorSwatchProps, ExtendedColorChannel, MachineContext, MachineState, Send, State, UserDefinedContext };
97
+ export type State = S.State<MachineContext, MachineState>;
98
+ export type Send = S.Send<S.AnyEventObject>;
99
+ export type { Color, ColorChannel, ColorFormat };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,4 @@
1
- export { anatomy } from './color-picker.anatomy.js';
2
- export { connect } from './color-picker.connect.js';
3
- export { machine } from './color-picker.machine.js';
4
- export { ColorAreaProps, ColorChannelProps, ColorSwatchProps, UserDefinedContext as Context } from './color-picker.types.js';
5
- import '@zag-js/anatomy';
6
- import '@zag-js/color-utils';
7
- import '@zag-js/types';
8
- import '@zag-js/core';
1
+ export { anatomy } from "./color-picker.anatomy";
2
+ export { connect } from "./color-picker.connect";
3
+ export { machine } from "./color-picker.machine";
4
+ export type { Color, ColorAreaProps, ColorChannel, ColorChannelProps, ColorSwatchProps, UserDefinedContext as Context, } from "./color-picker.types";