diff --git a/packages/@react-aria/calendar/src/useCalendarCell.ts b/packages/@react-aria/calendar/src/useCalendarCell.ts index aabeac2f9a5..1c415d0b3d8 100644 --- a/packages/@react-aria/calendar/src/useCalendarCell.ts +++ b/packages/@react-aria/calendar/src/useCalendarCell.ts @@ -101,7 +101,11 @@ export function useCalendarCell(props: AriaCalendarCellProps, state: CalendarSta ); if (isInvalid) { - isSelected = true; + // don't mark unavaliable + invalid dates in range calendars as selected, that case only comes up via allowsNoncontiguousRanges + // and thus those unavailable dates shouldn't be selected. For single select calendars, we mark unavailble + invalid days as selected for styling reasons + if (!('highlightedRange' in state) || !isUnavailable) { + isSelected = true; + } } // For performance, reuse the same date object as before if the new date prop is the same. diff --git a/packages/@react-spectrum/s2/chromatic/Button.stories.tsx b/packages/@react-spectrum/s2/chromatic/Button.stories.tsx index 2ad49d90c26..0149063d3fb 100644 --- a/packages/@react-spectrum/s2/chromatic/Button.stories.tsx +++ b/packages/@react-spectrum/s2/chromatic/Button.stories.tsx @@ -40,18 +40,34 @@ let states = [ let combinations = generatePowerset(states); -const Template = (args: ButtonProps): ReactNode => { - let {children, ...otherArgs} = args; +let premiumStates = [ + {isDisabled: true}, + {size: ['S', 'M', 'L', 'XL']} +]; + +let premiumCombinations = generatePowerset(premiumStates); + +let genaiStates = [ + {isDisabled: true}, + {size: ['S', 'M', 'L', 'XL']} +]; + +let genaiCombinations = generatePowerset(genaiStates); + +const Template = (args: ButtonProps & {combos?: any[]}): ReactNode => { + let {children, combos = combinations, variant, ...otherArgs} = args; return (
- {combinations.map(c => { + {combos.map(c => { let fullComboName = Object.keys(c).map(k => `${k}: ${c[k]}`).join(' '); let key = Object.keys(c).map(k => shortName(k, c[k])).join(' '); if (!key) { key = 'default'; } - let button = ; + let finalVariant = c.variant ?? variant; + let buttonProps = {...otherArgs, ...c, ...(finalVariant && {variant: finalVariant})}; + let button = ; if (c.staticColor != null) { return ( @@ -84,4 +100,52 @@ export const IconOnly: StoryObj = { } }; +export const Premium: StoryObj = { + render: (args) =>