Skip to content

Commit d6ded07

Browse files
committed
Merge branch 'main' of github.com:adobe/react-spectrum
2 parents 54c2366 + 69c0940 commit d6ded07

File tree

4 files changed

+318
-4
lines changed

4 files changed

+318
-4
lines changed

packages/@react-spectrum/contextualhelp/docs/ContextualHelp.mdx

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import {Flex} from '@react-spectrum/layout';
2525
---
2626
category: Overlays
2727
keywords: [popover, field, input]
28-
after_version: 3.0.0-alpha.1
2928
---
3029

3130
# ContextualHelp

packages/@react-spectrum/menu/docs/MenuTrigger.mdx

+39-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export default Layout;
1313
import docs from 'docs:@react-spectrum/menu';
1414
import {HeaderInfo, PropTable, PageDescription} from '@react-spectrum/docs';
1515
import packageData from '@react-spectrum/menu/package.json';
16+
import {Keyboard} from '@react-spectrum/text';
1617

1718
```jsx import
1819
import {ActionButton} from '@react-spectrum/button'
@@ -42,7 +43,7 @@ keywords: [menu, dropdown, action menu]
4243
```tsx example
4344
<MenuTrigger>
4445
<ActionButton>
45-
Edit
46+
Edit
4647
</ActionButton>
4748
<Menu>
4849
<Item>Cut</Item>
@@ -82,6 +83,43 @@ function Example() {
8283
}
8384
```
8485

86+
## Long press
87+
By default, a MenuTrigger's Menu is opened by pressing the trigger element or activating it via the <Keyboard>Space</Keyboard> or <Keyboard>Enter</Keyboard> keys. However, there may be cases in which your trigger element
88+
should perform a separate default action on press such as selection, and should only display the Menu when long pressed. This behavior can be changed by providing `"longPress"` to the `trigger` prop. With this prop, the Menu will only be opened upon
89+
pressing and holding the trigger element or by using the <Keyboard>Option</Keyboard> (<Keyboard>Alt</Keyboard> on Windows) + <Keyboard>Down Arrow</Keyboard>/<Keyboard>Up Arrow</Keyboard> keys while focusing the trigger element.
90+
91+
The example below illustrates how one would setup a MenuTrigger to have long press behavior.
92+
93+
```tsx example
94+
import CloneStamp from '@spectrum-icons/workflow/CloneStamp';
95+
import Crop from '@spectrum-icons/workflow/Crop';
96+
import CropRotate from '@spectrum-icons/workflow/CropRotate';
97+
import Slice from '@spectrum-icons/workflow/Slice';
98+
import {Text} from '@react-spectrum/text';
99+
100+
<MenuTrigger trigger="longPress">
101+
<ActionButton
102+
aria-label="Crop tool"
103+
onPress={() => alert('Cropping!')}>
104+
<Crop />
105+
</ActionButton>
106+
<Menu>
107+
<Item textValue="Crop Rotate">
108+
<CropRotate />
109+
<Text>Crop Rotate</Text>
110+
</Item>
111+
<Item textValue="Slice">
112+
<Slice />
113+
<Text>Slice</Text>
114+
</Item>
115+
<Item textValue="Clone stamp">
116+
<CloneStamp />
117+
<Text>Clone Stamp</Text>
118+
</Item>
119+
</Menu>
120+
</MenuTrigger>
121+
```
122+
85123
## Props
86124

87125
<PropTable component={docs.exports.MenuTrigger} links={docs.links} />

packages/@react-spectrum/provider/docs/Provider.mdx

+23-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {Layout} from '@react-spectrum/docs';
22
export default Layout;
33

44
import docs from 'docs:@react-spectrum/provider';
5-
import {HeaderInfo, PropTable, PageDescription} from '@react-spectrum/docs';
5+
import {HeaderInfo, PropTable, PageDescription, TypeLink} from '@react-spectrum/docs';
66
import packageData from '@react-spectrum/provider/package.json';
77

88
```jsx import
@@ -27,7 +27,7 @@ keywords: [theme, locale, application, colorstop]
2727

