@rescui/ui-contexts 0.6.1-remove-core-js-dep-e582ebda.2 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- export { LayeringConsumer, LayeringContext, withLayering, useLayeringContext } from './parts/layering-context';
2
- export { default as LayeringProvider } from './layering-provider';
3
- export type { LayeringProviderProps } from './layering-provider';
4
- export { ThemeConsumer, ThemeContext, withTheme, useTheme, useThemeWithUndefined } from './parts/theme-context';
5
- export { default as ThemeProvider } from './theme-provider';
6
- export type { ThemeProviderProps } from './theme-provider';
7
- export type { Theme } from './parts/types';
8
- export { getInverseTheme } from './parts/utils';
1
+ export { LayeringConsumer, LayeringContext, withLayering, useLayeringContext } from './parts/layering-context';
2
+ export { default as LayeringProvider } from './layering-provider';
3
+ export type { LayeringProviderProps } from './layering-provider';
4
+ export { ThemeConsumer, ThemeContext, withTheme, useTheme, useThemeWithUndefined } from './parts/theme-context';
5
+ export { default as ThemeProvider } from './theme-provider';
6
+ export type { ThemeProviderProps } from './theme-provider';
7
+ export type { Theme } from './parts/types';
8
+ export { getInverseTheme } from './parts/utils';
@@ -1,14 +1,14 @@
1
- import { PropsWithChildren } from 'react';
2
- import PropTypes from 'prop-types';
3
- declare type Layer = 'default' | 'popup' | 'dropdown' | 'tooltip';
4
- export declare type LayeringProviderProps = PropsWithChildren<{
5
- baseLayer?: Exclude<Layer, 'default'>;
6
- }>;
7
- declare function LayeringProvider({ baseLayer, children }: LayeringProviderProps): JSX.Element;
8
- declare namespace LayeringProvider {
9
- var propTypes: {
10
- baseLayer: PropTypes.Requireable<string>;
11
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
12
- };
13
- }
14
- export default LayeringProvider;
1
+ import React, { PropsWithChildren } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ type Layer = 'default' | 'popup' | 'dropdown' | 'tooltip';
4
+ export type LayeringProviderProps = PropsWithChildren<{
5
+ baseLayer?: Exclude<Layer, 'default'>;
6
+ }>;
7
+ declare function LayeringProvider({ baseLayer, children }: LayeringProviderProps): React.JSX.Element;
8
+ declare namespace LayeringProvider {
9
+ var propTypes: {
10
+ baseLayer: PropTypes.Requireable<string>;
11
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
12
+ };
13
+ }
14
+ export default LayeringProvider;
@@ -1,24 +1,24 @@
1
- import React from 'react';
2
- interface LayeringInfo {
3
- baseZIndex: number;
4
- isInPortal: boolean;
5
- popupZIndex: number;
6
- dropdownZIndex: number;
7
- tooltipZIndex: number;
8
- }
9
- export declare class LayeringContextValue implements LayeringInfo {
10
- readonly baseZIndex: number;
11
- readonly isInPortal: boolean;
12
- readonly popupZIndex: number;
13
- readonly dropdownZIndex: number;
14
- readonly tooltipZIndex: number;
15
- constructor(baseZIndex: number, isInPortal?: boolean);
16
- }
17
- export declare const LayeringContext: React.Context<LayeringContextValue>;
18
- export declare const LayeringConsumer: React.Consumer<LayeringContextValue>;
19
- export declare const useLayeringContext: () => LayeringContextValue;
20
- /**
21
- * @deprecated use `useLayeringContext` hook instead
22
- * */
23
- export declare const withLayering: <P extends Partial<LayeringInfo>>(WrappedComponent: React.ComponentType<P>) => React.ComponentType<P>;
24
- export {};
1
+ import React from 'react';
2
+ interface LayeringInfo {
3
+ baseZIndex: number;
4
+ isInPortal: boolean;
5
+ popupZIndex: number;
6
+ dropdownZIndex: number;
7
+ tooltipZIndex: number;
8
+ }
9
+ export declare class LayeringContextValue implements LayeringInfo {
10
+ readonly baseZIndex: number;
11
+ readonly isInPortal: boolean;
12
+ readonly popupZIndex: number;
13
+ readonly dropdownZIndex: number;
14
+ readonly tooltipZIndex: number;
15
+ constructor(baseZIndex: number, isInPortal?: boolean);
16
+ }
17
+ export declare const LayeringContext: React.Context<LayeringContextValue>;
18
+ export declare const LayeringConsumer: React.Consumer<LayeringContextValue>;
19
+ export declare const useLayeringContext: () => LayeringContextValue;
20
+ /**
21
+ * @deprecated use `useLayeringContext` hook instead
22
+ * */
23
+ export declare const withLayering: <P extends Partial<LayeringInfo>>(WrappedComponent: React.ComponentType<P>) => React.ComponentType<P>;
24
+ export {};
@@ -40,8 +40,8 @@ const LayeringContext = /*#__PURE__*/createContext(new LayeringContextValue(0));
40
40
  const LayeringConsumer = LayeringContext.Consumer;
