Skip to content

Commit

Permalink
Merge branch 'main' into node-22
Browse files Browse the repository at this point in the history
  • Loading branch information
snowystinger authored Feb 26, 2025
2 parents 0a7375a + 5334df7 commit 912e8b6
Show file tree
Hide file tree
Showing 153 changed files with 5,618 additions and 1,503 deletions.
5 changes: 5 additions & 0 deletions .storybook-s2/manager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import {addons} from '@storybook/manager-api';

addons.setConfig({
enableShortcuts: false
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/dist/cjs/document/prepareDocument.js b/dist/cjs/document/prepareDocument.js
index 39a24b8f2ccdc52739d130480ab18975073616cb..0c3f5199401c15b90230c25a02de364eeef3e297 100644
--- a/dist/cjs/document/prepareDocument.js
+++ b/dist/cjs/document/prepareDocument.js
@@ -30,7 +30,7 @@ function prepareDocument(document) {
const initialValue = UI.getInitialValue(el);
if (initialValue !== undefined) {
if (el.value !== initialValue) {
- dispatchEvent.dispatchDOMEvent(el, 'change');
+ el.dispatchEvent(new Event('change'));
}
UI.clearInitialValue(el);
}
diff --git a/dist/cjs/utils/focus/getActiveElement.js b/dist/cjs/utils/focus/getActiveElement.js
index d25f3a8ef67e856e43614559f73012899c0b53d7..4ed9ee45565ed438ee9284d8d3043c0bd50463eb 100644
--- a/dist/cjs/utils/focus/getActiveElement.js
+++ b/dist/cjs/utils/focus/getActiveElement.js
@@ -6,6 +6,8 @@ function getActiveElement(document) {
const activeElement = document.activeElement;
if (activeElement === null || activeElement === undefined ? undefined : activeElement.shadowRoot) {
return getActiveElement(activeElement.shadowRoot);
+ } else if (activeElement && activeElement.tagName === 'IFRAME') {
+ return getActiveElement(activeElement.contentWindow.document);
} else {
// Browser does not yield disabled elements as document.activeElement - jsdom does
if (isDisabled.isDisabled(activeElement)) {
246 changes: 184 additions & 62 deletions examples/rac-tailwind/src/App.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/rsp-cra-18/src/AutocompleteExample.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {UNSTABLE_Autocomplete as Autocomplete, Input, Label, Menu, MenuItem, SearchField, Text, useFilter} from 'react-aria-components'
import {Autocomplete, Input, Label, Menu, MenuItem, SearchField, Text, useFilter} from 'react-aria-components'
import {classNames} from '@react-spectrum/utils';
import styles from './autocomplete.css';

Expand Down
67 changes: 66 additions & 1 deletion examples/rsp-cra-18/src/sections/CollectionExamples.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
import {ActionMenu, Flex, Divider, Item, ListBox, ListView, MenuTrigger, Menu, SubmenuTrigger, ActionButton, TableBody, TableView, Row, Cell, TableHeader, Column, TagGroup} from '@adobe/react-spectrum';
import {
ActionMenu,
Flex,
Divider,
Item,
ListBox,
ListView,
MenuTrigger,
Menu,
SubmenuTrigger,
ActionButton,
TableBody,
TableView,
Row,
Cell,
TableHeader,
Column,
TagGroup,
Text,
TreeView,
TreeViewItem,
TreeViewItemContent
} from '@adobe/react-spectrum';

import FileTxt from '@spectrum-icons/workflow/FileTxt';
import Folder from '@spectrum-icons/workflow/Folder';

export default function CollectionExamples(){
return (
Expand Down Expand Up @@ -92,6 +117,46 @@ export default function CollectionExamples(){
<Item>Gaming</Item>
<Item>Shopping</Item>
</TagGroup>
<div style={{width: '300px', height: '150px', overflow: 'auto'}}>
<TreeView disabledKeys={['projects-1']} aria-label="test static tree">
<TreeViewItem id="Photos" textValue="Photos">
<TreeViewItemContent>
<Text>Photos</Text>
<Folder />
</TreeViewItemContent>
</TreeViewItem>
<TreeViewItem id="projects" textValue="Projects">
<TreeViewItemContent>
<Text>Projects</Text>
<Folder />
</TreeViewItemContent>
<TreeViewItem id="projects-1" textValue="Projects-1">
<TreeViewItemContent>
<Text>Projects-1</Text>
<Folder />
</TreeViewItemContent>
<TreeViewItem id="projects-1A" textValue="Projects-1A">
<TreeViewItemContent>
<Text>Projects-1A</Text>
<FileTxt />
</TreeViewItemContent>
</TreeViewItem>
</TreeViewItem>
<TreeViewItem id="projects-2" textValue="Projects-2">
<TreeViewItemContent>
<Text>Projects-2</Text>
<FileTxt />
</TreeViewItemContent>
</TreeViewItem>
<TreeViewItem id="projects-3" textValue="Projects-3">
<TreeViewItemContent>
<Text>Projects-3</Text>
<FileTxt />
</TreeViewItemContent>
</TreeViewItem>
</TreeViewItem>
</TreeView>
</div>
</Flex>
</>
)
Expand Down
48 changes: 47 additions & 1 deletion examples/rsp-next-ts-17/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ import {
Accordion,
Disclosure,
DisclosureTitle,
DisclosurePanel
DisclosurePanel,
TreeView,
TreeViewItem,
TreeViewItemContent
} from "@adobe/react-spectrum";
import Edit from "@spectrum-icons/workflow/Edit";
import NotFound from "@spectrum-icons/illustrations/NotFound";
Expand All @@ -90,6 +93,9 @@ import ReorderableListView from "../components/ReorderableListView";
import {ToastQueue} from '@react-spectrum/toast';
import {SubmenuTrigger} from "@react-spectrum/menu";

import FileTxt from '@spectrum-icons/workflow/FileTxt';
import Folder from '@spectrum-icons/workflow/Folder';

let nestedItems = [
{foo: 'Lvl 1 Foo 1', bar: 'Lvl 1 Bar 1', baz: 'Lvl 1 Baz 1', childRows: [
{foo: 'Lvl 2 Foo 1', bar: 'Lvl 2 Bar 1', baz: 'Lvl 2 Baz 1', childRows: [
Expand Down Expand Up @@ -238,6 +244,46 @@ export default function Home() {
}
</TableBody>
</TableView>
<div style={{width: '300px', height: '150px', overflow: 'auto'}}>
<TreeView disabledKeys={['projects-1']} aria-label="test static tree">
<TreeViewItem id="Photos" textValue="Photos">
<TreeViewItemContent>
<Text>Photos</Text>
<Folder />
</TreeViewItemContent>
</TreeViewItem>
<TreeViewItem id="projects" textValue="Projects">
<TreeViewItemContent>
<Text>Projects</Text>
<Folder />
</TreeViewItemContent>
<TreeViewItem id="projects-1" textValue="Projects-1">
<TreeViewItemContent>
<Text>Projects-1</Text>
<Folder />
</TreeViewItemContent>
<TreeViewItem id="projects-1A" textValue="Projects-1A">
<TreeViewItemContent>
<Text>Projects-1A</Text>
<FileTxt />
</TreeViewItemContent>
</TreeViewItem>
</TreeViewItem>
<TreeViewItem id="projects-2" textValue="Projects-2">
<TreeViewItemContent>
<Text>Projects-2</Text>
<FileTxt />
</TreeViewItemContent>
</TreeViewItem>
<TreeViewItem id="projects-3" textValue="Projects-3">
<TreeViewItemContent>
<Text>Projects-3</Text>
<FileTxt />
</TreeViewItemContent>
</TreeViewItem>
</TreeViewItem>
</TreeView>
</div>
</Section>

<Section title="Color">
Expand Down
2 changes: 1 addition & 1 deletion examples/rsp-next-ts/components/AutocompleteExample.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {UNSTABLE_Autocomplete as Autocomplete, Input, Label, Menu, MenuItem, SearchField, Text, useFilter} from 'react-aria-components'
import {Autocomplete, Input, Label, Menu, MenuItem, SearchField, Text, useFilter} from 'react-aria-components'
import {classNames} from '@react-spectrum/utils';
import React from 'react';
import styles from './autocomplete.module.css';
Expand Down
49 changes: 48 additions & 1 deletion examples/rsp-next-ts/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ import {
Accordion,
Disclosure,
DisclosureTitle,
DisclosurePanel
DisclosurePanel,
TreeView,
TreeViewItem,
TreeViewItemContent
} from "@adobe/react-spectrum";
import {AutocompleteExample} from "../components/AutocompleteExample";
import Edit from "@spectrum-icons/workflow/Edit";
Expand All @@ -91,6 +94,9 @@ import ReorderableListView from "../components/ReorderableListView";
import {ToastQueue} from '@react-spectrum/toast';
import {SubmenuTrigger} from "@react-spectrum/menu";

import FileTxt from '@spectrum-icons/workflow/FileTxt';
import Folder from '@spectrum-icons/workflow/Folder';

let nestedItems = [
{foo: 'Lvl 1 Foo 1', bar: 'Lvl 1 Bar 1', baz: 'Lvl 1 Baz 1', childRows: [
{foo: 'Lvl 2 Foo 1', bar: 'Lvl 2 Bar 1', baz: 'Lvl 2 Baz 1', childRows: [
Expand Down Expand Up @@ -242,6 +248,47 @@ export default function Home() {
</TableBody>
</TableView>
<AutocompleteExample />

<div style={{width: '300px', height: '150px', overflow: 'auto'}}>
<TreeView disabledKeys={['projects-1']} aria-label="test static tree">
<TreeViewItem id="Photos" textValue="Photos">
<TreeViewItemContent>
<Text>Photos</Text>
<Folder />
</TreeViewItemContent>
</TreeViewItem>
<TreeViewItem id="projects" textValue="Projects">
<TreeViewItemContent>
<Text>Projects</Text>
<Folder />
</TreeViewItemContent>
<TreeViewItem id="projects-1" textValue="Projects-1">
<TreeViewItemContent>
<Text>Projects-1</Text>
<Folder />
</TreeViewItemContent>
<TreeViewItem id="projects-1A" textValue="Projects-1A">
<TreeViewItemContent>
<Text>Projects-1A</Text>
<FileTxt />
</TreeViewItemContent>
</TreeViewItem>
</TreeViewItem>
<TreeViewItem id="projects-2" textValue="Projects-2">
<TreeViewItemContent>
<Text>Projects-2</Text>
<FileTxt />
</TreeViewItemContent>
</TreeViewItem>
<TreeViewItem id="projects-3" textValue="Projects-3">
<TreeViewItemContent>
<Text>Projects-3</Text>
<FileTxt />
</TreeViewItemContent>
</TreeViewItem>
</TreeViewItem>
</TreeView>
</div>
</Section>

<Section title="Color">
Expand Down
45 changes: 44 additions & 1 deletion examples/s2-parcel-example/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,14 @@ import {
TableView,
Text,
ToggleButton,
ToggleButtonGroup
ToggleButtonGroup,
TreeView,
TreeViewItem,
TreeViewItemContent
} from "@react-spectrum/s2";
import Edit from "@react-spectrum/s2/icons/Edit";
import FileTxt from "@react-spectrum/s2/icons/FileText";
import Folder from "@react-spectrum/s2/icons/Folder";
import Section from "./components/Section";
import { style } from "@react-spectrum/s2/style" with { type: "macro" };
import { CardViewExample } from "./components/CardViewExample";
Expand Down Expand Up @@ -205,6 +210,44 @@ function App() {
</Row>
</TableBody>
</TableView>
<TreeView disabledKeys={['projects-1']} aria-label="test static tree">
<TreeViewItem id="Photos" textValue="Photos">
<TreeViewItemContent>
<Text>Photos</Text>
<Folder />
</TreeViewItemContent>
</TreeViewItem>
<TreeViewItem id="projects" textValue="Projects">
<TreeViewItemContent>
<Text>Projects</Text>
<Folder />
</TreeViewItemContent>
<TreeViewItem id="projects-1" textValue="Projects-1">
<TreeViewItemContent>
<Text>Projects-1</Text>
<Folder />
</TreeViewItemContent>
<TreeViewItem id="projects-1A" textValue="Projects-1A">
<TreeViewItemContent>
<Text>Projects-1A</Text>
<FileTxt />
</TreeViewItemContent>
</TreeViewItem>
</TreeViewItem>
<TreeViewItem id="projects-2" textValue="Projects-2">
<TreeViewItemContent>
<Text>Projects-2</Text>
<FileTxt />
</TreeViewItemContent>
</TreeViewItem>
<TreeViewItem id="projects-3" textValue="Projects-3">
<TreeViewItemContent>
<Text>Projects-3</Text>
<FileTxt />
</TreeViewItemContent>
</TreeViewItem>
</TreeViewItem>
</TreeView>
</Section>

{!isLazyLoaded && <ActionButton onPress={() => setLazyLoaded(true)}>Load more</ActionButton>}
Expand Down
45 changes: 44 additions & 1 deletion examples/s2-vite-project/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,14 @@ import {
TableView,
Text,
ToggleButton,
ToggleButtonGroup
ToggleButtonGroup,
TreeView,
TreeViewItem,
TreeViewItemContent
} from "@react-spectrum/s2";
import Edit from "@react-spectrum/s2/icons/Edit";
import FileTxt from "@react-spectrum/s2/icons/FileText";
import Folder from "@react-spectrum/s2/icons/Folder";
import Section from "./components/Section";
import { style } from "@react-spectrum/s2/style" with { type: "macro" };
import { CardViewExample } from "./components/CardViewExample";
Expand Down Expand Up @@ -205,6 +210,44 @@ function App() {
</Row>
</TableBody>
</TableView>
<TreeView disabledKeys={['projects-1']} aria-label="test static tree">
<TreeViewItem id="Photos" textValue="Photos">
<TreeViewItemContent>
<Text>Photos</Text>
<Folder />
</TreeViewItemContent>
</TreeViewItem>
<TreeViewItem id="projects" textValue="Projects">
<TreeViewItemContent>
<Text>Projects</Text>
<Folder />
</TreeViewItemContent>
<TreeViewItem id="projects-1" textValue="Projects-1">
<TreeViewItemContent>
<Text>Projects-1</Text>
<Folder />
</TreeViewItemContent>
<TreeViewItem id="projects-1A" textValue="Projects-1A">
<TreeViewItemContent>
<Text>Projects-1A</Text>
<FileTxt />
</TreeViewItemContent>
</TreeViewItem>
</TreeViewItem>
<TreeViewItem id="projects-2" textValue="Projects-2">
<TreeViewItemContent>
<Text>Projects-2</Text>
<FileTxt />
</TreeViewItemContent>
</TreeViewItem>
<TreeViewItem id="projects-3" textValue="Projects-3">
<TreeViewItemContent>
<Text>Projects-3</Text>
<FileTxt />
</TreeViewItemContent>
</TreeViewItem>
</TreeViewItem>
</TreeView>
</Section>

{!isLazyLoaded && <ActionButton onPress={() => setLazyLoaded(true)}>Load more</ActionButton>}
Expand Down
Loading

0 comments on commit 912e8b6

Please sign in to comment.