Skip to content

Commit bf8fcf5

Browse files
LFDanLudannify
andauthored
docs: S2 release notes (#7406)
* update s2 release notes * update migrating docs * update release notes * exposing padding prop in CustomDialog docs * add section for docs updates * tensing * updating for ActionGroup codemod * consistency fixes --------- Co-authored-by: Danni <[email protected]>
1 parent d142c4e commit bf8fcf5

File tree

3 files changed

+95
-7
lines changed

3 files changed

+95
-7
lines changed

.storybook-s2/docs/Migrating.jsx

Lines changed: 38 additions & 2 deletions
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

Lines changed: 50 additions & 0 deletions
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/s2/stories/CustomDialog.stories.tsx

Lines changed: 7 additions & 5 deletions
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)