Skip to content

Commit 57da826

Browse files
authored
Merge branch 'main' into 7887-add-shouldSelectOnPressUp-prop-to-GridList
2 parents b05c4fc + 1457ded commit 57da826

File tree

361 files changed

+5392
-4326
lines changed

Some content is hidden

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

361 files changed

+5392
-4326
lines changed

.storybook-s2/docs/Intro.jsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ function App() {
176176
<Provider background="base">
177177
{/* your app */}
178178
</Provider>`)}</Pre>
179+
<H3>Usage with older React Spectrum versions</H3>
180+
<P>See Adobe internal documentation.</P>
179181
<H2>Styling</H2>
180182
<P>React Spectrum v3 supported a limited set of <Link href="https://react-spectrum.adobe.com/react-spectrum/styling.html" target="_blank">style props</Link> for layout and positioning using Spectrum-defined values. In Spectrum 2, we’re improving on this by offering a much more flexible style macro. This offers additional Spectrum tokens, improves performance by generating CSS at build time rather than runtime, and works with any DOM element for use in custom components.</P>
181183
<P><Link href="https://parceljs.org/features/macros/" target="_blank">Macros</Link> are a new bundler feature that enable functions to run at build time. The React Spectrum <Code>style</Code> macro uses this to generate CSS that can be applied to any DOM element or component. Import the <Code>style</Code> macro using the with <Code>{`{type: 'macro'}`}</Code> <Link href="https://github.com/tc39/proposal-import-attributes" target="_blank">import attribute</Link>, and pass the result to the <Code>styles</Code> prop of any React Spectrum component to provide it with styles.</P>
@@ -238,8 +240,12 @@ function YourComponent() {
238240
<Pre>{highlight(`/* YourComponent.css */
239241
.your-unsafe-class {
240242
background: red;
241-
}
242-
`, 'CSS')}</Pre>
243+
}`, 'CSS')}</Pre>
244+
<H3>CSS Resets</H3>
245+
<P>CSS resets are strongly discouraged. Global CSS selectors can unintentionally affect elements that were not intended, leading to style clashes. Since Spectrum 2 uses <Link href="https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Cascade_layers" target="_blank">CSS cascade layers</Link>, global CSS outside a <Code>@layer</Code> will override S2's CSS. Therefore, if you cannot remove your CSS reset, it must be placed in a lower layer. This can be done by declaring your reset layer before the <Code>_</Code> layer used by S2.</P>
246+
<Pre>{highlight(`/* App.css */
247+
@layer reset, _;
248+
@import "reset.css" layer(reset);`)}</Pre>
243249
</main>
244250
</div>
245251
)

.storybook-s2/docs/Migrating.jsx

