@zag-js/number-input 0.0.0-dev-20220604091934 → 0.0.0-dev-20220604123458

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
@@ -54,6 +54,9 @@ function raf(fn) {
54
54
  globalThis.cancelAnimationFrame(id);
55
55
  };
56
56
  }
57
+ var isDom = () => typeof window !== "undefined";
58
+ var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
59
+ var isTouchDevice = isDom() && !!navigator.maxTouchPoints;
57
60
  var runIfFn = (v, ...a) => {
58
61
  const res = typeof v === "function" ? v(...a) : v;
59
62
  return res != null ? res : void 0;
@@ -61,7 +64,6 @@ var runIfFn = (v, ...a) => {
61
64
  var noop = () => {
62
65
  };
63
66
  var pipe = (...fns) => (v) => fns.reduce((a, b) => b(a), v);
64
- var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
65
67
  function getListenerElements() {
66
68
  ;
67
69
  globalThis.__listenerElements__ = globalThis.__listenerElements__ || /* @__PURE__ */ new Map();
@@ -319,9 +321,11 @@ function decimalOperation(a, op, b) {
319
321
  var nf = new Intl.NumberFormat("en-US", { style: "decimal", maximumFractionDigits: 20 });
320
322
 
321
323
  // ../../utilities/rect/dist/index.mjs
324
+ var isDom2 = () => typeof window !== "undefined";
322
325
  var isArray = (v) => Array.isArray(v);
323
326
  var isObject = (v) => !(v == null || typeof v !== "object" || isArray(v));
324
327
  var hasProp2 = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
328
+ var isTouchDevice2 = isDom2() && !!navigator.maxTouchPoints;
325
329
  var isTouchEvent = (v) => isObject(v) && hasProp2(v, "touches");
326
330
  var fallback = { pageX: 0, pageY: 0, clientX: 0, clientY: 0 };
327
331
  function getEventPoint(e, t = "page") {
@@ -340,18 +344,23 @@ function createNormalizer(fn) {
340
344
  var normalizeProp = createNormalizer((v) => v);
341
345
 
342
346
  // ../../utilities/core/dist/index.mjs
343
- var pipe2 = (...fns) => (v) => fns.reduce((a, b) => b(a), v);
344
- var platform = (v) => isDom() && v.test(navigator.platform);
345
- var ua = (v) => isDom() && v.test(navigator.userAgent);
346
- var isDom = () => typeof window !== "undefined";
347
- var isMac = () => platform(/^Mac/);
348
- var isIPhone = () => platform(/^iPhone/);
349
- var isIPad = () => platform(/^iPad/) || isMac() && navigator.maxTouchPoints > 1;
350
- var isIos = () => isIPhone() || isIPad();
351
- var isSafari = () => ua(/^((?!chrome|android).)*safari/i);
352
- var supportsPointerEvent = () => isDom() && window.onpointerdown === null;
347
+ var isDom3 = () => typeof window !== "undefined";
348
+ function getPlatform() {
349
+ var _a;
350
+ const agent = navigator.userAgentData;
351
+ return (_a = agent == null ? void 0 : agent.platform) != null ? _a : navigator.platform;
352
+ }
353
+ var pt = (v) => isDom3() && v.test(getPlatform());
354
+ var vn = (v) => isDom3() && v.test(navigator.vendor);
355
+ var isTouchDevice3 = isDom3() && !!navigator.maxTouchPoints;
356
+ var isMac = () => pt(/^Mac/) && !isTouchDevice3;
357
+ var isSafari = () => isApple() && vn(/apple/i);
358
+ var isApple = () => pt(/mac|iphone|ipad|ipod/i);
359
+ var isIos = () => isApple() && !isMac();
360
+ var supportsPointerEvent = () => isDom3() && window.onpointerdown === null;
353
361
  var isLeftClick = (v) => v.button === 0;
354
362
  var isModifiedEvent = (v) => v.ctrlKey || v.altKey || v.metaKey;
363
+ var pipe2 = (...fns) => (v) => fns.reduce((a, b) => b(a), v);
355
364
 
356
365
  // src/number-input.dom.ts
357
366
  var dom = {