@impulse-ui-native/modal 9.1.1 → 10.0.0

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.
@@ -1,11 +1,10 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { ModalCloseProps } from '../types/modal.types.mjs';
4
3
  import 'react-native-reanimated';
5
4
  import '@impulse-ui-native/overlay';
6
5
  import '@impulse-ui-native/primitives';
7
6
  import '@impulse-ui-native/theme';
8
7
 
9
- declare const ModalClose: react.MemoExoticComponent<({ disabled, loading, style, onPress, ...props }: ModalCloseProps) => react_jsx_runtime.JSX.Element>;
8
+ declare const ModalClose: react.MemoExoticComponent<({ disabled, loading, style, onPress, ...props }: ModalCloseProps) => react.JSX.Element>;
10
9
 
11
10
  export { ModalClose };
@@ -1,11 +1,10 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { ModalContentProps } from '../types/modal.types.mjs';
4
3
  import 'react-native-reanimated';
5
4
  import '@impulse-ui-native/overlay';
6
5
  import '@impulse-ui-native/primitives';
7
6
  import '@impulse-ui-native/theme';
8
7
 
9
- declare const ModalContent: react.MemoExoticComponent<({ style, ...props }: ModalContentProps) => react_jsx_runtime.JSX.Element>;
8
+ declare const ModalContent: react.MemoExoticComponent<({ style, ...props }: ModalContentProps) => react.JSX.Element>;
10
9
 
11
10
  export { ModalContent };
@@ -1,11 +1,10 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { ModalDescriptionProps } from '../types/modal.types.mjs';
4
3
  import 'react-native-reanimated';
5
4
  import '@impulse-ui-native/overlay';
6
5
  import '@impulse-ui-native/primitives';
7
6
  import '@impulse-ui-native/theme';
8
7
 
9
- declare const ModalDescription: react.MemoExoticComponent<(props: ModalDescriptionProps) => react_jsx_runtime.JSX.Element>;
8
+ declare const ModalDescription: react.MemoExoticComponent<(props: ModalDescriptionProps) => react.JSX.Element>;
10
9
 
11
10
  export { ModalDescription };
@@ -1,11 +1,10 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { ModalFooterProps } from '../types/modal.types.mjs';
4
3
  import 'react-native-reanimated';
5
4
  import '@impulse-ui-native/overlay';
6
5
  import '@impulse-ui-native/primitives';
7
6
  import '@impulse-ui-native/theme';
8
7
 
9
- declare const ModalFooter: react.MemoExoticComponent<({ style, ...props }: ModalFooterProps) => react_jsx_runtime.JSX.Element>;
8
+ declare const ModalFooter: react.MemoExoticComponent<({ style, ...props }: ModalFooterProps) => react.JSX.Element>;
10
9
 
11
10
  export { ModalFooter };
@@ -1,11 +1,10 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { ModalHeaderProps } from '../types/modal.types.mjs';
4
3
  import 'react-native-reanimated';
5
4
  import '@impulse-ui-native/overlay';
6
5
  import '@impulse-ui-native/primitives';
7
6
  import '@impulse-ui-native/theme';
8
7
 
9
- declare const ModalHeader: react.MemoExoticComponent<({ style, ...props }: ModalHeaderProps) => react_jsx_runtime.JSX.Element>;
8
+ declare const ModalHeader: react.MemoExoticComponent<({ style, ...props }: ModalHeaderProps) => react.JSX.Element>;
10
9
 
11
10
  export { ModalHeader };
@@ -1,4 +1,3 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import * as react from 'react';
3
2
  import { ModalProps, ModalProviderProps, ModalRootProps, ModalHeaderProps, ModalCloseProps, ModalContentProps, ModalFooterProps, ModalTitleProps, ModalDescriptionProps } from '../types/modal.types.mjs';
4
3
  import 'react-native-reanimated';
@@ -7,16 +6,16 @@ import '@impulse-ui-native/primitives';
7
6
  import '@impulse-ui-native/theme';
8
7
 