41
41
 
42
42
  const useLayeringContext = () => useContext(LayeringContext);
43
- /**
44
- * @deprecated use `useLayeringContext` hook instead
43
+ /**
44
+ * @deprecated use `useLayeringContext` hook instead
45
45
  * */
46
46
 
47
47
 
@@ -1,23 +1,23 @@
1
- import React, { ForwardRefExoticComponent, PropsWithoutRef, RefAttributes } from 'react';
2
- import { Theme } from './types';
3
- declare type ThemeContextValue = {
4
- theme: Theme;
5
- noProvider?: boolean;
6
- };
7
- export declare const ThemeContext: React.Context<ThemeContextValue>;
8
- export declare const ThemeConsumer: React.Consumer<ThemeContextValue>;
9
- /**
10
- * @deprecated please support --rs-theme-dark and --rs-theme-flip css variables and don't use react context for theme
11
- * If you need to maintain backward compatibility use `useThemeWithUndefined` hook instead, rely on --rs-theme-dark and --rs-theme-flip css variables when theme is undefined
12
- * */
13
- export declare const useTheme: (overwriteValue?: Theme) => Theme;
14
- export declare const useThemeWithUndefined: (overwriteValue?: Theme) => Theme | undefined;
15
- export interface ThemeProps {
16
- theme?: Theme;
17
- }
18
- /**
19
- * @deprecated please support --rs-theme-dark and --rs-theme-flip css variables and don't use react context for theme
20
- * If you need to maintain backward compatibility use `useThemeWithUndefined` hook instead, rely on --rs-theme-dark and --rs-theme-flip css variables when theme is undefined
21
- * */
22
- export declare const withTheme: <P extends ThemeProps = ThemeProps>(wrappedComponent: React.ComponentType<P>) => React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<unknown>>;
23
- export {};
1
+ import React, { ForwardRefExoticComponent, PropsWithoutRef, RefAttributes } from 'react';
2
+ import { Theme } from './types';
3
+ type ThemeContextValue = {
4
+ theme: Theme;
5
+ noProvider?: boolean;
6
+ };
7
+ export declare const ThemeContext: React.Context<ThemeContextValue>;
8
+ export declare const ThemeConsumer: React.Consumer<ThemeContextValue>;
9
+ /**
10
+ * @deprecated please support --rs-theme-dark and --rs-theme-flip css variables and don't use react context for theme
11
+ * If you need to maintain backward compatibility use `useThemeWithUndefined` hook instead, rely on --rs-theme-dark and --rs-theme-flip css variables when theme is undefined
12
+ * */
13
+ export declare const useTheme: (overwriteValue?: Theme) => Theme;
14
+ export declare const useThemeWithUndefined: (overwriteValue?: Theme) => Theme | undefined;
15
+ export interface ThemeProps {
16
+ theme?: Theme;
17
+ }
18
+ /**
19
+ * @deprecated please support --rs-theme-dark and --rs-theme-flip css variables and don't use react context for theme
20
+ * If you need to maintain backward compatibility use `useThemeWithUndefined` hook instead, rely on --rs-theme-dark and --rs-theme-flip css variables when theme is undefined
21
+ * */
22
+ export declare const withTheme: <P extends ThemeProps = ThemeProps>(wrappedComponent: React.ComponentType<P>) => ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<unknown>>;
23
+ export {};
@@ -5,9 +5,9 @@ const ThemeContext = /*#__PURE__*/createContext({
5
5
  noProvider: true
6
6
  });
7
7
  const ThemeConsumer = ThemeContext.Consumer;
