@zag-js/types 0.70.0 → 0.71.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.js +4 -32
- package/dist/index.mjs +2 -5
- package/package.json +3 -4
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/src/create-props.ts +0 -10
- package/src/index.ts +0 -50
- package/src/jsx.ts +0 -1649
- package/src/prop-types.ts +0 -75
package/src/prop-types.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import type { JSX } from "./jsx"
|
|
2
|
-
|
|
3
|
-
type Dict<T = any> = Record<string, T>
|
|
4
|
-
|
|
5
|
-
type DataAttr = {
|
|
6
|
-
"data-selected"?: any
|
|
7
|
-
"data-expanded"?: any
|
|
8
|
-
"data-highlighted"?: any
|
|
9
|
-
"data-readonly"?: any
|
|
10
|
-
"data-indeterminate"?: any
|
|
11
|
-
"data-invalid"?: any
|
|
12
|
-
"data-hover"?: any
|
|
13
|
-
"data-active"?: any
|
|
14
|
-
"data-focus"?: any
|
|
15
|
-
"data-focus-visible"?: any
|
|
16
|
-
"data-disabled"?: any
|
|
17
|
-
"data-open"?: any
|
|
18
|
-
"data-checked"?: any
|
|
19
|
-
"data-pressed"?: any
|
|
20
|
-
"data-complete"?: any
|
|
21
|
-
"data-side"?: any
|
|
22
|
-
"data-align"?: any
|
|
23
|
-
"data-empty"?: any
|
|
24
|
-
"data-placeholder-shown"?: any
|
|
25
|
-
"data-half"?: any
|
|
26
|
-
"data-scope"?: string
|
|
27
|
-
"data-uid"?: string
|
|
28
|
-
"data-name"?: string
|
|
29
|
-
"data-ownedby"?: string
|
|
30
|
-
"data-type"?: string
|
|
31
|
-
"data-valuetext"?: string
|
|
32
|
-
"data-placement"?: string
|
|
33
|
-
"data-controls"?: string
|
|
34
|
-
"data-part"?: string
|
|
35
|
-
"data-label"?: string
|
|
36
|
-
"data-state"?: string | null
|
|
37
|
-
"data-value"?: string | number
|
|
38
|
-
"data-orientation"?: "horizontal" | "vertical"
|
|
39
|
-
"data-count"?: number
|
|
40
|
-
"data-index"?: number
|
|
41
|
-
} & {
|
|
42
|
-
[key in `data-${string}`]?: any
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export type PropTypes<T = Dict> = Record<
|
|
46
|
-
| "button"
|
|
47
|
-
| "label"
|
|
48
|
-
| "input"
|
|
49
|
-
| "textarea"
|
|
50
|
-
| "img"
|
|
51
|
-
| "output"
|
|
52
|
-
| "element"
|
|
53
|
-
| "select"
|
|
54
|
-
| "rect"
|
|
55
|
-
| "style"
|
|
56
|
-
| "circle"
|
|
57
|
-
| "svg"
|
|
58
|
-
| "path",
|
|
59
|
-
T
|
|
60
|
-
>
|
|
61
|
-
|
|
62
|
-
export type NormalizeProps<T extends PropTypes> = {
|
|
63
|
-
[K in keyof T]: (props: K extends keyof JSX.IntrinsicElements ? DataAttr & JSX.IntrinsicElements[K] : never) => T[K]
|
|
64
|
-
} & {
|
|
65
|
-
element(props: DataAttr & JSX.HTMLAttributes<HTMLElement> & Record<string, any>): T["element"]
|
|
66
|
-
style: JSX.CSSProperties
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export function createNormalizer<T extends PropTypes>(fn: (props: Dict) => Dict): NormalizeProps<T> {
|
|
70
|
-
return new Proxy({} as any, {
|
|
71
|
-
get() {
|
|
72
|
-
return fn
|
|
73
|
-
},
|
|
74
|
-
})
|
|
75
|
-
}
|