From 2e27d7c83ad84b5a21b5df7635790effc78d9bea Mon Sep 17 00:00:00 2001 From: Devon Govett Date: Tue, 5 May 2026 08:38:05 -1000 Subject: [PATCH 1/2] Fix types for page.css (#10016) --- packages/@react-spectrum/s2/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/@react-spectrum/s2/package.json b/packages/@react-spectrum/s2/package.json index 844f53110ff..40b130b4a7a 100644 --- a/packages/@react-spectrum/s2/package.json +++ b/packages/@react-spectrum/s2/package.json @@ -24,6 +24,7 @@ }, "./page.css": { "source": "./src/page.ts", + "types": "./dist/types/src/page.d.ts", "default": "./page.css" }, "./style": { From 623d9083e64c7c70aeba764635b797815e5b1ff0 Mon Sep 17 00:00:00 2001 From: Robert Snow Date: Wed, 6 May 2026 09:24:05 +1000 Subject: [PATCH 2/2] fix: checkbox in cardview and radio and switch (#10012) --- packages/@react-spectrum/s2/src/Checkbox.tsx | 7 +++++-- packages/@react-spectrum/s2/src/RadioGroup.tsx | 7 +++++-- packages/@react-spectrum/s2/src/Switch.tsx | 7 +++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/packages/@react-spectrum/s2/src/Checkbox.tsx b/packages/@react-spectrum/s2/src/Checkbox.tsx index 0922dcc028e..af1d9ba6949 100644 --- a/packages/@react-spectrum/s2/src/Checkbox.tsx +++ b/packages/@react-spectrum/s2/src/Checkbox.tsx @@ -53,7 +53,10 @@ export const CheckboxContext = createContext const field = style({ display: 'grid', - gridTemplateColumns: ['max-content', '1fr'], + gridTemplateColumns: { + default: ['max-content', '1fr'], + isNoVisibleLabel: ['max-content'] + }, columnGap: 'text-to-control', alignContent: 'start', width: { @@ -182,7 +185,7 @@ export const Checkbox = forwardRef(function Checkbox({children, ...props}: Check ref={domRef} inputRef={inputRef} style={props.UNSAFE_style} - className={(props.UNSAFE_className || '') + field({size: props.size || 'M', isInCheckboxGroup}, props.styles)}> + className={(props.UNSAFE_className || '') + field({size: props.size || 'M', isInCheckboxGroup, isNoVisibleLabel: !children}, props.styles)}> {({isDisabled, isInvalid}) => (<> wrapper({...renderProps, isInForm, size: props.size || 'M'})}> {renderProps => { diff --git a/packages/@react-spectrum/s2/src/RadioGroup.tsx b/packages/@react-spectrum/s2/src/RadioGroup.tsx index 21a054d129d..603e267aecb 100644 --- a/packages/@react-spectrum/s2/src/RadioGroup.tsx +++ b/packages/@react-spectrum/s2/src/RadioGroup.tsx @@ -175,7 +175,10 @@ interface RenderProps extends RadioRenderProps, ContextProps {} const radioField = style({ display: 'grid', - gridTemplateColumns: ['max-content', '1fr'], + gridTemplateColumns: { + default: ['max-content', '1fr'], + isNoVisibleLabel: ['max-content'] + }, columnGap: 'text-to-control', alignContent: 'start', font: controlFont(), @@ -277,7 +280,7 @@ export const Radio = /*#__PURE__*/ forwardRef(function Radio(props: RadioProps, ref={domRef} inputRef={inputRef} style={UNSAFE_style} - className={renderProps => UNSAFE_className + radioField({...renderProps, isInForm, size}, allProps.styles)}> + className={renderProps => UNSAFE_className + radioField({...renderProps, isInForm, size, isNoVisibleLabel: !children}, allProps.styles)}> {renderProps => ( <> wrapper({...renderProps, isInForm, size})}> diff --git a/packages/@react-spectrum/s2/src/Switch.tsx b/packages/@react-spectrum/s2/src/Switch.tsx index 69186ab32bb..aaaa182cdb4 100644 --- a/packages/@react-spectrum/s2/src/Switch.tsx +++ b/packages/@react-spectrum/s2/src/Switch.tsx @@ -47,7 +47,10 @@ export const SwitchContext = createContext, Fo const field = style({ display: 'grid', - gridTemplateColumns: ['max-content', '1fr'], + gridTemplateColumns: { + default: ['max-content', '1fr'], + isNoVisibleLabel: ['max-content'] + }, columnGap: 'text-to-control', width: 'fit', font: controlFont(), @@ -183,7 +186,7 @@ export const Switch = /*#__PURE__*/ forwardRef(function Switch(props: SwitchProp ref={domRef} inputRef={inputRef} style={UNSAFE_style} - className={renderProps => UNSAFE_className + field({...renderProps, isInForm, size: props.size || 'M'}, props.styles)}> + className={renderProps => UNSAFE_className + field({...renderProps, isInForm, size: props.size || 'M', isNoVisibleLabel: !children}, props.styles)}> {({isDisabled, isInvalid}) => (<> wrapper({...renderProps, isInForm, size: props.size || 'M'})}> {renderProps => (