Skip to content

chore: Rename @react-stately/* to @react-stately-nutrient/* #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion examples/rsp-cra-18/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {Provider, defaultTheme, Item, TagGroup, Cell, Column, Row, TableBody, Ta
import Lighting from './Lighting';
import {useState} from 'react'
import BodyContent from './BodyContent';
import {enableTableNestedRows} from '@react-stately/flags';
import {enableTableNestedRows} from '@react-stately-nutrient/flags';
import ButtonExamples from './sections/ButtonExamples';
import CollectionExamples from './sections/CollectionExamples';
import DateTimeExamples from './sections/DateTimeExamples';
Expand Down
2 changes: 1 addition & 1 deletion examples/rsp-next-ts-17/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { useState } from "react";
import Moon from "@spectrum-icons/workflow/Moon";
import Light from "@spectrum-icons/workflow/Light";
import { ToastContainer } from "@react-spectrum/toast";
import {enableTableNestedRows} from '@react-stately/flags';
import {enableTableNestedRows} from '@react-stately-nutrient/flags';

function MyApp({ Component, pageProps }: AppProps) {
const [theme, setTheme] = useState<ColorScheme>("light");
Expand Down
2 changes: 1 addition & 1 deletion examples/rsp-next-ts/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useState } from "react";
import Moon from "@spectrum-icons/workflow/Moon";
import Light from "@spectrum-icons/workflow/Light";
import { ToastContainer } from "@react-spectrum/toast";
import {enableTableNestedRows} from '@react-stately/flags';
import {enableTableNestedRows} from '@react-stately-nutrient/flags';
import {useRouter, type NextRouter} from 'next/router';
import Script from 'next/script';

Expand Down
2 changes: 1 addition & 1 deletion examples/rsp-webpack-4/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {Provider, defaultTheme, Item, TagGroup, Cell, Column, InlineAlert, Row,
import Lighting from './Lighting';
import {useState} from 'react'
import BodyContent from './BodyContent';
import {enableTableNestedRows} from '@react-stately/flags';
import {enableTableNestedRows} from '@react-stately-nutrient/flags';

let columns = [
{name: 'Foo', key: 'foo'},
Expand Down
4 changes: 2 additions & 2 deletions packages/@adobe/react-spectrum/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@
"@react-spectrum/tree": "^3.0.1",
"@react-spectrum/view": "^3.6.17",
"@react-spectrum/well": "^3.4.21",
"@react-stately/collections": "^3.12.2",
"@react-stately/data": "^3.12.2",
"@react-stately-nutrient/collections": "^3.12.2",
"@react-stately-nutrient/data": "^3.12.2",
"@react-types/shared": "^3.28.0",
"client-only": "^0.0.1"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/@adobe/react-spectrum/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ export {Tooltip, TooltipTrigger} from '@react-spectrum/tooltip';
export {TreeView, TreeViewItem, TreeViewItemContent} from '@react-spectrum/tree';
export {Content, Footer, Header, View} from '@react-spectrum/view';
export {Well} from '@react-spectrum/well';
export {Item, Section} from '@react-stately/collections';
export {useAsyncList, useListData, useTreeData} from '@react-stately/data';
export {Item, Section} from '@react-stately-nutrient/collections';
export {useAsyncList, useListData, useTreeData} from '@react-stately-nutrient/data';
export {VisuallyHidden} from '@react-aria-nutrient/visually-hidden';
export {useCollator, useDateFormatter, useFilter, useLocale, useLocalizedStringFormatter, useMessageFormatter, useNumberFormatter} from '@react-aria-nutrient/i18n';
export {SSRProvider} from '@react-aria-nutrient/ssr';
Expand Down Expand Up @@ -122,7 +122,7 @@ export type {SpectrumTooltipProps, SpectrumTooltipTriggerProps} from '@react-spe
export type {SpectrumTreeViewProps, SpectrumTreeViewItemProps, SpectrumTreeViewItemContentProps} from '@react-spectrum/tree';
export type {ContentProps, FooterProps, HeaderProps, ViewProps} from '@react-spectrum/view';
export type {SpectrumWellProps} from '@react-spectrum/well';
export type {AsyncListData, AsyncListOptions, ListData, ListOptions, TreeData, TreeOptions} from '@react-stately/data';
export type {AsyncListData, AsyncListOptions, ListData, ListOptions, TreeData, TreeOptions} from '@react-stately-nutrient/data';
export type {VisuallyHiddenAria, VisuallyHiddenProps} from '@react-aria-nutrient/visually-hidden';
export type {DateFormatter, DateFormatterOptions, Filter, FormatMessage, Locale, LocalizedStrings} from '@react-aria-nutrient/i18n';
export type {SSRProviderProps} from '@react-aria-nutrient/ssr';
Expand Down
2 changes: 1 addition & 1 deletion packages/@react-aria/actiongroup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@react-aria-nutrient/i18n": "^3.12.7",
"@react-aria-nutrient/interactions": "^3.24.1",
"@react-aria-nutrient/utils": "^3.28.1",
"@react-stately/list": "^3.12.0",
"@react-stately-nutrient/list": "^3.12.0",
"@react-types/actiongroup": "^3.4.15",
"@react-types/shared": "^3.28.0",
"@swc/helpers": "^0.5.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/@react-aria/actiongroup/src/useActionGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {AriaActionGroupProps} from '@react-types/actiongroup';
import {createFocusManager} from '@react-aria-nutrient/focus';
import {DOMAttributes, FocusableElement, Orientation, RefObject} from '@react-types/shared';
import {filterDOMProps, useLayoutEffect} from '@react-aria-nutrient/utils';
import {ListState} from '@react-stately/list';
import {ListState} from '@react-stately-nutrient/list';
import {useLocale} from '@react-aria-nutrient/i18n';
import {useState} from 'react';

Expand Down
2 changes: 1 addition & 1 deletion packages/@react-aria/actiongroup/src/useActionGroupItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

import {DOMAttributes, FocusableElement, Key, RefObject} from '@react-types/shared';
import {ListState} from '@react-stately/list';
import {ListState} from '@react-stately-nutrient/list';
import {mergeProps, useEffectEvent} from '@react-aria-nutrient/utils';
import {PressProps} from '@react-aria-nutrient/interactions';
import {useEffect} from 'react';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {createRef} from 'react';
import {FocusableElement} from '@react-types/shared';
import {renderHook} from '@react-spectrum/test-utils-internal';
import {useActionGroup} from '../';
import {useListState} from '@react-stately/list';
import {useListState} from '@react-stately-nutrient/list';

describe('useActionGroup', function () {
let renderActionGroupHook = (props) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/@react-aria/autocomplete/docs/useAutocomplete.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default Layout;
import docs from 'docs:@react-aria-nutrient/autocomplete';
import {FunctionAPI, HeaderInfo, InterfaceType, TypeContext, TypeLink, PageDescription} from '@react-spectrum/docs';
import packageData from '@react-aria-nutrient/autocomplete/package.json';
import statelyDocs from 'docs:@react-stately/autocomplete';
import statelyDocs from 'docs:@react-stately-nutrient/autocomplete';
import {InlineAlert, Content, Heading} from '@adobe/react-spectrum';

---
Expand Down Expand Up @@ -56,7 +56,7 @@ to filter the collection. `useAutocomplete` handles exposing the correct ARIA at
<InterfaceType properties={docs.links[docs.exports.useAutocomplete.return.base?.id ?? docs.exports.useAutocomplete.return.id].properties} />
</TypeContext.Provider>

State is managed by the <TypeLink links={statelyDocs.links} type={statelyDocs.exports.useAutocompleteState} /> hook from `@react-stately/autocomplete`.
State is managed by the <TypeLink links={statelyDocs.links} type={statelyDocs.exports.useAutocompleteState} /> hook from `@react-stately-nutrient/autocomplete`.
The state object should be passed as an option to `useAutocomplete`.

## Internationalization
Expand Down
14 changes: 7 additions & 7 deletions packages/@react-aria/autocomplete/docs/useSearchAutocomplete.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import {FunctionAPI, HeaderInfo, InterfaceType, TypeContext, TypeLink, PageDescr
import i18nDocs from 'docs:@react-aria-nutrient/i18n';
import overlaysDocs from 'docs:@react-aria-nutrient/overlays';
import packageData from '@react-aria-nutrient/autocomplete/package.json';
import selectionDocs from 'docs:@react-stately/selection';
import statelyDocs from 'docs:@react-stately/combobox';
import selectionDocs from 'docs:@react-stately-nutrient/selection';
import statelyDocs from 'docs:@react-stately-nutrient/combobox';
import Anatomy from './anatomy.svg';
import ChevronRight from '@spectrum-icons/workflow/ChevronRight';
import {ExampleCard} from '@react-spectrum/docs/src/ExampleCard';
Expand Down Expand Up @@ -83,7 +83,7 @@ with [useListBox](useListBox.html), which handles the implementation of the popu
<InterfaceType properties={docs.links[docs.exports.useSearchAutocomplete.return.base?.id ?? docs.exports.useSearchAutocomplete.return.id].properties} />
</TypeContext.Provider>

State is managed by the <TypeLink links={statelyDocs.links} type={statelyDocs.exports.useComboBoxState} /> hook from `@react-stately/combobox`.
State is managed by the <TypeLink links={statelyDocs.links} type={statelyDocs.exports.useComboBoxState} /> hook from `@react-stately-nutrient/combobox`.
The state object should be passed as an option to `useSearchAutocomplete`.

If the search field does not have a visible label, an `aria-label` or `aria-labelledby` prop must be provided instead to
Expand All @@ -96,7 +96,7 @@ navigation and other interactions. It does this using the <TypeLink links={colle
interface, which is a generic interface to access sequential unique keyed data. You can
implement this interface yourself, e.g. by using a prop to pass a list of item objects,
but <TypeLink links={statelyDocs.links} type={statelyDocs.exports.useComboBoxState} /> from
`@react-stately/combobox` implements a JSX based interface for building collections instead.
`@react-stately-nutrient/combobox` implements a JSX based interface for building collections instead.
See [Collection Components](/react-stately/collections.html) for more information,
and [Collection Interface](/react-stately/Collection.html) for internal details.

Expand All @@ -122,9 +122,9 @@ In addition, see [useListBox](useListBox.html) for examples of sections (option
options.

```tsx example export=true
import {Item} from '@react-stately/collections';
import {Item} from '@react-stately-nutrient/collections';
import {useButton} from '@react-aria-nutrient/button';
import {useComboBoxState} from '@react-stately/combobox'
import {useComboBoxState} from '@react-stately-nutrient/combobox'
import {useSearchAutocomplete} from '@react-aria-nutrient/autocomplete';
import {useFilter} from '@react-aria-nutrient/i18n';

Expand Down Expand Up @@ -543,7 +543,7 @@ and filtering of data from a server. You may additionally want to display a spin
state to the user, or support features like infinite scroll to load more data.

```tsx example
import {useAsyncList} from '@react-stately/data';
import {useAsyncList} from '@react-stately-nutrient/data';

function AsyncLoadingExample() {
let list = useAsyncList({
Expand Down
4 changes: 2 additions & 2 deletions packages/@react-aria/autocomplete/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"@react-aria-nutrient/searchfield": "^3.8.2",
"@react-aria-nutrient/textfield": "^3.17.1",
"@react-aria-nutrient/utils": "^3.28.1",
"@react-stately/autocomplete": "3.0.0-beta.0",
"@react-stately/combobox": "^3.10.3",
"@react-stately-nutrient/autocomplete": "3.0.0-beta.0",
"@react-stately-nutrient/combobox": "^3.10.3",
"@react-types/autocomplete": "3.0.0-alpha.29",
"@react-types/button": "^3.11.0",
"@react-types/shared": "^3.28.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@react-aria/autocomplete/src/useAutocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import {AriaLabelingProps, BaseEvent, DOMProps, RefObject} from '@react-types/shared';
import {AriaTextFieldProps} from '@react-aria-nutrient/textfield';
import {AutocompleteProps, AutocompleteState} from '@react-stately/autocomplete';
import {AutocompleteProps, AutocompleteState} from '@react-stately-nutrient/autocomplete';
import {CLEAR_FOCUS_EVENT, FOCUS_EVENT, getActiveElement, getOwnerDocument, isCtrlKeyPressed, mergeProps, mergeRefs, useEffectEvent, useId, useLabels, useObjectRef} from '@react-aria-nutrient/utils';
import {dispatchVirtualBlur, dispatchVirtualFocus, moveVirtualFocus} from '@react-aria-nutrient/focus';
import {getInteractionModality} from '@react-aria-nutrient/interactions';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import {AriaButtonProps} from '@react-types/button';
import {AriaListBoxOptions} from '@react-aria-nutrient/listbox';
import {AriaSearchAutocompleteProps} from '@react-types/autocomplete';
import {ComboBoxState} from '@react-stately/combobox';
import {ComboBoxState} from '@react-stately-nutrient/combobox';
import {DOMAttributes, KeyboardDelegate, LayoutDelegate, RefObject, ValidationResult} from '@react-types/shared';
import {InputHTMLAttributes} from 'react';
import {mergeProps} from '@react-aria-nutrient/utils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
* governing permissions and limitations under the License.
*/

