@zag-js/types 0.0.0-dev-20220415160434 → 0.0.0-dev-20220417135151
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.d.ts +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,12 @@ import type * as React from "react";
|
|
|
2
2
|
export declare type Direction = "ltr" | "rtl";
|
|
3
3
|
export declare type Orientation = "horizontal" | "vertical";
|
|
4
4
|
export declare type MaybeElement<T extends HTMLElement = HTMLElement> = T | null;
|
|
5
|
+
export declare type DirectionProperty = {
|
|
6
|
+
/**
|
|
7
|
+
* The document's text/writing direction.
|
|
8
|
+
*/
|
|
9
|
+
dir?: Direction;
|
|
10
|
+
};
|
|
5
11
|
export declare type Context<T> = T & {
|
|
6
12
|
/**
|
|
7
13
|
* @internal
|
|
@@ -19,10 +25,6 @@ export declare type Context<T> = T & {
|
|
|
19
25
|
* Used as a polyfill for `e.relatedTarget`
|
|
20
26
|
*/
|
|
21
27
|
pointerdownNode?: HTMLElement | null;
|
|
22
|
-
/**
|
|
23
|
-
* The document's text/writing direction.
|
|
24
|
-
*/
|
|
25
|
-
dir?: Direction;
|
|
26
28
|
};
|
|
27
29
|
export declare type Style = React.CSSProperties & {
|
|
28
30
|
[prop: string]: string | number | undefined;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAA;AAEnC,oBAAY,SAAS,GAAG,KAAK,GAAG,KAAK,CAAA;AAErC,oBAAY,WAAW,GAAG,YAAY,GAAG,UAAU,CAAA;AAEnD,oBAAY,YAAY,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAAI,CAAC,GAAG,IAAI,CAAA;AAExE,oBAAY,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG;IAC3B;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;;OAGG;IACH,GAAG,CAAC,EAAE,QAAQ,CAAA;IACd;;;;OAIG;IACH,eAAe,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAA;AAEnC,oBAAY,SAAS,GAAG,KAAK,GAAG,KAAK,CAAA;AAErC,oBAAY,WAAW,GAAG,YAAY,GAAG,UAAU,CAAA;AAEnD,oBAAY,YAAY,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAAI,CAAC,GAAG,IAAI,CAAA;AAExE,oBAAY,iBAAiB,GAAG;IAC9B;;OAEG;IACH,GAAG,CAAC,EAAE,SAAS,CAAA;CAChB,CAAA;AAED,oBAAY,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG;IAC3B;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;;OAGG;IACH,GAAG,CAAC,EAAE,QAAQ,CAAA;IACd;;;;OAIG;IACH,eAAe,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;CACrC,CAAA;AAED,oBAAY,KAAK,GAAG,KAAK,CAAC,aAAa,GAAG;IACxC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CAC5C,CAAA;AAED,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA"}
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/prop-types.ts", "../src/controls.ts"],
|
|
4
|
-
"sourcesContent": ["import type * as React from \"react\"\n\nexport type Direction = \"ltr\" | \"rtl\"\n\nexport type Orientation = \"horizontal\" | \"vertical\"\n\nexport type MaybeElement<T extends HTMLElement = HTMLElement> = T | null\n\nexport type Context<T> = T & {\n /**\n * @internal\n * The unique identifier of the accordion.\n */\n uid: string\n /**\n * @internal\n * The owner document of the accordion widget.\n */\n doc?: Document\n /**\n * @internal\n * The related target when the element is blurred.\n * Used as a polyfill for `e.relatedTarget`\n */\n pointerdownNode?: HTMLElement | null\n
|
|
4
|
+
"sourcesContent": ["import type * as React from \"react\"\n\nexport type Direction = \"ltr\" | \"rtl\"\n\nexport type Orientation = \"horizontal\" | \"vertical\"\n\nexport type MaybeElement<T extends HTMLElement = HTMLElement> = T | null\n\nexport type DirectionProperty = {\n /**\n * The document's text/writing direction.\n */\n dir?: Direction\n}\n\nexport type Context<T> = T & {\n /**\n * @internal\n * The unique identifier of the accordion.\n */\n uid: string\n /**\n * @internal\n * The owner document of the accordion widget.\n */\n doc?: Document\n /**\n * @internal\n * The related target when the element is blurred.\n * Used as a polyfill for `e.relatedTarget`\n */\n pointerdownNode?: HTMLElement | null\n}\n\nexport type Style = React.CSSProperties & {\n [prop: string]: string | number | undefined\n}\n\nexport * from \"./prop-types\"\nexport * from \"./controls\"\n", "import type * as React from \"react\"\n\ntype Dict<T = any> = Record<string, T>\n\ntype Booleanish = boolean | \"true\" | \"false\"\n\ntype Omit<T, K extends keyof T> = { [P in Exclude<keyof T, K>]?: T[P] }\n\ntype WithStyle<T extends { style?: any }> = Omit<T, \"style\"> & {\n style?: T[\"style\"] & {\n [prop: string]: string | number | undefined\n }\n}\n\ntype DataAttr = {\n \"data-uid\"?: string\n \"data-name\"?: string\n \"data-ownedby\"?: string\n \"data-selected\"?: Booleanish\n \"data-expanded\"?: Booleanish\n \"data-highlighted\"?: Booleanish\n \"data-readonly\"?: Booleanish\n \"data-invalid\"?: Booleanish\n \"data-hover\"?: Booleanish\n \"data-active\"?: Booleanish\n \"data-focus\"?: Booleanish\n \"data-disabled\"?: Booleanish\n \"data-type\"?: string\n \"data-value\"?: string | number\n \"data-valuetext\"?: string\n \"data-open\"?: Booleanish\n \"data-placement\"?: string\n \"data-orientation\"?: \"horizontal\" | \"vertical\"\n \"data-label\"?: string\n \"data-checked\"?: Booleanish\n \"data-pressed\"?: Booleanish\n \"data-state\"?: string | null\n \"data-half\"?: Booleanish\n \"data-count\"?: number\n \"data-controls\"?: string\n \"data-part\"?: string\n \"data-index\"?: number\n \"data-complete\"?: Booleanish\n \"data-empty\"?: Booleanish\n \"data-placeholder-shown\"?: Booleanish\n}\n\ntype JSXElementAttributes = DataAttr & React.HTMLAttributes<HTMLElement>\ntype JSXButtonAttributes = DataAttr & React.ButtonHTMLAttributes<HTMLButtonElement>\ntype JSXInputAttributes = DataAttr & React.InputHTMLAttributes<HTMLInputElement>\ntype JSXLabelAttributes = DataAttr & React.LabelHTMLAttributes<HTMLLabelElement>\ntype JSXOutputAttributes = DataAttr & React.OutputHTMLAttributes<HTMLOutputElement>\n\nexport type PropTypes = Record<\"button\" | \"label\" | \"input\" | \"output\" | \"element\", Dict>\n\nexport type ReactPropTypes = {\n button: JSXButtonAttributes\n label: JSXLabelAttributes\n input: JSXInputAttributes\n output: JSXOutputAttributes\n element: JSXElementAttributes\n}\n\nexport type NormalizeProps = {\n button<T extends PropTypes>(props: WithStyle<JSXButtonAttributes>): T[\"button\"]\n label<T extends PropTypes>(props: WithStyle<JSXLabelAttributes>): T[\"label\"]\n input<T extends PropTypes>(props: WithStyle<JSXInputAttributes>): T[\"input\"]\n output<T extends PropTypes>(props: WithStyle<JSXOutputAttributes>): T[\"output\"]\n element<T extends PropTypes>(props: WithStyle<JSXElementAttributes>): T[\"element\"]\n}\n\nexport function createNormalizer(fn: (props: Dict) => Dict): NormalizeProps {\n return { button: fn, label: fn, input: fn, output: fn, element: fn }\n}\n\nexport const normalizeProp = createNormalizer((v) => v)\n", "export type ControlProp =\n | { type: \"boolean\"; label?: string; defaultValue: boolean }\n | { type: \"string\"; label?: string; defaultValue: string; placeholder?: string }\n | { type: \"select\"; options: readonly string[]; defaultValue: string; label?: string }\n | { type: \"multiselect\"; options: readonly string[]; defaultValue: string[]; label?: string }\n | { type: \"number\"; label?: string; defaultValue: number; min?: number; max?: number }\n\nexport type ControlRecord = Record<string, ControlProp>\n\nexport type ControlValue<T extends ControlRecord> = {\n [K in keyof T]: T[K] extends { type: \"boolean\" }\n ? boolean\n : T[K] extends { type: \"string\" }\n ? string\n : T[K] extends { type: \"select\" }\n ? T[K][\"options\"][number]\n : T[K] extends { type: \"multiselect\" }\n ? T[K][\"options\"][number][]\n : T[K] extends { type: \"number\" }\n ? number\n : never\n}\n\nexport function defineControls<T extends ControlRecord>(config: T) {\n return config\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACuEO,0BAA0B,IAA2C;AAC1E,SAAO,EAAE,QAAQ,IAAI,OAAO,IAAI,OAAO,IAAI,QAAQ,IAAI,SAAS,GAAG;AACrE;AAEO,IAAM,gBAAgB,iBAAiB,CAAC,MAAM,CAAC;;;ACpD/C,wBAAiD,QAAW;AACjE,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|