@solid-aria/toggle
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -5,3 +5,3 @@ // src/createToggle.ts | ||
import { combineProps, filterDOMProps } from "@solid-aria/utils"; | ||
import { createMemo, mergeProps, splitProps } from "solid-js"; | ||
import { createMemo, mergeProps } from "solid-js"; | ||
@@ -36,3 +36,2 @@ // src/createToggleState.ts | ||
function createToggle(props, inputRef) { | ||
const state = createToggleState(props); | ||
const defaultProps = { | ||
@@ -42,13 +41,4 @@ isDisabled: false, | ||
}; | ||
const propsWithDefault = mergeProps(defaultProps, props); | ||
const [local] = splitProps(propsWithDefault, [ | ||
"isDisabled", | ||
"isRequired", | ||
"isReadOnly", | ||
"value", | ||
"name", | ||
"aria-errormessage", | ||
"aria-controls", | ||
"validationState" | ||
]); | ||
props = mergeProps(defaultProps, props); | ||
const state = createToggleState(props); | ||
const onChange = (event) => { | ||
@@ -67,10 +57,10 @@ event.stopPropagation(); | ||
return combineProps(domProps(), { | ||
"aria-invalid": local.validationState === "invalid" || void 0, | ||
"aria-errormessage": local["aria-errormessage"], | ||
"aria-controls": local["aria-controls"], | ||
"aria-readonly": local.isReadOnly || void 0, | ||
"aria-required": local.isRequired || void 0, | ||
disabled: local.isDisabled, | ||
value: local.value, | ||
name: local.name, | ||
"aria-invalid": props.validationState === "invalid" || void 0, | ||
"aria-errormessage": props["aria-errormessage"], | ||
"aria-controls": props["aria-controls"], | ||
"aria-readonly": props.isReadOnly || void 0, | ||
"aria-required": props.isRequired || void 0, | ||
disabled: props.isDisabled, | ||
value: props.value, | ||
name: props.name, | ||
type: "checkbox", | ||
@@ -77,0 +67,0 @@ onChange |
{ | ||
"name": "@solid-aria/toggle", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"private": false, | ||
@@ -34,6 +34,6 @@ "description": "Primitives for building toggle components like checkboxes and switches.", | ||
"dependencies": { | ||
"@solid-aria/focus": "^0.0.3", | ||
"@solid-aria/interactions": "^0.0.3", | ||
"@solid-aria/focus": "^0.0.4", | ||
"@solid-aria/interactions": "^0.0.4", | ||
"@solid-aria/types": "^0.0.3", | ||
"@solid-aria/utils": "^0.0.3" | ||
"@solid-aria/utils": "^0.0.4" | ||
}, | ||
@@ -40,0 +40,0 @@ "peerDependencies": { |
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
12983
251
+ Added@solid-aria/focus@0.0.4(transitive)
+ Added@solid-aria/interactions@0.0.4(transitive)
+ Added@solid-aria/utils@0.0.4(transitive)
- Removed@solid-aria/focus@0.0.3(transitive)
- Removed@solid-aria/interactions@0.0.3(transitive)
- Removed@solid-aria/utils@0.0.3(transitive)
Updated@solid-aria/focus@^0.0.4
Updated@solid-aria/utils@^0.0.4