import {Item} from '@react-stately/collections';
import {Item} from '@react-stately-nutrient/collections';
import React from 'react';
import {renderHook} from '@react-spectrum/test-utils-internal';
import {useComboBoxState} from '@react-stately/combobox';
import {useComboBoxState} from '@react-stately-nutrient/combobox';
import {useSearchAutocomplete} from '../';

describe('useSearchAutocomplete', function () {
Expand Down
6 changes: 3 additions & 3 deletions packages/@react-aria/button/docs/useToggleButton.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {Layout} from '@react-spectrum/docs';
export default Layout;

import docs from 'docs:@react-aria-nutrient/button';
import statelyDocs from 'docs:@react-stately/toggle';
import statelyDocs from 'docs:@react-stately-nutrient/toggle';
import {HeaderInfo, FunctionAPI, TypeContext, InterfaceType, TypeLink, PageDescription} from '@react-spectrum/docs';
import {Keyboard} from '@react-spectrum/text';
import packageData from '@react-aria-nutrient/button/package.json';
Expand Down Expand Up @@ -62,7 +62,7 @@ whether the user is currently pressing the button:
</TypeContext.Provider>

Selection state is managed by the <TypeLink links={statelyDocs.links} type={statelyDocs.exports.useToggleState} />
hook in `@react-stately/toggle`. The state object should be passed as an option to `useToggleButton`.
hook in `@react-stately-nutrient/toggle`. The state object should be passed as an option to `useToggleButton`.

If a visual label is not provided (e.g. an icon only button), then an `aria-label` or
`aria-labelledby` prop must be passed to identify the button to assistive technology.
Expand All @@ -80,7 +80,7 @@ In addition, the `isPressed` state is used to adjust the background to be darker
```tsx example export=true
import {useRef} from 'react';
import {useToggleButton} from '@react-aria-nutrient/button';
import {useToggleState} from '@react-stately/toggle';
import {useToggleState} from '@react-stately-nutrient/toggle';

function ToggleButton(props) {
let ref = useRef<HTMLButtonElement | null>(null);
Expand Down
8 changes: 4 additions & 4 deletions packages/@react-aria/button/docs/useToggleButtonGroup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {Layout} from '@react-spectrum/docs';
export default Layout;

import docs from 'docs:@react-aria-nutrient/button';
import statelyDocs from 'docs:@react-stately/toggle';
import statelyDocs from 'docs:@react-stately-nutrient/toggle';
import {HeaderInfo, FunctionAPI, TypeContext, InterfaceType, TypeLink, PageDescription} from '@react-spectrum/docs';
import {Keyboard} from '@react-spectrum/text';
import packageData from '@react-aria-nutrient/button/package.json';
Expand Down Expand Up @@ -66,7 +66,7 @@ A toggle button group consists of a set of toggle buttons, and coordinates the s
</TypeContext.Provider>

Selection state is managed by the <TypeLink links={statelyDocs.links} type={statelyDocs.exports.useToggleGroupState} />
hook in `@react-stately/toggle`. The state object should be passed as an option to `useToggleButtonGroup`
hook in `@react-stately-nutrient/toggle`. The state object should be passed as an option to `useToggleButtonGroup`
and `useToggleButtonGroupItem`.

**Note:** `useToggleButtonGroupItem` should only be used when it is contained within a toggle button group. For a
Expand All @@ -76,9 +76,9 @@ standalone toggle button, use the [useToggleButton](useToggleButton.html) hook i

```tsx example export=true
import type {AriaToggleButtonGroupProps, AriaToggleButtonGroupItemProps} from '@react-aria-nutrient/button';
import type {ToggleGroupState} from '@react-stately/toggle';
import type {ToggleGroupState} from '@react-stately-nutrient/toggle';
import {useToggleButtonGroup, useToggleButtonGroupItem} from '@react-aria-nutrient/button';
import {useToggleGroupState} from '@react-stately/toggle';
import {useToggleGroupState} from '@react-stately-nutrient/toggle';

interface ToggleButtonGroupProps extends AriaToggleButtonGroupProps {
children: React.ReactNode
Expand Down
2 changes: 1 addition & 1 deletion packages/@react-aria/button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@react-aria-nutrient/interactions": "^3.24.1",
"@react-aria-nutrient/toolbar": "3.0.0-beta.14",
"@react-aria-nutrient/utils": "^3.28.1",
"@react-stately/toggle": "^3.8.2",
"@react-stately-nutrient/toggle": "^3.8.2",
"@react-types/button": "^3.11.0",
"@react-types/shared": "^3.28.0",
"@swc/helpers": "^0.5.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/@react-aria/button/src/useToggleButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {AriaToggleButtonProps} from '@react-types/button';
import {ButtonAria, useButton} from './useButton';
import {chain, mergeProps} from '@react-aria-nutrient/utils';
import {DOMAttributes} from '@react-types/shared';
import {ToggleState} from '@react-stately/toggle';
import {ToggleState} from '@react-stately-nutrient/toggle';

export interface AriaToggleButtonOptions<E extends ElementType> extends Omit<AriaToggleButtonProps<E>, 'children'> {}

Expand Down
2 changes: 1 addition & 1 deletion packages/@react-aria/button/src/useToggleButtonGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
import {AriaLabelingProps, DOMAttributes, Orientation, RefObject} from '@react-types/shared';
import {AriaToggleButtonGroupItemProps} from '@react-types/button';
import {ToggleButtonAria, useToggleButton} from './useToggleButton';
import {ToggleGroupProps, ToggleGroupState, ToggleState} from '@react-stately/toggle';
import {ToggleGroupProps, ToggleGroupState, ToggleState} from '@react-stately-nutrient/toggle';
import {useToolbar} from '@react-aria-nutrient/toolbar';

export interface AriaToggleButtonGroupProps extends ToggleGroupProps, AriaLabelingProps {
Expand Down
8 changes: 4 additions & 4 deletions packages/@react-aria/calendar/docs/useCalendar.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {Layout} from '@react-spectrum/docs';
export default Layout;

import docs from 'docs:@react-aria-nutrient/calendar';
import statelyDocs from 'docs:@react-stately/calendar';
import statelyDocs from 'docs:@react-stately-nutrient/calendar';
import i18nDocs from 'docs:@internationalized/date';
import {FunctionAPI, HeaderInfo, InterfaceType, TypeContext, TypeLink, PageDescription} from '@react-spectrum/docs';
import packageData from '@react-aria-nutrient/calendar/package.json';
Expand Down Expand Up @@ -85,7 +85,7 @@ A calendar consists of a grouping element containing one or more date grids (e.g
<InterfaceType properties={docs.links[docs.exports.useCalendarCell.return.id].properties} />
</TypeContext.Provider>

State is managed by the <TypeLink links={statelyDocs.links} type={statelyDocs.exports.useCalendarState} /> hook from `@react-stately/calendar`. The state object should be passed as an option to `useCalendar`, `useCalendarGrid`, and `useCalendarCell`.
State is managed by the <TypeLink links={statelyDocs.links} type={statelyDocs.exports.useCalendarState} /> hook from `@react-stately-nutrient/calendar`. The state object should be passed as an option to `useCalendar`, `useCalendarGrid`, and `useCalendarCell`.

Note that much of this anatomy is shared with [range calendars](useRangeCalendar.html). The only difference is that `useCalendarState` is used instead of `useRangeCalendarState`, and `useCalendar` is used instead of `useRangeCalendar`.

Expand All @@ -104,7 +104,7 @@ A `Calendar` consists of three components: the main calendar wrapper element wit
For simplicity, this example only displays a single month at a time. See the [styled examples](#styled-examples) section for more examples with multiple months, as well as other time ranges like weeks.

```tsx example render=false export=true
import {useCalendarState} from '@react-stately/calendar';
import {useCalendarState} from '@react-stately-nutrient/calendar';
import {useCalendar} from '@react-aria-nutrient/calendar';
import {useLocale} from '@react-aria-nutrient/i18n';
import {createCalendar} from '@internationalized/date';
Expand Down Expand Up @@ -545,7 +545,7 @@ By default, this includes [all calendar systems](../internationalized/date/Calen
For example, if your application only supports Gregorian dates, you could implement a `createCalendar` function like this:

```jsx
import {useCalendarState} from '@react-stately/datepicker';
import {useCalendarState} from '@react-stately-nutrient/datepicker';
import {useLocale} from '@react-aria-nutrient/i18n';
import {GregorianCalendar} from '@internationalized/date';

Expand Down
Loading