@zag-js/pin-input 0.2.10 → 0.2.11

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.
@@ -54,7 +54,7 @@ function machine(userContext) {
54
54
  initial: ctx.autoFocus ? "focused" : "idle",
55
55
  context: {
56
56
  value: [],
57
- focusedIndex: ctx.autoFocus ? 0 : -1,
57
+ focusedIndex: -1,
58
58
  placeholder: "\u25CB",
59
59
  otp: false,
60
60
  type: "numeric",
@@ -76,7 +76,7 @@ function machine(userContext) {
76
76
  value: ["dispatchInputEvent"],
77
77
  isValueComplete: ["invokeOnComplete", "blurFocusedInputIfNeeded"]
78
78
  },
79
- entry: ["setupValue"],
79
+ entry: ctx.autoFocus ? ["setupValue", "setFocusIndexToFirst"] : ["setupValue"],
80
80
  on: {
81
81
  SET_VALUE: [
82
82
  {
package/dist/index.js CHANGED
@@ -336,7 +336,7 @@ function machine(userContext) {
336
336
  initial: ctx.autoFocus ? "focused" : "idle",
337
337
  context: {
338
338
  value: [],
339
- focusedIndex: ctx.autoFocus ? 0 : -1,
339
+ focusedIndex: -1,
340
340
  placeholder: "\u25CB",
341
341
  otp: false,
342
342
  type: "numeric",
@@ -358,7 +358,7 @@ function machine(userContext) {
358
358
  value: ["dispatchInputEvent"],
359
359
  isValueComplete: ["invokeOnComplete", "blurFocusedInputIfNeeded"]
360
360
  },
361
- entry: ["setupValue"],
361
+ entry: ctx.autoFocus ? ["setupValue", "setFocusIndexToFirst"] : ["setupValue"],
362
362
  on: {
363
363
  SET_VALUE: [
364
364
  {
package/dist/index.mjs CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-BJXKBZJG.mjs";
7
7
  import {
8
8
  machine
9
- } from "./chunk-53K4IC6M.mjs";
9
+ } from "./chunk-6TEZTVFI.mjs";
10
10
  import "./chunk-NT4W6JYX.mjs";
11
11
  import "./chunk-T5OKDF74.mjs";
12
12
  export {
@@ -128,7 +128,7 @@ function machine(userContext) {
128
128
  initial: ctx.autoFocus ? "focused" : "idle",
129
129
  context: {
130
130
  value: [],
131
- focusedIndex: ctx.autoFocus ? 0 : -1,
131
+ focusedIndex: -1,
132
132
  placeholder: "\u25CB",
133
133
  otp: false,
134
134
  type: "numeric",
@@ -150,7 +150,7 @@ function machine(userContext) {
150
150
  value: ["dispatchInputEvent"],
151
151
  isValueComplete: ["invokeOnComplete", "blurFocusedInputIfNeeded"]
152
152
  },
153
- entry: ["setupValue"],
153
+ entry: ctx.autoFocus ? ["setupValue", "setFocusIndexToFirst"] : ["setupValue"],
154
154
  on: {
155
155
  SET_VALUE: [
156
156
  {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  machine
3
- } from "./chunk-53K4IC6M.mjs";
3
+ } from "./chunk-6TEZTVFI.mjs";
4
4
  import "./chunk-NT4W6JYX.mjs";
5
5
  import "./chunk-T5OKDF74.mjs";
6
6
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/pin-input",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "description": "Core logic for the pin-input widget implemented as a state machine",
5
5
  "keywords": [
6
6
  "js",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@zag-js/anatomy": "0.1.4",
30
- "@zag-js/core": "0.2.7",
30
+ "@zag-js/core": "0.2.8",
31
31
  "@zag-js/types": "0.3.4"
32
32
  },
33
33
  "devDependencies": {