Skip to content

Commit 1b72a1d

Browse files
committed
Merge branch 'main' into s2-treeview
# Conflicts: # packages/@react-spectrum/s2/package.json # yarn.lock
2 parents 6b8f9ab + 71f0ef2 commit 1b72a1d

File tree

789 files changed

+10077
-8553
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

789 files changed

+10077
-8553
lines changed

.storybook-s2/docs/Icons.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {highlight} from './highlight' with {type: 'macro'};
66

77
export function Icons() {
88
return (
9-
<div className={style({maxWidth: 'lg', marginX: 'auto'})}>
9+
<div className={style({marginX: 'auto'})}>
1010
<div className={style({marginX: 48})}>
1111
<h1 className={style({font: 'heading-2xl', marginBottom: 48})}>
1212
Workflow icons

.storybook-s2/docs/Illustrations.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { useState } from 'react';
1111
export function Illustrations() {
1212
let [gradientStyle, setStyle] = useState('generic1');
1313
return (
14-
<div className={style({maxWidth: 'lg', marginX: 'auto'})}>
14+
<div className={style({marginX: 'auto'})}>
1515
<div className={style({marginX: 48})}>
1616
<h1 className={style({font: 'heading-2xl', marginBottom: 48})}>
1717
Illustrations

.storybook-s2/docs/Intro.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {H2, H3, H4, P, Pre, Code, Strong, Link} from './typography';
1313

1414
export function Docs() {
1515
return (
16-
<div className={style({maxWidth: 'lg', marginX: 'auto', marginY: 48})}>
16+
<div className={style({marginX: 'auto', marginY: 48})}>
1717
<header
1818
style={{
1919
backgroundImage: `url(${new URL('wallpaper_collaborative_S2_desktop.webp', import.meta.url).toString()})`,

.storybook-s2/docs/MDXLayout.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const mdxComponents = {
1919

2020
export function MDXLayout({children}) {
2121
return (
22-
<div className={style({maxWidth: 'lg', marginX: 'auto'})}>
22+
<div className={style({marginX: 'auto'})}>
2323
<main className={style({marginX: 48})}>
2424
<MDXProvider components={mdxComponents}>
2525
{children}

.storybook-s2/docs/Migrating.jsx

+49-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {P, Code, Pre, H3, H2, Link} from './typography';
33

44
export function Migrating() {
55
return (
6-
<div className={style({maxWidth: 'lg', marginX: 'auto', fontFamily: 'sans'})}>
6+
<div className={style({marginX: 'auto', fontFamily: 'sans'})}>
77
<div className={style({marginX: 48})}>
88
<h1 className={style({font: 'heading-2xl', marginBottom: 48})}>
99
Migrating to Spectrum 2
@@ -34,6 +34,16 @@ export function Migrating() {
3434
<li className={style({font: 'body', marginY: 8})}>Update <Link href="https://react-spectrum.adobe.com/react-spectrum/styling.html#style-props">style props</Link> to use the <Link href="?path=/docs/style-macro--docs">style macro</Link> instead. See the 'Style props' section below</li>
3535
</ul>
3636

37+
<H3>Accordion</H3>
38+
<ul className="sb-unstyled">
39+
<li className={style({font: 'body', marginY: 8})}>Update <Code>Item</Code> to be <Code>Disclosure</Code>. <Code>Disclosure</Code> should now consist of two children: <Code>DisclosureTitle</Code> and <Code>DisclosurePanel</Code>. Note that you can now add interactive elements inside the header and adjacent to the title by using the <Code>DisclosureHeader</Code> component with the <Code>DisclosureTitle</Code> and interactive elements inside.</li>
40+
<li className={style({font: 'body', marginY: 8})}>Update <Code>Item</Code>'s title prop to be a child of <Code>DisclosureTitle</Code></li>
41+
<li className={style({font: 'body', marginY: 8})}>Update children of <Code>Item</Code> to be children of <Code>DisclosurePanel</Code></li>
42+
<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>
43+
<li className={style({font: 'body', marginY: 8})}>Remove <Code>disabledKeys</Code> and add <Code>isDisabled</Code> to individual <Code>Disclosure</Code> components</li>
44+
<li className={style({font: 'body', marginY: 8})}>Add <Code>allowsMultipleExpanded</Code> to allow multiple <Code>Disclosure</Code> components to be expanded at once (previously default behavior)</li>
45+
</ul>
46+
3747
<H3>ActionButton</H3>
3848
<P>No updates needed.</P>
3949

@@ -44,6 +54,19 @@ export function Migrating() {
4454
<li className={style({font: 'body', marginY: 8})}>Update <Code>Item</Code> to be a <Code>MenuItem</Code></li>
4555
</ul>
4656

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+
4770
<H3>AlertDialog</H3>
4871
<P>No updates needed.</P>
4972

@@ -131,14 +154,37 @@ export function Migrating() {
131154
<ul className="sb-unstyled">
132155
<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>
133156
<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>
134171
</ul>
135172

136173
<H3>DialogTrigger</H3>
137174
<ul className="sb-unstyled">
138175
<li className={style({font: 'body', marginY: 8})}>[PENDING] Comment out <Code>type="tray"</Code> (<Code>Tray</Code> has not been implemented yet)</li>
139-
<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>
140177
<li className={style({font: 'body', marginY: 8})}>Remove <Code>targetRef</Code> (it is no longer supported in Spectrum 2)</li>
141178
<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>
142188
</ul>
143189

144190
<H3>Divider</H3>
@@ -458,7 +504,7 @@ export function Migrating() {
458504
<td><Code>'large'</Code></td>
459505
<td><Code>'xl'</Code></td>
460506
</tr>
461-
</tbody>
507+
</tbody>
462508
</table>
463509

464510
<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

.storybook-s2/docs/StyleMacro.jsx

+12-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {Colors} from './Colors';
66

77
export function StyleMacro() {
88
return (
9-
<div className={style({maxWidth: 'lg', marginX: 'auto'})}>
9+
<div className={style({marginX: 'auto'})}>
1010
<header
1111
className={style({
1212
paddingX: 48,
@@ -37,9 +37,17 @@ export function StyleMacro() {
3737
<H3>Colors</H3>
3838
<P>The Spectrum 2 color palette is available across all color properties. See the following sections for color values available for each property.</P>
3939
<Colors />
40-
<H3>Spacing and sizing</H3>
41-
<P>Spacing properties such as <Code>margin</Code> and <Code>padding</Code>, and sizing properties such as <Code>width</Code> and <Code>height</Code> support a limited set of values. The API is represented in pixels, however, only values conforming to a 4px grid are allowed. This helps ensure that spacing and sizing are visually consistent.</P>
42-
<P>Internally, spacing and sizing values are converted from pixels to rems, which scale according to the user’s font size preference. In addition, sizing values are multiplied by 1.25x on touch screen devices to help increase the size of hit targets. Spacing values do not scale and remain fixed.</P>
40+
<H3>Spacing</H3>
41+
<P>Spacing properties such as <Code>margin</Code> and <Code>padding</Code> support a limited set of values. The API is represented in pixels, however, only values conforming to a 4px grid are allowed. This helps ensure that spacing and sizing are visually consistent. Spacing values are automatically converted to rems, which scale according to the user’s font size preference.</P>
42+
<P>In addition to numeric values, the following spacing options are available:</P>
43+
<ul className="sb-unstyled">
44+
<li className={style({font: 'body-lg', marginTop: 0, marginBottom: 8})}><Code>text-to-control</Code> – The default horizontal spacing between text and a UI control, for example between a label and input. This value automatically adjusts based on the font size.</li>
45+
<li className={style({font: 'body-lg', marginTop: 0, marginBottom: 8})}><Code>text-to-visual</Code> – The default horizontal spacing between text and a visual element, such as an icon. This value automatically adjusts based on the font size.</li>
46+
<li className={style({font: 'body-lg', marginTop: 0, marginBottom: 8})}><Code>edge-to-text</Code> – The default horizontal spacing between the edge of a UI control and text within it. This value is calculated relative to the height of the control.</li>
47+
<li className={style({font: 'body-lg', marginTop: 0, marginBottom: 8})}><Code>pill</Code> – The default horizontal spacing between the edge of a pill-shaped UI control (e.g. a fully rounded button) and text within it. This value is calculated relative to the height of the control.</li>
48+
</ul>
49+
<H3>Sizing</H3>
50+
<P>Sizing properties such as <Code>width</Code> and <Code>height</Code> accept arbitrary pixel values. Internally, sizes are converted to rems, which scale according to the user’s font size preference. Additionally, size values are multiplied by 1.25x on touch screen devices to help increase the size of hit targets.</P>
4351
<H3>Typography</H3>
4452
<P>Spectrum 2 does not include specific components for typography. Instead, you can use the style macro to apply Spectrum typography to any HTML element or component.</P>
4553
<P>The <Code>font</Code> shorthand applies default values for the <Code>fontFamily</Code>, <Code>fontSize</Code>, <Code>fontWeight</Code>, <Code>lineHeight</Code>, and <Code>color</Code> properties, following Spectrum design pairings. These individual properties can also be set to override the default set by the shorthand.</P>

examples/rac-spectrum-tailwind/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"@react-spectrum/provider": "^3.9.7",
1313
"@spectrum-icons/illustrations": "^3.6.3",
1414
"@spectrum-icons/workflow": "^4.2.12",
15-
"parcel": "2.0.0-dev.1599",
15+
"parcel": "^2.13.0",
1616
"postcss": "^8.2.1",
1717
"react": "^18.2.0",
1818
"react-aria-components": "^1.0.0-alpha.4",

examples/rac-tailwind/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"@heroicons/react": "^2.0.16",
1212
"@react-aria/parcel-resolver-optimize-locales": "^1.0.0",
1313
"framer-motion": "^10.12.16",
14-
"parcel": "2.0.0-dev.1599",
14+
"parcel": "^2.13.0",
1515
"postcss": "^8.4.21",
1616
"react": "^18.2.0",
1717
"react-aria-components": "^1.0.0-alpha.4",

examples/rsp-cra-18/src/sections/NavigationExamples.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Accordion, Disclosure, DisclosureHeader, DisclosurePanel, Flex, Divider, Breadcrumbs, Item, Link, Tabs, TabList, TabPanels} from '@adobe/react-spectrum';
1+
import {Accordion, Disclosure, DisclosureTitle, DisclosurePanel, Flex, Divider, Breadcrumbs, Item, Link, Tabs, TabList, TabPanels} from '@adobe/react-spectrum';
22

33
export default function NavigationExamples() {
44
return (
@@ -35,25 +35,25 @@ export default function NavigationExamples() {
3535
<h3>Accordion</h3>
3636
<Accordion maxWidth="size-3600">
3737
<Disclosure id="files">
38-
<DisclosureHeader>
38+
<DisclosureTitle>
3939
Files
40-
</DisclosureHeader>
40+
</DisclosureTitle>
4141
<DisclosurePanel>
4242
<p>Files content</p>
4343
</DisclosurePanel>
4444
</Disclosure>
4545
<Disclosure id="people">
46-
<DisclosureHeader>
46+
<DisclosureTitle>
4747
People
48-
</DisclosureHeader>
48+
</DisclosureTitle>
4949
<DisclosurePanel>
5050
<p>People content</p>
5151
</DisclosurePanel>
5252
</Disclosure>
5353
</Accordion>
5454
<h3>Disclosure</h3>
5555
<Disclosure>
56-
<DisclosureHeader>System Requirements</DisclosureHeader>
56+
<DisclosureTitle>System Requirements</DisclosureTitle>
5757
<DisclosurePanel>
5858
<p>Details about system requirements here.</p>
5959
</DisclosurePanel>

0 commit comments

Comments
 (0)