@zag-js/radio-group 0.10.3 → 0.10.5

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.
@@ -16,7 +16,6 @@ function machine(userContext) {
16
16
  id: "radio",
17
17
  initial: "idle",
18
18
  context: {
19
- previousValue: null,
20
19
  value: null,
21
20
  activeId: null,
22
21
  focusedId: null,
@@ -91,11 +90,8 @@ function machine(userContext) {
91
90
  input.checked = input.value === ctx2.value;
92
91
  });
93
92
  },
94
- setPreviousValue(ctx2) {
95
- ctx2.previousValue = ctx2.value;
96
- },
97
93
  setIndicatorTransition(ctx2) {
98
- ctx2.canIndicatorTransition = utils.isString(ctx2.previousValue) && utils.isString(ctx2.value);
94
+ ctx2.canIndicatorTransition = utils.isString(ctx2.value);
99
95
  },
100
96
  cleanupObserver(ctx2) {
101
97
  ctx2.indicatorCleanup?.();
@@ -12,7 +12,6 @@ function machine(userContext) {
12
12
  id: "radio",
13
13
  initial: "idle",
14
14
  context: {
15
- previousValue: null,
16
15
  value: null,
17
16
  activeId: null,
18
17
  focusedId: null,
@@ -87,11 +86,8 @@ function machine(userContext) {
87
86
  input.checked = input.value === ctx2.value;
88
87
  });
89
88
  },
90
- setPreviousValue(ctx2) {
91
- ctx2.previousValue = ctx2.value;
92
- },
93
89
  setIndicatorTransition(ctx2) {
94
- ctx2.canIndicatorTransition = isString(ctx2.previousValue) && isString(ctx2.value);
90
+ ctx2.canIndicatorTransition = isString(ctx2.value);
95
91
  },
96
92
  cleanupObserver(ctx2) {
97
93
  ctx2.indicatorCleanup?.();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/radio-group",
3
- "version": "0.10.3",
3
+ "version": "0.10.5",
4
4
  "description": "Core logic for the radio group widget implemented as a state machine",
5
5
  "keywords": [
6
6
  "js",
@@ -28,14 +28,14 @@
28
28
  "url": "https://github.com/chakra-ui/zag/issues"
29
29
  },
30
30
  "dependencies": {
31
- "@zag-js/anatomy": "0.10.3",
32
- "@zag-js/dom-query": "0.10.3",
33
- "@zag-js/element-rect": "0.10.3",
34
- "@zag-js/form-utils": "0.10.3",
35
- "@zag-js/visually-hidden": "0.10.3",
36
- "@zag-js/utils": "0.10.3",
37
- "@zag-js/core": "0.10.3",
38
- "@zag-js/types": "0.10.3"
31
+ "@zag-js/anatomy": "0.10.5",
32
+ "@zag-js/dom-query": "0.10.5",
33
+ "@zag-js/element-rect": "0.10.5",
34
+ "@zag-js/form-utils": "0.10.5",
35
+ "@zag-js/visually-hidden": "0.10.5",
36
+ "@zag-js/utils": "0.10.5",
37
+ "@zag-js/core": "0.10.5",
38
+ "@zag-js/types": "0.10.5"
39
39
  },
40
40
  "devDependencies": {
41
41
  "clean-package": "2.2.0"
@@ -13,7 +13,6 @@ export function machine(userContext: UserDefinedContext) {
13
13
  id: "radio",
14
14
  initial: "idle",
15
15
  context: {
16
- previousValue: null,
17
16
  value: null,
18
17
  activeId: null,
19
18
  focusedId: null,
@@ -96,11 +95,8 @@ export function machine(userContext: UserDefinedContext) {
96
95
  input.checked = input.value === ctx.value
97
96
  })
98
97
  },
99
- setPreviousValue(ctx) {
100
- ctx.previousValue = ctx.value
101
- },
102
98
  setIndicatorTransition(ctx) {
103
- ctx.canIndicatorTransition = isString(ctx.previousValue) && isString(ctx.value)
99
+ ctx.canIndicatorTransition = isString(ctx.value)
104
100
  },
105
101
  cleanupObserver(ctx) {
106
102
  ctx.indicatorCleanup?.()
@@ -81,11 +81,6 @@ type PrivateContext = Context<{
81
81
  * Function to clean up the observer for the active tab's rect
82
82
  */
83
83
  indicatorCleanup?: VoidFunction | null
84
- /**
85
- * @internal
86
- * The previous value of the radio group
87
- */
88
- previousValue: string | null
89
84
  }>
90
85
 
91
86
  export type UserDefinedContext = RequiredBy<PublicContext, "id">