@zag-js/number-input 0.2.1 → 0.2.3

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
@@ -39,6 +39,10 @@ declare type PublicContext = DirectionProperty & CommonProperties & {
39
39
  * The name attribute of the number input. Useful for form submission.
40
40
  */
41
41
  name?: string;
42
+ /**
43
+ * The associate form of the input element.
44
+ */
45
+ form?: string;
42
46
  /**
43
47
  * Whether the number input is disabled.
44
48
  */
@@ -46,7 +50,7 @@ declare type PublicContext = DirectionProperty & CommonProperties & {
46
50
  /**
47
51
  * Whether the number input is readonly
48
52
  */
49
- readonly?: boolean;
53
+ readOnly?: boolean;
50
54
  /**
51
55
  * Whether the number input value is invalid.
52
56
  */
package/dist/index.js CHANGED
@@ -494,6 +494,7 @@ function connect(state, send, normalize) {
494
494
  inputProps: normalize.input({
495
495
  "data-part": "input",
496
496
  name: state.context.name,
497
+ form: state.context.form,
497
498
  id: dom.getInputId(state.context),
498
499
  role: "spinbutton",
499
500
  defaultValue: state.context.formattedValue,
@@ -503,7 +504,7 @@ function connect(state, send, normalize) {
503
504
  "data-invalid": dataAttr(isInvalid),
504
505
  disabled: isDisabled,
505
506
  "data-disabled": dataAttr(isDisabled),
506
- readOnly: !!state.context.readonly,
507
+ readOnly: !!state.context.readOnly,
507
508
  autoComplete: "off",
508
509
  autoCorrect: "off",
509
510
  spellCheck: "false",
@@ -650,7 +651,7 @@ function getWindow(el) {
650
651
  }
651
652
  function getDescriptor(el, options) {
652
653
  var _a;
653
- const { type, property } = options;
654
+ const { type, property = "value" } = options;
654
655
  const proto = getWindow(el)[type].prototype;
655
656
  return (_a = Object.getOwnPropertyDescriptor(proto, property)) != null ? _a : {};
656
657
  }
@@ -1058,8 +1059,7 @@ function machine(userContext) {
1058
1059
  dispatchChangeEvent(ctx2) {
1059
1060
  dispatchInputValueEvent(dom.getInputEl(ctx2), ctx2.formattedValue);
1060
1061
  }
1061
- },
1062
- hookSync: true
1062
+ }
1063
1063
  }
1064
1064
  );
1065
1065
  }
package/dist/index.mjs CHANGED
@@ -467,6 +467,7 @@ function connect(state, send, normalize) {
467
467
  inputProps: normalize.input({
468
468
  "data-part": "input",
469
469
  name: state.context.name,
470
+ form: state.context.form,
470
471
  id: dom.getInputId(state.context),
471
472
  role: "spinbutton",
472
473
  defaultValue: state.context.formattedValue,
@@ -476,7 +477,7 @@ function connect(state, send, normalize) {
476
477
  "data-invalid": dataAttr(isInvalid),
477
478
  disabled: isDisabled,
478
479
  "data-disabled": dataAttr(isDisabled),
479
- readOnly: !!state.context.readonly,
480
+ readOnly: !!state.context.readOnly,
480
481
  autoComplete: "off",
481
482
  autoCorrect: "off",
482
483
  spellCheck: "false",
@@ -623,7 +624,7 @@ function getWindow(el) {
623
624
  }
624
625
  function getDescriptor(el, options) {
625
626
  var _a;
626
- const { type, property } = options;
627
+ const { type, property = "value" } = options;
627
628
  const proto = getWindow(el)[type].prototype;
628
629
  return (_a = Object.getOwnPropertyDescriptor(proto, property)) != null ? _a : {};
629
630
  }
@@ -1031,8 +1032,7 @@ function machine(userContext) {
1031
1032
  dispatchChangeEvent(ctx2) {
1032
1033
  dispatchInputValueEvent(dom.getInputEl(ctx2), ctx2.formattedValue);
1033
1034
  }
1034
- },
1035
- hookSync: true
1035
+ }
1036
1036
  }
1037
1037
  );
1038
1038
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/number-input",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Core logic for the number-input widget implemented as a state machine",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -29,14 +29,14 @@
29
29
  "url": "https://github.com/chakra-ui/zag/issues"
30
30
  },
31
31
  "dependencies": {
32
- "@zag-js/core": "0.2.1",
33
- "@zag-js/types": "0.3.0"
32
+ "@zag-js/core": "0.2.2",
33
+ "@zag-js/types": "0.3.1"
34
34
  },
35
35
  "devDependencies": {
36
- "@zag-js/dom-utils": "0.2.0",
37
- "@zag-js/form-utils": "0.2.0",
36
+ "@zag-js/dom-utils": "0.2.1",
37
+ "@zag-js/form-utils": "0.2.2",
38
38
  "@zag-js/number-utils": "0.2.0",
39
- "@zag-js/utils": "0.3.0"
39
+ "@zag-js/utils": "0.3.1"
40
40
  },
41
41
  "scripts": {
42
42
  "build-fast": "tsup src/index.ts --format=esm,cjs",