@cdx-ui/components 0.0.1-beta.111 → 0.0.1-beta.113

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.
Files changed (76) hide show
  1. package/lib/commonjs/animation/hooks/index.js +33 -0
  2. package/lib/commonjs/animation/hooks/index.js.map +1 -1
  3. package/lib/commonjs/animation/hooks/usePopupDialogContentAnimation.js +173 -0
  4. package/lib/commonjs/animation/hooks/usePopupDialogContentAnimation.js.map +1 -0
  5. package/lib/commonjs/animation/hooks/usePopupOverlayAnimation.js +67 -0
  6. package/lib/commonjs/animation/hooks/usePopupOverlayAnimation.js.map +1 -0
  7. package/lib/commonjs/animation/hooks/usePopupRootAnimation.js +26 -0
  8. package/lib/commonjs/animation/hooks/usePopupRootAnimation.js.map +1 -0
  9. package/lib/commonjs/components/AlertDialog/index.js +15 -1
  10. package/lib/commonjs/components/AlertDialog/index.js.map +1 -1
  11. package/lib/commonjs/components/Box/Box.js +1 -11
  12. package/lib/commonjs/components/Box/Box.js.map +1 -1
  13. package/lib/commonjs/components/Dialog/animation.js +13 -0
  14. package/lib/commonjs/components/Dialog/animation.js.map +1 -0
  15. package/lib/commonjs/components/Dialog/index.js +267 -24
  16. package/lib/commonjs/components/Dialog/index.js.map +1 -1
  17. package/lib/commonjs/components/Dialog/styles.js +7 -3
  18. package/lib/commonjs/components/Dialog/styles.js.map +1 -1
  19. package/lib/commonjs/components/Link/index.js.map +1 -1
  20. package/lib/module/animation/hooks/index.js +3 -0
  21. package/lib/module/animation/hooks/index.js.map +1 -1
  22. package/lib/module/animation/hooks/usePopupDialogContentAnimation.js +169 -0
  23. package/lib/module/animation/hooks/usePopupDialogContentAnimation.js.map +1 -0
  24. package/lib/module/animation/hooks/usePopupOverlayAnimation.js +63 -0
  25. package/lib/module/animation/hooks/usePopupOverlayAnimation.js.map +1 -0
  26. package/lib/module/animation/hooks/usePopupRootAnimation.js +22 -0
  27. package/lib/module/animation/hooks/usePopupRootAnimation.js.map +1 -0
  28. package/lib/module/components/AlertDialog/index.js +15 -1
  29. package/lib/module/components/AlertDialog/index.js.map +1 -1
  30. package/lib/module/components/Box/Box.js +1 -11
  31. package/lib/module/components/Box/Box.js.map +1 -1
  32. package/lib/module/components/Dialog/animation.js +7 -0
  33. package/lib/module/components/Dialog/animation.js.map +1 -0
  34. package/lib/module/components/Dialog/index.js +271 -30
  35. package/lib/module/components/Dialog/index.js.map +1 -1
  36. package/lib/module/components/Dialog/styles.js +6 -2
  37. package/lib/module/components/Dialog/styles.js.map +1 -1
  38. package/lib/module/components/Link/index.js.map +1 -1
  39. package/lib/typescript/animation/hooks/index.d.ts +3 -0
  40. package/lib/typescript/animation/hooks/index.d.ts.map +1 -1
  41. package/lib/typescript/animation/hooks/usePopupDialogContentAnimation.d.ts +47 -0
  42. package/lib/typescript/animation/hooks/usePopupDialogContentAnimation.d.ts.map +1 -0
  43. package/lib/typescript/animation/hooks/usePopupOverlayAnimation.d.ts +29 -0
  44. package/lib/typescript/animation/hooks/usePopupOverlayAnimation.d.ts.map +1 -0
  45. package/lib/typescript/animation/hooks/usePopupRootAnimation.d.ts +16 -0
  46. package/lib/typescript/animation/hooks/usePopupRootAnimation.d.ts.map +1 -0
  47. package/lib/typescript/components/AlertDialog/index.d.ts +5 -2
  48. package/lib/typescript/components/AlertDialog/index.d.ts.map +1 -1
  49. package/lib/typescript/components/Box/Box.d.ts +0 -3
  50. package/lib/typescript/components/Box/Box.d.ts.map +1 -1
  51. package/lib/typescript/components/Dialog/animation.d.ts +11 -0
  52. package/lib/typescript/components/Dialog/animation.d.ts.map +1 -0
  53. package/lib/typescript/components/Dialog/index.d.ts +6 -2
  54. package/lib/typescript/components/Dialog/index.d.ts.map +1 -1
  55. package/lib/typescript/components/Dialog/styles.d.ts +1 -0
  56. package/lib/typescript/components/Dialog/styles.d.ts.map +1 -1
  57. package/lib/typescript/components/Link/index.d.ts +1 -0
  58. package/lib/typescript/components/Link/index.d.ts.map +1 -1
  59. package/package.json +13 -5
  60. package/src/animation/hooks/index.ts +3 -0
  61. package/src/animation/hooks/usePopupDialogContentAnimation.ts +256 -0
  62. package/src/animation/hooks/usePopupOverlayAnimation.ts +84 -0
  63. package/src/animation/hooks/usePopupRootAnimation.ts +27 -0
  64. package/src/components/AlertDialog/index.tsx +16 -3
  65. package/src/components/Box/Box.tsx +3 -7
  66. package/src/components/Dialog/animation.ts +13 -0
  67. package/src/components/Dialog/index.tsx +331 -31
  68. package/src/components/Dialog/styles.ts +22 -1
  69. package/src/components/Link/index.tsx +1 -0
  70. package/lib/commonjs/utils/WrapStringChild.js +0 -22
  71. package/lib/commonjs/utils/WrapStringChild.js.map +0 -1
  72. package/lib/module/utils/WrapStringChild.js +0 -18
  73. package/lib/module/utils/WrapStringChild.js.map +0 -1
  74. package/lib/typescript/utils/WrapStringChild.d.ts +0 -10
  75. package/lib/typescript/utils/WrapStringChild.d.ts.map +0 -1
  76. package/src/utils/WrapStringChild.tsx +0 -25
