@react-spectrum/utils
Advanced tools
Comparing version 3.0.0-nightly-0ddbe6f95-241021 to 3.0.0-nightly-10a43de88-241127
@@ -32,2 +32,3 @@ var $iTRw5$reactariautils = require("@react-aria/utils"); | ||
let slot = props.slot || defaultSlot; | ||
// @ts-ignore TODO why is slot an object and not just string or undefined? | ||
let { [slot]: slotProps = {} } = (0, $iTRw5$react.useContext)($e81916440cf6fd84$var$SlotContext) || {}; | ||
@@ -34,0 +35,0 @@ return (0, $iTRw5$reactariautils.mergeProps)(props, (0, $iTRw5$reactariautils.mergeProps)(slotProps, { |
@@ -19,2 +19,3 @@ import {mergeProps as $doF98$mergeProps} from "@react-aria/utils"; | ||
let slot = props.slot || defaultSlot; | ||
// @ts-ignore TODO why is slot an object and not just string or undefined? | ||
let { [slot]: slotProps = {} } = (0, $doF98$useContext)($59d09bcc83651bf9$var$SlotContext) || {}; | ||
@@ -21,0 +22,0 @@ return (0, $doF98$mergeProps)(props, (0, $doF98$mergeProps)(slotProps, { |
@@ -377,4 +377,4 @@ var $893a66ba513f4a66$exports = require("./BreakpointProvider.main.js"); | ||
function $d3b73be57066120b$export$f348bec194f2e6b5(value, matchedBreakpoints) { | ||
value = $d3b73be57066120b$export$52dbfdbe1b2c3541(value, matchedBreakpoints); | ||
return $d3b73be57066120b$export$abc24f5b99744ea6(value); | ||
let responsiveValue = $d3b73be57066120b$export$52dbfdbe1b2c3541(value, matchedBreakpoints); | ||
if (responsiveValue != null) return $d3b73be57066120b$export$abc24f5b99744ea6(responsiveValue); | ||
} | ||
@@ -381,0 +381,0 @@ function $d3b73be57066120b$var$colorValue(value, type = 'default', version = 5) { |
@@ -364,4 +364,4 @@ import {useBreakpoint as $1051245f87c5981d$export$199d6754bdf4e1e3} from "./BreakpointProvider.module.js"; | ||
function $380ed8f3903c3931$export$f348bec194f2e6b5(value, matchedBreakpoints) { | ||
value = $380ed8f3903c3931$export$52dbfdbe1b2c3541(value, matchedBreakpoints); | ||
return $380ed8f3903c3931$export$abc24f5b99744ea6(value); | ||
let responsiveValue = $380ed8f3903c3931$export$52dbfdbe1b2c3541(value, matchedBreakpoints); | ||
if (responsiveValue != null) return $380ed8f3903c3931$export$abc24f5b99744ea6(responsiveValue); | ||
} | ||
@@ -368,0 +368,0 @@ function $380ed8f3903c3931$var$colorValue(value, type = 'default', version = 5) { |
@@ -18,6 +18,6 @@ import React, { ReactNode, CSSProperties, HTMLAttributes, JSXElementConstructor, ReactElement } from "react"; | ||
export function useMatchedBreakpoints(breakpoints: Breakpoints): string[]; | ||
export function useBreakpoint(): BreakpointContext; | ||
export function useBreakpoint(): BreakpointContext | null; | ||
type Breakpoint = 'base' | 'S' | 'M' | 'L' | string; | ||
type StyleName = string | string[] | ((dir: Direction) => string); | ||
type StyleHandler = (value: any, colorVersion?: number) => string; | ||
type StyleHandler = (value: any, colorVersion?: number) => string | undefined; | ||
export interface StyleHandlers { | ||
@@ -28,4 +28,4 @@ [key: string]: [StyleName, StyleHandler]; | ||
export const viewStyleProps: StyleHandlers; | ||
export function dimensionValue(value: DimensionValue): string; | ||
export function responsiveDimensionValue(value: Responsive<DimensionValue>, matchedBreakpoints: Breakpoint[]): string; | ||
export function dimensionValue(value: DimensionValue): string | undefined; | ||
export function responsiveDimensionValue(value: Responsive<DimensionValue>, matchedBreakpoints: Breakpoint[]): string | undefined; | ||
export function convertStyleProps<C extends ColorVersion>(props: ViewStyleProps<C>, handlers: StyleHandlers, direction: Direction, matchedBreakpoints: Breakpoint[]): CSSProperties; | ||
@@ -39,3 +39,3 @@ type StylePropsOptions = { | ||
export function passthroughStyle(value: any): any; | ||
export function getResponsiveProp<T>(prop: Responsive<T>, matchedBreakpoints: Breakpoint[]): T; | ||
export function getResponsiveProp<T>(prop: Responsive<T>, matchedBreakpoints: Breakpoint[]): T | undefined; | ||
export let shouldKeepSpectrumClassNames: boolean; | ||
@@ -42,0 +42,0 @@ export function keepSpectrumClassNames(): void; |
{ | ||
"name": "@react-spectrum/utils", | ||
"version": "3.0.0-nightly-0ddbe6f95-241021", | ||
"version": "3.0.0-nightly-10a43de88-241127", | ||
"description": "Spectrum UI components in React", | ||
@@ -27,6 +27,6 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-aria/i18n": "^3.0.0-nightly-0ddbe6f95-241021", | ||
"@react-aria/ssr": "^3.0.0-nightly-0ddbe6f95-241021", | ||
"@react-aria/utils": "^3.0.0-nightly-0ddbe6f95-241021", | ||
"@react-types/shared": "^3.0.0-nightly-0ddbe6f95-241021", | ||
"@react-aria/i18n": "^3.0.0-nightly-10a43de88-241127", | ||
"@react-aria/ssr": "^3.0.0-nightly-10a43de88-241127", | ||
"@react-aria/utils": "^3.0.0-nightly-10a43de88-241127", | ||
"@react-types/shared": "^3.0.0-nightly-10a43de88-241127", | ||
"@swc/helpers": "^0.5.0", | ||
@@ -36,3 +36,3 @@ "clsx": "^2.0.0" | ||
"peerDependencies": { | ||
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0" | ||
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" | ||
}, | ||
@@ -42,3 +42,3 @@ "publishConfig": { | ||
}, | ||
"stableVersion": "3.11.11" | ||
"stableVersion": "3.12.0" | ||
} |
@@ -27,3 +27,3 @@ /* | ||
export function classNames(cssModule: {[key: string]: string}, ...values: Array<string | Object | undefined>): string { | ||
let classes = []; | ||
let classes: Array<{} | undefined> = []; | ||
for (let value of values) { | ||
@@ -30,0 +30,0 @@ if (typeof value === 'object' && value) { |
@@ -20,3 +20,3 @@ /* | ||
type StyleName = string | string[] | ((dir: Direction) => string); | ||
type StyleHandler = (value: any, colorVersion?: number) => string; | ||
type StyleHandler = (value: any, colorVersion?: number) => string | undefined; | ||
export interface StyleHandlers { | ||
@@ -148,4 +148,6 @@ [key: string]: [StyleName, StyleHandler] | ||
export function responsiveDimensionValue(value: Responsive<DimensionValue>, matchedBreakpoints: Breakpoint[]) { | ||
value = getResponsiveProp(value, matchedBreakpoints); | ||
return dimensionValue(value); | ||
let responsiveValue = getResponsiveProp(value, matchedBreakpoints); | ||
if (responsiveValue != null) { | ||
return dimensionValue(responsiveValue); | ||
} | ||
} | ||
@@ -304,3 +306,3 @@ | ||
export function getResponsiveProp<T>(prop: Responsive<T>, matchedBreakpoints: Breakpoint[]): T { | ||
export function getResponsiveProp<T>(prop: Responsive<T>, matchedBreakpoints: Breakpoint[]): T | undefined { | ||
if (prop && typeof prop === 'object' && !Array.isArray(prop)) { | ||
@@ -307,0 +309,0 @@ for (let i = 0; i < matchedBreakpoints.length; i++) { |
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
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
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
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
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
225997
3162
+ Addedreact@19.0.0-rc-fb9a90fa48-20240614(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removedreact@18.3.1(transitive)