diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index c1ab3fb655..1dd0be6297 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -10,9 +10,14 @@ description: All notable changes will be documented in this file. - **ColorPicker**: Added support for `invalid` and `openAutoFocus` props. +- ### Changed + +- **Environment**: Deprecated `EnvironmentContext` in favor of `UseEnvironmentContext`. + ### Fixed - **Presence, Collapsible**: Resolved a potential memory leak occurring after component unmount. +- **Environment**: Exported `EnvironmentContext` ## [4.4.4] - 2024-11-18 diff --git a/packages/react/src/providers/environment/examples/basic.tsx b/packages/react/src/providers/environment/examples/basic.tsx index 3b1665d676..b3765f3f48 100644 --- a/packages/react/src/providers/environment/examples/basic.tsx +++ b/packages/react/src/providers/environment/examples/basic.tsx @@ -1,5 +1,5 @@ +import { EnvironmentProvider } from '@ark-ui/react/environment' import Frame from 'react-frame-component' -import { EnvironmentProvider } from '../' import { Usage } from './usage' export const Basic = () => { diff --git a/packages/react/src/providers/environment/examples/setup.tsx b/packages/react/src/providers/environment/examples/setup.tsx index 3b27d1c655..9f9979916c 100644 --- a/packages/react/src/providers/environment/examples/setup.tsx +++ b/packages/react/src/providers/environment/examples/setup.tsx @@ -1,5 +1,5 @@ +import { EnvironmentProvider } from '@ark-ui/react/environment' import Frame from 'react-frame-component' -import { EnvironmentProvider } from '../' export const App = () => { return ( diff --git a/packages/react/src/providers/environment/examples/shadow-root.tsx b/packages/react/src/providers/environment/examples/shadow-root.tsx index 022ecc7cd7..1d1c6083df 100644 --- a/packages/react/src/providers/environment/examples/shadow-root.tsx +++ b/packages/react/src/providers/environment/examples/shadow-root.tsx @@ -1,7 +1,6 @@ +import { EnvironmentProvider, useEnvironmentContext } from '@ark-ui/react/environment' +import { Portal } from '@ark-ui/react/portal' import { useEffect, useState } from 'react' -import { EnvironmentProvider, useEnvironmentContext } from '../' -import { Portal } from '../../../components' -import { Basic } from '../../../components/tooltip/examples/basic' export const ShadowRoot = () => { const [ref, setRef] = useState(null) @@ -28,7 +27,6 @@ const PrintEnvironment = () => { return (
{JSON.stringify(getRootNode(), null, 2)}
-
) } diff --git a/packages/react/src/providers/environment/examples/usage.tsx b/packages/react/src/providers/environment/examples/usage.tsx index acfc836b41..45823cf566 100644 --- a/packages/react/src/providers/environment/examples/usage.tsx +++ b/packages/react/src/providers/environment/examples/usage.tsx @@ -1,4 +1,4 @@ -import { useEnvironmentContext } from '../use-environment-context' +import { useEnvironmentContext } from '@ark-ui/react/environment' export const Usage = () => { const { getRootNode } = useEnvironmentContext() diff --git a/packages/react/src/providers/environment/index.ts b/packages/react/src/providers/environment/index.ts index ac2d0d756d..ec1d6d282b 100644 --- a/packages/react/src/providers/environment/index.ts +++ b/packages/react/src/providers/environment/index.ts @@ -1,6 +1,10 @@ export { EnvironmentProvider, type EnvironmentProviderProps } from './environment-provider' export { useEnvironmentContext, - type EnvironmentContext, + type UseEnvironmentContext, + /** + * @deprecated Use `UseEnvironmentContext` instead. + */ + type UseEnvironmentContext as EnvironmentContext, type RootNode, } from './use-environment-context' diff --git a/packages/react/src/providers/environment/use-environment-context.ts b/packages/react/src/providers/environment/use-environment-context.ts index b78d6e25b8..cb69b6b2f7 100644 --- a/packages/react/src/providers/environment/use-environment-context.ts +++ b/packages/react/src/providers/environment/use-environment-context.ts @@ -2,7 +2,7 @@ import { createContext } from '../../utils/create-context' export type RootNode = ShadowRoot | Document | Node -export interface EnvironmentContext { +export interface UseEnvironmentContext { /** * The root node of the application. * This is used to determine the window and document objects. @@ -19,7 +19,7 @@ export interface EnvironmentContext { } export const [EnvironmentContextProvider, useEnvironmentContext] = - createContext({ + createContext({ name: 'EnvironmentContext', hookName: 'useEnvironmentContext', providerName: '', diff --git a/packages/solid/CHANGELOG.md b/packages/solid/CHANGELOG.md index abda7c29eb..c5c4149f9c 100644 --- a/packages/solid/CHANGELOG.md +++ b/packages/solid/CHANGELOG.md @@ -10,6 +10,10 @@ description: All notable changes will be documented in this file. - **ColorPicker**: Added support for `invalid` and `openAutoFocus` props. +- ### Changed + +- **Environment**: Deprecated `EnvironmentContext` in favor of `UseEnvironmentContext`. + ### Fixed - **Presence, Collapsible**: Resolved a potential memory leak occurring after component unmount. diff --git a/packages/solid/src/providers/environment/examples/basic.tsx b/packages/solid/src/providers/environment/examples/basic.tsx index 8fc63c103e..506b9b6cb8 100644 --- a/packages/solid/src/providers/environment/examples/basic.tsx +++ b/packages/solid/src/providers/environment/examples/basic.tsx @@ -1,4 +1,4 @@ -import { EnvironmentProvider } from '../..' +import { EnvironmentProvider } from '@ark-ui/solid/environment' import { Usage } from './usage' export const Basic = () => ( diff --git a/packages/solid/src/providers/environment/examples/setup.tsx b/packages/solid/src/providers/environment/examples/setup.tsx index 3d571ef4e3..10697abbc4 100644 --- a/packages/solid/src/providers/environment/examples/setup.tsx +++ b/packages/solid/src/providers/environment/examples/setup.tsx @@ -1,4 +1,4 @@ -import { EnvironmentProvider } from '../..' +import { EnvironmentProvider } from '@ark-ui/solid/environment' export const App = () => { return ( diff --git a/packages/solid/src/providers/environment/index.tsx b/packages/solid/src/providers/environment/index.tsx index ac2d0d756d..e6cd1093fd 100644 --- a/packages/solid/src/providers/environment/index.tsx +++ b/packages/solid/src/providers/environment/index.tsx @@ -1,6 +1,10 @@ export { EnvironmentProvider, type EnvironmentProviderProps } from './environment-provider' export { useEnvironmentContext, - type EnvironmentContext, + /** + * @deprecated Use `UseEnvironmentContext` instead. + */ + type UseEnvironmentContext as EnvironmentContext, type RootNode, + type UseEnvironmentContext, } from './use-environment-context' diff --git a/packages/solid/src/providers/environment/use-environment-context.ts b/packages/solid/src/providers/environment/use-environment-context.ts index 0a098b7d0a..ae82071441 100644 --- a/packages/solid/src/providers/environment/use-environment-context.ts +++ b/packages/solid/src/providers/environment/use-environment-context.ts @@ -3,7 +3,7 @@ import { createContext } from '../../utils/create-context' export type RootNode = ShadowRoot | Document | Node -export interface EnvironmentContext { +export interface UseEnvironmentContext { /** * The root node of the application. * This is used to determine the window and document objects. @@ -23,7 +23,7 @@ export interface EnvironmentContext { } export const [EnvironmentContextProvider, useEnvironmentContext] = createContext< - Accessor + Accessor >({ hookName: 'useEnvironmentContext', providerName: '', diff --git a/packages/svelte/src/lib/providers/environment/index.ts b/packages/svelte/src/lib/providers/environment/index.ts index d36f516dd8..5f120e01b5 100644 --- a/packages/svelte/src/lib/providers/environment/index.ts +++ b/packages/svelte/src/lib/providers/environment/index.ts @@ -4,6 +4,6 @@ export { } from './environment-provider.svelte' export { useEnvironmentContext, - type EnvironmentContext, + type UseEnvironmentContext, type RootNode, } from './use-environment-context' diff --git a/packages/svelte/src/lib/providers/environment/use-environment-context.ts b/packages/svelte/src/lib/providers/environment/use-environment-context.ts index aeed9c819c..3ff8e6a4e1 100644 --- a/packages/svelte/src/lib/providers/environment/use-environment-context.ts +++ b/packages/svelte/src/lib/providers/environment/use-environment-context.ts @@ -2,7 +2,7 @@ import { createContext } from '$lib/utils/create-context' export type RootNode = ShadowRoot | Document | Node -export interface EnvironmentContext { +export interface UseEnvironmentContext { /** * The root node of the application. * This is used to determine the window and document objects. @@ -22,7 +22,7 @@ export interface EnvironmentContext { } export const [EnvironmentContextProvider, useEnvironmentContext] = - createContext({ + createContext({ key: 'EnvironmentContext', defaultValue: { getRootNode: () => document, diff --git a/packages/vue/CHANGELOG.md b/packages/vue/CHANGELOG.md index 9c3ded171a..1d66ad15cc 100644 --- a/packages/vue/CHANGELOG.md +++ b/packages/vue/CHANGELOG.md @@ -10,6 +10,10 @@ description: All notable changes will be documented in this file. - **ColorPicker**: Added support for `invalid` and `openAutoFocus` props. +- ### Changed + +- **Environment**: Deprecated `EnvironmentContext` in favor of `UseEnvironmentContext`. + ### Fixed - **Presence, Collapsible**: Resolved a potential memory leak occurring after component unmount. diff --git a/packages/vue/src/providers/environment/examples/basic.vue b/packages/vue/src/providers/environment/examples/basic.vue index 604c11f385..e1a00b8b61 100644 --- a/packages/vue/src/providers/environment/examples/basic.vue +++ b/packages/vue/src/providers/environment/examples/basic.vue @@ -1,5 +1,5 @@ diff --git a/packages/vue/src/providers/environment/examples/setup.vue b/packages/vue/src/providers/environment/examples/setup.vue index d8031023a5..7bf0ee1100 100644 --- a/packages/vue/src/providers/environment/examples/setup.vue +++ b/packages/vue/src/providers/environment/examples/setup.vue @@ -1,5 +1,5 @@