@@ -1,9 +1,6 @@
1
1
  import { View, type ViewProps } from 'react-native';
2
- import type { TextProps } from '../Text';
3
2
  export interface BoxProps extends ViewProps {
4
3
  className?: string;
5
- textProps?: TextProps;
6
4
  }
7
- /** @deprecated Use View instead */
8
5
  export declare const Box: import("react").ForwardRefExoticComponent<BoxProps & import("react").RefAttributes<View>>;
9
6
  //# sourceMappingURL=Box.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../../src/components/Box/Box.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,WAAW,QAAS,SAAQ,SAAS;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,mCAAmC;AACnC,eAAO,MAAM,GAAG,2FAQf,CAAC"}
1
+ {"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../../src/components/Box/Box.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,WAAW,QAAS,SAAQ,SAAS;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,GAAG,2FAQf,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { SharedValue } from 'react-native-reanimated';
2
+ export interface DialogAnimationContextValue {
3
+ progress: SharedValue<number>;
4
+ isDragging: SharedValue<boolean>;
5
+ isGestureReleaseAnimationRunning: SharedValue<boolean>;
6
+ }
7
+ export declare const DialogAnimationProvider: import("react").FunctionComponent<{
8
+ children: import("react").ReactNode;
9
+ value: DialogAnimationContextValue;
10
+ }>, useDialogAnimation: () => DialogAnimationContextValue;
11
+ //# sourceMappingURL=animation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG3D,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC9B,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACjC,gCAAgC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACxD;AAED,eAAO,MAAO,uBAAuB;;;IAAE,kBAAkB,mCAGrD,CAAC"}
@@ -1,10 +1,12 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { Text, View, type TextProps, type ViewProps } from 'react-native';
3
- import { type IDialogCloseProps, type IDialogPopupProps, type IDialogRootProps, type IDialogTriggerProps } from '@cdx-ui/primitives';
3
+ import { type IDialogCloseProps, type IDialogContentProps, type IDialogRootProps, type IDialogTriggerProps } from '@cdx-ui/primitives';
4
+ import { type AnimationRootDisableAll } from '../../animation';
4
5
  import { type DialogTitleVariantProps, type DialogVariantProps } from './styles';
5
6
  export { useDialog } from '@cdx-ui/primitives';
6
7
  export interface DialogRootProps extends Omit<ViewProps, 'children' | 'role'>, IDialogRootProps, DialogVariantProps {
7
8
  className?: string;
9
+ animation?: AnimationRootDisableAll;
8
10
  }
9
11
  declare const DialogRoot: import("react").ForwardRefExoticComponent<DialogRootProps & import("react").RefAttributes<View>>;
10
12
  export interface DialogTriggerProps extends IDialogTriggerProps {
@@ -12,9 +14,11 @@ export interface DialogTriggerProps extends IDialogTriggerProps {
12
14
  children?: ReactNode;
13
15
  }
14
16
  declare const DialogTrigger: import("react").ForwardRefExoticComponent<DialogTriggerProps & import("react").RefAttributes<View>>;
15
- export interface DialogPopupProps extends IDialogPopupProps, Pick<DialogVariantProps, 'size'> {
17
+ export interface DialogPopupProps extends Omit<IDialogContentProps, 'asChild'>, Pick<DialogVariantProps, 'size'> {
16
18
  className?: string;
17
19
  children?: ReactNode;
20
+ disableFullWindowOverlay?: boolean;
21
+ isSwipeable?: boolean;
18
22
  }
19
23
  declare const DialogPopup: import("react").ForwardRefExoticComponent<DialogPopupProps & import("react").RefAttributes<View>>;
20
24
  export interface DialogHeaderProps extends ViewProps {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1E,OAAO,EASL,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACzB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EAYxB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,SA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AQF,KAAK,uBAAuB,GAAG,OAAO,UAAU,GAAG;IACjD,OAAO,EAAE,OAAO,aAAa,CAAC;IAC9B,KAAK,EAAE,OAAO,WAAW,CAAC;IAC1B,MAAM,EAAE,OAAO,YAAY,CAAC;IAC5B,KAAK,EAAE,OAAO,WAAW,CAAC;IAC1B,WAAW,EAAE,OAAO,iBAAiB,CAAC;IACtC,OAAO,EAAE,OAAO,aAAa,CAAC;IAC9B,IAAI,EAAE,OAAO,UAAU,CAAC;IACxB,MAAM,EAAE,OAAO,YAAY,CAAC;IAC5B,KAAK,EAAE,OAAO,WAAW,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,MAAM,EAUb,uBAAuB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { type VariantProps } from 'class-variance-authority';
2
+ export declare const dialogPortalVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
2
3
  export declare const dialogOverlayVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
3
4
  export declare const dialogPopupVariants: (props?: ({
4
5
  size?: "full" | "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAKlE,eAAO,MAAM,qBAAqB,oFAAmD,CAAC;AAItF,eAAO,MAAM,mBAAmB;;8EAsB/B,CAAC;AAIF,eAAO,MAAM,oBAAoB,oFAG/B,CAAC;AAIH,eAAO,MAAM,mBAAmB;;8EAY9B,CAAC;AAIH,eAAO,MAAM,uBAAuB;;8EAYlC,CAAC;AAIH,eAAO,MAAM,yBAAyB,oFAAkD,CAAC;AAIzF,eAAO,MAAM,qBAAqB;;8EAUhC,CAAC;AAIH,eAAO,MAAM,kBAAkB,oFAA2C,CAAC;AAI3E,eAAO,MAAM,oBAAoB,oFAG/B,CAAC;AAIH,eAAO,MAAM,mBAAmB,oFAa9B,CAAC;AAIH,eAAO,MAAM,uBAAuB,oFAAwC,CAAC;AAI7E,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,OAAO,mBAAmB,CAAC,GAAG;IAC1E,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,YAAY,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAKlE,eAAO,MAAM,oBAAoB,oFAI/B,CAAC;AAIH,eAAO,MAAM,qBAAqB,oFAQhC,CAAC;AAIH,eAAO,MAAM,mBAAmB;;8EA2B/B,CAAC;AAIF,eAAO,MAAM,oBAAoB,oFAG/B,CAAC;AAIH,eAAO,MAAM,mBAAmB;;8EAY9B,CAAC;AAIH,eAAO,MAAM,uBAAuB;;8EAYlC,CAAC;AAIH,eAAO,MAAM,yBAAyB,oFAAkD,CAAC;AAIzF,eAAO,MAAM,qBAAqB;;8EAUhC,CAAC;AAIH,eAAO,MAAM,kBAAkB,oFAA2C,CAAC;AAI3E,eAAO,MAAM,oBAAoB,oFAG/B,CAAC;AAIH,eAAO,MAAM,mBAAmB,oFAa9B,CAAC;AAIH,eAAO,MAAM,uBAAuB,oFAAwC,CAAC;AAI7E,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,OAAO,mBAAmB,CAAC,GAAG;IAC1E,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,YAAY,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -4,6 +4,7 @@ import { type ILinkProps } from '@cdx-ui/primitives';
4
4
  import { type IconProps } from '../Icon';
5
5
  export { LinkProvider, type LinkConfig, type LinkAction } from '@cdx-ui/primitives';
6
6
  export interface LinkProps extends ILinkProps {
7
+ asChild?: boolean;
7
8
  className?: string;
8
9
  children?: ReactNode;
9
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Link/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAY,IAAI,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAML,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAQ/C,OAAO,EAAE,YAAY,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAMpF,MAAM,WAAW,SAAU,SAAQ,UAAU;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,QAAQ,4FAcZ,CAAC;AAQH,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,SAAS,iGAwBd,CAAC;AAQF,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;CAAG;AAErE,QAAA,MAAM,QAAQ;yCAAwC,aAAa;;CAalE,CAAC;AAQF,KAAK,qBAAqB,GAAG,OAAO,QAAQ,GAAG;IAC7C,KAAK,EAAE,OAAO,SAAS,CAAC;IACxB,IAAI,EAAE,OAAO,QAAQ,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,IAAI,EAGX,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Link/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAY,IAAI,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAML,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAQ/C,OAAO,EAAE,YAAY,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAMpF,MAAM,WAAW,SAAU,SAAQ,UAAU;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,QAAQ,4FAcZ,CAAC;AAQH,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,SAAS,iGAwBd,CAAC;AAQF,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;CAAG;AAErE,QAAA,MAAM,QAAQ;yCAAwC,aAAa;;CAalE,CAAC;AAQF,KAAK,qBAAqB,GAAG,OAAO,QAAQ,GAAG;IAC7C,KAAK,EAAE,OAAO,SAAS,CAAC;IACxB,IAAI,EAAE,OAAO,QAAQ,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,IAAI,EAGX,qBAAqB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdx-ui/components",
3
- "version": "0.0.1-beta.111",
3
+ "version": "0.0.1-beta.113",
4
4
  "main": "lib/commonjs/index.js",
5
5
  "module": "lib/module/index.js",
6
6
  "react-native": "src/index.ts",
@@ -45,9 +45,11 @@
45
45
  "@shopify/flash-list": ">=2.0.0",
46
46
  "react": "^18.2.0 || ^19.0.0",
47
47
  "react-native": ">=0.76.0",
48
+ "react-native-gesture-handler": ">=2.0.0",
48
49
  "react-native-reanimated": ">=4.0.0",
49
50
  "react-native-safe-area-context": ">=4.0.0",
50
- "react-native-web": ">=0.19.0"
51
+ "react-native-web": ">=0.19.0",
52
+ "react-native-worklets": ">=0.4.0"
51
53
  },
52
54
  "peerDependenciesMeta": {
53
55
  "@shopify/flash-list": {
@@ -56,11 +58,17 @@
56
58
  "react-native": {
57
59
  "optional": true
58
60
  },
61
+ "react-native-gesture-handler": {
62
+ "optional": true
63
+ },
59
64
  "react-native-reanimated": {
60
65
  "optional": true
61
66
  },
62
67
  "react-native-web": {
63
68
  "optional": true
69
+ },
70
+ "react-native-worklets": {
71
+ "optional": true
64
72
  }
65
73
  },
66
74
  "dependencies": {
@@ -68,9 +76,9 @@
68
76
  "class-variance-authority": "^0.7.1",
69
77
  "react-native-reanimated-carousel": "5.0.0-beta.5",
70
78
  "uniwind": "1.10.0",
71
- "@cdx-ui/primitives": "0.0.1-beta.111",
72
- "@cdx-ui/utils": "0.0.1-beta.111",
73
- "@cdx-ui/icons": "0.0.1-beta.111"
79
+ "@cdx-ui/utils": "0.0.1-beta.113",
80
+ "@cdx-ui/primitives": "0.0.1-beta.113",
81
+ "@cdx-ui/icons": "0.0.1-beta.113"
74
82
  },
75
83
  "devDependencies": {
76
84
  "@react-navigation/bottom-tabs": "*",
@@ -1 +1,4 @@
1
1
  export * from './useCombinedAnimationDisabledState';
2
+ export * from './usePopupRootAnimation';
3
+ export * from './usePopupOverlayAnimation';
4
+ export * from './usePopupDialogContentAnimation';
@@ -0,0 +1,256 @@
1
+ import { useEffect, useMemo } from 'react';
2
+ import { Keyboard, Platform, useWindowDimensions } from 'react-native';
3
+ import { Gesture } from 'react-native-gesture-handler';
4
+ import {
5
+ Easing,
6
+ Extrapolation,
7
+ interpolate,
8
+ Keyframe,
9
+ useAnimatedStyle,
10
+ useDerivedValue,
11
+ useSharedValue,
12
+ withSpring,
13
+ type EntryOrExitLayoutType,
14
+ type SharedValue,
15
+ } from 'react-native-reanimated';
16
+ import { scheduleOnRN } from 'react-native-worklets';
17
+ import { useAnimationSettings } from '../../providers/animation-settings';
18
+ import type { PopupDialogContentAnimation } from '../types';
19
+ import { getAnimationState, getIsAnimationDisabledValue } from '../utils';
20
+
21
+ const IS_WEB = Platform.OS === 'web';
22
+
23
+ export interface UsePopupDialogContentAnimationOptions {
24
+ isOpen: boolean;
25
+ progress: SharedValue<number>;
26
+ isDragging: SharedValue<boolean>;
27
+ isGestureReleaseAnimationRunning: SharedValue<boolean>;
28
+ onOpenChange: (open: boolean) => void;
29
+ animation?: PopupDialogContentAnimation;
30
+ /** @default true */
31
+ isSwipeable?: boolean;
32
+ }
33
+
34
+ const DEFAULT_ENTERING_ANIMATION: EntryOrExitLayoutType = new Keyframe({
35
+ 0: {
36
+ transform: [{ scale: 0.96 }],
37
+ opacity: 0,
38
+ },
39
+ 100: {
40
+ transform: [{ scale: 1 }],
41
+ opacity: 1,
42
+ easing: Easing.out(Easing.ease),
43
+ },
44
+ }).duration(200);
45
+
46
+ const DEFAULT_EXITING_ANIMATION: EntryOrExitLayoutType = new Keyframe({
47
+ 0: {
48
+ transform: [{ scale: 1 }],
49
+ opacity: 1,
50
+ },
51
+ 100: {
52
+ transform: [{ scale: 0.96 }],
53
+ opacity: 0,
54
+ easing: Easing.in(Easing.ease),
55
+ },
56
+ }).duration(150);
57
+
58
+ /**
59
+ * Animation hook for popup dialog content (panel).
60
+ * Handles enter/exit Keyframes, swipe-to-dismiss gesture, and drag-driven
61
+ * translateY + scale via a shared `progress` value.
62
+ *
63
+ * On web, entering/exiting are undefined (CSS transitions drive the visuals)
64
+ * and the gesture is disabled.
65
+ */
66
+ export function usePopupDialogContentAnimation({
67
+ isOpen,
68
+ progress,
69
+ isDragging,
70
+ isGestureReleaseAnimationRunning,
71
+ onOpenChange,
72
+ animation,
73
+ isSwipeable = true,
74
+ }: UsePopupDialogContentAnimationOptions) {
75
+ const { height: screenHeight } = useWindowDimensions();
76
+
77
+ const animationSettingsContext = useAnimationSettings();
78
+ const isAllAnimationsDisabled = animationSettingsContext?.isAllAnimationsDisabled;
79
+
80
+ const { animationConfig, isAnimationDisabled } = getAnimationState(animation);
81
+
82
+ const isAnimationDisabledValue = getIsAnimationDisabledValue({
83
+ isAnimationDisabled,
84
+ isAllAnimationsDisabled,
85
+ });
86
+
87
+ const enteringValue = animationConfig?.entering ?? DEFAULT_ENTERING_ANIMATION;
88
+ const exitingValue = animationConfig?.exiting ?? DEFAULT_EXITING_ANIMATION;
89
+
90
+ const contentY = useSharedValue(0);
91
+ const contentHeight = useSharedValue(0);
92
+ const progressAnchor = useSharedValue(1);
93
+ const contentTranslateYAnchor = useSharedValue(0);
94
+ const contentScaleAnchor = useSharedValue(1);
95
+ const gestureTranslationY = useSharedValue(0);
96
+
97
+ useEffect(() => {
98
+ if (isOpen) {
99
+ progress.set(1);
100
+ }
101
+ }, [isOpen, progress]);
102
+
103
+ const dismissKeyboard = () => {
104
+ Keyboard.dismiss();
105
+ };
106
+
107
+ const contentTranslateY = useDerivedValue(() => {
108
+ const maxDragDistance = screenHeight - contentY.get();
109
+
110
+ if (progress.get() >= 1) {
111
+ return interpolate(progress.get(), [1, 2], [0, maxDragDistance], Extrapolation.CLAMP);
112
+ }
113
+
114
+ const absoluteGestureTranslationY = Math.abs(gestureTranslationY.get());
115
+
116
+ return interpolate(
117
+ absoluteGestureTranslationY,
118
+ [0, screenHeight],
119
+ [0, -50],
120
+ Extrapolation.CLAMP,
121
+ );
122
+ });
123
+
124
+ const contentScale = useDerivedValue(() => {
125
+ return interpolate(progress.get(), [1, 2], [1, 0.95], Extrapolation.CLAMP);
126
+ });
127
+
128
+ const panGesture = useMemo(
129
+ () =>
130
+ Gesture.Pan()
131
+ .enabled(isSwipeable && isOpen && !isAnimationDisabledValue && !IS_WEB)
132
+ .onStart(() => isDragging.set(true))
133
+ .onUpdate((event) => {
134
+ if (!isDragging.get()) return;
135
+
136
+ const maxDragDistance = screenHeight - contentY.get();
137
+
138
+ gestureTranslationY.set(event.translationY);
139
+
140
+ if (event.translationY > 0) {
141
+ const progressValue = 1 + event.translationY / maxDragDistance;
142
+ progress.set(Math.max(1, Math.min(progressValue, 2)));
143
+ } else if (event.translationY < 0) {
144
+ const progressValue = 1 - Math.abs(event.translationY) / contentY.get();
145
+ progress.set(Math.max(0, Math.min(progressValue, 1)));
146
+ }
147
+ })
148
+ .onFinalize(() => {
149
+ progressAnchor.set(progress.get());
150
+ contentTranslateYAnchor.set(contentTranslateY.get());
151
+ contentScaleAnchor.set(contentScale.get());
152
+
153
+ if (progress.get() > 1.1) {
154
+ isGestureReleaseAnimationRunning.set(true);
155
+ scheduleOnRN(dismissKeyboard);
156
+ progress.set(
157
+ withSpring(
158
+ 2,
159
+ {
160
+ mass: 4,
161
+ damping: 120,
162
+ stiffness: 900,
163
+ overshootClamping: false,
164
+ },
165
+ () => {
166
+ isGestureReleaseAnimationRunning.set(false);
167
+ },
168
+ ),
169
+ );
170
+ isDragging.set(false);
171
+ setTimeout(() => {
172
+ progress.set(2);
173
+ scheduleOnRN(onOpenChange, false);
174
+ }, 300);
175
+ setTimeout(() => {
176
+ progress.set(0);
177
+ }, 350);
178
+ } else {
179
+ isGestureReleaseAnimationRunning.set(true);
180
+ progress.set(
181
+ withSpring(1, {}, () => {
182
+ isGestureReleaseAnimationRunning.set(false);
183
+ }),
184
+ );
185
+ isDragging.set(false);
186
+ }
187
+ }),
188
+ [
189
+ contentScale,
190
+ contentScaleAnchor,
191
+ contentTranslateY,
192
+ contentTranslateYAnchor,
193
+ contentY,
194
+ isOpen,
195
+ isDragging,
196
+ isGestureReleaseAnimationRunning,
197
+ isSwipeable,
198
+ onOpenChange,
199
+ progress,
200
+ progressAnchor,
201
+ screenHeight,
202
+ isAnimationDisabledValue,
203
+ gestureTranslationY,
204
+ ],
205
+ );
206
+
207
+ const rDragContainerStyle = useAnimatedStyle(() => {
208
+ if (isGestureReleaseAnimationRunning.get()) {
209
+ return {
210
+ opacity: interpolate(progress.get(), [1, progressAnchor.get(), 1.5, 1.75], [1, 1, 1, 0]),
211
+ transform: [
212
+ {
213
+ translateY: interpolate(
214
+ progress.get(),
215
+ [progressAnchor.get(), 1, progressAnchor.get(), progressAnchor.get() + 0.1, 2],
216
+ [
217
+ contentTranslateYAnchor.get(),
218
+ 0,
219
+ contentTranslateYAnchor.get(),
220
+ contentTranslateYAnchor.get() + 50,
221
+ contentTranslateYAnchor.get() - 150,
222
+ ],
223
+ ),
224
+ },
225
+ {
226
+ scale: interpolate(
227
+ progress.get(),
228
+ [progressAnchor.get(), 1, progressAnchor.get(), 2],
229
+ [contentScaleAnchor.get(), 1, contentScaleAnchor.get(), 0.75],
230
+ ),
231
+ },
232
+ ],
233
+ };
234
+ }
235
+
236
+ return {
237
+ transform: [
238
+ {
239
+ translateY: contentTranslateY.get(),
240
+ },
241
+ {
242
+ scale: contentScale.get(),
243
+ },
244
+ ],
245
+ };
246
+ });
247
+
248
+ return {
249
+ contentY,
250
+ contentHeight,
251
+ panGesture,
252
+ rDragContainerStyle,
253
+ entering: isAnimationDisabledValue || IS_WEB ? undefined : enteringValue,
254
+ exiting: isAnimationDisabledValue || IS_WEB ? undefined : exitingValue,
255
+ };
256
+ }
@@ -0,0 +1,84 @@
1
+ import { Platform } from 'react-native';
2
+ import type { SharedValue } from 'react-native-reanimated';
3
+ import { FadeIn, FadeOut, interpolate, useAnimatedStyle } from 'react-native-reanimated';
4
+ import { useAnimationSettings } from '../../providers/animation-settings';
5
+ import type { PopupOverlayAnimation } from '../types';
6
+ import {
7
+ getAnimationState,
8
+ getAnimationValueProperty,
9
+ getIsAnimationDisabledValue,
10
+ } from '../utils';
11
+
12
+ const IS_WEB = Platform.OS === 'web';
13
+
14
+ export interface UsePopupOverlayAnimationOptions {
15
+ /** Animation progress shared value (0=idle, 1=open, 2=close) */
16
+ progress?: SharedValue<number>;
17
+ /** Dragging state shared value */
18
+ isDragging?: SharedValue<boolean>;
19
+ /** Gesture release animation running state (for components with swipe gestures) */
20
+ isGestureReleaseAnimationRunning?: SharedValue<boolean>;
21
+ /** Animation configuration for overlay */
22
+ animation?: PopupOverlayAnimation;
23
+ }
24
+
25
+ /**
26
+ * Animation hook for popup overlay (backdrop) components.
27
+ * Shared by Dialog, Select, BottomSheet, Popover, etc.
28
+ *
29
+ * Returns progress-based opacity style and entering/exiting layout animations.
30
+ * On web, entering/exiting are undefined (CSS transitions drive the visuals).
31
+ */
32
+ export function usePopupOverlayAnimation(options: UsePopupOverlayAnimationOptions) {
33
+ const { progress, isDragging, isGestureReleaseAnimationRunning, animation } = options;
34
+
35
+ const animationSettingsContext = useAnimationSettings();
36
+ const isAllAnimationsDisabled = animationSettingsContext?.isAllAnimationsDisabled;
37
+
38
+ const { animationConfig, isAnimationDisabled } = getAnimationState(animation);
39
+
40
+ const isAnimationDisabledValue = getIsAnimationDisabledValue({
41
+ isAnimationDisabled,
42
+ isAllAnimationsDisabled,
43
+ });
44
+
45
+ const opacityValue = getAnimationValueProperty({
46
+ animationValue: animationConfig?.opacity,
47
+ property: 'value',
48
+ defaultValue: [0, 1, 0] as [number, number, number],
49
+ });
50
+
51
+ const rContainerStyle = useAnimatedStyle(() => {
52
+ if (progress?.get() === undefined) {
53
+ return {};
54
+ }
55
+
56
+ if (isAnimationDisabledValue) {
57
+ return {
58
+ opacity: progress.get() > 0 ? 1 : 0,
59
+ };
60
+ }
61
+
62
+ if ((isDragging?.get() || isGestureReleaseAnimationRunning?.get()) && progress.get() <= 1) {
63
+ return {
64
+ opacity: 1,
65
+ };
66
+ }
67
+
68
+ return {
69
+ opacity: interpolate(progress.get(), [0, 1, 2], opacityValue),
70
+ };
71
+ });
72
+
73
+ const enteringValue =
74
+ animationConfig?.entering ?? (isAnimationDisabledValue ? undefined : FadeIn.duration(200));
75
+
76
+ const exitingValue =
77
+ animationConfig?.exiting ?? (isAnimationDisabledValue ? undefined : FadeOut.duration(150));
78
+
79
+ return {
80
+ rContainerStyle,
81
+ entering: isAnimationDisabledValue || IS_WEB ? undefined : enteringValue,
82
+ exiting: isAnimationDisabledValue || IS_WEB ? undefined : exitingValue,
83
+ };
84
+ }
@@ -0,0 +1,27 @@
1
+ import { useSharedValue } from 'react-native-reanimated';
2
+ import type { AnimationRootDisableAll } from '../types';
3
+ import { useCombinedAnimationDisabledState } from './useCombinedAnimationDisabledState';
4
+
5
+ export interface UsePopupRootAnimationOptions {
6
+ animation?: AnimationRootDisableAll;
7
+ }
8
+
9
+ /**
10
+ * Root animation hook for popup-like components (Dialog, Select, BottomSheet, Popover, etc.)
11
+ * Manages component state transitions and animation coordination via a shared
12
+ * `progress` value: 0 = idle/closed, 1 = fully open, 2 = dismissed.
13
+ */
14
+ export function usePopupRootAnimation(options: UsePopupRootAnimationOptions) {
15
+ const isAllAnimationsDisabled = useCombinedAnimationDisabledState(options.animation);
16
+
17
+ const progress = useSharedValue(0);
18
+ const isDragging = useSharedValue(false);
19
+ const isGestureReleaseAnimationRunning = useSharedValue(false);
20
+
21
+ return {
22
+ isAllAnimationsDisabled,
23
+ progress,
24
+ isDragging,
25
+ isGestureReleaseAnimationRunning,
26
+ };
27
+ }
@@ -3,7 +3,7 @@ import { View } from 'react-native';
3
3
  import { Slot, useDialog } from '@cdx-ui/primitives';
4
4
  import { composeEventHandlers } from '@cdx-ui/utils';
5
5
  import { Button, type ButtonProps } from '../Button';
6
- import { Dialog, type DialogRootProps } from '../Dialog';
6
+ import { Dialog, type DialogRootProps, type DialogPopupProps } from '../Dialog';
7
7
 
8
8
  // =============================================================================
9
9
  // ALERT DIALOG ROOT (Dialog with non-dismissible defaults + alertdialog role)
@@ -35,6 +35,19 @@ const AlertDialogRoot = forwardRef<View, AlertDialogRootProps>(
35
35
  );
36
36
  AlertDialogRoot.displayName = 'AlertDialog';
37
37
 
38
+ // =============================================================================
39
+ // ALERT DIALOG POPUP (swipe disabled by default)
40
+ // =============================================================================
41
+
42
+ export interface AlertDialogPopupProps extends DialogPopupProps {}
43
+
44
+ const AlertDialogPopup = forwardRef<View, AlertDialogPopupProps>(
45
+ ({ isSwipeable = false, ...props }, ref) => (
46
+ <Dialog.Popup ref={ref} isSwipeable={isSwipeable} {...props} />
47
+ ),
48
+ );
49
+ AlertDialogPopup.displayName = 'AlertDialog.Popup';
50
+
38
51
  // =============================================================================
39
52
  // ALERT DIALOG ACTION
40
53
  // =============================================================================
@@ -98,7 +111,7 @@ AlertDialogCancel.displayName = 'AlertDialog.Cancel';
98
111
 
99
112
  type AlertDialogCompoundComponent = typeof AlertDialogRoot & {
100
113
  Trigger: typeof Dialog.Trigger;
101
- Popup: typeof Dialog.Popup;
114
+ Popup: typeof AlertDialogPopup;
102
115
  Header: typeof Dialog.Header;
103
116
  Title: typeof Dialog.Title;
104
117
  Description: typeof Dialog.Description;
@@ -112,7 +125,7 @@ type AlertDialogCompoundComponent = typeof AlertDialogRoot & {
112
125
 
113
126
  export const AlertDialog = Object.assign(AlertDialogRoot, {
114
127
  Trigger: Dialog.Trigger,
115
- Popup: Dialog.Popup,
128
+ Popup: AlertDialogPopup,
116
129
  Header: Dialog.Header,
117
130
  Title: Dialog.Title,
118
131
  Description: Dialog.Description,
@@ -1,19 +1,15 @@
1
1
  import { type ForwardedRef, forwardRef } from 'react';
2
2
  import { View, type ViewProps } from 'react-native';
3
- import { WrapStringChild } from '../../utils/WrapStringChild';
4
- import type { TextProps } from '../Text';
5
3
 
6
4
  export interface BoxProps extends ViewProps {
7
5
  className?: string;
8
- textProps?: TextProps;
9
6
  }
10
7
 
11
- /** @deprecated Use View instead */
12
8
  export const Box = forwardRef<View, BoxProps>(
13
- ({ style, className, children, textProps, ...restProps }, ref: ForwardedRef<View>) => {
9
+ ({ children, ...restProps }, ref: ForwardedRef<View>) => {
14
10
  return (
15
- <View ref={ref} style={style} className={className} {...restProps}>
16
- <WrapStringChild textProps={textProps}>{children}</WrapStringChild>
11
+ <View ref={ref} {...restProps}>
12
+ {children}
17
13
  </View>
18
14
  );
19
15
  },
@@ -0,0 +1,13 @@
1
+ import type { SharedValue } from 'react-native-reanimated';
2
+ import { createContext } from '@cdx-ui/utils';
3
+
4
+ export interface DialogAnimationContextValue {
5
+ progress: SharedValue<number>;
6
+ isDragging: SharedValue<boolean>;
7
+ isGestureReleaseAnimationRunning: SharedValue<boolean>;
8
+ }
9
+
10
+ export const [DialogAnimationProvider, useDialogAnimation] =
11
+ createContext<DialogAnimationContextValue>('DialogAnimationContext', {
12
+ strict: false,
13
+ });