From 42e64d99995353a091ba14c18b1099d0ddb0b6ce Mon Sep 17 00:00:00 2001
From: Yihui Liao <44729383+yihuiliao@users.noreply.github.com>
Date: Wed, 22 Oct 2025 16:33:50 -0700
Subject: [PATCH 01/14] docs: add non-component hook docs
---
.../dev/s2-docs/pages/react-aria/useFocus.mdx | 85 ++++++++++
.../pages/react-aria/useFocusVisible.mdx | 78 +++++++++
.../pages/react-aria/useFocusWithin.mdx | 102 ++++++++++++
.../dev/s2-docs/pages/react-aria/useHover.mdx | 114 ++++++++++++++
.../s2-docs/pages/react-aria/useKeyboard.mdx | 83 ++++++++++
.../s2-docs/pages/react-aria/useLandmark.mdx | 109 +++++++++++++
.../s2-docs/pages/react-aria/useLongPress.mdx | 113 +++++++++++++
.../dev/s2-docs/pages/react-aria/useMove.mdx | 149 ++++++++++++++++++
.../dev/s2-docs/pages/react-aria/usePress.mdx | 112 +++++++++++++
packages/dev/s2-docs/src/FunctionAPI.tsx | 34 ++++
10 files changed, 979 insertions(+)
create mode 100644 packages/dev/s2-docs/pages/react-aria/useFocus.mdx
create mode 100644 packages/dev/s2-docs/pages/react-aria/useFocusVisible.mdx
create mode 100644 packages/dev/s2-docs/pages/react-aria/useFocusWithin.mdx
create mode 100644 packages/dev/s2-docs/pages/react-aria/useHover.mdx
create mode 100644 packages/dev/s2-docs/pages/react-aria/useKeyboard.mdx
create mode 100644 packages/dev/s2-docs/pages/react-aria/useLandmark.mdx
create mode 100644 packages/dev/s2-docs/pages/react-aria/useLongPress.mdx
create mode 100644 packages/dev/s2-docs/pages/react-aria/useMove.mdx
create mode 100644 packages/dev/s2-docs/pages/react-aria/usePress.mdx
create mode 100644 packages/dev/s2-docs/src/FunctionAPI.tsx
diff --git a/packages/dev/s2-docs/pages/react-aria/useFocus.mdx b/packages/dev/s2-docs/pages/react-aria/useFocus.mdx
new file mode 100644
index 00000000000..7d750bb41f3
--- /dev/null
+++ b/packages/dev/s2-docs/pages/react-aria/useFocus.mdx
@@ -0,0 +1,85 @@
+{/* Copyright 2025 Adobe. All rights reserved.
+This file is licensed to you under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License. You may obtain a copy
+of the License at http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software distributed under
+the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
+OF ANY KIND, either express or implied. See the License for the specific language
+governing permissions and limitations under the License. */}
+
+import {Layout} from '../../src/Layout';
+export default Layout;
+import {GroupedPropTable} from '../../src/PropTable';
+import {FunctionAPI} from '../../src/FunctionAPI';
+import docs from 'docs:@react-aria/interactions';
+export const section = 'Hooks';
+export const description = 'Implementing collections in React Aria';
+
+# useFocus
+
+
+## API
+
+
Example region with no focusable children.
+
+ {name}
+
+
+
+
+ {': '}
+
+
+ );
+}
\ No newline at end of file
From c76fdf656b3b917e4e19fb16eaf82c4a8feffa5b Mon Sep 17 00:00:00 2001
From: Yihui Liao <44729383+yihuiliao@users.noreply.github.com>
Date: Thu, 23 Oct 2025 13:38:00 -0700
Subject: [PATCH 02/14] add useClipboard
---
.../s2-docs/pages/react-aria/useClipboard.mdx | 481 ++++++++++++++++++
1 file changed, 481 insertions(+)
create mode 100644 packages/dev/s2-docs/pages/react-aria/useClipboard.mdx
diff --git a/packages/dev/s2-docs/pages/react-aria/useClipboard.mdx b/packages/dev/s2-docs/pages/react-aria/useClipboard.mdx
new file mode 100644
index 00000000000..015c3f7b50f
--- /dev/null
+++ b/packages/dev/s2-docs/pages/react-aria/useClipboard.mdx
@@ -0,0 +1,481 @@
+{/* Copyright 2025 Adobe. All rights reserved.
+This file is licensed to you under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License. You may obtain a copy
+of the License at http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software distributed under
+the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
+OF ANY KIND, either express or implied. See the License for the specific language
+governing permissions and limitations under the License. */}
+
+import {Layout} from '../../src/Layout';
+export default Layout;
+import {GroupedPropTable} from '../../src/PropTable';
+import {FunctionAPI} from '../../src/FunctionAPI';
+import docs from 'docs:@react-aria/dnd';
+export const section = 'Hooks';
+export const description = 'Implementing collections in React Aria';
+
+# useClipboard
+
+## API
+
++ {result === 0 + ? 'The strings are the same' + : result < 0 + ? 'First comes before second' + : 'Second comes before first' + } +
+ > + ); +} +``` diff --git a/packages/dev/s2-docs/pages/react-aria/useDateFormatter.mdx b/packages/dev/s2-docs/pages/react-aria/useDateFormatter.mdx new file mode 100644 index 00000000000..abb2daa8e51 --- /dev/null +++ b/packages/dev/s2-docs/pages/react-aria/useDateFormatter.mdx @@ -0,0 +1,58 @@ +{/* Copyright 2025 Adobe. All rights reserved. +This file is licensed to you under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. You may obtain a copy +of the License at http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +OF ANY KIND, either express or implied. See the License for the specific language +governing permissions and limitations under the License. */} + +import {Layout} from '../../src/Layout'; +export default Layout; +import {GroupedPropTable} from '../../src/PropTable'; +import {FunctionAPI} from '../../src/FunctionAPI'; +import docs from 'docs:@react-aria/i18n'; + +export const section = 'Internationalization'; +export const description = 'Implementing collections in React Aria'; + +# useDateFormatter + +## Introduction + +`useDateFormatter` wraps a builtin browser [Intl.DateTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) +object to provide a React Hook that integrates with the i18n system in React Aria. It handles formatting dates for the current locale, +updating when the locale changes, and caching of date formatters for performance. See the +[Intl.DateTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) docs for +information on formatting options. + +## API + +{formatter.format(new Date())}
+ ); +} + +<> +
- {name}
-
-
-
-
- {': '}
-
-
+
+ {name}
+
+
+
+
+ {': '}
+
+
);
-}
\ No newline at end of file
+}
From 844f2a5eae8f819691aa836fa42c16c32d4129aa Mon Sep 17 00:00:00 2001
From: Yihui Liao <44729383+yihuiliao@users.noreply.github.com>
Date: Tue, 28 Oct 2025 16:47:17 -0700
Subject: [PATCH 11/14] actually fix lint
---
packages/dev/s2-docs/src/FunctionAPI.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/dev/s2-docs/src/FunctionAPI.tsx b/packages/dev/s2-docs/src/FunctionAPI.tsx
index 4bbe132fb92..e6a7e272364 100644
--- a/packages/dev/s2-docs/src/FunctionAPI.tsx
+++ b/packages/dev/s2-docs/src/FunctionAPI.tsx
@@ -10,9 +10,9 @@
* governing permissions and limitations under the License.
*/
+import {styles as codeStyles} from './Code';
import {Indent, JoinList, setLinks, Type, TypeParameters} from './types';
import React from 'react';
-import {styles as codeStyles} from './Code';
export function FunctionAPI({function: func, links}) {
let {name, parameters, return: returnType, typeParameters} = func;
From 8fff5ce7c0e360fdde207c31b5a235ce34caa2e1 Mon Sep 17 00:00:00 2001
From: Yihui Liao <44729383+yihuiliao@users.noreply.github.com>
Date: Tue, 28 Oct 2025 16:47:31 -0700
Subject: [PATCH 12/14] remove console log
---
packages/dev/s2-docs/src/ClassAPI.tsx | 1 -
1 file changed, 1 deletion(-)
diff --git a/packages/dev/s2-docs/src/ClassAPI.tsx b/packages/dev/s2-docs/src/ClassAPI.tsx
index 457b50d39f1..8d837a3e283 100644
--- a/packages/dev/s2-docs/src/ClassAPI.tsx
+++ b/packages/dev/s2-docs/src/ClassAPI.tsx
@@ -7,7 +7,6 @@ interface ClassAPIProps {
}
export function ClassAPI({class: c, links}: ClassAPIProps) {
- console.log('c', c);
setLinks(links);
return (