@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/dist/index.js
CHANGED
|
@@ -1,29 +1,4 @@
|
|
|
1
|
-
|
|
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);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var src_exports = {};
|
|
22
|
-
__export(src_exports, {
|
|
23
|
-
createNormalizer: () => createNormalizer,
|
|
24
|
-
createProps: () => createProps
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(src_exports);
|
|
1
|
+
'use strict';
|
|
27
2
|
|
|
28
3
|
// src/prop-types.ts
|
|
29
4
|
function createNormalizer(fn) {
|
|
@@ -36,9 +11,6 @@ function createNormalizer(fn) {
|
|
|
36
11
|
|
|
37
12
|
// src/create-props.ts
|
|
38
13
|
var createProps = () => (props) => Array.from(new Set(props));
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
createProps
|
|
43
|
-
});
|
|
44
|
-
//# sourceMappingURL=index.js.map
|
|
14
|
+
|
|
15
|
+
exports.createNormalizer = createNormalizer;
|
|
16
|
+
exports.createProps = createProps;
|
package/dist/index.mjs
CHANGED
|
@@ -9,8 +9,5 @@ function createNormalizer(fn) {
|
|
|
9
9
|
|
|
10
10
|
// src/create-props.ts
|
|
11
11
|
var createProps = () => (props) => Array.from(new Set(props));
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
createProps
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=index.mjs.map
|
|
12
|
+
|
|
13
|
+
export { createNormalizer, createProps };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.71.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"js",
|
|
6
6
|
"utils",
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
"repository": "https://github.com/chakra-ui/zag/tree/main/packages/utilities/types",
|
|
13
13
|
"sideEffects": false,
|
|
14
14
|
"files": [
|
|
15
|
-
"dist"
|
|
16
|
-
"src"
|
|
15
|
+
"dist"
|
|
17
16
|
],
|
|
18
17
|
"publishConfig": {
|
|
19
18
|
"access": "public"
|
|
@@ -41,7 +40,7 @@
|
|
|
41
40
|
},
|
|
42
41
|
"scripts": {
|
|
43
42
|
"build": "tsup",
|
|
44
|
-
"test": "
|
|
43
|
+
"test": "vitest --passWithNoTests",
|
|
45
44
|
"lint": "eslint src",
|
|
46
45
|
"typecheck": "tsc --noEmit"
|
|
47
46
|
}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/prop-types.ts","../src/create-props.ts"],"sourcesContent":["import type { JSX } from \"./jsx\"\n\nexport type RequiredBy<T, K extends keyof T> = Partial<Omit<T, K>> & Required<Pick<T, K>>\n\nexport type Direction = \"ltr\" | \"rtl\"\n\nexport type Orientation = \"horizontal\" | \"vertical\"\n\nexport type MaybeElement<T extends HTMLElement = HTMLElement> = T | null\n\nexport interface OrientationProperty {\n /**\n * The orientation of the element.\n * @default \"horizontal\"\n */\n orientation?: Orientation\n}\n\nexport interface DirectionProperty {\n /**\n * The document's text/writing direction.\n * @default \"ltr\"\n */\n dir?: \"ltr\" | \"rtl\"\n}\n\nexport interface LocaleProperties extends DirectionProperty {\n /**\n * The current locale. Based on the BCP 47 definition.\n * @default \"en-US\"\n */\n locale?: string\n}\n\nexport interface CommonProperties {\n /**\n * The unique identifier of the machine.\n */\n id: string\n /**\n * A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.\n */\n getRootNode?: () => ShadowRoot | Document | Node\n}\n\nexport type Style = JSX.CSSProperties\n\nexport * from \"./prop-types\"\nexport type { JSX }\nexport * from \"./create-props\"\n","import type { JSX } from \"./jsx\"\n\ntype Dict<T = any> = Record<string, T>\n\ntype DataAttr = {\n \"data-selected\"?: any\n \"data-expanded\"?: any\n \"data-highlighted\"?: any\n \"data-readonly\"?: any\n \"data-indeterminate\"?: any\n \"data-invalid\"?: any\n \"data-hover\"?: any\n \"data-active\"?: any\n \"data-focus\"?: any\n \"data-focus-visible\"?: any\n \"data-disabled\"?: any\n \"data-open\"?: any\n \"data-checked\"?: any\n \"data-pressed\"?: any\n \"data-complete\"?: any\n \"data-side\"?: any\n \"data-align\"?: any\n \"data-empty\"?: any\n \"data-placeholder-shown\"?: any\n \"data-half\"?: any\n \"data-scope\"?: string\n \"data-uid\"?: string\n \"data-name\"?: string\n \"data-ownedby\"?: string\n \"data-type\"?: string\n \"data-valuetext\"?: string\n \"data-placement\"?: string\n \"data-controls\"?: string\n \"data-part\"?: string\n \"data-label\"?: string\n \"data-state\"?: string | null\n \"data-value\"?: string | number\n \"data-orientation\"?: \"horizontal\" | \"vertical\"\n \"data-count\"?: number\n \"data-index\"?: number\n} & {\n [key in `data-${string}`]?: any\n}\n\nexport type PropTypes<T = Dict> = Record<\n | \"button\"\n | \"label\"\n | \"input\"\n | \"textarea\"\n | \"img\"\n | \"output\"\n | \"element\"\n | \"select\"\n | \"rect\"\n | \"style\"\n | \"circle\"\n | \"svg\"\n | \"path\",\n T\n>\n\nexport type NormalizeProps<T extends PropTypes> = {\n [K in keyof T]: (props: K extends keyof JSX.IntrinsicElements ? DataAttr & JSX.IntrinsicElements[K] : never) => T[K]\n} & {\n element(props: DataAttr & JSX.HTMLAttributes<HTMLElement> & Record<string, any>): T[\"element\"]\n style: JSX.CSSProperties\n}\n\nexport function createNormalizer<T extends PropTypes>(fn: (props: Dict) => Dict): NormalizeProps<T> {\n return new Proxy({} as any, {\n get() {\n return fn\n },\n })\n}\n","type StrictKeys<K extends (keyof T)[], T> = K extends (keyof T)[]\n ? [keyof T] extends [K[number]]\n ? unknown\n : `Missing required keys: ${Exclude<keyof T, K[number]>}`\n : never\n\nexport const createProps =\n <T extends Record<never, never>>() =>\n <K extends (keyof T)[]>(props: K & StrictKeys<K, T>) =>\n Array.from(new Set(props))\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACoEO,SAAS,iBAAsC,IAA8C;AAClG,SAAO,IAAI,MAAM,CAAC,GAAU;AAAA,IAC1B,MAAM;AACJ,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AACH;;;ACpEO,IAAM,cACX,MACA,CAAwB,UACtB,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC;","names":[]}
|
package/dist/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/prop-types.ts","../src/create-props.ts"],"sourcesContent":["import type { JSX } from \"./jsx\"\n\ntype Dict<T = any> = Record<string, T>\n\ntype DataAttr = {\n \"data-selected\"?: any\n \"data-expanded\"?: any\n \"data-highlighted\"?: any\n \"data-readonly\"?: any\n \"data-indeterminate\"?: any\n \"data-invalid\"?: any\n \"data-hover\"?: any\n \"data-active\"?: any\n \"data-focus\"?: any\n \"data-focus-visible\"?: any\n \"data-disabled\"?: any\n \"data-open\"?: any\n \"data-checked\"?: any\n \"data-pressed\"?: any\n \"data-complete\"?: any\n \"data-side\"?: any\n \"data-align\"?: any\n \"data-empty\"?: any\n \"data-placeholder-shown\"?: any\n \"data-half\"?: any\n \"data-scope\"?: string\n \"data-uid\"?: string\n \"data-name\"?: string\n \"data-ownedby\"?: string\n \"data-type\"?: string\n \"data-valuetext\"?: string\n \"data-placement\"?: string\n \"data-controls\"?: string\n \"data-part\"?: string\n \"data-label\"?: string\n \"data-state\"?: string | null\n \"data-value\"?: string | number\n \"data-orientation\"?: \"horizontal\" | \"vertical\"\n \"data-count\"?: number\n \"data-index\"?: number\n} & {\n [key in `data-${string}`]?: any\n}\n\nexport type PropTypes<T = Dict> = Record<\n | \"button\"\n | \"label\"\n | \"input\"\n | \"textarea\"\n | \"img\"\n | \"output\"\n | \"element\"\n | \"select\"\n | \"rect\"\n | \"style\"\n | \"circle\"\n | \"svg\"\n | \"path\",\n T\n>\n\nexport type NormalizeProps<T extends PropTypes> = {\n [K in keyof T]: (props: K extends keyof JSX.IntrinsicElements ? DataAttr & JSX.IntrinsicElements[K] : never) => T[K]\n} & {\n element(props: DataAttr & JSX.HTMLAttributes<HTMLElement> & Record<string, any>): T[\"element\"]\n style: JSX.CSSProperties\n}\n\nexport function createNormalizer<T extends PropTypes>(fn: (props: Dict) => Dict): NormalizeProps<T> {\n return new Proxy({} as any, {\n get() {\n return fn\n },\n })\n}\n","type StrictKeys<K extends (keyof T)[], T> = K extends (keyof T)[]\n ? [keyof T] extends [K[number]]\n ? unknown\n : `Missing required keys: ${Exclude<keyof T, K[number]>}`\n : never\n\nexport const createProps =\n <T extends Record<never, never>>() =>\n <K extends (keyof T)[]>(props: K & StrictKeys<K, T>) =>\n Array.from(new Set(props))\n"],"mappings":";AAoEO,SAAS,iBAAsC,IAA8C;AAClG,SAAO,IAAI,MAAM,CAAC,GAAU;AAAA,IAC1B,MAAM;AACJ,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AACH;;;ACpEO,IAAM,cACX,MACA,CAAwB,UACtB,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC;","names":[]}
|
package/src/create-props.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
type StrictKeys<K extends (keyof T)[], T> = K extends (keyof T)[]
|
|
2
|
-
? [keyof T] extends [K[number]]
|
|
3
|
-
? unknown
|
|
4
|
-
: `Missing required keys: ${Exclude<keyof T, K[number]>}`
|
|
5
|
-
: never
|
|
6
|
-
|
|
7
|
-
export const createProps =
|
|
8
|
-
<T extends Record<never, never>>() =>
|
|
9
|
-
<K extends (keyof T)[]>(props: K & StrictKeys<K, T>) =>
|
|
10
|
-
Array.from(new Set(props))
|
package/src/index.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { JSX } from "./jsx"
|
|
2
|
-
|
|
3
|
-
export type RequiredBy<T, K extends keyof T> = Partial<Omit<T, K>> & Required<Pick<T, K>>
|
|
4
|
-
|
|
5
|
-
export type Direction = "ltr" | "rtl"
|
|
6
|
-
|
|
7
|
-
export type Orientation = "horizontal" | "vertical"
|
|
8
|
-
|
|
9
|
-
export type MaybeElement<T extends HTMLElement = HTMLElement> = T | null
|
|
10
|
-
|
|
11
|
-
export interface OrientationProperty {
|
|
12
|
-
/**
|
|
13
|
-
* The orientation of the element.
|
|
14
|
-
* @default "horizontal"
|
|
15
|
-
*/
|
|
16
|
-
orientation?: Orientation
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface DirectionProperty {
|
|
20
|
-
/**
|
|
21
|
-
* The document's text/writing direction.
|
|
22
|
-
* @default "ltr"
|
|
23
|
-
*/
|
|
24
|
-
dir?: "ltr" | "rtl"
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface LocaleProperties extends DirectionProperty {
|
|
28
|
-
/**
|
|
29
|
-
* The current locale. Based on the BCP 47 definition.
|
|
30
|
-
* @default "en-US"
|
|
31
|
-
*/
|
|
32
|
-
locale?: string
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface CommonProperties {
|
|
36
|
-
/**
|
|
37
|
-
* The unique identifier of the machine.
|
|
38
|
-
*/
|
|
39
|
-
id: string
|
|
40
|
-
/**
|
|
41
|
-
* A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.
|
|
42
|
-
*/
|
|
43
|
-
getRootNode?: () => ShadowRoot | Document | Node
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export type Style = JSX.CSSProperties
|
|
47
|
-
|
|
48
|
-
export * from "./prop-types"
|
|
49
|
-
export type { JSX }
|
|
50
|
-
export * from "./create-props"
|