+6
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,12 @@ export function Migrating() {
411411
<li className={style({font: 'body', marginY: 8})}>Update placement prop to be have one value (i.e. Update <Code>placement="bottom left"</Code> to be <Code>placement="bottom"</Code>)</li>
412412
</ul>
413413

414+
<H3>TreeView</H3>
415+
<P>If migrating from TreeView version 3.0.0-beta.3 or before, please do the following. Otherwise, no updates needed.</P>
416+
<ul className="sb-unstyled">
417+
<li className={style({font: 'body', marginY: 8})}> Update content within <Code>TreeViewItem</Code> to be wrapped in <Code>TreeViewContentItem</Code></li>
418+
</ul>
419+
414420
<H3>View</H3>
415421
<ul className="sb-unstyled">
416422
<li className={style({font: 'body', marginY: 8})}>Update <Code>View</Code> to be a <Code>div</Code> and apply styles using the style macro</li>

.storybook-s2/docs/Release Notes.mdx

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

55
# Release Notes
66

7+
## v0.7.0
8+
9+
### New Components
10+
11+
* [TreeView](?path=/docs/treeview--docs)
12+
13+
### Updates
14+
15+
* [Badge](?path=/docs/badge--docs): Add `overflowMode` prop, fix icon alignment, update typo from `variant="charteuse"` to `variant="chartreuse"`
16+
* [CardView](?path=/docs/cardview--docs): Fix styling when using `renderActionBar`
17+
* Image: Add `fetchPriority` prop
18+
* [Menu](?path=/docs/menu--docs): Fix menu item's focus rings from exceeding popover boundaries
19+
* [Tabs](?path=/docs/tabs--docs): Add collapse behavior
20+
* Remove `all: revert-layer` from style macro generated CSS to fix Safari issues
21+
* Remove references to CSS `flex` shorthand. Please use `flexGrow`, `flexBasis`, and `flexShrink` instead.
22+
23+
### Codemods
24+
25+
* Update S2 icon migration map
26+
* Handle margin/padding shorthands in style props codemod
27+
28+
### Important CSS update
29+
30+
In this release, we have made significant changes to the way our Style Macro generates CSS in order to fix issues with Safari. The Style Macro uses [CSS Cascade Layers](https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Styling_basics/Cascade_layers) to avoid CSS specificity and ordering issues. However, this means global CSS declared outside a `@layer`, such as CSS resets, will take precedence over S2's CSS. To avoid this, we previously used [all: revert-layer](https://developer.mozilla.org/en-US/docs/Web/CSS/revert-layer). Unfortunately, due to numerous bugs in Safari 18, this caused rendering issues in our components.
31+
32+
To fix these Safari issues, we have removed `all: revert-layer` in this release. This means that global CSS will now take precedence over S2's styles. **If you are using a CSS reset on the same page as S2 components, you will need to remove it** or put it in a `@layer` of its own. See [the docs](?path=/docs/intro--docs#css-resets) for more information.
33+
34+
**If you are using a version older than React Spectrum v3 on the same page, you must update to the latest version.** See the Adobe internal documentation for more details.
35+
736
## v0.6.0
837

938
### New Components

.storybook-s2/manager.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import {addons} from '@storybook/manager-api';
2+
3+
addons.setConfig({
4+
enableShortcuts: false
5+
});

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@
235235
"recast": "0.23.6",
236236
"ast-types": "0.16.1",
237237
"svgo": "^3",
238-
"@testing-library/user-event@npm:^14.4.0": "patch:@testing-library/user-event@npm%3A14.6.1#~/.yarn/patches/@testing-library-user-event-npm-14.6.1-5da7e1d4e2.patch"
238+
"@testing-library/user-event": "patch:@testing-library/user-event@npm%3A14.6.1#~/.yarn/patches/@testing-library-user-event-npm-14.6.1-5da7e1d4e2.patch"
239239
},
240240
"@parcel/transformer-css": {
241241
"cssModules": {

packages/@adobe/react-spectrum/package.json

+62-60
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@adobe/react-spectrum",
3-
"version": "3.39.0",
3+
"version": "3.40.1",
44
"description": "Spectrum UI components in React",
55
"license": "Apache-2.0",
66
"main": "dist/main.js",
@@ -38,66 +38,68 @@
3838
},
3939
"dependencies": {
4040
"@internationalized/string": "^3.2.5",
41-
"@react-aria/i18n": "^3.12.5",
41+
"@react-aria/collections": "3.0.0-beta.1",
42+
"@react-aria/i18n": "^3.12.7",
4243
"@react-aria/ssr": "^3.9.7",
43-
"@react-aria/utils": "^3.27.0",
44-
"@react-aria/visually-hidden": "^3.8.19",
45-
"@react-spectrum/accordion": "^3.0.2",
46-
"@react-spectrum/actionbar": "^3.6.3",
47-
"@react-spectrum/actiongroup": "^3.10.11",
48-
"@react-spectrum/avatar": "^3.0.18",
49-
"@react-spectrum/badge": "^3.1.19",
50-
"@react-spectrum/breadcrumbs": "^3.9.13",
51-
"@react-spectrum/button": "^3.16.10",
52-
"@react-spectrum/buttongroup": "^3.6.18",
53-
"@react-spectrum/calendar": "^3.6.0",
54-
"@react-spectrum/checkbox": "^3.9.12",
55-
"@react-spectrum/color": "^3.0.3",
56-
"@react-spectrum/combobox": "^3.14.1",
57-
"@react-spectrum/contextualhelp": "^3.6.17",
58-
"@react-spectrum/datepicker": "^3.12.0",
59-
"@react-spectrum/dialog": "^3.8.17",
60-
"@react-spectrum/divider": "^3.5.19",
61-
"@react-spectrum/dnd": "^3.5.1",
62-
"@react-spectrum/dropzone": "^3.0.7",
63-
"@react-spectrum/filetrigger": "^3.0.7",
64-
"@react-spectrum/form": "^3.7.11",
65-
"@react-spectrum/icon": "^3.8.1",
66-
"@react-spectrum/illustratedmessage": "^3.5.6",
67-
"@react-spectrum/image": "^3.5.7",
68-
"@react-spectrum/inlinealert": "^3.2.11",
69-
"@react-spectrum/labeledvalue": "^3.1.19",
70-
"@react-spectrum/layout": "^3.6.11",
71-
"@react-spectrum/link": "^3.6.13",
72-
"@react-spectrum/list": "^3.9.1",
73-
"@react-spectrum/listbox": "^3.14.1",
74-
"@react-spectrum/menu": "^3.21.1",
75-
"@react-spectrum/meter": "^3.5.6",
76-
"@react-spectrum/numberfield": "^3.9.9",
77-
"@react-spectrum/overlays": "^5.7.1",
78-
"@react-spectrum/picker": "^3.15.5",
79-
"@react-spectrum/progress": "^3.7.12",
80-
"@react-spectrum/provider": "^3.10.1",
81-
"@react-spectrum/radio": "^3.7.12",
82-
"@react-spectrum/searchfield": "^3.8.12",
83-
"@react-spectrum/slider": "^3.7.1",
84-
"@react-spectrum/statuslight": "^3.5.18",
85-
"@react-spectrum/switch": "^3.5.11",
86-
"@react-spectrum/table": "^3.15.1",
87-
"@react-spectrum/tabs": "^3.8.16",
88-
"@react-spectrum/tag": "^3.2.12",
89-
"@react-spectrum/text": "^3.5.11",
90-
"@react-spectrum/textfield": "^3.12.8",
91-
"@react-spectrum/theme-dark": "^3.5.15",
92-
"@react-spectrum/theme-default": "^3.5.15",
93-
"@react-spectrum/theme-light": "^3.4.15",
94-
"@react-spectrum/tooltip": "^3.7.1",
95-
"@react-spectrum/tree": "^3.0.0-beta.3",
96-
"@react-spectrum/view": "^3.6.15",
97-
"@react-spectrum/well": "^3.4.19",
98-
"@react-stately/collections": "^3.12.1",
99-
"@react-stately/data": "^3.12.1",
100-
"@react-types/shared": "^3.27.0",
44+
"@react-aria/utils": "^3.28.1",
45+
"@react-aria/visually-hidden": "^3.8.21",
46+
"@react-spectrum/accordion": "^3.0.4",
47+
"@react-spectrum/actionbar": "^3.6.5",
48+
"@react-spectrum/actiongroup": "^3.10.13",
49+
"@react-spectrum/avatar": "^3.0.20",
50+
"@react-spectrum/badge": "^3.1.21",
51+
"@react-spectrum/breadcrumbs": "^3.9.15",
52+
"@react-spectrum/button": "^3.16.12",
53+
"@react-spectrum/buttongroup": "^3.6.20",
54+
"@react-spectrum/calendar": "^3.6.2",
55+
"@react-spectrum/checkbox": "^3.9.14",
56+
"@react-spectrum/color": "^3.0.5",
57+
"@react-spectrum/combobox": "^3.15.1",
58+
"@react-spectrum/contextualhelp": "^3.6.19",
59+
"@react-spectrum/datepicker": "^3.13.1",
60+
"@react-spectrum/dialog": "^3.8.19",
61+
"@react-spectrum/divider": "^3.5.21",
62+
"@react-spectrum/dnd": "^3.5.3",
63+
"@react-spectrum/dropzone": "^3.0.9",
64+
"@react-spectrum/filetrigger": "^3.0.9",
65+
"@react-spectrum/form": "^3.7.13",
66+
"@react-spectrum/icon": "^3.8.3",
67+
"@react-spectrum/illustratedmessage": "^3.5.8",
68+
"@react-spectrum/image": "^3.5.9",
69+
"@react-spectrum/inlinealert": "^3.2.13",
70+
"@react-spectrum/labeledvalue": "^3.2.1",
71+
"@react-spectrum/layout": "^3.6.13",
72+
"@react-spectrum/link": "^3.6.15",
73+
"@react-spectrum/list": "^3.9.3",
74+
"@react-spectrum/listbox": "^3.14.3",
75+
"@react-spectrum/menu": "^3.21.3",
76+
"@react-spectrum/meter": "^3.5.8",
77+
"@react-spectrum/numberfield": "^3.9.11",
78+
"@react-spectrum/overlays": "^5.7.3",
79+
"@react-spectrum/picker": "^3.15.7",
80+
"@react-spectrum/progress": "^3.7.14",
81+
"@react-spectrum/provider": "^3.10.3",
82+
"@react-spectrum/radio": "^3.7.14",
83+
"@react-spectrum/searchfield": "^3.8.14",
84+
"@react-spectrum/slider": "^3.7.3",
85+
"@react-spectrum/statuslight": "^3.5.20",
86+
"@react-spectrum/switch": "^3.5.13",
87+
"@react-spectrum/table": "^3.16.1",
88+
"@react-spectrum/tabs": "^3.8.18",
89+
"@react-spectrum/tag": "^3.2.14",
90+
"@react-spectrum/text": "^3.5.13",
91+
"@react-spectrum/textfield": "^3.13.1",
92+
"@react-spectrum/theme-dark": "^3.5.16",
93+
"@react-spectrum/theme-default": "^3.5.16",
94+
"@react-spectrum/theme-light": "^3.4.16",
95+
"@react-spectrum/toast": "^3.0.1",
96+
"@react-spectrum/tooltip": "^3.7.3",
97+
"@react-spectrum/tree": "^3.0.1",
98+
"@react-spectrum/view": "^3.6.17",
99+
"@react-spectrum/well": "^3.4.21",
100+
"@react-stately/collections": "^3.12.2",
101+
"@react-stately/data": "^3.12.2",
102+
"@react-types/shared": "^3.28.0",
101103
"client-only": "^0.0.1"
102104
},
103105
"publishConfig": {

packages/@adobe/react-spectrum/src/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export {TextArea, TextField} from '@react-spectrum/textfield';
6161
export {theme as darkTheme} from '@react-spectrum/theme-dark';
6262
export {theme as defaultTheme} from '@react-spectrum/theme-default';
6363
export {theme as lightTheme} from '@react-spectrum/theme-light';
64+
export {ToastContainer, ToastQueue} from '@react-spectrum/toast';
6465
export {Tooltip, TooltipTrigger} from '@react-spectrum/tooltip';
6566
export {TreeView, TreeViewItem, TreeViewItemContent} from '@react-spectrum/tree';
6667
export {Content, Footer, Header, View} from '@react-spectrum/view';
@@ -71,6 +72,7 @@ export {VisuallyHidden} from '@react-aria/visually-hidden';
7172
export {useCollator, useDateFormatter, useFilter, useLocale, useLocalizedStringFormatter, useMessageFormatter, useNumberFormatter} from '@react-aria/i18n';
7273
export {SSRProvider} from '@react-aria/ssr';
7374
export {useDragAndDrop, DIRECTORY_DRAG_TYPE} from '@react-spectrum/dnd';
75+
export {Collection} from '@react-aria/collections';
7476

7577
export type {SpectrumActionBarContainerProps, SpectrumActionBarProps} from '@react-spectrum/actionbar';
7678
export type {SpectrumActionGroupProps} from '@react-spectrum/actiongroup';
@@ -115,6 +117,7 @@ export type {SpectrumTableProps, SpectrumColumnProps, TableHeaderProps, TableBod
115117
export type {SpectrumTabListProps, SpectrumTabPanelsProps, SpectrumTabsProps} from '@react-spectrum/tabs';
116118
export type {SpectrumTagGroupProps} from '@react-spectrum/tag';
117119
export type {SpectrumTextFieldProps, SpectrumTextAreaProps} from '@react-spectrum/textfield';
120+
export type {SpectrumToastContainerProps, SpectrumToastOptions} from '@react-spectrum/toast';
118121
export type {SpectrumTooltipProps, SpectrumTooltipTriggerProps} from '@react-spectrum/tooltip';
119122
export type {SpectrumTreeViewProps, SpectrumTreeViewItemProps, SpectrumTreeViewItemContentProps} from '@react-spectrum/tree';
120123
export type {ContentProps, FooterProps, HeaderProps, ViewProps} from '@react-spectrum/view';

packages/@adobe/spectrum-css-temp/components/checkbox/index.css

+2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ governing permissions and limitations under the License.
6767
opacity: .0001;
6868
z-index: 1;
6969

70+
/* prevent double click event due to browser waiting to fire double tap */
71+
touch-action: manipulation;
7072
cursor: default;
7173

7274
&:disabled {

packages/@adobe/spectrum-css-temp/components/inputgroup/skin.css

+6-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ governing permissions and limitations under the License.
2020
}
2121
}
2222

23+
.spectrum-InputGroup-input:focus {
24+
border-color: var(--spectrum-textfield-border-color);
25+
}
26+
2327
&.is-focused {
2428
&:not(.spectrum-InputGroup--invalid):not(.is-disabled) {
2529
.spectrum-InputGroup-input {
@@ -48,7 +52,8 @@ governing permissions and limitations under the License.
4852

4953
&.spectrum-InputGroup--invalid {
5054
.spectrum-FieldButton:before,
51-
.spectrum-InputGroup-input {
55+
.spectrum-InputGroup-input,
56+
.spectrum-InputGroup-input:focus {
5257
border-color: var(--spectrum-textfield-border-color-error);
5358
}
5459

packages/@adobe/spectrum-css-temp/components/toggle/index.css

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ governing permissions and limitations under the License.
5656
opacity: .0001;
5757
z-index: 1;
5858

59+
/* prevent double click event due to browser waiting to fire double tap */
60+
touch-action: manipulation;
5961
cursor: default;
6062

6163
&:checked + .spectrum-ToggleSwitch-switch {

packages/@react-aria/accordion/README.md

-3
This file was deleted.

packages/@react-aria/accordion/index.ts

-13
This file was deleted.

packages/@react-aria/accordion/package.json

-40
This file was deleted.

packages/@react-aria/accordion/src/index.ts

-14
This file was deleted.

0 commit comments

Comments
 (0)