Skip to content

Commit 352fa19

Browse files
authored
docs: shouldCloseOnSelect, interactOutsideBehavior, and new viewport css vars (adobe#9855)
* add control for select shouldCloseOnSelect to initial example * add new viewport/page width css vars * add interactOutsideBehavior docs * add interactOutsideBehavior to DateRangePicker * copy update * review comments
1 parent 45cb5d8 commit 352fa19

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

packages/@react-spectrum/s2/src/DateRangePicker.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import {useSpectrumContextProps} from './useSpectrumContextProps';
3535

3636
export interface DateRangePickerProps<T extends DateValue> extends
3737
Omit<AriaDateRangePickerProps<T>, 'children' | 'className' | 'style' | 'render' | keyof GlobalDOMAttributes>,
38-
Pick<RangeCalendarProps<T>, 'createCalendar' | 'pageBehavior' | 'firstDayOfWeek' | 'isDateUnavailable'>,
38+
Pick<RangeCalendarProps<T>, 'createCalendar' | 'pageBehavior' | 'firstDayOfWeek' | 'isDateUnavailable' | 'interactOutsideBehavior'>,
3939
Pick<PopoverProps, 'shouldFlip'>,
4040
StyleProps,
4141
SpectrumLabelableProps,
@@ -84,6 +84,7 @@ export const DateRangePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(func
8484
placeholderValue,
8585
maxVisibleMonths = 1,
8686
createCalendar,
87+
interactOutsideBehavior,
8788
...dateFieldProps
8889
} = props;
8990
let formContext = useContext(FormContext);
@@ -154,6 +155,7 @@ export const DateRangePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(func
154155
<RangeCalendar
155156
visibleMonths={maxVisibleMonths}
156157
createCalendar={createCalendar}
158+
interactOutsideBehavior={interactOutsideBehavior}
157159
errorMessage={errorMessage} />
158160
{showTimeField && (
159161
<div className={style({display: 'flex', gap: 16, contain: 'inline-size', marginTop: 24})}>

packages/dev/s2-docs/pages/react-aria/Modal.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ const CustomTrigger = React.forwardRef((props, ref) => (
211211
showDescription
212212
cssVariables={{
213213
'--visual-viewport-height': 'The height of the [Visual Viewport](https://developer.mozilla.org/en-US/docs/Web/API/Visual_Viewport_API), i.e. space above the software keyboard.',
214-
'--page-height': 'The height of the `<body>` element. Useful for sizing the modal backdrop.'
214+
'--visual-viewport-width': 'The width of the [Visual Viewport](https://developer.mozilla.org/en-US/docs/Web/API/Visual_Viewport_API).',
215+
'--page-height': 'The height of the `<body>` element. Useful for sizing and positioning the modal backdrop.',
216+
'--page-width': 'The width of the `<body>` element. Useful for sizing and positioning the modal backdrop.'
215217
}} />
216218

217219
### Dialog

packages/dev/s2-docs/pages/react-aria/RangeCalendar.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ export const description = 'Displays one or more date grids and allows users to
2121
component={VanillaRangeCalendar}
2222
docs={vanillaDocs.exports.RangeCalendar}
2323
links={vanillaDocs.links}
24-
props={['isDisabled']}
24+
props={['isDisabled', 'interactOutsideBehavior']}
2525
type="vanilla"
2626
files={["starters/docs/src/RangeCalendar.tsx", "starters/docs/src/RangeCalendar.css"]} />
2727
<VisualExample
2828
component={TailwindRangeCalendar}
2929
docs={vanillaDocs.exports.RangeCalendar}
3030
links={vanillaDocs.links}
31-
props={['isDisabled']}
31+
props={['isDisabled', 'interactOutsideBehavior']}
3232
type="tailwind"
3333
files={["starters/tailwind/src/RangeCalendar.tsx"]} />
3434
</ExampleSwitcher>

packages/dev/s2-docs/pages/s2/RangeCalendar.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const description = 'Allows a user to select a contiguous range of dates.
1515
component={RangeCalendar}
1616
docs={docs.exports.RangeCalendar}
1717
links={docs.links}
18-
props={['visibleMonths', 'pageBehavior', 'firstDayOfWeek', 'isDisabled']}
18+
props={['visibleMonths', 'pageBehavior', 'firstDayOfWeek', 'isDisabled', 'interactOutsideBehavior']}
1919
initialProps={{'aria-label': 'Trip dates'}}
2020
controlOptions={{
2121
visibleMonths: {
@@ -44,7 +44,7 @@ function Example() {
4444
end: parseDate('2025-02-12')
4545
});
4646
let formatter = useDateFormatter({ dateStyle: 'long' });
47-
47+
4848
return (
4949
<>
5050
<RangeCalendar

0 commit comments

Comments
 (0)