@zag-js/slider 0.0.0-dev-20220627213111 → 0.0.0-dev-20220703123907

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 CHANGED
@@ -156,7 +156,7 @@ function raf(fn) {
156
156
  globalThis.cancelAnimationFrame(id);
157
157
  };
158
158
  }
159
- function getOwnerWindow(el) {
159
+ function getWindow(el) {
160
160
  var _a;
161
161
  return (_a = el == null ? void 0 : el.ownerDocument.defaultView) != null ? _a : window;
162
162
  }
@@ -246,12 +246,12 @@ function getPointRelativeToNode(point, element) {
246
246
  function getDescriptor(el, options) {
247
247
  var _a;
248
248
  const { type, property } = options;
249
- const proto = getOwnerWindow(el)[type].prototype;
249
+ const proto = getWindow(el)[type].prototype;
250
250
  return (_a = Object.getOwnPropertyDescriptor(proto, property)) != null ? _a : {};
251
251
  }
252
252
  function dispatchInputValueEvent(el, value) {
253
253
  var _a;
254
- const win = getOwnerWindow(el);
254
+ const win = getWindow(el);
255
255
  if (!(el instanceof win.HTMLInputElement))
256
256
  return;
257
257
  const desc = getDescriptor(el, { type: "HTMLInputElement", property: "value" });
@@ -615,22 +615,12 @@ var dom = __spreadProps(__spreadValues({}, styles), {
615
615
  }
616
616
  });
617
617
 
618
- // ../../types/dist/index.mjs
619
- function createNormalizer(fn) {
620
- return new Proxy({}, {
621
- get() {
622
- return fn;
623
- }
624
- });
625
- }
626
- var normalizeProp = createNormalizer((v) => v);
627
-
628
618
  // ../../utilities/core/dist/index.mjs
629
619
  var isLeftClick2 = (v) => v.button === 0;
630
620
  var isModifiedEvent = (v) => v.ctrlKey || v.altKey || v.metaKey;
631
621
 
632
622
  // src/slider.connect.ts
633
- function connect(state2, send, normalize = normalizeProp) {
623
+ function connect(state2, send, normalize) {
634
624
  var _a, _b;
635
625
  const ariaLabel = state2.context["aria-label"];
636
626
  const ariaLabelledBy = state2.context["aria-labelledby"];
package/dist/index.mjs CHANGED
@@ -132,7 +132,7 @@ function raf(fn) {
132
132
  globalThis.cancelAnimationFrame(id);
133
133
  };
134
134
  }
135
- function getOwnerWindow(el) {
135
+ function getWindow(el) {
136
136
  var _a;
137
137
  return (_a = el == null ? void 0 : el.ownerDocument.defaultView) != null ? _a : window;
138
138
  }
@@ -222,12 +222,12 @@ function getPointRelativeToNode(point, element) {
222
222
  function getDescriptor(el, options) {
223
223
  var _a;
224
224
  const { type, property } = options;
225
- const proto = getOwnerWindow(el)[type].prototype;
225
+ const proto = getWindow(el)[type].prototype;
226
226
  return (_a = Object.getOwnPropertyDescriptor(proto, property)) != null ? _a : {};
227
227
  }
228
228
  function dispatchInputValueEvent(el, value) {
229
229
  var _a;
230
- const win = getOwnerWindow(el);
230
+ const win = getWindow(el);
231
231
  if (!(el instanceof win.HTMLInputElement))
232
232
  return;
233
233
  const desc = getDescriptor(el, { type: "HTMLInputElement", property: "value" });
@@ -591,22 +591,12 @@ var dom = __spreadProps(__spreadValues({}, styles), {
591
591
  }
592
592
  });
593
593
 
594
- // ../../types/dist/index.mjs
595
- function createNormalizer(fn) {
596
- return new Proxy({}, {
597
- get() {
598
- return fn;
599
- }
600
- });
601
- }
602
- var normalizeProp = createNormalizer((v) => v);
603
-
604
594
  // ../../utilities/core/dist/index.mjs
605
595
  var isLeftClick2 = (v) => v.button === 0;
606
596
  var isModifiedEvent = (v) => v.ctrlKey || v.altKey || v.metaKey;
607
597
 
608
598
  // src/slider.connect.ts
609
- function connect(state2, send, normalize = normalizeProp) {
599
+ function connect(state2, send, normalize) {
610
600
  var _a, _b;
611
601
  const ariaLabel = state2.context["aria-label"];
612
602
  const ariaLabelledBy = state2.context["aria-labelledby"];
@@ -1,6 +1,6 @@
1
- import { PropTypes, ReactPropTypes } from "@zag-js/types";
1
+ import type { NormalizeProps, PropTypes } from "@zag-js/types";
2
2
  import type { Send, State } from "./slider.types";
3
- export declare function connect<T extends PropTypes = ReactPropTypes>(state: State, send: Send, normalize?: import("@zag-js/types").NormalizeProps): {
3
+ export declare function connect<T extends PropTypes>(state: State, send: Send, normalize: NormalizeProps<T>): {
4
4
  isFocused: boolean;
5
5
  isDragging: boolean;
6
6
  value: number;
@@ -18,12 +18,12 @@ export declare const dom: {
18
18
  getValueFromPoint(ctx: Ctx, point: Point): number | undefined;
19
19
  dispatchChangeEvent(ctx: Ctx): void;
20
20
  getThumbOffset: (ctx: import("./slider.types").SharedContext) => string;
21
- getControlStyle: () => import("@zag-js/types").Style;
22
- getThumbStyle: (ctx: import("./slider.types").SharedContext) => import("@zag-js/types").Style;
23
- getRangeStyle: (ctx: Pick<import("./slider.types").SharedContext, "isVertical" | "isRtl">) => import("@zag-js/types").Style;
24
- getRootStyle: (ctx: Ctx) => import("@zag-js/types").Style;
25
- getMarkerStyle: (ctx: Pick<import("./slider.types").SharedContext, "isHorizontal" | "isRtl">, percent: number) => import("@zag-js/types").Style;
26
- getLabelStyle: () => import("@zag-js/types").Style;
27
- getTrackStyle: () => import("@zag-js/types").Style;
28
- getMarkerGroupStyle: () => import("@zag-js/types").Style;
21
+ getControlStyle: () => JSX.CSSProperties;
22
+ getThumbStyle: (ctx: import("./slider.types").SharedContext) => JSX.CSSProperties;
23
+ getRangeStyle: (ctx: Pick<import("./slider.types").SharedContext, "isVertical" | "isRtl">) => JSX.CSSProperties;
24
+ getRootStyle: (ctx: Ctx) => JSX.CSSProperties;
25
+ getMarkerStyle: (ctx: Pick<import("./slider.types").SharedContext, "isHorizontal" | "isRtl">, percent: number) => JSX.CSSProperties;
26
+ getLabelStyle: () => JSX.CSSProperties;
27
+ getTrackStyle: () => JSX.CSSProperties;
28
+ getMarkerGroupStyle: () => JSX.CSSProperties;
29
29
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/slider",
3
- "version": "0.0.0-dev-20220627213111",
3
+ "version": "0.0.0-dev-20220703123907",
4
4
  "description": "Core logic for the slider widget implemented as a state machine",
5
5
  "keywords": [
6
6
  "js",
@@ -29,10 +29,10 @@
29
29
  "url": "https://github.com/chakra-ui/zag/issues"
30
30
  },
31
31
  "dependencies": {
32
- "@zag-js/core": "0.0.0-dev-20220627213111",
33
- "@zag-js/dom-utils": "0.0.0-dev-20220627213111",
32
+ "@zag-js/core": "0.0.0-dev-20220703123907",
33
+ "@zag-js/dom-utils": "0.0.0-dev-20220703123907",
34
34
  "@zag-js/number-utils": "0.1.2",
35
- "@zag-js/types": "0.2.0",
35
+ "@zag-js/types": "0.0.0-dev-20220703123907",
36
36
  "@zag-js/utils": "0.1.2"
37
37
  },
38
38
  "scripts": {