zag-ripple 0.0.9 → 0.0.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zag-ripple",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "RippleJS Adapter for Zag JS",
5
5
  "keywords": [
6
6
  "js",
package/src/index.d.ts CHANGED
@@ -4,7 +4,8 @@ import { Component } from "ripple";
4
4
  export { mergeProps } from "@zag-js/core";
5
5
 
6
6
  // From normalize-props.ripple
7
- export declare const normalizeProps: <T>(props: T) => T;
7
+ import { NormalizeProps, PropTypes } from "@zag-js/types";
8
+ export declare const normalizeProps: NormalizeProps<PropTypes>;
8
9
 
9
10
  // From machine.ripple
10
11
  export interface MachineApi<TContext = Record<string, any>, TState extends string = string> {
@@ -1,5 +1,4 @@
1
- import { createNormalizer } from "@zag-js/types"
2
-
1
+ import { createNormalizer, type PropTypes } from "@zag-js/types"
3
2
 
4
3
  type Dict = Record<string, boolean | number | string | undefined>
5
4
 
@@ -44,7 +43,7 @@ function toRipplePropValue(key: string, value: Dict[string]) {
44
43
  return value
45
44
  }
46
45
 
47
- export const normalizeProps = createNormalizer<Record<string, any>>((props) => {
46
+ const normalizeFn = (props: any) => {
48
47
  const normalized: Dict = {}
49
48
 
50
49
  for (const key in props) {
@@ -52,4 +51,6 @@ export const normalizeProps = createNormalizer<Record<string, any>>((props) => {
52
51
  }
53
52
 
54
53
  return normalized
55
- })
54
+ }
55
+
56
+ export const normalizeProps = createNormalizer<PropTypes>(normalizeFn)