8
- /**
9
- * @deprecated please support --rs-theme-dark and --rs-theme-flip css variables and don't use react context for theme
10
- * If you need to maintain backward compatibility use `useThemeWithUndefined` hook instead, rely on --rs-theme-dark and --rs-theme-flip css variables when theme is undefined
8
+ /**
9
+ * @deprecated please support --rs-theme-dark and --rs-theme-flip css variables and don't use react context for theme
10
+ * If you need to maintain backward compatibility use `useThemeWithUndefined` hook instead, rely on --rs-theme-dark and --rs-theme-flip css variables when theme is undefined
11
11
  * */
12
12
 
13
13
  const useTheme = overwriteValue => {
@@ -24,13 +24,14 @@ const useThemeWithUndefined = overwriteValue => {
24
24
  } = useContext(ThemeContext);
25
25
  return overwriteValue || (noProvider ? undefined : theme);
26
26
  };
27
- /**
28
- * @deprecated please support --rs-theme-dark and --rs-theme-flip css variables and don't use react context for theme
29
- * If you need to maintain backward compatibility use `useThemeWithUndefined` hook instead, rely on --rs-theme-dark and --rs-theme-flip css variables when theme is undefined
27
+ /**
28
+ * @deprecated please support --rs-theme-dark and --rs-theme-flip css variables and don't use react context for theme
29
+ * If you need to maintain backward compatibility use `useThemeWithUndefined` hook instead, rely on --rs-theme-dark and --rs-theme-flip css variables when theme is undefined
30
30
  * */
31
31
 
32
32
 
33
33
  const withTheme = wrappedComponent => {
34
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
34
35
  const WrappedComponent = wrappedComponent;
35
36
  const ComponentWithTheme = /*#__PURE__*/React.forwardRef((_ref, ref) => {
36
37
  let {
@@ -1 +1 @@
1
- export declare type Theme = 'light' | 'dark';
1
+ export type Theme = 'light' | 'dark';
@@ -1,2 +1,2 @@
1
- import { Theme } from './types';
2
- export declare const getInverseTheme: (theme: Theme) => Theme;
1
+ import { Theme } from './types';
2
+ export declare const getInverseTheme: (theme: Theme) => Theme;
@@ -1,16 +1,16 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import type { Theme } from './parts/types';
4
- export declare type ThemeProviderProps = {
5
- theme: Theme;
6
- ignoreThemeValueForCSSApi?: boolean;
7
- children?: React.ReactNode;
8
- };
9
- declare const ThemeProvider: {
10
- ({ theme, children, ignoreThemeValueForCSSApi }: ThemeProviderProps): JSX.Element;
11
- propTypes: {
12
- theme: PropTypes.Validator<string>;
13
- ignoreThemeValueForCSSApi: PropTypes.Requireable<boolean>;
14
- };
15
- };
16
- export default ThemeProvider;
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import type { Theme } from './parts/types';
4
+ export type ThemeProviderProps = {
5
+ theme: Theme;
6
+ ignoreThemeValueForCSSApi?: boolean;
7
+ children?: React.ReactNode;
8
+ };
9
+ declare const ThemeProvider: {
10
+ ({ theme, children, ignoreThemeValueForCSSApi }: ThemeProviderProps): React.JSX.Element;
11
+ propTypes: {
12
+ theme: PropTypes.Validator<string>;
13
+ ignoreThemeValueForCSSApi: PropTypes.Requireable<boolean>;
14
+ };
15
+ };
16
+ export default ThemeProvider;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rescui/ui-contexts",
3
- "version": "0.6.1-remove-core-js-dep-e582ebda.2+e582ebda",
3
+ "version": "0.6.1",
4
4
  "description": "",
5
5
  "license": "Apache-2.0",
6
6
  "author": "JetBrains",
@@ -23,11 +23,11 @@
23
23
  "react": ">=16.8.0 <20"
24
24
  },
25
25
  "devDependencies": {
26
- "@rescui/scripts": "0.5.1"
26
+ "@rescui/scripts": "^0.5.2"
27
27
  },
28
28
  "scripts": {
29
29
  "build": "rescui-scripts build"
30
30
  },
31
31
  "nx": {},
32
- "gitHead": "e582ebda8e4a1120fbf651940b389dcc226128c8"
32
+ "gitHead": "a04f6790abce8e72834eedce3512ee83513c5e78"
33
33
  }