@infomaximum/ui-kit 0.14.3 → 0.14.4

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.
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { ContextIsolatorProps } from './ContextIsolator.types';
3
+ export declare const ContextIsolator: FC<ContextIsolatorProps>;
@@ -0,0 +1,20 @@
1
+ import { jsx } from "@emotion/react/jsx-runtime";
2
+ import { FormItemContextIsolator } from "../Form/components/FormItemContextIsolator/FormItemContextIsolator.js";
3
+ const ContextIsolatorComponent = (props) => {
4
+ const {
5
+ formItem,
6
+ children
7
+ } = props;
8
+ if (!children) {
9
+ return children;
10
+ }
11
+ let result = children;
12
+ if (formItem) {
13
+ result = /* @__PURE__ */ jsx(FormItemContextIsolator, { children: result });
14
+ }
15
+ return result;
16
+ };
17
+ const ContextIsolator = ContextIsolatorComponent;
18
+ export {
19
+ ContextIsolator
20
+ };
@@ -0,0 +1,4 @@
1
+ import { PropsWithChildren } from 'react';
2
+ export interface ContextIsolatorProps extends PropsWithChildren {
3
+ formItem?: boolean;
4
+ }
@@ -0,0 +1 @@
1
+ export { ContextIsolator } from './ContextIsolator';
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { FormItemContextIsolatorProps } from './FormItemContextIsolator.types';
3
+ export declare const FormItemContextIsolator: FC<FormItemContextIsolatorProps>;
@@ -0,0 +1,21 @@
1
+ import { jsx } from "@emotion/react/jsx-runtime";
2
+ import { useContext, useMemo } from "react";
3
+ import { FormItemContext } from "../FormItem/contexts/FormItemContext.js";
4
+ const FormItemContextIsolatorComponent = (props) => {
5
+ const {
6
+ children
7
+ } = props;
8
+ const contextValue = useContext(FormItemContext);
9
+ const isolatedContextValue = useMemo(() => {
10
+ const newContextValue = {
11
+ ...contextValue
12
+ };
13
+ delete newContextValue.status;
14
+ return newContextValue;
15
+ }, [contextValue]);
16
+ return /* @__PURE__ */ jsx(FormItemContext.Provider, { value: isolatedContextValue, children });
17
+ };
18
+ const FormItemContextIsolator = FormItemContextIsolatorComponent;
19
+ export {
20
+ FormItemContextIsolator
21
+ };
@@ -0,0 +1,3 @@
1
+ import { PropsWithChildren } from 'react';
2
+ export interface FormItemContextIsolatorProps extends PropsWithChildren {
3
+ }
package/dist/index.d.ts CHANGED
@@ -47,4 +47,5 @@ export { TreeSelect } from './components/TreeSelect';
47
47
  export type { TreeSelectProps } from './components/TreeSelect';
48
48
  export { type EmptyProps, Empty } from './components/Empty';
49
49
  export { type SegmentedProps, type SegmentedLabeledOption, Segmented, } from './components/Segmented';
50
+ export { ContextIsolator } from './components/ContextIsolator';
50
51
  export * from 'react-intersection-observer/test-utils';
package/dist/index.js CHANGED
@@ -35,6 +35,7 @@ import { Popconfirm } from "./components/Popconfirm/Popconfirm.js";
35
35
  import { TreeSelect } from "./components/TreeSelect/TreeSelect.js";
36
36
  import { Empty } from "./components/Empty/Empty.js";
37
37
  import { Segmented } from "./components/Segmented/Segmented.js";
38
+ import { ContextIsolator } from "./components/ContextIsolator/ContextIsolator.js";
38
39
  export {
39
40
  Alert,
40
41
  Avatar,
@@ -42,6 +43,7 @@ export {
42
43
  Button,
43
44
  Checkbox,
44
45
  ConfigProvider,
46
+ ContextIsolator,
45
47
  DatePicker,
46
48
  Dropdown,
47
49
  Empty,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@infomaximum/ui-kit",
3
3
  "license": "Apache-2.0",
4
- "version": "0.14.3",
4
+ "version": "0.14.4",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",