2828
<HeaderInfo
2929
packageData={packageData}
30-
componentNames={['Provider']} />
30+
componentNames={['Provider', 'useProvider']} />
3131

3232
## Example
3333

@@ -149,3 +149,24 @@ function Register() {
149149
## Props
150150

151151
<PropTable component={docs.exports.Provider} links={docs.links} />
152+
153+
## useProvider
154+
The <TypeLink links={docs.links} type={docs.exports.useProvider} /> hook can be used to access the various properties applied by the nearest parent Provider. This can be useful for adapting a custom component to the current color scheme or scale.
155+
156+
The example below uses the `colorScheme` returned from `useProvider` to display either a moon or sun icon depending on the current color scheme. Toggle the theme using the switcher in the top right corner of the page to see the icon change.
157+
158+
```tsx example
159+
import Light from '@spectrum-icons/workflow/Light';
160+
import Moon from '@spectrum-icons/workflow/Moon';
161+
import {useProvider} from '@react-spectrum/provider';
162+
163+
function Example() {
164+
let {colorScheme} = useProvider();
165+
166+
return colorScheme === 'dark'
167+
? <Moon aria-label="In dark theme" />
168+
: <Light aria-label="In light theme" />
169+
}
170+
171+
<Example />
172+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,256 @@
1+
{/* Copyright 2022 Adobe. All rights reserved.
2+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
3+
you may not use this file except in compliance with the License. You may obtain a copy
4+
of the License at http://www.apache.org/licenses/LICENSE-2.0
5+
Unless required by applicable law or agreed to in writing, software distributed under
6+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
7+
OF ANY KIND, either express or implied. See the License for the specific language
8+
governing permissions and limitations under the License. */}
9+
10+
import {BlogPostLayout, Hero} from '@react-spectrum/docs';
11+
export default BlogPostLayout;
12+
13+
---
14+
description: We are back with a new year and a new component! The Contextual Help component has been added to React Spectrum thanks to @arumsey. This component is handy for showing users more information in forms and other views. We also have some new features including long press support for `MenuTrigger`, additional keyboard support in `Combobox` and `useMove`, and plenty of bug fixes.
15+
date: 2022-02-15
16+
---
17+
18+
# February 15, 2022 Release
19+
20+
We are back with a new year and a new component! The Contextual Help component has been added to React Spectrum thanks to [@arumsey](https://github.com/arumsey) 🥳 This component is handy for showing users more information in forms and other views. We also have some new features including long press support for `MenuTrigger`, additional keyboard support in `Combobox` and `useMove`, and plenty of bug fixes.
21+
22+
Thank you to all our contributors who helped us with this release!
23+
24+
25+
## New Component
26+
- Contextual Help
27+
- `@react-spectrum/contextualhelp` - [Docs](https://react-spectrum.adobe.com/react-spectrum/ContextualHelp.html)
28+
## New features
29+
- Add support for long press on `MenuTrigger` - [@lishichengyan](https://github.com/lishichengyan) - [PR](https://github.com/adobe/react-spectrum/pull/2678) - [Docs](https://react-spectrum.adobe.com/react-spectrum/MenuTrigger.html#long-press)
30+
- Add `useProvider` to @adobe/react-spectrum - [@LFDanLu](https://github.com/LFDanLu) - [PR](https://github.com/adobe/react-spectrum/pull/2769) - [Docs](https://react-spectrum.adobe.com/react-spectrum/Provider.html#useprovider)
31+
- Support `onKeyDown` in `ComboBox` - [@sdjustin](https://github.com/sdjustin) - [PR](https://github.com/adobe/react-spectrum/pull/2674)
32+
- Add modifier keys to `useMove` - [@snowystinger](https://github.com/snowystinger) - [PR](https://github.com/adobe/react-spectrum/pull/2794)
33+
- Add `maxHeight` to `useOverlayPosition` - [@sttwarrior](https://github.com/sttwarrior) - [PR](https://github.com/adobe/react-spectrum/pull/2673)
34+
- Add `defaultOpen` and `onOpenChange` to `ActionMenu` - [@ktabors](https://github.com/ktabors) - [PR](https://github.com/adobe/react-spectrum/pull/2728)
35+
## Fixed
36+
- Update usage of `start` to use `flex-start` in CSS - [@msabramo](https://github.com/msabramo) - [PR](https://github.com/adobe/react-spectrum/pull/2695)
37+
- Fix loss of focus on `NumberField` on Android - [@snowystinger](https://github.com/snowystinger) - [PR](https://github.com/adobe/react-spectrum/pull/2127)
38+
- Update `FocusScope` to restore focus correctly when children change - [@kherock](https://github.com/kherock) - [PR](https://github.com/adobe/react-spectrum/pull/2791)
39+
- Fix SSR error for TableView - [@solimant](https://github.com/solimant) - [PR](https://github.com/adobe/react-spectrum/pull/2754)
40+
- Improve aria labeling for `SearchWithin` - [@reidbarber](https://github.com/reidbarber) - [PR](https://github.com/adobe/react-spectrum/pull/2288)
41+
- Fix `setState` callback in `useControlledState` - [@devongovett](https://github.com/devongovett) - [PR](https://github.com/adobe/react-spectrum/pull/2304)
42+
- Handle keyboard “select all” checkbox events in TableView when rows are empty - [@ilumin](https://github.com/ilumin) - [PR](https://github.com/adobe/react-spectrum/pull/2720)
43+
- Update `ActionGroup` to display borders correctly - [@snowystinger](https://github.com/snowystinger) - [PR](https://github.com/adobe/react-spectrum/pull/2710)
44+
- Change Dialog heading to use `H2` - [@majornista](https://github.com/majornista) - [PR](https://github.com/adobe/react-spectrum/pull/2633)
45+
- Update type of `AsyncListLoadFunction` in `useAsyncList` - [@LFDanLu](https://github.com/LFDanLu) - [PR](https://github.com/adobe/react-spectrum/pull/2683)
46+
- Fix keyboard form submission in `usePress` - [@snowystinger](https://github.com/snowystinger) - [PR](https://github.com/adobe/react-spectrum/pull/904)
47+
- Fix falsey checks in `TableKeyboardDelegate` - [@LFDanLu](https://github.com/LFDanLu) - [PR](https://github.com/adobe/react-spectrum/pull/2846)
48+
## Docs
49+
- Add documentation for `ActionMenu` - [@ktabors](https://github.com/ktabors) - [PR](https://github.com/adobe/react-spectrum/pull/2227)
50+
- Update `locale` prop in SSR docs - [@snowystinger](https://github.com/snowystinger) - [PR](https://github.com/adobe/react-spectrum/pull/2833)
51+
- Update supported browsers - [@devongovett](https://github.com/devongovett) - [PR](https://github.com/adobe/react-spectrum/pull/2828)
52+
## Under construction
53+
54+
Pre-release versions of the following components have been released. Please feel free to try them out, and report any issues you encounter.
55+
56+
57+
- ColorSlider beta
58+
- [React Spectrum](https://react-spectrum.adobe.com/react-spectrum/ColorSlider.html)
59+
- [React Aria](https://react-spectrum.adobe.com/react-aria/useColorSlider.html)
60+
- ColorWheel beta
61+
- [React Spectrum](https://react-spectrum.adobe.com/react-spectrum/ColorWheel.html)
62+
- [React Aria](https://react-spectrum.adobe.com/react-aria/useColorWheel.html)
63+
- ColorField beta
64+
- [React Spectrum](https://react-spectrum.adobe.com/react-spectrum/ColorField.html)
65+
- [React Aria](https://react-spectrum.adobe.com/react-aria/useColorField.html)
66+
- SearchWithin alpha
67+
- Calendar alpha
68+
- DatePicker alpha
69+
- ListView alpha
70+
- CardView alpha
71+
- Card alpha
72+
- TagGroup alpha
73+
74+
75+
## Released packages
76+
```
77+
78+
- @internationalized/[email protected]
79+
- @internationalized/[email protected]
80+
- @internationalized/[email protected]
81+
- @react-aria/[email protected]
82+
- @react-aria/[email protected]
83+
- @react-aria/[email protected]
84+
- @react-aria/[email protected]
85+
- @react-aria/[email protected]
86+
- @react-aria/[email protected]
87+
- @react-aria/[email protected]
88+
- @react-aria/[email protected]
89+
- @react-aria/[email protected]
90+
- @react-aria/[email protected]
91+
- @react-aria/[email protected]
92+
- @react-aria/[email protected]
93+
- @react-aria/[email protected]
94+
- @react-aria/[email protected]
95+
- @react-aria/[email protected]
96+
- @react-aria/[email protected]
97+
- @react-aria/[email protected]
98+
- @react-aria/[email protected]
99+
- @react-aria/[email protected]
100+
- @react-aria/[email protected]
101+
- @react-aria/[email protected]
102+
- @react-aria/[email protected]
103+
- @react-aria/[email protected]
104+
- @react-aria/[email protected]
105+
- @react-aria/[email protected]
106+
- @react-aria/[email protected]
107+
- @react-aria/[email protected]
108+
- @react-aria/[email protected]
109+
- @react-aria/[email protected]
110+
- @react-aria/[email protected]
111+
- @react-aria/[email protected]
112+
- @react-aria/[email protected]
113+
- @react-aria/[email protected]
114+
- @react-aria/[email protected]
115+
- @react-aria/[email protected]
116+
- @react-aria/[email protected]
117+
- @react-aria/[email protected]
118+
- @react-aria/[email protected]
119+
- @react-aria/[email protected]
120+
- @react-aria/[email protected]
121+
- @react-aria/[email protected]
122+
- @react-aria/[email protected]
123+
- @react-aria/[email protected]
124+
- @react-aria/[email protected]
125+
- @react-spectrum/[email protected]
126+
- @react-spectrum/[email protected]
127+
- @react-spectrum/[email protected]
128+
- @react-spectrum/[email protected]
129+
- @react-spectrum/[email protected]
130+
- @react-spectrum/[email protected]
131+
- @react-spectrum/[email protected]
132+
- @react-spectrum/[email protected]
133+
- @react-spectrum/[email protected]
134+
- @react-spectrum/[email protected]
135+
- @react-spectrum/[email protected]
136+
- @react-spectrum/[email protected]
137+
- @react-spectrum/[email protected]
138+
- @react-spectrum/[email protected]
139+
- @react-spectrum/[email protected]
140+
- @react-spectrum/[email protected]
141+
- @react-spectrum/[email protected]
142+
- @react-spectrum/[email protected]
143+
- @react-spectrum/[email protected]
144+
- @react-spectrum/[email protected]
145+
- @react-spectrum/[email protected]
146+
- @react-spectrum/[email protected]
147+
- @react-spectrum/[email protected]
148+
- @react-spectrum/[email protected]
149+
- @react-spectrum/[email protected]
150+
- @react-spectrum/[email protected]
151+
- @react-spectrum/[email protected]
152+
- @react-spectrum/[email protected]
153+
- @react-spectrum/[email protected]
154+
- @react-spectrum/[email protected]
155+
- @react-spectrum/[email protected]
156+
- @react-spectrum/[email protected]
157+
- @react-spectrum/[email protected]
158+
- @react-spectrum/[email protected]
159+
- @react-spectrum/[email protected]
160+
- @react-spectrum/[email protected]
161+
- @react-spectrum/[email protected]
162+
- @react-spectrum/[email protected]
163+
- @react-spectrum/[email protected]
164+
- @react-spectrum/[email protected]
165+
- @react-spectrum/[email protected]
166+
- @react-spectrum/[email protected]
167+
- @react-spectrum/[email protected]
168+
- @react-spectrum/[email protected]
169+
- @react-spectrum/[email protected]
170+
- @react-spectrum/[email protected]
171+
- @react-spectrum/[email protected]
172+
- @react-spectrum/[email protected]
173+
- @react-spectrum/[email protected]
174+
- @react-spectrum/[email protected]
175+
- @react-spectrum/[email protected]
176+
- @react-stately/[email protected]
177+
- @react-stately/[email protected]
178+
- @react-stately/[email protected]
179+
- @react-stately/[email protected]
180+
- @react-stately/[email protected]
181+
- @react-stately/[email protected]
182+
- @react-stately/[email protected]
183+
- @react-stately/[email protected]
184+
- @react-stately/[email protected]
185+
- @react-stately/[email protected]
186+
- @react-stately/[email protected]
187+
- @react-stately/[email protected]
188+
- @react-stately/[email protected]
189+
- @react-stately/[email protected]
190+
- @react-stately/[email protected]
191+
- @react-stately/[email protected]
192+
- @react-stately/[email protected]
193+
- @react-stately/[email protected]
194+
- @react-stately/[email protected]
195+
- @react-stately/[email protected]
196+
- @react-stately/[email protected]
197+
- @react-stately/[email protected]
198+
- @react-stately/[email protected]
199+
- @react-stately/[email protected]
200+
- @react-stately/[email protected]
201+
- @react-stately/[email protected]
202+
- @react-types/[email protected]
203+
- @react-types/[email protected]
204+
- @react-types/[email protected]
205+
- @react-types/[email protected]
206+
- @react-types/[email protected]
207+
- @react-types/[email protected]
208+
- @react-types/[email protected]
209+
- @react-types/[email protected]
210+
- @react-types/[email protected]
211+
- @react-types/[email protected]
212+
- @react-types/[email protected]
213+
- @react-types/[email protected]
214+
- @react-types/[email protected]
215+
- @react-types/[email protected]
216+
- @react-types/[email protected]
217+
- @react-types/[email protected]
218+
- @react-types/[email protected]
219+
- @react-types/[email protected]
220+
- @react-types/[email protected]
221+
- @react-types/[email protected]
222+
- @react-types/[email protected]
223+
- @react-types/[email protected]
224+
- @react-types/[email protected]
225+
- @react-types/[email protected]
226+
- @react-types/[email protected]
227+
- @react-types/[email protected]
228+
- @react-types/[email protected]
229+
- @react-types/[email protected]
230+
- @react-types/[email protected]
231+
- @react-types/[email protected]
232+
- @react-types/[email protected]
233+
- @react-types/[email protected]
234+
- @react-types/[email protected]
235+
- @react-types/[email protected]
236+
- @react-types/[email protected]
237+
- @react-types/[email protected]
238+
- @react-types/[email protected]
239+
- @react-types/[email protected]
240+
- @react-types/[email protected]
241+
- @react-types/[email protected]
242+
- @react-types/[email protected]
243+
- @react-types/[email protected]
244+
- @react-types/[email protected]
245+
- @react-types/[email protected]
246+
- @react-types/[email protected]
247+
- @react-types/[email protected]
248+
- @react-types/[email protected]
249+
- @spectrum-icons/[email protected]
250+
- @spectrum-icons/[email protected]
251+
- @spectrum-icons/[email protected]
252+
- @spectrum-icons/[email protected]
253+
254+
255+
```
256+

0 commit comments

Comments
 (0)