@zag-js/number-input 0.0.0-dev-20220604091726 → 0.0.0-dev-20220604123738

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.mjs CHANGED
@@ -31,6 +31,9 @@ function raf(fn) {
31
31
  globalThis.cancelAnimationFrame(id);
32
32
  };
33
33
  }
34
+ var isDom = () => typeof window !== "undefined";
35
+ var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
36
+ var isTouchDevice = isDom() && !!navigator.maxTouchPoints;
34
37
  var runIfFn = (v, ...a) => {
35
38
  const res = typeof v === "function" ? v(...a) : v;
36
39
  return res != null ? res : void 0;
@@ -38,7 +41,6 @@ var runIfFn = (v, ...a) => {
38
41
  var noop = () => {
39
42
  };
40
43
  var pipe = (...fns) => (v) => fns.reduce((a, b) => b(a), v);
41
- var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
42
44
  function getListenerElements() {
43
45
  ;
44
46
  globalThis.__listenerElements__ = globalThis.__listenerElements__ || /* @__PURE__ */ new Map();
@@ -296,9 +298,11 @@ function decimalOperation(a, op, b) {
296
298
  var nf = new Intl.NumberFormat("en-US", { style: "decimal", maximumFractionDigits: 20 });
297
299
 
298
300
  // ../../utilities/rect/dist/index.mjs
301
+ var isDom2 = () => typeof window !== "undefined";
299
302
  var isArray = (v) => Array.isArray(v);
300
303
  var isObject = (v) => !(v == null || typeof v !== "object" || isArray(v));
301
304
  var hasProp2 = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
305
+ var isTouchDevice2 = isDom2() && !!navigator.maxTouchPoints;
302
306
  var isTouchEvent = (v) => isObject(v) && hasProp2(v, "touches");
303
307
  var fallback = { pageX: 0, pageY: 0, clientX: 0, clientY: 0 };
304
308
  function getEventPoint(e, t = "page") {
@@ -317,18 +321,23 @@ function createNormalizer(fn) {
317
321
  var normalizeProp = createNormalizer((v) => v);
318
322
 
319
323
  // ../../utilities/core/dist/index.mjs
320
- var pipe2 = (...fns) => (v) => fns.reduce((a, b) => b(a), v);
321
- var platform = (v) => isDom() && v.test(navigator.platform);
322
- var ua = (v) => isDom() && v.test(navigator.userAgent);
323
- var isDom = () => typeof window !== "undefined";
324
- var isMac = () => platform(/^Mac/);
325
- var isIPhone = () => platform(/^iPhone/);
326
- var isIPad = () => platform(/^iPad/) || isMac() && navigator.maxTouchPoints > 1;
327
- var isIos = () => isIPhone() || isIPad();
328
- var isSafari = () => ua(/^((?!chrome|android).)*safari/i);
329
- var supportsPointerEvent = () => isDom() && window.onpointerdown === null;
324
+ var isDom3 = () => typeof window !== "undefined";
325
+ function getPlatform() {
326
+ var _a;
327
+ const agent = navigator.userAgentData;
328
+ return (_a = agent == null ? void 0 : agent.platform) != null ? _a : navigator.platform;
329
+ }
330
+ var pt = (v) => isDom3() && v.test(getPlatform());
331
+ var vn = (v) => isDom3() && v.test(navigator.vendor);
332
+ var isTouchDevice3 = isDom3() && !!navigator.maxTouchPoints;
333
+ var isMac = () => pt(/^Mac/) && !isTouchDevice3;
334
+ var isSafari = () => isApple() && vn(/apple/i);
335
+ var isApple = () => pt(/mac|iphone|ipad|ipod/i);
336
+ var isIos = () => isApple() && !isMac();
337
+ var supportsPointerEvent = () => isDom3() && window.onpointerdown === null;
330
338
  var isLeftClick = (v) => v.button === 0;
331
339
  var isModifiedEvent = (v) => v.ctrlKey || v.altKey || v.metaKey;
340
+ var pipe2 = (...fns) => (v) => fns.reduce((a, b) => b(a), v);
332
341
 
333
342
  // src/number-input.dom.ts
334
343
  var dom = {