@zag-js/radio
Advanced tools
Comparing version 0.0.0-20220814155032 to 0.0.0-20220817145316
@@ -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.0-20220814155032", | ||
"version": "0.0.0-20220817145316", | ||
"description": "Core logic for the radio widget implemented as a state machine", | ||
@@ -33,6 +33,6 @@ "keywords": [ | ||
"@zag-js/core": "0.1.9", | ||
"@zag-js/types": "0.0.0-20220814155032" | ||
"@zag-js/types": "0.2.4" | ||
}, | ||
"devDependencies": { | ||
"@zag-js/dom-utils": "0.0.0-20220814155032", | ||
"@zag-js/dom-utils": "0.1.10", | ||
"@zag-js/form-utils": "0.1.0" | ||
@@ -39,0 +39,0 @@ }, |
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
33099
944
+ Added@zag-js/types@0.2.4(transitive)
- Removed@zag-js/types@0.0.0-20220814155032(transitive)
Updated@zag-js/types@0.2.4