Skip to content

Commit 881c947

Browse files
committed
Merge branch 'main' of github.com:adobe/react-spectrum
2 parents 17358f7 + bf8fcf5 commit 881c947

File tree

16 files changed

+453
-26
lines changed

16 files changed

+453
-26
lines changed

.storybook-s2/docs/Migrating.jsx

+38-2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@ export function Migrating() {
5454
<li className={style({font: 'body', marginY: 8})}>Update <Code>Item</Code> to be a <Code>MenuItem</Code></li>
5555
</ul>
5656

57+
<H3>ActionGroup</H3>
58+
<ul className="sb-unstyled">
59+
<li className={style({font: 'body', marginY: 8})}>Use <Code>ActionButtonGroup</Code> if you are migrating from an <Code>ActionGroup</Code> that didn't allow for selection. <Code>ActionButtonGroup</Code> takes <Code>ActionButtons</Code> as children. </li>
60+
<li className={style({font: 'body', marginY: 8})}>Use <Code>ToggleButtonGroup</Code> if you are migrating from an <Code>ActionGroup</Code> that used single or multiple selection. <Code>ToggleButtonGroup</Code> takes <Code>ToggleButtons</Code> as children. </li>
61+
<li className={style({font: 'body', marginY: 8})}>[PENDING] Comment out <Code>overflowMode</Code> (it has not been implemented yet)</li>
62+
<li className={style({font: 'body', marginY: 8})}>[PENDING] Comment out <Code>buttonLabelBehavior</Code> (it has not been implemented yet)</li>
63+
<li className={style({font: 'body', marginY: 8})}>[PENDING] Comment out <Code>summaryIcon</Code> (it has not been implemented yet)</li>
64+
<li className={style({font: 'body', marginY: 8})}>Update root level <Code>onAction</Code> to called via <Code>onPress</Code> on each <Code>ActionButton</Code></li>
65+
<li className={style({font: 'body', marginY: 8})}>Apply <Code>isDisabled</Code> directly on each <Code>ActionButton</Code> or <Code>ToggleButton</Code> instead of root level <Code>disabledKeys</Code></li>
66+
<li className={style({font: 'body', marginY: 8})}>Update <Code>key</Code> to be <Code>id</Code> (and keep <Code>key</Code> if rendered inside <Code>array.map</Code>)</li>
67+
<li className={style({font: 'body', marginY: 8})}>Convert dynamic collections render function to <Code>items.map</Code></li>
68+
</ul>
69+
5770
<H3>AlertDialog</H3>
5871
<P>No updates needed.</P>
5972

@@ -141,14 +154,37 @@ export function Migrating() {
141154
<ul className="sb-unstyled">
142155
<li className={style({font: 'body', marginY: 8})}>Update children to move render props from being the second child of <Code>DialogTrigger</Code> to being a child of <Code>Dialog</Code></li>
143156
<li className={style({font: 'body', marginY: 8})}>Remove <Code>onDismiss</Code> and use <Code>onOpenChange</Code> on the <Code>DialogTrigger</Code>, or <Code>onDismiss</Code> on the <Code>DialogContainer</Code> instead</li>
157+
<li className={style({font: 'body', marginY: 8})}><Code>Dialog</Code> is now meant specifically for rendering modal dialogs only and follows the same preset layout as before</li>
158+
<li className={style({font: 'body', marginY: 8})}>If you are trying to create a dialog with a custom layout use <Code>CustomDialog</Code></li>
159+
<li className={style({font: 'body', marginY: 8})}>If you are trying to create a fullscreen dialog use <Code>FullscreenDialog</Code></li>
160+
<li className={style({font: 'body', marginY: 8})}>If you are trying to create a popover dialog use <Code>Popover</Code></li>
161+
<li className={style({font: 'body', marginY: 8})}>Supports <Code>isKeyboardDismissDisabled</Code> in place of <Code>DialogTrigger</Code></li>
162+
<li className={style({font: 'body', marginY: 8})}>Supports <Code>isDismissible</Code> in place of <Code>DialogTrigger</Code>. Note the fixed spelling from previous <Code>isDismissible</Code> prop.</li>
163+
<li className={style({font: 'body', marginY: 8})}>Supports <Code>role: "dialog" | "alertdialog"</Code></li>
164+
</ul>
165+
166+
<H3>DialogContainer</H3>
167+
<ul className="sb-unstyled">
168+
<li className={style({font: 'body', marginY: 8})}>Remove <Code>type</Code>, this is dependent on the dialog level child that you use (e.g. <Code>Dialog</Code>, <Code>FullscreenDialog</Code>, <Code>Popover</Code>)</li>
169+
<li className={style({font: 'body', marginY: 8})}>Remove <Code>isDismissable</Code>, prop now exists on the dialog level component as <Code>isDismissible</Code></li>
170+
<li className={style({font: 'body', marginY: 8})}>Remove <Code>isKeyboardDismissDisabled</Code>, prop now exists on the dialog level component</li>
144171
</ul>
145172

146173
<H3>DialogTrigger</H3>
147174
<ul className="sb-unstyled">
148175
<li className={style({font: 'body', marginY: 8})}>[PENDING] Comment out <Code>type="tray"</Code> (<Code>Tray</Code> has not been implemented yet)</li>
149-
<li className={style({font: 'body', marginY: 8})}>[PENDING] Comment out <Code>mobileType="tray"</Code> (<Code>Tray</Code> has not been implemented yet)</li>
176+
<li className={style({font: 'body', marginY: 8})}>[PENDING] Comment out <Code>mobileType</Code> (<Code>Tray</Code> and other types have not been implemented yet for <Code>Popover</Code>)</li>
150177
<li className={style({font: 'body', marginY: 8})}>Remove <Code>targetRef</Code> (it is no longer supported in Spectrum 2)</li>
151178
<li className={style({font: 'body', marginY: 8})}>Update <Code>children</Code> to remove render props usage, and note that the <Code>close</Code> function was moved from <Code>DialogTrigger</Code> to <Code>Dialog</Code></li>
179+
<li className={style({font: 'body', marginY: 8})}>Remove <Code>containerPadding</Code>, prop now exists on the <Code>Popover</Code> component</li>
180+
<li className={style({font: 'body', marginY: 8})}>Remove <Code>crossOffset</Code>, prop now exists on the <Code>Popover</Code> component</li>
181+
<li className={style({font: 'body', marginY: 8})}>Remove <Code>hideArrow</Code>, prop now exists on the <Code>Popover</Code> component</li>
182+
<li className={style({font: 'body', marginY: 8})}>Remove <Code>isDismissable</Code>, prop now exists on the dialog level component as <Code>isDismissible</Code></li>
183+
<li className={style({font: 'body', marginY: 8})}>Remove <Code>isKeyboardDismissDisabled</Code>, prop now exists on the dialog level component</li>
184+
<li className={style({font: 'body', marginY: 8})}>Remove <Code>offset</Code>, prop now exists on the <Code>Popover</Code> component</li>
185+
<li className={style({font: 'body', marginY: 8})}>Remove <Code>placement</Code>, prop now exists on the <Code>Popover</Code> component</li>
186+
<li className={style({font: 'body', marginY: 8})}>Remove <Code>shouldFlip</Code>, prop now exists on the <Code>Popover</Code> component</li>
187+
<li className={style({font: 'body', marginY: 8})}>Remove <Code>type</Code>, this is dependent on the dialog level child that you use (e.g. <Code>Dialog</Code>, <Code>FullscreenDialog</Code>, <Code>Popover</Code>)</li>
152188
</ul>
153189

154190
<H3>Divider</H3>
@@ -468,7 +504,7 @@ export function Migrating() {
468504
<td><Code>'large'</Code></td>
469505
<td><Code>'xl'</Code></td>
470506
</tr>
471-
</tbody>
507+
</tbody>
472508
</table>
473509

474510
<H3>Dimension values</H3>

.storybook-s2/docs/Release Notes.mdx

+50
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,56 @@ export default MDXLayout;
44

55
# Release Notes
66

7+
## v0.5.0
8+
9+
In this release we have updated our Dialog and DialogTrigger APIs to improve layout flexibility for custom dialogs and popovers. Dialog has been split into four components:
10+
11+
* [Dialog](?path=/docs/dialog--docs) – a modal dialog with a standard layout with slots for the heading, content, hero image, button group, etc. This corresponds to the previous `type="modal"` API.
12+
* [FullscreenDialog](?path=/docs/fullscreendialog--docs) – a fullscreen or takeover modal, similar to a Dialog but with different slots and layout. This corresponds to the previous `type="fullscreen"` and `type="fullscreenTakeover"` APIs.
13+
* [CustomDialog](?path=/docs/customdialog--docs) – a modal dialog with a completely custom layout. It can have default padding or go edge-to-edge. No built-in slots are provided, the layout is entirely up to you.
14+
* [Popover](?path=/docs/popover--docs) Popovers no longer support the previous dialog-style layout, which was rarely needed in recent apps. In addition, popover now has a reduced amount of padding by default, which was a common request.
15+
16+
In addition, several DialogTrigger props have moved to the above children:
17+
18+
* `type` is removed. Use one of the above components instead.
19+
* `isKeyboardDismissDisabled` moved to Dialog, FullscreenDialog, and CustomDialog
20+
* `isDismissable` was renamed to `isDismissible` (fixed spelling), and moved to Dialog and CustomDialog
21+
* `hideArrow`, `offset`, `crossOffset`, `containerPadding`, `placement`, and `shouldFlip` moved to Popover
22+
23+
We've also continued to iterate on developer experience based on your feedback. Documentation on style macro usage with regards to
24+
[colors](?path=/docs/style-macro--docs#colors) and [typography](?path=/docs/style-macro--docs#typography) have been added to help clarify
25+
these common use cases. Style macro properties like `width` and `height` now allow for arbitrary pixel size values, please see the [docs](?path=/docs/style-macro--docs#sizing)
26+
for more information. Finally, documentation on [optimizing CSS bundling](?path=/docs/style-macro--docs#css-optimization) have also been
27+
added to help you generate a properly optimized output when using the bundler of your choice.
28+
29+
### New components
30+
31+
* [ActionButtonGroup](?path=/docs/actionbuttongroup--docs)
32+
* [CloseButton](?path=/docs/customdialog--docs)
33+
* [CustomDialog](?path=/docs/customdialog--docs)
34+
* [FullscreenDialog](?path=/docs/fullscreendialog--docs)
35+
* [Popover](?path=/docs/popover--docs)
36+
* [ToggleButtonGroup](?path=/docs/togglebuttongroup--docs)
37+
38+
### Updates
39+
40+
* [Accordion](?path=/docs/accordion--docs): Add support for adjacent sibling elements in header
41+
* [ActionButton](?path=/docs/actionbutton--docs): Add support for Avatars in ActionButtons
42+
* [Dialog](?path=/docs/dialog--docs): See above for a summary of the changes to Dialog and Dialog adjacent components.
43+
* [Disclosure](?path=/docs/disclosure--docs): Add support for adjacent sibling elements in header
44+
* [DropZone](?path=/docs/dropzone--docs): Add t-shirt sizing
45+
* [Menu](?path=/docs/menu--docs): Add support for separate user defined selection modes per MenuSection
46+
* [Meter](?path=/docs/meter--docs): Add label positioning support
47+
* Update Spectrum Tokens to v53
48+
* Allow arbitrary pixel sizes for style macro sizing properties (e.g. width, height)
49+
50+
### Codemods
51+
52+
* Support Dialog updates
53+
* Support ActionGroup -> ActionButtonGroup/ToggleButtonGroup
54+
* Support arbitrary pixel sizing for style macro sizing properties
55+
* Update S1 to S2 icon mapping
56+
757
## v0.4.0
858

959
### New components

packages/@react-spectrum/accordion/docs/Accordion.mdx

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ import {Accordion, Disclosure, DisclosureTitle, DisclosurePanel} from '@react-sp
2929

3030
<HeaderInfo
3131
packageData={packageData}
32-
componentNames={['Accordion', 'Disclosure', 'DisclosureTitle', 'DisclosurePanel']} />
32+
componentNames={['Accordion', 'Disclosure', 'DisclosureTitle', 'DisclosurePanel']}
33+
since="3.38.0" />
3334

3435
## Example
3536

@@ -67,7 +68,7 @@ import {Key} from "@react-types/shared";
6768

6869
function ControlledExpansion() {
6970
let [expandedKeys, setExpandedKeys] = React.useState<Set<Key>>(new Set(['personal']))
70-
71+
7172
return (
7273
<>
7374
<Accordion expandedKeys={expandedKeys} onExpandedChange={setExpandedKeys}>

packages/@react-spectrum/accordion/docs/Disclosure.mdx

+4-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ import {Disclosure, DisclosureTitle, DisclosurePanel} from '@react-spectrum/acco
2929

3030
<HeaderInfo
3131
packageData={packageData}
32-
componentNames={['Disclosure', 'DisclosureTitle', 'DisclosurePanel']} />
32+
componentNames={['Disclosure', 'DisclosureTitle', 'DisclosurePanel']}
33+
since="3.38.0" />
3334

3435
## Example
3536

@@ -44,7 +45,7 @@ import {Disclosure, DisclosureTitle, DisclosurePanel} from '@react-spectrum/acco
4445

4546
## Content
4647

47-
Disclosure follows the [ARIA Disclosure pattern](https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/) and consists of two children: `DisclosureTitle` and `DisclosurePanel`. The `DisclosureTitle` controls the expansion of the `DisclosurePanel` and the contents inside.
48+
Disclosure follows the [ARIA Disclosure pattern](https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/) and consists of two children: `DisclosureTitle` and `DisclosurePanel`. The `DisclosureTitle` controls the expansion of the `DisclosurePanel` and the contents inside.
4849

4950
Disclosure can be used as a standalone collapsible section of content. However, multiple discosures can be combined to form an [Accordion](Accordion.html).
5051

@@ -59,7 +60,7 @@ Disclosure accepts an `onExpandedChange` prop which is triggered when it is expa
5960
```tsx example
6061
function ControlledExpansion() {
6162
let [isExpanded, setIsExpanded] = React.useState<boolean>(false);
62-
63+
6364
return (
6465
<>
6566
<Disclosure isExpanded={isExpanded} onExpandedChange={setIsExpanded}>

packages/@react-spectrum/color/docs/ColorArea.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ keywords: [color area]
3737
componentNames={['ColorArea']}
3838
sourceData={[
3939
{type: 'Spectrum', url: 'https://spectrum.adobe.com/page/color-area/'}
40-
]} />
40+
]}
41+
since="3.35.0" />
4142

4243
## Example
4344

packages/@react-spectrum/color/docs/ColorField.mdx

+3-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ keywords: [color field, input]
3333
<HeaderInfo
3434
packageData={packageData}
3535
componentNames={['ColorField']}
36-
sourceData={[]} />
36+
sourceData={[]}
37+
since="3.35.0" />
3738

3839
## Example
3940

@@ -44,7 +45,7 @@ keywords: [color field, input]
4445
## Value
4546

4647
A ColorField's `value` is empty by default, but an initial, uncontrolled, value can be provided using the `defaultValue` prop.
47-
Alternatively, a controlled value can be provided using the `value` prop. The value provided to either of these props should be a color string or <TypeLink links={colorTypes.links} type={colorTypes.exports.Color} /> object.
48+
Alternatively, a controlled value can be provided using the `value` prop. The value provided to either of these props should be a color string or <TypeLink links={colorTypes.links} type={colorTypes.exports.Color} /> object.
4849

4950
In the example below, the <TypeLink links={statelyDocs.links} type={statelyDocs.exports.parseColor} /> function is used to parse the initial color
5051
from a hex value, stored in state.

packages/@react-spectrum/color/docs/ColorPicker.mdx

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ keywords: [color picker]
3232

3333
<HeaderInfo
3434
packageData={packageData}
35-
componentNames={['ColorPicker', 'ColorEditor']} />
35+
componentNames={['ColorPicker', 'ColorEditor']}
36+
since="3.35.0" />
3637

3738
## Example
3839

@@ -142,7 +143,7 @@ import {ColorWheel, ColorArea} from '@react-spectrum/color';
142143

143144
<ColorPicker label="Fill" defaultValue="#08f">
144145
<ColorWheel />
145-
<ColorArea
146+
<ColorArea
146147
colorSpace="hsb"
147148
xChannel="saturation"
148149
yChannel="brightness"

packages/@react-spectrum/color/docs/ColorSlider.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ keywords: [color slider]
3535
componentNames={['ColorSlider']}
3636
sourceData={[
3737
{type: 'Spectrum', url: 'https://spectrum.adobe.com/page/color-slider/'}
38-
]} />
38+
]}
39+
since="3.35.0" />
3940

4041
## Example
4142

packages/@react-spectrum/color/docs/ColorSwatch.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ keywords: [color swatch]
3535
componentNames={['ColorSwatch']}
3636
sourceData={[
3737
{type: 'Spectrum', url: 'https://spectrum.adobe.com/page/swatch/'}
38-
]} />
38+
]}
39+
since="3.35.0" />
3940

4041
## Example
4142

packages/@react-spectrum/color/docs/ColorSwatchPicker.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ keywords: [color swatch]
3434
componentNames={['ColorSwatchPicker']}
3535
sourceData={[
3636
{type: 'Spectrum', url: 'https://spectrum.adobe.com/page/swatch-group/'}
37-
]} />
37+
]}
38+
since="3.35.0" />
3839

3940
## Example
4041

packages/@react-spectrum/color/docs/ColorWheel.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ keywords: [color wheel, slider]
3535
componentNames={['ColorWheel']}
3636
sourceData={[
3737
{type: 'Spectrum', url: 'https://spectrum.adobe.com/page/color-wheel/'}
38-
]} />
38+
]}
39+
since="3.35.0" />
3940

4041
## Example
4142

packages/@react-spectrum/dropzone/docs/DropZone.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ category: Drag and drop
3535
<HeaderInfo
3636
packageData={packageData}
3737
componentNames={['DropZone']}
38+
since="3.35.0"
3839
/>
3940

4041
## Example
@@ -340,7 +341,7 @@ function Example() {
340341

341342
A DropZone displays visual feedback to the user when a drag hovers over the drop target by passing the `getDropOperation` function. If a drop target only supports data of specific types (e.g. images, videos, text, etc.), then it should implement the `getDropOperation` prop and return `'cancel'` for types that aren't supported. This will prevent visual feedback indicating that the drop target accepts the dragged data when this is not true. [Read more about getDropOperation.](../react-aria/useDrop.html#getdropoperation)
342343

343-
In the below example, the drop zone only supports dropping JPEG images. If a JPEG is dragged over the drop zone, it will be highlighted and the operating system will display a copy cursor. If another type is dragged over the drop zone, then there is no visual feedback, indicating that a drop is not accepted.
344+
In the below example, the drop zone only supports dropping JPEG images. If a JPEG is dragged over the drop zone, it will be highlighted and the operating system will display a copy cursor. If another type is dragged over the drop zone, then there is no visual feedback, indicating that a drop is not accepted.
344345

345346
```tsx example
346347
import {FileTrigger} from '@adobe/react-spectrum';

packages/@react-spectrum/filetrigger/docs/FileTrigger.mdx

+4-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ category: Buttons
3232

3333
<HeaderInfo
3434
packageData={packageData}
35-
componentNames={['FileTrigger']} />
35+
componentNames={['FileTrigger']}
36+
since="3.35.0" />
3637

3738
## Example
3839

@@ -94,9 +95,9 @@ A file trigger can accept multiple files by passsing the `allowsMultiple` proper
9495

9596
## Directory selection
9697

97-
To enable selecting directories instead of files, use the `acceptDirectory` property.
98+
To enable selecting directories instead of files, use the `acceptDirectory` property.
9899

99-
This reflects the [webkitdirectory](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitdirectory) HTML attribute and allows users to select directories and their contents. Please note that support for this feature varies from browser to browser.
100+
This reflects the [webkitdirectory](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitdirectory) HTML attribute and allows users to select directories and their contents. Please note that support for this feature varies from browser to browser.
100101

101102

102103
```tsx example

packages/@react-spectrum/icon/docs/custom-icons.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ Custom icons can be used by wrapping them in an Icon component.
3232
componentNames={['Icon']}
3333
sourceData={[
3434
{type: 'Spectrum', url: 'https://spectrum.adobe.com/page/iconography/'}
35-
]} />
35+
]}
36+
since="3.0.0" />
3637

3738
## Example
3839

packages/@react-spectrum/s2/stories/CustomDialog.stories.tsx

+7-5
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ const meta: Meta<typeof CustomDialog> = {
2222
layout: 'centered'
2323
},
2424
tags: ['autodocs'],
25-
title: 'CustomDialog',
26-
argTypes: {
27-
padding: {table: {disable: true}}
28-
}
25+
title: 'CustomDialog'
2926
};
3027

3128
export default meta;
@@ -59,7 +56,12 @@ export const EdgeToEdge = (args: any) => (
5956
</DialogTrigger>
6057
);
6158

59+
EdgeToEdge.args = {
60+
padding: 'none'
61+
};
62+
6263
export const Illustration = (args: any) => (
64+
6365
<DialogTrigger>
6466
<ActionButton>Open dialog</ActionButton>
6567
<CustomDialog {...args}>
@@ -82,7 +84,7 @@ export const SideImage = (args: any) => (
8284
<ActionButton>Open dialog</ActionButton>
8385
<CustomDialog padding="none" {...args}>
8486
<div className={style({display: 'flex', size: 'full', flexDirection: {default: 'column', sm: 'row'}})}>
85-
<Image
87+
<Image
8688
alt=""
8789
src={new URL('./assets/preview.png', import.meta.url).toString()}
8890
styles={style({

0 commit comments

Comments
 (0)