9
8
  declare const Modal: react.NamedExoticComponent<ModalProps> & {
10
- readonly type: ({ id, open, layer, onOpen, onOpenFinished, onStatusChange, onClose, onCloseFinished, header, title, footer, hideClose, children, ...props }: ModalProps) => react_jsx_runtime.JSX.Element;
9
+ readonly type: ({ id, open, layer, onOpen, onOpenFinished, onStatusChange, onClose, onCloseFinished, header, title, footer, hideClose, children, ...props }: ModalProps) => react.JSX.Element;
11
10
  } & {
12
- Provider: react.MemoExoticComponent<({ children, layer, ...props }: ModalProviderProps) => react_jsx_runtime.JSX.Element>;
13
- Root: react.MemoExoticComponent<({ children, ...props }: ModalRootProps) => react_jsx_runtime.JSX.Element | null>;
14
- Header: react.MemoExoticComponent<({ style, ...props }: ModalHeaderProps) => react_jsx_runtime.JSX.Element>;
15
- Close: react.MemoExoticComponent<({ disabled, loading, style, onPress, ...props }: ModalCloseProps) => react_jsx_runtime.JSX.Element>;
16
- Content: react.MemoExoticComponent<({ style, ...props }: ModalContentProps) => react_jsx_runtime.JSX.Element>;
17
- Footer: react.MemoExoticComponent<({ style, ...props }: ModalFooterProps) => react_jsx_runtime.JSX.Element>;
18
- Title: react.MemoExoticComponent<(props: ModalTitleProps) => react_jsx_runtime.JSX.Element>;
19
- Description: react.MemoExoticComponent<(props: ModalDescriptionProps) => react_jsx_runtime.JSX.Element>;
11
+ Provider: react.MemoExoticComponent<({ children, layer, ...props }: ModalProviderProps) => react.JSX.Element>;
12
+ Root: react.MemoExoticComponent<({ children, ...props }: ModalRootProps) => react.JSX.Element | null>;
13
+ Header: react.MemoExoticComponent<({ style, ...props }: ModalHeaderProps) => react.JSX.Element>;
14
+ Close: react.MemoExoticComponent<({ disabled, loading, style, onPress, ...props }: ModalCloseProps) => react.JSX.Element>;
15
+ Content: react.MemoExoticComponent<({ style, ...props }: ModalContentProps) => react.JSX.Element>;
16
+ Footer: react.MemoExoticComponent<({ style, ...props }: ModalFooterProps) => react.JSX.Element>;
17
+ Title: react.MemoExoticComponent<(props: ModalTitleProps) => react.JSX.Element>;
18
+ Description: react.MemoExoticComponent<(props: ModalDescriptionProps) => react.JSX.Element>;
20
19
  };
21
20
 
22
21
  export { Modal };
@@ -1,11 +1,10 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { ModalProps } from '../types/modal.types.mjs';
4
3
  import 'react-native-reanimated';
5
4
  import '@impulse-ui-native/overlay';
6
5
  import '@impulse-ui-native/primitives';
7
6
  import '@impulse-ui-native/theme';
8
7
 
9
- declare const ModalComponent: react.MemoExoticComponent<({ id, open, layer, onOpen, onOpenFinished, onStatusChange, onClose, onCloseFinished, header, title, footer, hideClose, children, ...props }: ModalProps) => react_jsx_runtime.JSX.Element>;
8
+ declare const ModalComponent: react.MemoExoticComponent<({ id, open, layer, onOpen, onOpenFinished, onStatusChange, onClose, onCloseFinished, header, title, footer, hideClose, children, ...props }: ModalProps) => react.JSX.Element>;
10
9
 
11
10
  export { ModalComponent };
