@zag-js/radio
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -86,3 +86,3 @@ import { RequiredBy, DirectionProperty, CommonProperties, Context, PropTypes, NormalizeProps } from '@zag-js/types'; | ||
setValue(value: string): void; | ||
focus(): void; | ||
focus: () => void; | ||
blur(): void; | ||
@@ -89,0 +89,0 @@ rootProps: T["element"]; |
@@ -153,2 +153,11 @@ "use strict"; | ||
} | ||
const focus = () => { | ||
const firstEnabledAndCheckedInput = dom.getFirstEnabledAndCheckedInputEl(state.context); | ||
if (firstEnabledAndCheckedInput) { | ||
firstEnabledAndCheckedInput.focus(); | ||
return; | ||
} | ||
const firstEnabledInput = dom.getFirstEnabledInputEl(state.context); | ||
firstEnabledInput == null ? void 0 : firstEnabledInput.focus(); | ||
}; | ||
return { | ||
@@ -159,11 +168,3 @@ value: state.context.value, | ||
}, | ||
focus() { | ||
const firstEnabledAndCheckedInput = dom.getFirstEnabledAndCheckedInputEl(state.context); | ||
if (firstEnabledAndCheckedInput) { | ||
firstEnabledAndCheckedInput.focus(); | ||
return; | ||
} | ||
const firstEnabledInput = dom.getFirstEnabledInputEl(state.context); | ||
firstEnabledInput == null ? void 0 : firstEnabledInput.focus(); | ||
}, | ||
focus, | ||
blur() { | ||
@@ -186,3 +187,4 @@ const focusedElement = dom.getActiveElement(state.context); | ||
"data-part": "label", | ||
id: dom.getLabelId(state.context) | ||
id: dom.getLabelId(state.context), | ||
onClick: focus | ||
}), | ||
@@ -189,0 +191,0 @@ getItemProps(props) { |
{ | ||
"name": "@zag-js/radio", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Core logic for the radio widget implemented as a state machine", | ||
@@ -32,8 +32,8 @@ "keywords": [ | ||
"dependencies": { | ||
"@zag-js/core": "0.1.9", | ||
"@zag-js/types": "0.2.4" | ||
"@zag-js/core": "0.1.10", | ||
"@zag-js/types": "0.2.5" | ||
}, | ||
"devDependencies": { | ||
"@zag-js/dom-utils": "0.1.10", | ||
"@zag-js/form-utils": "0.1.0" | ||
"@zag-js/dom-utils": "0.1.11", | ||
"@zag-js/form-utils": "0.1.1" | ||
}, | ||
@@ -40,0 +40,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33085
944
+ Added@zag-js/core@0.1.10(transitive)
+ Added@zag-js/store@0.1.2(transitive)
+ Added@zag-js/types@0.2.5(transitive)
+ Addedproxy-compare@2.3.0(transitive)
- Removed@zag-js/core@0.1.9(transitive)
- Removed@zag-js/store@0.1.1(transitive)
- Removed@zag-js/types@0.2.4(transitive)
- Removedproxy-compare@2.2.0(transitive)
Updated@zag-js/core@0.1.10
Updated@zag-js/types@0.2.5