@zag-js/radio-group 1.3.0 → 1.3.2
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.js +6 -0
- package/dist/index.mjs +7 -1
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -26,6 +26,7 @@ var getItemControlId = (ctx, value) => ctx.ids?.itemControl?.(value) ?? `radio-g
|
|
|
26
26
|
var getItemLabelId = (ctx, value) => ctx.ids?.itemLabel?.(value) ?? `radio-group:${ctx.id}:radio:label:${value}`;
|
|
27
27
|
var getIndicatorId = (ctx) => ctx.ids?.indicator ?? `radio-group:${ctx.id}:indicator`;
|
|
28
28
|
var getRootEl = (ctx) => ctx.getById(getRootId(ctx));
|
|
29
|
+
var getItemHiddenInputEl = (ctx, value) => ctx.getById(getItemHiddenInputId(ctx, value));
|
|
29
30
|
var getIndicatorEl = (ctx) => ctx.getById(getIndicatorId(ctx));
|
|
30
31
|
var getFirstEnabledInputEl = (ctx) => getRootEl(ctx)?.querySelector("input:not(:disabled)");
|
|
31
32
|
var getFirstEnabledAndCheckedInputEl = (ctx) => getRootEl(ctx)?.querySelector("input:not(:disabled):checked");
|
|
@@ -151,6 +152,11 @@ function connect(service, normalize) {
|
|
|
151
152
|
onPointerUp() {
|
|
152
153
|
if (itemState.disabled) return;
|
|
153
154
|
send({ type: "SET_ACTIVE", value: null });
|
|
155
|
+
},
|
|
156
|
+
onClick() {
|
|
157
|
+
if (!itemState.disabled && domQuery.isSafari()) {
|
|
158
|
+
getItemHiddenInputEl(scope, props2.value)?.focus();
|
|
159
|
+
}
|
|
154
160
|
}
|
|
155
161
|
});
|
|
156
162
|
},
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createAnatomy } from '@zag-js/anatomy';
|
|
2
|
-
import { dispatchInputCheckedEvent, nextTick, trackFormControl, queryAll, dataAttr, visuallyHiddenStyle } from '@zag-js/dom-query';
|
|
2
|
+
import { dispatchInputCheckedEvent, nextTick, trackFormControl, queryAll, dataAttr, visuallyHiddenStyle, isSafari } from '@zag-js/dom-query';
|
|
3
3
|
import { trackFocusVisible, isFocusVisible } from '@zag-js/focus-visible';
|
|
4
4
|
import { createGuards, createMachine } from '@zag-js/core';
|
|
5
5
|
import { trackElementRect } from '@zag-js/element-rect';
|
|
@@ -24,6 +24,7 @@ var getItemControlId = (ctx, value) => ctx.ids?.itemControl?.(value) ?? `radio-g
|
|
|
24
24
|
var getItemLabelId = (ctx, value) => ctx.ids?.itemLabel?.(value) ?? `radio-group:${ctx.id}:radio:label:${value}`;
|
|
25
25
|
var getIndicatorId = (ctx) => ctx.ids?.indicator ?? `radio-group:${ctx.id}:indicator`;
|
|
26
26
|
var getRootEl = (ctx) => ctx.getById(getRootId(ctx));
|
|
27
|
+
var getItemHiddenInputEl = (ctx, value) => ctx.getById(getItemHiddenInputId(ctx, value));
|
|
27
28
|
var getIndicatorEl = (ctx) => ctx.getById(getIndicatorId(ctx));
|
|
28
29
|
var getFirstEnabledInputEl = (ctx) => getRootEl(ctx)?.querySelector("input:not(:disabled)");
|
|
29
30
|
var getFirstEnabledAndCheckedInputEl = (ctx) => getRootEl(ctx)?.querySelector("input:not(:disabled):checked");
|
|
@@ -149,6 +150,11 @@ function connect(service, normalize) {
|
|
|
149
150
|
onPointerUp() {
|
|
150
151
|
if (itemState.disabled) return;
|
|
151
152
|
send({ type: "SET_ACTIVE", value: null });
|
|
153
|
+
},
|
|
154
|
+
onClick() {
|
|
155
|
+
if (!itemState.disabled && isSafari()) {
|
|
156
|
+
getItemHiddenInputEl(scope, props2.value)?.focus();
|
|
157
|
+
}
|
|
152
158
|
}
|
|
153
159
|
});
|
|
154
160
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/radio-group",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "Core logic for the radio group widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
"url": "https://github.com/chakra-ui/zag/issues"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@zag-js/anatomy": "1.3.
|
|
31
|
-
"@zag-js/dom-query": "1.3.
|
|
32
|
-
"@zag-js/element-rect": "1.3.
|
|
33
|
-
"@zag-js/focus-visible": "1.3.
|
|
34
|
-
"@zag-js/utils": "1.3.
|
|
35
|
-
"@zag-js/core": "1.3.
|
|
36
|
-
"@zag-js/types": "1.3.
|
|
30
|
+
"@zag-js/anatomy": "1.3.2",
|
|
31
|
+
"@zag-js/dom-query": "1.3.2",
|
|
32
|
+
"@zag-js/element-rect": "1.3.2",
|
|
33
|
+
"@zag-js/focus-visible": "1.3.2",
|
|
34
|
+
"@zag-js/utils": "1.3.2",
|
|
35
|
+
"@zag-js/core": "1.3.2",
|
|
36
|
+
"@zag-js/types": "1.3.2"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"clean-package": "2.2.0"
|