@zag-js/number-input 0.0.0-dev-20220714091855 → 0.0.0-dev-20220730064719

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 CHANGED
@@ -26,6 +26,10 @@ declare type IntlMessages = {
26
26
  */
27
27
  decrementLabel: string;
28
28
  };
29
+ declare type Value = {
30
+ value: string;
31
+ valueAsNumber: number;
32
+ };
29
33
  declare type PublicContext = DirectionProperty & CommonProperties & {
30
34
  /**
31
35
  * The ids of the elements in the number input. Useful for composition.
@@ -115,18 +119,23 @@ declare type PublicContext = DirectionProperty & CommonProperties & {
115
119
  /**
116
120
  * Function invoked when the value changes
117
121
  */
118
- onChange?: (details: {
119
- value: string;
120
- valueAsNumber: number;
121
- }) => void;
122
+ onChange?: (details: Value) => void;
122
123
  /**
123
124
  * Function invoked when the value overflows or underflows the min/max range
124
125
  */
125
- onInvalid?: (details: {
126
+ onInvalid?: (details: Value & {
126
127
  reason: ValidityState;
127
- value: string;
128
- valueAsNumber: number;
129
128
  }) => void;
129
+ /**
130
+ * Function invoked when the number input is focused
131
+ */
132
+ onFocus?: (details: Value & {
133
+ srcElement: HTMLElement | null;
134
+ }) => void;
135
+ /**
136
+ * The value of the input when it is blurred
137
+ */
138
+ onBlur?: (details: Value) => void;
130
139
  /**
131
140
  * The minimum number of fraction digits to use. Possible values are from 0 to 20
132
141
  */
@@ -135,6 +144,10 @@ declare type PublicContext = DirectionProperty & CommonProperties & {
135
144
  * The maximum number of fraction digits to use. Possible values are from 0 to 20;
136
145
  */
137
146
  maxFractionDigits?: number;
147
+ /**
148
+ * Whether to spin the value when the increment/decrement button is pressed
149
+ */
150
+ spinOnPress?: boolean;
138
151
  };
139
152
  declare type UserDefinedContext = RequiredBy<PublicContext, "id">;
140
153
  declare type ComputedContext = Readonly<{
@@ -211,6 +224,7 @@ declare function connect<T extends PropTypes>(state: State, send: Send, normaliz
211
224
  setToMax(): void;
212
225
  setToMin(): void;
213
226
  focus(): void;
227
+ blur(): void;
214
228
  rootProps: T["element"];
215
229
  labelProps: T["label"];
216
230
  groupProps: T["element"];
package/dist/index.js CHANGED
@@ -280,6 +280,44 @@ var dom = defineDomHelpers({
280
280
  getDecButtonEl: (ctx) => dom.getById(ctx, dom.getDecButtonId(ctx)),
281
281
  getScrubberEl: (ctx) => dom.getById(ctx, dom.getScrubberId(ctx)),
282
282
  getCursorEl: (ctx) => dom.getDoc(ctx).getElementById(dom.getCursorId(ctx)),
283
+ getActiveButton: (ctx, hint = ctx.hint) => {
284
+ let btnEl = null;
285
+ if (hint === "increment") {
286
+ btnEl = dom.getIncButtonEl(ctx);
287
+ }
288
+ if (hint === "decrement") {
289
+ btnEl = dom.getDecButtonEl(ctx);
290
+ }
291
+ return btnEl;
292
+ },
293
+ setupVirtualCursor(ctx) {
294
+ if (isSafari() || !supportsPointerEvent())
295
+ return;
296
+ dom.createVirtualCursor(ctx);
297
+ return () => {
298
+ var _a;
299
+ (_a = dom.getCursorEl(ctx)) == null ? void 0 : _a.remove();
300
+ };
301
+ },
302
+ preventTextSelection(ctx) {
303
+ const doc = dom.getDoc(ctx);
304
+ const html = doc.documentElement;
305
+ const body = doc.body;
306
+ body.style.pointerEvents = "none";
307
+ html.style.userSelect = "none";
308
+ html.style.cursor = "ew-resize";
309
+ return () => {
310
+ body.style.pointerEvents = "";
311
+ html.style.userSelect = "";
312
+ html.style.cursor = "";
313
+ if (!html.style.length) {
314
+ html.removeAttribute("style");
315
+ }
316
+ if (!body.style.length) {
317
+ body.removeAttribute("style");
318
+ }
319
+ };
320
+ },
283
321
  getMousementValue(ctx, event) {
284
322
  const x = roundToDevicePixel(event.movementX);
285
323
  const y = roundToDevicePixel(event.movementY);
@@ -403,6 +441,10 @@ function connect(state, send, normalize) {
403
441
  var _a;
404
442
  (_a = dom.getInputEl(state.context)) == null ? void 0 : _a.focus();
405
443
  },
444
+ blur() {
445
+ var _a;
446
+ (_a = dom.getInputEl(state.context)) == null ? void 0 : _a.blur();
447
+ },
406
448
  rootProps: normalize.element({
407
449
  id: dom.getRootId(state.context),
408
450
  "data-part": "root",
@@ -586,6 +628,7 @@ function machine(ctx) {
586
628
  max: Number.MAX_SAFE_INTEGER,
587
629
  scrubberCursorPoint: null,
588
630
  invalid: false,
631
+ spinOnPress: true,
589
632
  ...ctx,
590
633
  messages: {
591
634
  incrementLabel: "increment value",
@@ -613,7 +656,8 @@ function machine(ctx) {
613
656
  },
614
657
  watch: {
615
658
  value: ["invokeOnChange"],
616
- isOutOfRange: ["invokeOnInvalid"]
659
+ isOutOfRange: ["invokeOnInvalid"],
660
+ scrubberCursorPoint: ["setVirtualCursorPosition"]
617
661
  },
618
662
  on: {
619
663
  SET_VALUE: {
@@ -639,6 +683,7 @@ function machine(ctx) {
639
683
  }
640
684
  },
641
685
  idle: {
686
+ exit: "invokeOnFocus",
642
687
  on: {
643
688
  PRESS_DOWN: {
644
689
  target: "before:spin",
@@ -652,7 +697,7 @@ function machine(ctx) {
652
697
  }
653
698
  },
654
699
  focused: {
655
- tags: ["focus"],
700
+ tags: "focus",
656
701
  entry: "focusInput",
657
702
  activities: "attachWheelListener",
658
703
  on: {
@@ -683,22 +728,22 @@ function machine(ctx) {
683
728
  {
684
729
  guard: "isInvalidExponential",
685
730
  target: "idle",
686
- actions: ["clearValue", "clearHint"]
731
+ actions: ["clearValue", "clearHint", "invokeOnBlur"]
687
732
  },
688
733
  {
689
734
  guard: and("clampOnBlur", not("isInRange"), not("isEmptyValue")),
690
735
  target: "idle",
691
- actions: ["clampValue", "clearHint"]
736
+ actions: ["clampValue", "clearHint", "invokeOnBlur"]
692
737
  },
693
738
  {
694
739
  target: "idle",
695
- actions: "roundValue"
740
+ actions: ["roundValue", "invokeOnBlur"]
696
741
  }
697
742
  ]
698
743
  }
699
744
  },
700
745
  "before:spin": {
701
- tags: ["focus"],
746
+ tags: "focus",
702
747
  activities: "trackButtonDisabled",
703
748
  entry: (0, import_core.choose)([
704
749
  { guard: "isIncrementHint", actions: "increment" },
@@ -707,7 +752,7 @@ function machine(ctx) {
707
752
  after: {
708
753
  CHANGE_DELAY: {
709
754
  target: "spinning",
710
- guard: "isInRange"
755
+ guard: and("isInRange", "spinOnPress")
711
756
  }
712
757
  },
713
758
  on: {
@@ -718,7 +763,7 @@ function machine(ctx) {
718
763
  }
719
764
  },
720
765
  spinning: {
721
- tags: ["focus"],
766
+ tags: "focus",
722
767
  activities: "trackButtonDisabled",
723
768
  every: [
724
769
  {
@@ -740,23 +785,19 @@ function machine(ctx) {
740
785
  }
741
786
  },
742
787
  scrubbing: {
743
- tags: ["focus"],
744
- entry: ["addCustomCursor", "disableTextSelection"],
745
- exit: ["removeCustomCursor", "restoreTextSelection"],
746
- activities: ["activatePointerLock", "trackMousemove"],
788
+ tags: "focus",
789
+ exit: "clearCursorPoint",
790
+ activities: ["activatePointerLock", "trackMousemove", "setupVirtualCursor", "preventTextSelection"],
747
791
  on: {
748
- POINTER_UP_SCRUBBER: {
749
- target: "focused",
750
- actions: "clearCursorPoint"
751
- },
792
+ POINTER_UP_SCRUBBER: "focused",
752
793
  POINTER_MOVE_SCRUBBER: [
753
794
  {
754
795
  guard: "isIncrementHint",
755
- actions: ["increment", "setCursorPoint", "updateCursor"]
796
+ actions: ["increment", "setCursorPoint"]
756
797
  },
757
798
  {
758
799
  guard: "isDecrementHint",
759
- actions: ["decrement", "setCursorPoint", "updateCursor"]
800
+ actions: ["decrement", "setCursorPoint"]
760
801
  }
761
802
  ]
762
803
  }
@@ -770,6 +811,7 @@ function machine(ctx) {
770
811
  guards: {
771
812
  clampOnBlur: (ctx2) => !!ctx2.clampValueOnBlur,
772
813
  isAtMin: (ctx2) => ctx2.isAtMin,
814
+ spinOnPress: (ctx2) => !!ctx2.spinOnPress,
773
815
  isAtMax: (ctx2) => ctx2.isAtMax,
774
816
  isInRange: (ctx2) => !ctx2.isOutOfRange,
775
817
  isDecrementHint: (ctx2, evt) => (evt.hint ?? ctx2.hint) === "decrement",
@@ -778,17 +820,15 @@ function machine(ctx) {
778
820
  isInvalidExponential: (ctx2) => ctx2.value.toString().startsWith("e")
779
821
  },
780
822
  activities: {
823
+ setupVirtualCursor(ctx2) {
824
+ return dom.setupVirtualCursor(ctx2);
825
+ },
826
+ preventTextSelection(ctx2) {
827
+ return dom.preventTextSelection(ctx2);
828
+ },
781
829
  trackButtonDisabled(ctx2, _evt, { send }) {
782
- let btnEl = null;
783
- if (ctx2.hint === "increment") {
784
- btnEl = dom.getIncButtonEl(ctx2);
785
- }
786
- if (ctx2.hint === "decrement") {
787
- btnEl = dom.getDecButtonEl(ctx2);
788
- }
789
- return observeAttributes(btnEl, "disabled", function onDisable() {
790
- send("PRESS_UP");
791
- });
830
+ const btn = dom.getActiveButton(ctx2, ctx2.hint);
831
+ return observeAttributes(btn, "disabled", () => send("PRESS_UP"));
792
832
  },
793
833
  attachWheelListener(ctx2, _evt, { send }) {
794
834
  const input = dom.getInputEl(ctx2);
@@ -884,6 +924,29 @@ function machine(ctx) {
884
924
  valueAsNumber: ctx2.valueAsNumber
885
925
  });
886
926
  },
927
+ invokeOnFocus(ctx2, evt) {
928
+ var _a;
929
+ let srcElement = null;
930
+ if (evt.type === "PRESS_DOWN") {
931
+ srcElement = dom.getActiveButton(ctx2, evt.hint);
932
+ } else if (evt.type === "FOCUS") {
933
+ srcElement = dom.getInputEl(ctx2);
934
+ } else if (evt.type === "PRESS_DOWN_SCRUBBER") {
935
+ srcElement = dom.getScrubberEl(ctx2);
936
+ }
937
+ (_a = ctx2.onFocus) == null ? void 0 : _a.call(ctx2, {
938
+ value: ctx2.value,
939
+ valueAsNumber: ctx2.valueAsNumber,
940
+ srcElement
941
+ });
942
+ },
943
+ invokeOnBlur(ctx2) {
944
+ var _a;
945
+ (_a = ctx2.onBlur) == null ? void 0 : _a.call(ctx2, {
946
+ value: ctx2.value,
947
+ valueAsNumber: ctx2.valueAsNumber
948
+ });
949
+ },
887
950
  invokeOnInvalid(ctx2) {
888
951
  var _a;
889
952
  if (!ctx2.isOutOfRange)
@@ -908,35 +971,12 @@ function machine(ctx) {
908
971
  clearCursorPoint(ctx2) {
909
972
  ctx2.scrubberCursorPoint = null;
910
973
  },
911
- updateCursor(ctx2) {
974
+ setVirtualCursorPosition(ctx2) {
912
975
  const cursor = dom.getCursorEl(ctx2);
913
976
  if (!cursor || !ctx2.scrubberCursorPoint)
914
977
  return;
915
978
  const { x, y } = ctx2.scrubberCursorPoint;
916
979
  cursor.style.transform = `translate3d(${x}px, ${y}px, 0px)`;
917
- },
918
- addCustomCursor(ctx2) {
919
- if (isSafari() || !supportsPointerEvent())
920
- return;
921
- dom.createVirtualCursor(ctx2);
922
- },
923
- removeCustomCursor(ctx2) {
924
- var _a;
925
- if (isSafari() || !supportsPointerEvent())
926
- return;
927
- (_a = dom.getCursorEl(ctx2)) == null ? void 0 : _a.remove();
928
- },
929
- disableTextSelection(ctx2) {
930
- const doc = dom.getDoc(ctx2);
931
- doc.body.style.pointerEvents = "none";
932
- doc.documentElement.style.userSelect = "none";
933
- doc.documentElement.style.cursor = "ew-resize";
934
- },
935
- restoreTextSelection(ctx2) {
936
- const doc = dom.getDoc(ctx2);
937
- doc.body.style.pointerEvents = "";
938
- doc.documentElement.style.userSelect = "";
939
- doc.documentElement.style.cursor = "";
940
980
  }
941
981
  },
942
982
  hookSync: true
package/dist/index.mjs CHANGED
@@ -253,6 +253,44 @@ var dom = defineDomHelpers({
253
253
  getDecButtonEl: (ctx) => dom.getById(ctx, dom.getDecButtonId(ctx)),
254
254
  getScrubberEl: (ctx) => dom.getById(ctx, dom.getScrubberId(ctx)),
255
255
  getCursorEl: (ctx) => dom.getDoc(ctx).getElementById(dom.getCursorId(ctx)),
256
+ getActiveButton: (ctx, hint = ctx.hint) => {
257
+ let btnEl = null;
258
+ if (hint === "increment") {
259
+ btnEl = dom.getIncButtonEl(ctx);
260
+ }
261
+ if (hint === "decrement") {
262
+ btnEl = dom.getDecButtonEl(ctx);
263
+ }
264
+ return btnEl;
265
+ },
266
+ setupVirtualCursor(ctx) {
267
+ if (isSafari() || !supportsPointerEvent())
268
+ return;
269
+ dom.createVirtualCursor(ctx);
270
+ return () => {
271
+ var _a;
272
+ (_a = dom.getCursorEl(ctx)) == null ? void 0 : _a.remove();
273
+ };
274
+ },
275
+ preventTextSelection(ctx) {
276
+ const doc = dom.getDoc(ctx);
277
+ const html = doc.documentElement;
278
+ const body = doc.body;
279
+ body.style.pointerEvents = "none";
280
+ html.style.userSelect = "none";
281
+ html.style.cursor = "ew-resize";
282
+ return () => {
283
+ body.style.pointerEvents = "";
284
+ html.style.userSelect = "";
285
+ html.style.cursor = "";
286
+ if (!html.style.length) {
287
+ html.removeAttribute("style");
288
+ }
289
+ if (!body.style.length) {
290
+ body.removeAttribute("style");
291
+ }
292
+ };
293
+ },
256
294
  getMousementValue(ctx, event) {
257
295
  const x = roundToDevicePixel(event.movementX);
258
296
  const y = roundToDevicePixel(event.movementY);
@@ -376,6 +414,10 @@ function connect(state, send, normalize) {
376
414
  var _a;
377
415
  (_a = dom.getInputEl(state.context)) == null ? void 0 : _a.focus();
378
416
  },
417
+ blur() {
418
+ var _a;
419
+ (_a = dom.getInputEl(state.context)) == null ? void 0 : _a.blur();
420
+ },
379
421
  rootProps: normalize.element({
380
422
  id: dom.getRootId(state.context),
381
423
  "data-part": "root",
@@ -559,6 +601,7 @@ function machine(ctx) {
559
601
  max: Number.MAX_SAFE_INTEGER,
560
602
  scrubberCursorPoint: null,
561
603
  invalid: false,
604
+ spinOnPress: true,
562
605
  ...ctx,
563
606
  messages: {
564
607
  incrementLabel: "increment value",
@@ -586,7 +629,8 @@ function machine(ctx) {
586
629
  },
587
630
  watch: {
588
631
  value: ["invokeOnChange"],
589
- isOutOfRange: ["invokeOnInvalid"]
632
+ isOutOfRange: ["invokeOnInvalid"],
633
+ scrubberCursorPoint: ["setVirtualCursorPosition"]
590
634
  },
591
635
  on: {
592
636
  SET_VALUE: {
@@ -612,6 +656,7 @@ function machine(ctx) {
612
656
  }
613
657
  },
614
658
  idle: {
659
+ exit: "invokeOnFocus",
615
660
  on: {
616
661
  PRESS_DOWN: {
617
662
  target: "before:spin",
@@ -625,7 +670,7 @@ function machine(ctx) {
625
670
  }
626
671
  },
627
672
  focused: {
628
- tags: ["focus"],
673
+ tags: "focus",
629
674
  entry: "focusInput",
630
675
  activities: "attachWheelListener",
631
676
  on: {
@@ -656,22 +701,22 @@ function machine(ctx) {
656
701
  {
657
702
  guard: "isInvalidExponential",
658
703
  target: "idle",
659
- actions: ["clearValue", "clearHint"]
704
+ actions: ["clearValue", "clearHint", "invokeOnBlur"]
660
705
  },
661
706
  {
662
707
  guard: and("clampOnBlur", not("isInRange"), not("isEmptyValue")),
663
708
  target: "idle",
664
- actions: ["clampValue", "clearHint"]
709
+ actions: ["clampValue", "clearHint", "invokeOnBlur"]
665
710
  },
666
711
  {
667
712
  target: "idle",
668
- actions: "roundValue"
713
+ actions: ["roundValue", "invokeOnBlur"]
669
714
  }
670
715
  ]
671
716
  }
672
717
  },
673
718
  "before:spin": {
674
- tags: ["focus"],
719
+ tags: "focus",
675
720
  activities: "trackButtonDisabled",
676
721
  entry: choose([
677
722
  { guard: "isIncrementHint", actions: "increment" },
@@ -680,7 +725,7 @@ function machine(ctx) {
680
725
  after: {
681
726
  CHANGE_DELAY: {
682
727
  target: "spinning",
683
- guard: "isInRange"
728
+ guard: and("isInRange", "spinOnPress")
684
729
  }
685
730
  },
686
731
  on: {
@@ -691,7 +736,7 @@ function machine(ctx) {
691
736
  }
692
737
  },
693
738
  spinning: {
694
- tags: ["focus"],
739
+ tags: "focus",
695
740
  activities: "trackButtonDisabled",
696
741
  every: [
697
742
  {
@@ -713,23 +758,19 @@ function machine(ctx) {
713
758
  }
714
759
  },
715
760
  scrubbing: {
716
- tags: ["focus"],
717
- entry: ["addCustomCursor", "disableTextSelection"],
718
- exit: ["removeCustomCursor", "restoreTextSelection"],
719
- activities: ["activatePointerLock", "trackMousemove"],
761
+ tags: "focus",
762
+ exit: "clearCursorPoint",
763
+ activities: ["activatePointerLock", "trackMousemove", "setupVirtualCursor", "preventTextSelection"],
720
764
  on: {
721
- POINTER_UP_SCRUBBER: {
722
- target: "focused",
723
- actions: "clearCursorPoint"
724
- },
765
+ POINTER_UP_SCRUBBER: "focused",
725
766
  POINTER_MOVE_SCRUBBER: [
726
767
  {
727
768
  guard: "isIncrementHint",
728
- actions: ["increment", "setCursorPoint", "updateCursor"]
769
+ actions: ["increment", "setCursorPoint"]
729
770
  },
730
771
  {
731
772
  guard: "isDecrementHint",
732
- actions: ["decrement", "setCursorPoint", "updateCursor"]
773
+ actions: ["decrement", "setCursorPoint"]
733
774
  }
734
775
  ]
735
776
  }
@@ -743,6 +784,7 @@ function machine(ctx) {
743
784
  guards: {
744
785
  clampOnBlur: (ctx2) => !!ctx2.clampValueOnBlur,
745
786
  isAtMin: (ctx2) => ctx2.isAtMin,
787
+ spinOnPress: (ctx2) => !!ctx2.spinOnPress,
746
788
  isAtMax: (ctx2) => ctx2.isAtMax,
747
789
  isInRange: (ctx2) => !ctx2.isOutOfRange,
748
790
  isDecrementHint: (ctx2, evt) => (evt.hint ?? ctx2.hint) === "decrement",
@@ -751,17 +793,15 @@ function machine(ctx) {
751
793
  isInvalidExponential: (ctx2) => ctx2.value.toString().startsWith("e")
752
794
  },
753
795
  activities: {
796
+ setupVirtualCursor(ctx2) {
797
+ return dom.setupVirtualCursor(ctx2);
798
+ },
799
+ preventTextSelection(ctx2) {
800
+ return dom.preventTextSelection(ctx2);
801
+ },
754
802
  trackButtonDisabled(ctx2, _evt, { send }) {
755
- let btnEl = null;
756
- if (ctx2.hint === "increment") {
757
- btnEl = dom.getIncButtonEl(ctx2);
758
- }
759
- if (ctx2.hint === "decrement") {
760
- btnEl = dom.getDecButtonEl(ctx2);
761
- }
762
- return observeAttributes(btnEl, "disabled", function onDisable() {
763
- send("PRESS_UP");
764
- });
803
+ const btn = dom.getActiveButton(ctx2, ctx2.hint);
804
+ return observeAttributes(btn, "disabled", () => send("PRESS_UP"));
765
805
  },
766
806
  attachWheelListener(ctx2, _evt, { send }) {
767
807
  const input = dom.getInputEl(ctx2);
@@ -857,6 +897,29 @@ function machine(ctx) {
857
897
  valueAsNumber: ctx2.valueAsNumber
858
898
  });
859
899
  },
900
+ invokeOnFocus(ctx2, evt) {
901
+ var _a;
902
+ let srcElement = null;
903
+ if (evt.type === "PRESS_DOWN") {
904
+ srcElement = dom.getActiveButton(ctx2, evt.hint);
905
+ } else if (evt.type === "FOCUS") {
906
+ srcElement = dom.getInputEl(ctx2);
907
+ } else if (evt.type === "PRESS_DOWN_SCRUBBER") {
908
+ srcElement = dom.getScrubberEl(ctx2);
909
+ }
910
+ (_a = ctx2.onFocus) == null ? void 0 : _a.call(ctx2, {
911
+ value: ctx2.value,
912
+ valueAsNumber: ctx2.valueAsNumber,
913
+ srcElement
914
+ });
915
+ },
916
+ invokeOnBlur(ctx2) {
917
+ var _a;
918
+ (_a = ctx2.onBlur) == null ? void 0 : _a.call(ctx2, {
919
+ value: ctx2.value,
920
+ valueAsNumber: ctx2.valueAsNumber
921
+ });
922
+ },
860
923
  invokeOnInvalid(ctx2) {
861
924
  var _a;
862
925
  if (!ctx2.isOutOfRange)
@@ -881,35 +944,12 @@ function machine(ctx) {
881
944
  clearCursorPoint(ctx2) {
882
945
  ctx2.scrubberCursorPoint = null;
883
946
  },
884
- updateCursor(ctx2) {
947
+ setVirtualCursorPosition(ctx2) {
885
948
  const cursor = dom.getCursorEl(ctx2);
886
949
  if (!cursor || !ctx2.scrubberCursorPoint)
887
950
  return;
888
951
  const { x, y } = ctx2.scrubberCursorPoint;
889
952
  cursor.style.transform = `translate3d(${x}px, ${y}px, 0px)`;
890
- },
891
- addCustomCursor(ctx2) {
892
- if (isSafari() || !supportsPointerEvent())
893
- return;
894
- dom.createVirtualCursor(ctx2);
895
- },
896
- removeCustomCursor(ctx2) {
897
- var _a;
898
- if (isSafari() || !supportsPointerEvent())
899
- return;
900
- (_a = dom.getCursorEl(ctx2)) == null ? void 0 : _a.remove();
901
- },
902
- disableTextSelection(ctx2) {
903
- const doc = dom.getDoc(ctx2);
904
- doc.body.style.pointerEvents = "none";
905
- doc.documentElement.style.userSelect = "none";
906
- doc.documentElement.style.cursor = "ew-resize";
907
- },
908
- restoreTextSelection(ctx2) {
909
- const doc = dom.getDoc(ctx2);
910
- doc.body.style.pointerEvents = "";
911
- doc.documentElement.style.userSelect = "";
912
- doc.documentElement.style.cursor = "";
913
953
  }
914
954
  },
915
955
  hookSync: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/number-input",
3
- "version": "0.0.0-dev-20220714091855",
3
+ "version": "0.0.0-dev-20220730064719",
4
4
  "description": "Core logic for the number-input widget implemented as a state machine",
5
5
  "keywords": [
6
6
  "js",
@@ -29,13 +29,13 @@
29
29
  "url": "https://github.com/chakra-ui/zag/issues"
30
30
  },
31
31
  "dependencies": {
32
- "@zag-js/core": "0.0.0-dev-20220714091855",
33
- "@zag-js/types": "0.0.0-dev-20220714091855"
32
+ "@zag-js/core": "0.1.9",
33
+ "@zag-js/types": "0.2.3"
34
34
  },
35
35
  "devDependencies": {
36
- "@zag-js/dom-utils": "0.0.0-dev-20220714091855",
37
- "@zag-js/number-utils": "0.0.0-dev-20220714091855",
38
- "@zag-js/utils": "0.0.0-dev-20220714091855"
36
+ "@zag-js/dom-utils": "0.1.8",
37
+ "@zag-js/number-utils": "0.1.3",
38
+ "@zag-js/utils": "0.1.3"
39
39
  },
40
40
  "scripts": {
41
41
  "build-fast": "tsup src/index.ts --format=esm,cjs",