@@ -27,6 +27,8 @@ const ModalComponent = memo(function Modal({
27
27
  ...props
28
28
  }) {
29
29
  const colors = useColors();
30
+ const showHeader = header || title || !hideClose;
31
+ const showTitle = !header && title;
30
32
  return /* @__PURE__ */ jsx(
31
33
  ModalProvider,
32
34
  {
@@ -39,9 +41,9 @@ const ModalComponent = memo(function Modal({
39
41
  onClose,
40
42
  onCloseFinished,
41
43
  children: /* @__PURE__ */ jsxs(ModalRoot, { ...props, children: [
42
- header || title || !hideClose ? /* @__PURE__ */ jsxs(ModalHeader, { children: [
44
+ showHeader ? /* @__PURE__ */ jsxs(ModalHeader, { children: [
43
45
  header,
44
- !header && title ? /* @__PURE__ */ jsx(ModalTitle, { children: title }) : null,
46
+ showTitle ? /* @__PURE__ */ jsx(ModalTitle, { children: title }) : null,
45
47
  !hideClose ? /* @__PURE__ */ jsx(ModalClose, { marginLeft: "auto", children: /* @__PURE__ */ jsx(Icon, { icon: XIcon, size: "small", color: colors.text.tertiary }) }) : null
46
48
  ] }) : null,
47
49
  /* @__PURE__ */ jsx(ModalContent, { children }),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/modal.tsx"],"sourcesContent":["import { memo } from \"react\";\n\nimport { Icon } from \"@impulse-ui-native/icon\";\nimport { XIcon } from \"@impulse-ui-native/icon/icons/x\";\nimport { useColors } from \"@impulse-ui-native/theme\";\n\nimport type { ModalProps } from \"../types\";\nimport { ModalClose } from \"./close\";\nimport { ModalContent } from \"./content\";\nimport { ModalFooter } from \"./footer\";\nimport { ModalHeader } from \"./header\";\nimport { ModalProvider } from \"./provider\";\nimport { ModalRoot } from \"./root\";\nimport { ModalTitle } from \"./title\";\n\nexport const ModalComponent = memo(function Modal({\n id,\n open,\n layer,\n onOpen,\n onOpenFinished,\n onStatusChange,\n onClose,\n onCloseFinished,\n header,\n title,\n footer,\n hideClose = false,\n children,\n ...props\n}: ModalProps) {\n const colors = useColors();\n\n return (\n <ModalProvider\n id={id}\n open={open}\n layer={layer}\n onOpen={onOpen}\n onOpenFinished={onOpenFinished}\n onStatusChange={onStatusChange}\n onClose={onClose}\n onCloseFinished={onCloseFinished}\n >\n <ModalRoot {...props}>\n {header || title || !hideClose ? (\n <ModalHeader>\n {header}\n {!header && title ? <ModalTitle>{title}</ModalTitle> : null}\n {!hideClose ? (\n <ModalClose marginLeft=\"auto\">\n <Icon icon={XIcon} size=\"small\" color={colors.text.tertiary} />\n </ModalClose>\n ) : null}\n </ModalHeader>\n ) : null}\n <ModalContent>{children}</ModalContent>\n {footer ? <ModalFooter>{footer}</ModalFooter> : null}\n </ModalRoot>\n </ModalProvider>\n );\n});\n"],"mappings":"AA8CU,SAEsB,KAFtB;AA9CV,SAAS,YAAY;AAErB,SAAS,YAAY;AACrB,SAAS,aAAa;AACtB,SAAS,iBAAiB;AAG1B,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAC9B,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAEpB,MAAM,iBAAiB,KAAK,SAAS,MAAM;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA,GAAG;AACL,GAAe;AACb,QAAM,SAAS,UAAU;AAEzB,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEA,+BAAC,aAAW,GAAG,OACZ;AAAA,kBAAU,SAAS,CAAC,YACnB,qBAAC,eACE;AAAA;AAAA,UACA,CAAC,UAAU,QAAQ,oBAAC,cAAY,iBAAM,IAAgB;AAAA,UACtD,CAAC,YACA,oBAAC,cAAW,YAAW,QACrB,8BAAC,QAAK,MAAM,OAAO,MAAK,SAAQ,OAAO,OAAO,KAAK,UAAU,GAC/D,IACE;AAAA,WACN,IACE;AAAA,QACJ,oBAAC,gBAAc,UAAS;AAAA,QACvB,SAAS,oBAAC,eAAa,kBAAO,IAAiB;AAAA,SAClD;AAAA;AAAA,EACF;AAEJ,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../src/components/modal.tsx"],"sourcesContent":["import { memo } from \"react\";\n\nimport { Icon } from \"@impulse-ui-native/icon\";\nimport { XIcon } from \"@impulse-ui-native/icon/icons/x\";\nimport { useColors } from \"@impulse-ui-native/theme\";\n\nimport type { ModalProps } from \"../types\";\nimport { ModalClose } from \"./close\";\nimport { ModalContent } from \"./content\";\nimport { ModalFooter } from \"./footer\";\nimport { ModalHeader } from \"./header\";\nimport { ModalProvider } from \"./provider\";\nimport { ModalRoot } from \"./root\";\nimport { ModalTitle } from \"./title\";\n\nexport const ModalComponent = memo(function Modal({\n id,\n open,\n layer,\n onOpen,\n onOpenFinished,\n onStatusChange,\n onClose,\n onCloseFinished,\n header,\n title,\n footer,\n hideClose = false,\n children,\n ...props\n}: ModalProps) {\n const colors = useColors();\n\n const showHeader = header || title || !hideClose;\n const showTitle = !header && title;\n\n return (\n <ModalProvider\n id={id}\n open={open}\n layer={layer}\n onOpen={onOpen}\n onOpenFinished={onOpenFinished}\n onStatusChange={onStatusChange}\n onClose={onClose}\n onCloseFinished={onCloseFinished}\n >\n <ModalRoot {...props}>\n {showHeader ? (\n <ModalHeader>\n {header}\n {showTitle ? <ModalTitle>{title}</ModalTitle> : null}\n {!hideClose ? (\n <ModalClose marginLeft=\"auto\">\n <Icon icon={XIcon} size=\"small\" color={colors.text.tertiary} />\n </ModalClose>\n ) : null}\n </ModalHeader>\n ) : null}\n <ModalContent>{children}</ModalContent>\n {footer ? <ModalFooter>{footer}</ModalFooter> : null}\n </ModalRoot>\n </ModalProvider>\n );\n});\n"],"mappings":"AAiDU,SAEe,KAFf;AAjDV,SAAS,YAAY;AAErB,SAAS,YAAY;AACrB,SAAS,aAAa;AACtB,SAAS,iBAAiB;AAG1B,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAC9B,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAEpB,MAAM,iBAAiB,KAAK,SAAS,MAAM;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA,GAAG;AACL,GAAe;AACb,QAAM,SAAS,UAAU;AAEzB,QAAM,aAAa,UAAU,SAAS,CAAC;AACvC,QAAM,YAAY,CAAC,UAAU;AAE7B,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEA,+BAAC,aAAW,GAAG,OACZ;AAAA,qBACC,qBAAC,eACE;AAAA;AAAA,UACA,YAAY,oBAAC,cAAY,iBAAM,IAAgB;AAAA,UAC/C,CAAC,YACA,oBAAC,cAAW,YAAW,QACrB,8BAAC,QAAK,MAAM,OAAO,MAAK,SAAQ,OAAO,OAAO,KAAK,UAAU,GAC/D,IACE;AAAA,WACN,IACE;AAAA,QACJ,oBAAC,gBAAc,UAAS;AAAA,QACvB,SAAS,oBAAC,eAAa,kBAAO,IAAiB;AAAA,SAClD;AAAA;AAAA,EACF;AAEJ,CAAC;","names":[]}
@@ -1,11 +1,10 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { ModalProviderProps } from '../types/modal.types.mjs';
4
3
  import 'react-native-reanimated';
5
4
  import '@impulse-ui-native/overlay';
6
5
  import '@impulse-ui-native/primitives';
7
6
  import '@impulse-ui-native/theme';
8
7
 
9
- declare const ModalProvider: react.MemoExoticComponent<({ children, layer, ...props }: ModalProviderProps) => react_jsx_runtime.JSX.Element>;
8
+ declare const ModalProvider: react.MemoExoticComponent<({ children, layer, ...props }: ModalProviderProps) => react.JSX.Element>;
10
9
 
11
10
  export { ModalProvider };
@@ -1,11 +1,10 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { ModalRootProps } from '../types/modal.types.mjs';
4
3
  import 'react-native-reanimated';
5
4
  import '@impulse-ui-native/overlay';
6
5
  import '@impulse-ui-native/primitives';
7
6
  import '@impulse-ui-native/theme';
8
7
 
9
- declare const ModalRoot: react.MemoExoticComponent<({ children, ...props }: ModalRootProps) => react_jsx_runtime.JSX.Element | null>;
8
+ declare const ModalRoot: react.MemoExoticComponent<({ children, ...props }: ModalRootProps) => react.JSX.Element | null>;
10
9
 
11
10
  export { ModalRoot };
@@ -1,11 +1,10 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { ModalSurfaceProps } from '../types/modal.types.mjs';
4
3
  import 'react-native-reanimated';
5
4
  import '@impulse-ui-native/overlay';
6
5
  import '@impulse-ui-native/primitives';
7
6
  import '@impulse-ui-native/theme';
8
7
 
9
- declare const ModalSurface: react.MemoExoticComponent<({ size, style, ...props }: ModalSurfaceProps) => react_jsx_runtime.JSX.Element>;
8
+ declare const ModalSurface: react.MemoExoticComponent<({ size, style, ...props }: ModalSurfaceProps) => react.JSX.Element>;
10
9
 
11
10
  export { ModalSurface };
@@ -1,11 +1,10 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { ModalTitleProps } from '../types/modal.types.mjs';
4
3
  import 'react-native-reanimated';
5
4
  import '@impulse-ui-native/overlay';
6
5
  import '@impulse-ui-native/primitives';
7
6
  import '@impulse-ui-native/theme';
8
7
 
9
- declare const ModalTitle: react.MemoExoticComponent<(props: ModalTitleProps) => react_jsx_runtime.JSX.Element>;
8
+ declare const ModalTitle: react.MemoExoticComponent<(props: ModalTitleProps) => react.JSX.Element>;
10
9
 
11
10
  export { ModalTitle };
@@ -1,8 +1,8 @@
1
- declare const ModalCloseStyles: {
1
+ declare const ModalCloseStyles: Readonly<{
2
2
  close: {
3
3
  alignItems: "center";
4
4
  justifyContent: "center";
5
5
  };
6
- };
6
+ }>;
7
7
 
8
8
  export { ModalCloseStyles };
@@ -1,44 +1,10 @@
1
- import { useEffect, useMemo } from "react";
2
- import {
3
- cancelAnimation,
4
- useSharedValue,
5
- withTiming
6
- } from "react-native-reanimated";
7
- import { scheduleOnRN } from "react-native-worklets";
8
- import { useEventCallback } from "@impulse-ui-native/core";
9
- import { useOverlayLifecycle } from "@impulse-ui-native/overlay";
1
+ import { useMemo } from "react";
2
+ import { useOverlayLifecycle, useOverlayTiming } from "@impulse-ui-native/overlay";
10
3
  import { useComponentsTokens } from "@impulse-ui-native/theme";
11
4
  function useModalLifecycle(props) {
12
5
  const tokens = useComponentsTokens().modal;
13
- const progress = useSharedValue(0);
14
- const enter = useEventCallback(
15
- (transitionId, complete) => {
16
- progress.set(
17
- withTiming(1, { duration: tokens.enterDuration }, (finished) => {
18
- if (finished) {
19
- scheduleOnRN(complete, transitionId);
20
- }
21
- })
22
- );
23
- }
24
- );
25
- const exit = useEventCallback(
26
- (transitionId, complete) => {
27
- progress.set(
28
- withTiming(0, { duration: tokens.exitDuration }, (finished) => {
29
- if (finished) {
30
- scheduleOnRN(complete, transitionId);
31
- }
32
- })
33
- );
34
- }
35
- );
36
- const options = useMemo(
37
- () => ({ onEnter: enter, onExit: exit }),
38
- [enter, exit]
39
- );
6
+ const { options, progress } = useOverlayTiming(tokens);
40
7
  const lifecycle = useOverlayLifecycle(props, options);
41
- useEffect(() => () => cancelAnimation(progress), [progress]);
42
8
  return useMemo(() => ({ ...lifecycle, progress }), [lifecycle, progress]);
43
9
  }
44
10
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/hooks/use-modal-lifecycle.hook.ts"],"sourcesContent":["import { useEffect, useMemo } from \"react\";\nimport {\n cancelAnimation,\n useSharedValue,\n withTiming,\n} from \"react-native-reanimated\";\nimport { scheduleOnRN } from \"react-native-worklets\";\n\nimport type { OverlayTransitionHandler } from \"@impulse-ui-native/overlay\";\nimport { useEventCallback } from \"@impulse-ui-native/core\";\nimport { useOverlayLifecycle } from \"@impulse-ui-native/overlay\";\nimport { useComponentsTokens } from \"@impulse-ui-native/theme\";\n\nimport type { ModalLifecycleProps } from \"../types\";\n\nexport function useModalLifecycle(props: ModalLifecycleProps) {\n const tokens = useComponentsTokens().modal;\n const progress = useSharedValue(0);\n\n const enter = useEventCallback<OverlayTransitionHandler>(\n (transitionId, complete) => {\n progress.set(\n withTiming(1, { duration: tokens.enterDuration }, (finished) => {\n if (finished) {\n scheduleOnRN(complete, transitionId);\n }\n }),\n );\n },\n );\n const exit = useEventCallback<OverlayTransitionHandler>(\n (transitionId, complete) => {\n progress.set(\n withTiming(0, { duration: tokens.exitDuration }, (finished) => {\n if (finished) {\n scheduleOnRN(complete, transitionId);\n }\n }),\n );\n },\n );\n\n const options = useMemo(\n () => ({ onEnter: enter, onExit: exit }),\n [enter, exit],\n );\n const lifecycle = useOverlayLifecycle(props, options);\n\n useEffect(() => () => cancelAnimation(progress), [progress]);\n\n return useMemo(() => ({ ...lifecycle, progress }), [lifecycle, progress]);\n}\n"],"mappings":"AAAA,SAAS,WAAW,eAAe;AACnC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,oBAAoB;AAG7B,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AACpC,SAAS,2BAA2B;AAI7B,SAAS,kBAAkB,OAA4B;AAC5D,QAAM,SAAS,oBAAoB,EAAE;AACrC,QAAM,WAAW,eAAe,CAAC;AAEjC,QAAM,QAAQ;AAAA,IACZ,CAAC,cAAc,aAAa;AAC1B,eAAS;AAAA,QACP,WAAW,GAAG,EAAE,UAAU,OAAO,cAAc,GAAG,CAAC,aAAa;AAC9D,cAAI,UAAU;AACZ,yBAAa,UAAU,YAAY;AAAA,UACrC;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACA,QAAM,OAAO;AAAA,IACX,CAAC,cAAc,aAAa;AAC1B,eAAS;AAAA,QACP,WAAW,GAAG,EAAE,UAAU,OAAO,aAAa,GAAG,CAAC,aAAa;AAC7D,cAAI,UAAU;AACZ,yBAAa,UAAU,YAAY;AAAA,UACrC;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AAEA,QAAM,UAAU;AAAA,IACd,OAAO,EAAE,SAAS,OAAO,QAAQ,KAAK;AAAA,IACtC,CAAC,OAAO,IAAI;AAAA,EACd;AACA,QAAM,YAAY,oBAAoB,OAAO,OAAO;AAEpD,YAAU,MAAM,MAAM,gBAAgB,QAAQ,GAAG,CAAC,QAAQ,CAAC;AAE3D,SAAO,QAAQ,OAAO,EAAE,GAAG,WAAW,SAAS,IAAI,CAAC,WAAW,QAAQ,CAAC;AAC1E;","names":[]}
1
+ {"version":3,"sources":["../../src/hooks/use-modal-lifecycle.hook.ts"],"sourcesContent":["import { useMemo } from \"react\";\n\nimport { useOverlayLifecycle, useOverlayTiming } from \"@impulse-ui-native/overlay\";\nimport { useComponentsTokens } from \"@impulse-ui-native/theme\";\n\nimport type { ModalLifecycleProps } from \"../types\";\n\nexport function useModalLifecycle(props: ModalLifecycleProps) {\n const tokens = useComponentsTokens().modal;\n const { options, progress } = useOverlayTiming(tokens);\n const lifecycle = useOverlayLifecycle(props, options);\n\n return useMemo(() => ({ ...lifecycle, progress }), [lifecycle, progress]);\n}\n"],"mappings":"AAAA,SAAS,eAAe;AAExB,SAAS,qBAAqB,wBAAwB;AACtD,SAAS,2BAA2B;AAI7B,SAAS,kBAAkB,OAA4B;AAC5D,QAAM,SAAS,oBAAoB,EAAE;AACrC,QAAM,EAAE,SAAS,SAAS,IAAI,iBAAiB,MAAM;AACrD,QAAM,YAAY,oBAAoB,OAAO,OAAO;AAEpD,SAAO,QAAQ,OAAO,EAAE,GAAG,WAAW,SAAS,IAAI,CAAC,WAAW,QAAQ,CAAC;AAC1E;","names":[]}
package/dist/index.d.mts CHANGED
@@ -1,7 +1,6 @@
1
1
  export { Modal } from './components/index.mjs';
2
2
  export { ModalCloseProps, ModalContentProps, ModalContextValue, ModalDescriptionProps, ModalFooterProps, ModalHeaderProps, ModalLifecycleProps, ModalProps, ModalProviderProps, ModalRootProps, ModalSurfaceProps, ModalTitleProps } from './types/modal.types.mjs';
3
3
  export { useModalContext } from './hooks/use-modal-context.hook.mjs';
4
- import 'react/jsx-runtime';
5
4
  import 'react';
6
5
  import 'react-native-reanimated';
7
6
  import '@impulse-ui-native/overlay';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@impulse-ui-native/modal",
3
- "version": "9.1.1",
3
+ "version": "10.0.0",
4
4
  "description": "Compound modal dialogs with local and OverlayHost lifecycle support.",
5
5
  "keywords": [
6
6
  "react-native",
@@ -12,11 +12,11 @@
12
12
  "source": "src/index.ts",
13
13
  "module": "dist/index.js",
14
14
  "types": "dist/index.d.mts",
15
- "react-native": "src/index.ts",
15
+ "react-native": "dist/index.js",
16
16
  "exports": {
17
17
  ".": {
18
18
  "types": "./dist/index.d.mts",
19
- "react-native": "./src/index.ts",
19
+ "react-native": "./dist/index.js",
20
20
  "import": "./dist/index.js"
21
21
  }
22
22
  },
@@ -27,22 +27,22 @@
27
27
  ],
28
28
  "sideEffects": false,
29
29
  "dependencies": {
30
- "@impulse-ui-native/icon": "9.1.1",
31
- "@impulse-ui-native/theme": "9.1.1",
32
- "@impulse-ui-native/primitives": "9.1.1",
33
- "@impulse-ui-native/overlay": "9.1.1",
34
- "@impulse-ui-native/core": "9.1.1"
30
+ "@impulse-ui-native/icon": "10.0.0",
31
+ "@impulse-ui-native/primitives": "10.0.0",
32
+ "@impulse-ui-native/theme": "10.0.0",
33
+ "@impulse-ui-native/core": "10.0.0",
34
+ "@impulse-ui-native/overlay": "10.0.0"
35
35
  },
36
36
  "devDependencies": {
37
- "@types/react": "~19.2.14",
37
+ "@types/react": "~19.3.0",
38
38
  "eslint": "^9.38.0",
39
39
  "prettier": "^3.6.2",
40
- "react": "19.2.3",
41
- "react-native": "0.86.2",
40
+ "react": "19.3.0",
41
+ "react-native": "0.88.0",
42
42
  "typescript": "~6.0.3",
43
- "react-native-reanimated": "4.5.1",
44
- "react-native-safe-area-context": "~5.7.0",
45
- "react-native-worklets": "0.10.1",
43
+ "react-native-reanimated": "4.7.1",
44
+ "react-native-safe-area-context": "~5.10.1",
45
+ "react-native-worklets": "0.13.0",
46
46
  "@impulse-ui-native/eslint-config": "1.0.0",
47
47
  "@impulse-ui-native/prettier-config": "1.0.0",
48
48
  "@impulse-ui-native/tsconfig": "1.0.0"