Skip to content

Commit b4695c8

Browse files
authored
docs: March release notes (#7845)
1 parent 4d3c72c commit b4695c8

File tree

8 files changed

+388
-5
lines changed

8 files changed

+388
-5
lines changed

.storybook-s2/docs/Intro.jsx

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

Lines changed: 6 additions & 0 deletions
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

Lines changed: 29 additions & 0 deletions
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

packages/@react-aria/autocomplete/docs/useAutocomplete.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {InlineAlert, Content, Heading} from '@adobe/react-spectrum';
1919
---
2020
category: Pickers
2121
keywords: [autocomplete, autosuggest, typeahead, search, aria]
22-
after_version: 3.0.0
22+
preRelease: beta
2323
---
2424

2525
# useAutocomplete

packages/@react-stately/autocomplete/docs/useAutocompleteState.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ export default Layout;
1313
import docs from 'docs:@react-stately/autocomplete';
1414
import {ClassAPI, HeaderInfo, FunctionAPI, PageDescription} from '@react-spectrum/docs';
1515
import packageData from '@react-stately/autocomplete/package.json';
16+
import {InlineAlert, Content, Heading} from '@adobe/react-spectrum';
1617

1718
---
1819
category: Pickers
1920
keywords: [autocomplete, state]
20-
after_version: 3.0.0-alpha.0
21+
preRelease: beta
2122
---
2223

2324
# useAutocompleteState
@@ -28,6 +29,11 @@ after_version: 3.0.0-alpha.0
2829
packageData={packageData}
2930
componentNames={['useAutocompleteState']} />
3031

32+
<InlineAlert variant="notice" marginTop={60}>
33+
<Heading>Under construction</Heading>
34+
<Content>This hook is in <strong>beta</strong>. More documentation is coming soon!</Content>
35+
</InlineAlert>
36+
3137
## API
3238

3339
<FunctionAPI function={docs.exports.useAutocompleteState} links={docs.links} />
Loading

0 commit comments

Comments
 (0)