@react-aria/utils
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -20,2 +20,6 @@ var _classnames = $parcel$interopDefault(require("classnames")); | ||
let $f09fcd7f5f367fc80aacfeac62ed2$var$randomInstanceNumber = Math.round(Math.random() * 10000000000); | ||
/** | ||
* If a default is not provided, generate an id. | ||
* @param defaultId - Default component id. | ||
*/ | ||
@@ -339,2 +343,7 @@ function useId(defaultId) { | ||
/** | ||
* Merges aria-label and aria-labelledby into aria-labelledby when both exist. | ||
* @param props - Aria label props. | ||
* @param defaultLabel - Default value for aria-label when not present. | ||
*/ | ||
function useLabels(props, defaultLabel) { | ||
@@ -345,3 +354,3 @@ let { | ||
'aria-labelledby': labelledBy | ||
} = props; // If there is both an aria-label and aria-labelledby, | ||
} = props; // If there is both an aria-label and aria-labelledby, | ||
// combine them by pointing to the element itself. | ||
@@ -471,3 +480,8 @@ | ||
const $a736ffc3e05a0bfc1508098ba395b41$var$labelablePropNames = new Set(['aria-label', 'aria-labelledby', 'aria-describedby', 'aria-details']); | ||
const $a736ffc3e05a0bfc1508098ba395b41$var$propRe = /^(data-.*)$/; // Filters out all props that aren't valid DOM props or are user defined via override prop obj. | ||
const $a736ffc3e05a0bfc1508098ba395b41$var$propRe = /^(data-.*)$/; | ||
/** | ||
* Filters out all props that aren't valid DOM props or defined via override prop obj. | ||
* @param props - The component props to be filtered. | ||
* @param opts - Props to override. | ||
*/ | ||
@@ -474,0 +488,0 @@ function filterDOMProps(props, opts) { |
@@ -8,2 +8,7 @@ import _classnames from "classnames"; | ||
let $f8b5fdd96fb429d7102983f777c41307$var$randomInstanceNumber = Math.round(Math.random() * 10000000000); | ||
/** | ||
* If a default is not provided, generate an id. | ||
* @param defaultId - Default component id. | ||
*/ | ||
export function useId(defaultId) { | ||
@@ -304,2 +309,8 @@ let [value, setValue] = useState(defaultId); | ||
} | ||
/** | ||
* Merges aria-label and aria-labelledby into aria-labelledby when both exist. | ||
* @param props - Aria label props. | ||
* @param defaultLabel - Default value for aria-label when not present. | ||
*/ | ||
export function useLabels(props, defaultLabel) { | ||
@@ -310,3 +321,3 @@ let { | ||
'aria-labelledby': labelledBy | ||
} = props; // If there is both an aria-label and aria-labelledby, | ||
} = props; // If there is both an aria-label and aria-labelledby, | ||
// combine them by pointing to the element itself. | ||
@@ -428,3 +439,8 @@ | ||
const $f6a965352cabf1a7c37e8c1337e5eab$var$labelablePropNames = new Set(['aria-label', 'aria-labelledby', 'aria-describedby', 'aria-details']); | ||
const $f6a965352cabf1a7c37e8c1337e5eab$var$propRe = /^(data-.*)$/; // Filters out all props that aren't valid DOM props or are user defined via override prop obj. | ||
const $f6a965352cabf1a7c37e8c1337e5eab$var$propRe = /^(data-.*)$/; | ||
/** | ||
* Filters out all props that aren't valid DOM props or defined via override prop obj. | ||
* @param props - The component props to be filtered. | ||
* @param opts - Props to override. | ||
*/ | ||
@@ -431,0 +447,0 @@ export function filterDOMProps(props, opts) { |
import { HTMLAttributes, MutableRefObject, EffectCallback } from "react"; | ||
import { Orientation, AriaLabelingProps, DOMProps } from "@react-types/shared"; | ||
/** | ||
* If a default is not provided, generate an id. | ||
* @param defaultId - Default component id. | ||
*/ | ||
export function useId(defaultId?: string): string; | ||
@@ -34,2 +38,7 @@ export function mergeIds(a: string, b: string): string; | ||
export function useDrag1D(props: UseDrag1DProps): HTMLAttributes<HTMLElement>; | ||
/** | ||
* Merges aria-label and aria-labelledby into aria-labelledby when both exist. | ||
* @param props - Aria label props. | ||
* @param defaultLabel - Default value for aria-label when not present. | ||
*/ | ||
export function useLabels(props: DOMProps & AriaLabelingProps, defaultLabel?: string): HTMLAttributes<HTMLElement>; | ||
@@ -42,4 +51,9 @@ export function useUpdateEffect(effect: EffectCallback, dependencies: any[]): void; | ||
} | ||
/** | ||
* Filters out all props that aren't valid DOM props or defined via override prop obj. | ||
* @param props - The component props to be filtered. | ||
* @param opts - Props to override. | ||
*/ | ||
export function filterDOMProps(props: DOMProps & AriaLabelingProps, opts?: Options): DOMProps & AriaLabelingProps; | ||
//# sourceMappingURL=types.d.ts.map |
{ | ||
"name": "@react-aria/utils", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "Spectrum UI components in React", | ||
@@ -21,3 +21,3 @@ "license": "Apache-2.0", | ||
"@babel/runtime": "^7.6.2", | ||
"@react-types/shared": "^3.0.1", | ||
"@react-types/shared": "^3.0.2", | ||
"classnames": "^2.2.5" | ||
@@ -31,3 +31,3 @@ }, | ||
}, | ||
"gitHead": "ac0b7a7ba0edccd1c9ab4f849022ad6d2ccd19ed" | ||
"gitHead": "05003506f02a0ec173f3448f1801cbdf12b47bc7" | ||
} |
@@ -34,3 +34,7 @@ /* | ||
// Filters out all props that aren't valid DOM props or are user defined via override prop obj. | ||
/** | ||
* Filters out all props that aren't valid DOM props or defined via override prop obj. | ||
* @param props - The component props to be filtered. | ||
* @param opts - Props to override. | ||
*/ | ||
export function filterDOMProps(props: DOMProps & AriaLabelingProps, opts: Options = {}): DOMProps & AriaLabelingProps { | ||
@@ -37,0 +41,0 @@ let {labelable, propNames} = opts; |
@@ -21,2 +21,7 @@ /* | ||
let randomInstanceNumber = Math.round(Math.random() * 10000000000); | ||
/** | ||
* If a default is not provided, generate an id. | ||
* @param defaultId - Default component id. | ||
*/ | ||
export function useId(defaultId?: string): string { | ||
@@ -23,0 +28,0 @@ let [value, setValue] = useState(defaultId); |
@@ -17,2 +17,7 @@ /* | ||
/** | ||
* Merges aria-label and aria-labelledby into aria-labelledby when both exist. | ||
* @param props - Aria label props. | ||
* @param defaultLabel - Default value for aria-label when not present. | ||
*/ | ||
export function useLabels(props: DOMProps & AriaLabelingProps, defaultLabel?: string): HTMLAttributes<HTMLElement> { | ||
@@ -25,3 +30,3 @@ let { | ||
// If there is both an aria-label and aria-labelledby, | ||
// If there is both an aria-label and aria-labelledby, | ||
// combine them by pointing to the element itself. | ||
@@ -28,0 +33,0 @@ id = useId(id); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
129066
1379
Updated@react-types/shared@^3.0.2