@yahoo/uds-mobile 2.19.0 → 2.20.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.
- package/dist/components/Modal/Modal.cjs +396 -0
- package/dist/components/Modal/Modal.d.cts +9 -0
- package/dist/components/Modal/Modal.d.cts.map +1 -0
- package/dist/components/Modal/Modal.d.ts +9 -0
- package/dist/components/Modal/Modal.d.ts.map +1 -0
- package/dist/components/Modal/Modal.js +395 -0
- package/dist/components/Modal/Modal.js.map +1 -0
- package/dist/components/Modal/ModalActions.cjs +47 -0
- package/dist/components/Modal/ModalActions.d.cts +9 -0
- package/dist/components/Modal/ModalActions.d.cts.map +1 -0
- package/dist/components/Modal/ModalActions.d.ts +9 -0
- package/dist/components/Modal/ModalActions.d.ts.map +1 -0
- package/dist/components/Modal/ModalActions.js +47 -0
- package/dist/components/Modal/ModalActions.js.map +1 -0
- package/dist/components/Modal/ModalContent.cjs +41 -0
- package/dist/components/Modal/ModalContent.d.cts +9 -0
- package/dist/components/Modal/ModalContent.d.cts.map +1 -0
- package/dist/components/Modal/ModalContent.d.ts +9 -0
- package/dist/components/Modal/ModalContent.d.ts.map +1 -0
- package/dist/components/Modal/ModalContent.js +41 -0
- package/dist/components/Modal/ModalContent.js.map +1 -0
- package/dist/components/Modal/ModalContext.cjs +14 -0
- package/dist/components/Modal/ModalContext.d.cts +10 -0
- package/dist/components/Modal/ModalContext.d.cts.map +1 -0
- package/dist/components/Modal/ModalContext.d.ts +10 -0
- package/dist/components/Modal/ModalContext.d.ts.map +1 -0
- package/dist/components/Modal/ModalContext.js +13 -0
- package/dist/components/Modal/ModalContext.js.map +1 -0
- package/dist/components/Modal/ModalDescription.cjs +21 -0
- package/dist/components/Modal/ModalDescription.d.cts +9 -0
- package/dist/components/Modal/ModalDescription.d.cts.map +1 -0
- package/dist/components/Modal/ModalDescription.d.ts +9 -0
- package/dist/components/Modal/ModalDescription.d.ts.map +1 -0
- package/dist/components/Modal/ModalDescription.js +21 -0
- package/dist/components/Modal/ModalDescription.js.map +1 -0
- package/dist/components/Modal/ModalTitle.cjs +22 -0
- package/dist/components/Modal/ModalTitle.d.cts +9 -0
- package/dist/components/Modal/ModalTitle.d.cts.map +1 -0
- package/dist/components/Modal/ModalTitle.d.ts +9 -0
- package/dist/components/Modal/ModalTitle.d.ts.map +1 -0
- package/dist/components/Modal/ModalTitle.js +22 -0
- package/dist/components/Modal/ModalTitle.js.map +1 -0
- package/dist/components/Modal/index.cjs +12 -0
- package/dist/components/Modal/index.d.cts +8 -0
- package/dist/components/Modal/index.d.ts +8 -0
- package/dist/components/Modal/index.js +7 -0
- package/dist/components/Modal/types.cjs +1 -0
- package/dist/components/Modal/types.d.cts +111 -0
- package/dist/components/Modal/types.d.cts.map +1 -0
- package/dist/components/Modal/types.d.ts +111 -0
- package/dist/components/Modal/types.d.ts.map +1 -0
- package/dist/components/Modal/types.js +1 -0
- package/dist/components/Modal/utils.cjs +59 -0
- package/dist/components/Modal/utils.d.cts +28 -0
- package/dist/components/Modal/utils.d.cts.map +1 -0
- package/dist/components/Modal/utils.d.ts +28 -0
- package/dist/components/Modal/utils.d.ts.map +1 -0
- package/dist/components/Modal/utils.js +56 -0
- package/dist/components/Modal/utils.js.map +1 -0
- package/dist/jest/mocks/gesture-handler.cjs +29 -0
- package/dist/jest/mocks/gesture-handler.d.cts +27 -2
- package/dist/jest/mocks/gesture-handler.d.cts.map +1 -1
- package/dist/jest/mocks/gesture-handler.d.ts +27 -2
- package/dist/jest/mocks/gesture-handler.d.ts.map +1 -1
- package/dist/jest/mocks/gesture-handler.js +22 -1
- package/dist/jest/mocks/gesture-handler.js.map +1 -1
- package/dist/jest/mocks/styles.cjs +39 -0
- package/dist/jest/mocks/styles.d.cts +3 -2
- package/dist/jest/mocks/styles.d.cts.map +1 -1
- package/dist/jest/mocks/styles.d.ts +3 -2
- package/dist/jest/mocks/styles.d.ts.map +1 -1
- package/dist/jest/mocks/styles.js +39 -1
- package/dist/jest/mocks/styles.js.map +1 -1
- package/dist/jest/setup.cjs +8 -28
- package/dist/jest/setup.d.cts.map +1 -1
- package/dist/jest/setup.d.ts.map +1 -1
- package/dist/jest/setup.js +8 -28
- package/dist/jest/setup.js.map +1 -1
- package/package.json +11 -1
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { useInternalModalContext } from "./ModalContext.js";
|
|
3
|
+
import { memo } from "react";
|
|
4
|
+
import { ScrollView, StyleSheet, View } from "react-native";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { modalStyles } from "../../../generated/styles";
|
|
7
|
+
//#region src/components/Modal/ModalContent.tsx
|
|
8
|
+
const ModalContent = memo(function ModalContent({ children, contentContainerStyle, style, ref, ...viewProps }) {
|
|
9
|
+
const { onScroll, onScrollInteractionBegin, onScrollInteractionEnd, scrollBehavior } = useInternalModalContext();
|
|
10
|
+
modalStyles.useVariants({});
|
|
11
|
+
if (scrollBehavior === "inside") return /* @__PURE__ */ jsx(ScrollView, {
|
|
12
|
+
ref,
|
|
13
|
+
disableScrollViewPanResponder: true,
|
|
14
|
+
keyboardShouldPersistTaps: "handled",
|
|
15
|
+
...viewProps,
|
|
16
|
+
contentContainerStyle: [modalStyles.spacingHorizontal, contentContainerStyle],
|
|
17
|
+
onMomentumScrollEnd: onScrollInteractionEnd,
|
|
18
|
+
onScroll,
|
|
19
|
+
onScrollBeginDrag: onScrollInteractionBegin,
|
|
20
|
+
onScrollEndDrag: onScrollInteractionEnd,
|
|
21
|
+
scrollEventThrottle: 16,
|
|
22
|
+
style: [styles$1.insideContent, style],
|
|
23
|
+
children
|
|
24
|
+
});
|
|
25
|
+
return /* @__PURE__ */ jsx(View, {
|
|
26
|
+
ref,
|
|
27
|
+
...viewProps,
|
|
28
|
+
style: [modalStyles.spacingHorizontal, style],
|
|
29
|
+
children
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
ModalContent.displayName = "ModalContent";
|
|
33
|
+
ModalContent.__modalSlot = "content";
|
|
34
|
+
const styles$1 = StyleSheet.create({ insideContent: {
|
|
35
|
+
flexGrow: 1,
|
|
36
|
+
flexShrink: 1
|
|
37
|
+
} });
|
|
38
|
+
//#endregion
|
|
39
|
+
export { ModalContent };
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=ModalContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalContent.js","names":["styles"],"sources":["../../../src/components/Modal/ModalContent.tsx"],"sourcesContent":["import type { Ref } from 'react';\nimport { memo } from 'react';\nimport type { ScrollView as ScrollViewType } from 'react-native';\nimport { ScrollView, StyleSheet, View } from 'react-native';\n\nimport { modalStyles } from '../../../generated/styles';\nimport { useInternalModalContext } from './ModalContext';\nimport type { ModalContentProps, ModalSlotComponent } from './types';\n\nconst ModalContent = memo(function ModalContent({\n children,\n contentContainerStyle,\n style,\n ref,\n ...viewProps\n}: ModalContentProps) {\n const { onScroll, onScrollInteractionBegin, onScrollInteractionEnd, scrollBehavior } =\n useInternalModalContext();\n\n modalStyles.useVariants({});\n\n if (scrollBehavior === 'inside') {\n return (\n <ScrollView\n ref={ref as Ref<ScrollViewType>}\n disableScrollViewPanResponder\n keyboardShouldPersistTaps=\"handled\"\n {...viewProps}\n contentContainerStyle={[modalStyles.spacingHorizontal, contentContainerStyle]}\n onMomentumScrollEnd={onScrollInteractionEnd}\n onScroll={onScroll}\n onScrollBeginDrag={onScrollInteractionBegin}\n onScrollEndDrag={onScrollInteractionEnd}\n scrollEventThrottle={16}\n style={[styles.insideContent, style]}\n >\n {children}\n </ScrollView>\n );\n }\n\n return (\n <View ref={ref as Ref<View>} {...viewProps} style={[modalStyles.spacingHorizontal, style]}>\n {children}\n </View>\n );\n});\n\nModalContent.displayName = 'ModalContent';\n(ModalContent as ModalSlotComponent).__modalSlot = 'content';\n\nconst styles = StyleSheet.create({\n insideContent: {\n flexGrow: 1,\n flexShrink: 1,\n },\n});\n\nexport { ModalContent, type ModalContentProps };\n"],"mappings":";;;;;;;AASA,MAAM,eAAe,KAAK,SAAS,aAAa,EAC9C,UACA,uBACA,OACA,KACA,GAAG,aACiB;CACpB,MAAM,EAAE,UAAU,0BAA0B,wBAAwB,mBAClE,yBAAyB;CAE3B,YAAY,YAAY,EAAE,CAAC;CAE3B,IAAI,mBAAmB,UACrB,OACE,oBAAC,YAAD;EACO;EACL,+BAAA;EACA,2BAA0B;EAC1B,GAAI;EACJ,uBAAuB,CAAC,YAAY,mBAAmB,sBAAsB;EAC7E,qBAAqB;EACX;EACV,mBAAmB;EACnB,iBAAiB;EACjB,qBAAqB;EACrB,OAAO,CAACA,SAAO,eAAe,MAAM;EAEnC;EACU,CAAA;CAIjB,OACE,oBAAC,MAAD;EAAW;EAAkB,GAAI;EAAW,OAAO,CAAC,YAAY,mBAAmB,MAAM;EACtF;EACI,CAAA;EAET;AAEF,aAAa,cAAc;AAC3B,aAAqC,cAAc;AAEnD,MAAMA,WAAS,WAAW,OAAO,EAC/B,eAAe;CACb,UAAU;CACV,YAAY;CACb,EACF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
require("../../_virtual/_rolldown/runtime.cjs");
|
|
4
|
+
let react = require("react");
|
|
5
|
+
//#region src/components/Modal/ModalContext.tsx
|
|
6
|
+
const ModalContext = (0, react.createContext)(null);
|
|
7
|
+
function useInternalModalContext() {
|
|
8
|
+
const context = (0, react.use)(ModalContext);
|
|
9
|
+
if (!context) throw new Error("Modal subcomponents must be rendered inside Modal.");
|
|
10
|
+
return context;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
exports.ModalContext = ModalContext;
|
|
14
|
+
exports.useInternalModalContext = useInternalModalContext;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
import { ModalContextValue } from "./types.cjs";
|
|
3
|
+
import * as _$react from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Modal/ModalContext.d.ts
|
|
6
|
+
declare const ModalContext: _$react.Context<ModalContextValue | null>;
|
|
7
|
+
declare function useInternalModalContext(): ModalContextValue;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { ModalContext, useInternalModalContext };
|
|
10
|
+
//# sourceMappingURL=ModalContext.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalContext.d.cts","names":[],"sources":["../../../src/components/Modal/ModalContext.tsx"],"mappings":";;;;;cAIM,YAAA,EAAY,OAAA,CAAA,OAAA,CAAA,iBAAA;AAAA,iBAET,uBAAA,CAAA,GAA2B,iBAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
import { ModalContextValue } from "./types.js";
|
|
3
|
+
import * as _$react from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Modal/ModalContext.d.ts
|
|
6
|
+
declare const ModalContext: _$react.Context<ModalContextValue | null>;
|
|
7
|
+
declare function useInternalModalContext(): ModalContextValue;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { ModalContext, useInternalModalContext };
|
|
10
|
+
//# sourceMappingURL=ModalContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalContext.d.ts","names":[],"sources":["../../../src/components/Modal/ModalContext.tsx"],"mappings":";;;;;cAIM,YAAA,EAAY,OAAA,CAAA,OAAA,CAAA,iBAAA;AAAA,iBAET,uBAAA,CAAA,GAA2B,iBAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { createContext, use } from "react";
|
|
3
|
+
//#region src/components/Modal/ModalContext.tsx
|
|
4
|
+
const ModalContext = createContext(null);
|
|
5
|
+
function useInternalModalContext() {
|
|
6
|
+
const context = use(ModalContext);
|
|
7
|
+
if (!context) throw new Error("Modal subcomponents must be rendered inside Modal.");
|
|
8
|
+
return context;
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { ModalContext, useInternalModalContext };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=ModalContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalContext.js","names":[],"sources":["../../../src/components/Modal/ModalContext.tsx"],"sourcesContent":["import { createContext, use } from 'react';\n\nimport type { ModalContextValue } from './types';\n\nconst ModalContext = createContext<ModalContextValue | null>(null);\n\nfunction useInternalModalContext(): ModalContextValue {\n const context = use(ModalContext);\n\n if (!context) {\n throw new Error('Modal subcomponents must be rendered inside Modal.');\n }\n\n return context;\n}\n\nexport { ModalContext, useInternalModalContext };\n"],"mappings":";;;AAIA,MAAM,eAAe,cAAwC,KAAK;AAElE,SAAS,0BAA6C;CACpD,MAAM,UAAU,IAAI,aAAa;CAEjC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,qDAAqD;CAGvE,OAAO"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
require("../../_virtual/_rolldown/runtime.cjs");
|
|
4
|
+
const require_components_Text = require("../Text.cjs");
|
|
5
|
+
let react = require("react");
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
let generated_styles = require("../../../generated/styles");
|
|
8
|
+
//#region src/components/Modal/ModalDescription.tsx
|
|
9
|
+
const ModalDescription = (0, react.memo)(function ModalDescription({ children, style, ref, ...textProps }) {
|
|
10
|
+
generated_styles.modalStyles.useVariants({});
|
|
11
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Text.Text, {
|
|
12
|
+
ref,
|
|
13
|
+
...textProps,
|
|
14
|
+
style: [generated_styles.modalStyles.description, style],
|
|
15
|
+
children
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
ModalDescription.displayName = "ModalDescription";
|
|
19
|
+
ModalDescription.__modalSlot = "description";
|
|
20
|
+
//#endregion
|
|
21
|
+
exports.ModalDescription = ModalDescription;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
|
|
2
|
+
import { ModalDescriptionProps } from "./types.cjs";
|
|
3
|
+
import * as _$react from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Modal/ModalDescription.d.ts
|
|
6
|
+
declare const ModalDescription: _$react.NamedExoticComponent<ModalDescriptionProps>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { ModalDescription, type ModalDescriptionProps };
|
|
9
|
+
//# sourceMappingURL=ModalDescription.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalDescription.d.cts","names":[],"sources":["../../../src/components/Modal/ModalDescription.tsx"],"mappings":";;;;;cAMM,gBAAA,EAAgB,OAAA,CAAA,oBAAA,CAAA,qBAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
|
|
2
|
+
import { ModalDescriptionProps } from "./types.js";
|
|
3
|
+
import * as _$react from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Modal/ModalDescription.d.ts
|
|
6
|
+
declare const ModalDescription: _$react.NamedExoticComponent<ModalDescriptionProps>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { ModalDescription, type ModalDescriptionProps };
|
|
9
|
+
//# sourceMappingURL=ModalDescription.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalDescription.d.ts","names":[],"sources":["../../../src/components/Modal/ModalDescription.tsx"],"mappings":";;;;;cAMM,gBAAA,EAAgB,OAAA,CAAA,oBAAA,CAAA,qBAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { Text } from "../Text.js";
|
|
3
|
+
import { memo } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { modalStyles } from "../../../generated/styles";
|
|
6
|
+
//#region src/components/Modal/ModalDescription.tsx
|
|
7
|
+
const ModalDescription = memo(function ModalDescription({ children, style, ref, ...textProps }) {
|
|
8
|
+
modalStyles.useVariants({});
|
|
9
|
+
return /* @__PURE__ */ jsx(Text, {
|
|
10
|
+
ref,
|
|
11
|
+
...textProps,
|
|
12
|
+
style: [modalStyles.description, style],
|
|
13
|
+
children
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
ModalDescription.displayName = "ModalDescription";
|
|
17
|
+
ModalDescription.__modalSlot = "description";
|
|
18
|
+
//#endregion
|
|
19
|
+
export { ModalDescription };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=ModalDescription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalDescription.js","names":[],"sources":["../../../src/components/Modal/ModalDescription.tsx"],"sourcesContent":["import { memo } from 'react';\n\nimport { modalStyles } from '../../../generated/styles';\nimport { Text } from '../Text';\nimport type { ModalDescriptionProps, ModalSlotComponent } from './types';\n\nconst ModalDescription = memo(function ModalDescription({\n children,\n style,\n ref,\n ...textProps\n}: ModalDescriptionProps) {\n modalStyles.useVariants({});\n\n return (\n <Text ref={ref} {...textProps} style={[modalStyles.description, style]}>\n {children}\n </Text>\n );\n});\n\nModalDescription.displayName = 'ModalDescription';\n(ModalDescription as ModalSlotComponent).__modalSlot = 'description';\n\nexport { ModalDescription, type ModalDescriptionProps };\n"],"mappings":";;;;;;AAMA,MAAM,mBAAmB,KAAK,SAAS,iBAAiB,EACtD,UACA,OACA,KACA,GAAG,aACqB;CACxB,YAAY,YAAY,EAAE,CAAC;CAE3B,OACE,oBAAC,MAAD;EAAW;EAAK,GAAI;EAAW,OAAO,CAAC,YAAY,aAAa,MAAM;EACnE;EACI,CAAA;EAET;AAEF,iBAAiB,cAAc;AAC/B,iBAAyC,cAAc"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
require("../../_virtual/_rolldown/runtime.cjs");
|
|
4
|
+
const require_components_Text = require("../Text.cjs");
|
|
5
|
+
let react = require("react");
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
let generated_styles = require("../../../generated/styles");
|
|
8
|
+
//#region src/components/Modal/ModalTitle.tsx
|
|
9
|
+
const ModalTitle = (0, react.memo)(function ModalTitle({ children, style, ref, ...textProps }) {
|
|
10
|
+
generated_styles.modalStyles.useVariants({});
|
|
11
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Text.Text, {
|
|
12
|
+
ref,
|
|
13
|
+
accessibilityRole: "header",
|
|
14
|
+
...textProps,
|
|
15
|
+
style: [generated_styles.modalStyles.title, style],
|
|
16
|
+
children
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
ModalTitle.displayName = "ModalTitle";
|
|
20
|
+
ModalTitle.__modalSlot = "title";
|
|
21
|
+
//#endregion
|
|
22
|
+
exports.ModalTitle = ModalTitle;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
|
|
2
|
+
import { ModalTitleProps } from "./types.cjs";
|
|
3
|
+
import * as _$react from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Modal/ModalTitle.d.ts
|
|
6
|
+
declare const ModalTitle: _$react.NamedExoticComponent<ModalTitleProps>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { ModalTitle, type ModalTitleProps };
|
|
9
|
+
//# sourceMappingURL=ModalTitle.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalTitle.d.cts","names":[],"sources":["../../../src/components/Modal/ModalTitle.tsx"],"mappings":";;;;;cAMM,UAAA,EAAU,OAAA,CAAA,oBAAA,CAAA,eAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
|
|
2
|
+
import { ModalTitleProps } from "./types.js";
|
|
3
|
+
import * as _$react from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Modal/ModalTitle.d.ts
|
|
6
|
+
declare const ModalTitle: _$react.NamedExoticComponent<ModalTitleProps>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { ModalTitle, type ModalTitleProps };
|
|
9
|
+
//# sourceMappingURL=ModalTitle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalTitle.d.ts","names":[],"sources":["../../../src/components/Modal/ModalTitle.tsx"],"mappings":";;;;;cAMM,UAAA,EAAU,OAAA,CAAA,oBAAA,CAAA,eAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { Text } from "../Text.js";
|
|
3
|
+
import { memo } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { modalStyles } from "../../../generated/styles";
|
|
6
|
+
//#region src/components/Modal/ModalTitle.tsx
|
|
7
|
+
const ModalTitle = memo(function ModalTitle({ children, style, ref, ...textProps }) {
|
|
8
|
+
modalStyles.useVariants({});
|
|
9
|
+
return /* @__PURE__ */ jsx(Text, {
|
|
10
|
+
ref,
|
|
11
|
+
accessibilityRole: "header",
|
|
12
|
+
...textProps,
|
|
13
|
+
style: [modalStyles.title, style],
|
|
14
|
+
children
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
ModalTitle.displayName = "ModalTitle";
|
|
18
|
+
ModalTitle.__modalSlot = "title";
|
|
19
|
+
//#endregion
|
|
20
|
+
export { ModalTitle };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=ModalTitle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalTitle.js","names":[],"sources":["../../../src/components/Modal/ModalTitle.tsx"],"sourcesContent":["import { memo } from 'react';\n\nimport { modalStyles } from '../../../generated/styles';\nimport { Text } from '../Text';\nimport type { ModalSlotComponent, ModalTitleProps } from './types';\n\nconst ModalTitle = memo(function ModalTitle({\n children,\n style,\n ref,\n ...textProps\n}: ModalTitleProps) {\n modalStyles.useVariants({});\n\n return (\n <Text ref={ref} accessibilityRole=\"header\" {...textProps} style={[modalStyles.title, style]}>\n {children}\n </Text>\n );\n});\n\nModalTitle.displayName = 'ModalTitle';\n(ModalTitle as ModalSlotComponent).__modalSlot = 'title';\n\nexport { ModalTitle, type ModalTitleProps };\n"],"mappings":";;;;;;AAMA,MAAM,aAAa,KAAK,SAAS,WAAW,EAC1C,UACA,OACA,KACA,GAAG,aACe;CAClB,YAAY,YAAY,EAAE,CAAC;CAE3B,OACE,oBAAC,MAAD;EAAW;EAAK,mBAAkB;EAAS,GAAI;EAAW,OAAO,CAAC,YAAY,OAAO,MAAM;EACxF;EACI,CAAA;EAET;AAEF,WAAW,cAAc;AACzB,WAAmC,cAAc"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const require_components_Modal_ModalActions = require("./ModalActions.cjs");
|
|
4
|
+
const require_components_Modal_ModalContent = require("./ModalContent.cjs");
|
|
5
|
+
const require_components_Modal_ModalDescription = require("./ModalDescription.cjs");
|
|
6
|
+
const require_components_Modal_ModalTitle = require("./ModalTitle.cjs");
|
|
7
|
+
const require_components_Modal_Modal = require("./Modal.cjs");
|
|
8
|
+
exports.Modal = require_components_Modal_Modal.Modal;
|
|
9
|
+
exports.ModalActions = require_components_Modal_ModalActions.ModalActions;
|
|
10
|
+
exports.ModalContent = require_components_Modal_ModalContent.ModalContent;
|
|
11
|
+
exports.ModalDescription = require_components_Modal_ModalDescription.ModalDescription;
|
|
12
|
+
exports.ModalTitle = require_components_Modal_ModalTitle.ModalTitle;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
import { ModalActionsProps, ModalContentProps, ModalDescriptionProps, ModalProps, ModalTitleProps } from "./types.cjs";
|
|
3
|
+
import { Modal } from "./Modal.cjs";
|
|
4
|
+
import { ModalActions } from "./ModalActions.cjs";
|
|
5
|
+
import { ModalContent } from "./ModalContent.cjs";
|
|
6
|
+
import { ModalDescription } from "./ModalDescription.cjs";
|
|
7
|
+
import { ModalTitle } from "./ModalTitle.cjs";
|
|
8
|
+
export { Modal, ModalActions, type ModalActionsProps, ModalContent, type ModalContentProps, ModalDescription, type ModalDescriptionProps, type ModalProps, ModalTitle, type ModalTitleProps };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
import { ModalActionsProps, ModalContentProps, ModalDescriptionProps, ModalProps, ModalTitleProps } from "./types.js";
|
|
3
|
+
import { Modal } from "./Modal.js";
|
|
4
|
+
import { ModalActions } from "./ModalActions.js";
|
|
5
|
+
import { ModalContent } from "./ModalContent.js";
|
|
6
|
+
import { ModalDescription } from "./ModalDescription.js";
|
|
7
|
+
import { ModalTitle } from "./ModalTitle.js";
|
|
8
|
+
export { Modal, ModalActions, type ModalActionsProps, ModalContent, type ModalContentProps, ModalDescription, type ModalDescriptionProps, type ModalProps, ModalTitle, type ModalTitleProps };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { ModalActions } from "./ModalActions.js";
|
|
3
|
+
import { ModalContent } from "./ModalContent.js";
|
|
4
|
+
import { ModalDescription } from "./ModalDescription.js";
|
|
5
|
+
import { ModalTitle } from "./ModalTitle.js";
|
|
6
|
+
import { Modal } from "./Modal.js";
|
|
7
|
+
export { Modal, ModalActions, ModalContent, ModalDescription, ModalTitle };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
|
|
2
|
+
import { IconSlotType } from "../IconSlot.cjs";
|
|
3
|
+
import { TextProps as TextProps$1 } from "../Text.cjs";
|
|
4
|
+
import { ReactNode, Ref, RefObject } from "react";
|
|
5
|
+
import { DimensionValue, NativeScrollEvent, NativeSyntheticEvent, ScrollViewProps, StyleProp, View, ViewProps, ViewStyle } from "react-native";
|
|
6
|
+
|
|
7
|
+
//#region src/components/Modal/types.d.ts
|
|
8
|
+
type ModalScrollBehavior = 'inside' | 'outside';
|
|
9
|
+
type ModalDimension = DimensionValue | `${number}px`;
|
|
10
|
+
type ModalSlot = 'title' | 'description' | 'content' | 'actions';
|
|
11
|
+
interface ModalProps extends Omit<ViewProps, 'children' | 'style'> {
|
|
12
|
+
/** Whether the modal is open. */
|
|
13
|
+
open: boolean;
|
|
14
|
+
/** The modal child slots. Prefer ModalTitle, ModalDescription, ModalContent, and ModalActions. */
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
/** Called when a dismiss action requests the modal to close. */
|
|
17
|
+
onClose?: () => void;
|
|
18
|
+
/** Called when `open` transitions from false to true. */
|
|
19
|
+
onOpen?: () => void;
|
|
20
|
+
/** Whether to render the modal through the UDS overlay portal. @default true */
|
|
21
|
+
portal?: boolean;
|
|
22
|
+
/** Overrides whether the backdrop scrim is rendered. @default true */
|
|
23
|
+
includeScrim?: boolean;
|
|
24
|
+
/** Whether scrim press and Android back can close the modal. @default true */
|
|
25
|
+
dismissible?: boolean;
|
|
26
|
+
/** Whether to hide the close button. @default false */
|
|
27
|
+
hideDismissButton?: boolean;
|
|
28
|
+
/** Disable motion and transition effects. @default false */
|
|
29
|
+
reduceMotion?: boolean;
|
|
30
|
+
/** Icon displayed inside the close button. Use `false` to hide. @default 'Cross' */
|
|
31
|
+
closeIcon?: IconSlotType | false;
|
|
32
|
+
/** Web parity alias for the close button accessibility label. @default 'Close' */
|
|
33
|
+
closeAriaLabel?: string;
|
|
34
|
+
/** Accessible label for the close button. @default closeAriaLabel ?? 'Close' */
|
|
35
|
+
closeAccessibilityLabel?: string;
|
|
36
|
+
/** Constrains the modal width. Supports numbers, percentages, and px strings. */
|
|
37
|
+
maxWidth?: ModalDimension;
|
|
38
|
+
/** Constrains the modal height. Supports numbers, percentages, and px strings. */
|
|
39
|
+
maxHeight?: ModalDimension;
|
|
40
|
+
/** Expand horizontally until the modal hits maxWidth or the configured gutter. @default false */
|
|
41
|
+
fullWidth?: boolean;
|
|
42
|
+
/** Expand vertically until the modal hits maxHeight or the configured gutter. @default false */
|
|
43
|
+
fullHeight?: boolean;
|
|
44
|
+
/** Determines how oversized modal content scrolls. @default 'outside' */
|
|
45
|
+
scrollBehavior?: ModalScrollBehavior;
|
|
46
|
+
/** Title content. Ignored when ModalTitle is provided as a child. */
|
|
47
|
+
title?: ReactNode;
|
|
48
|
+
/** Description content. Ignored when ModalDescription is provided as a child. */
|
|
49
|
+
description?: ReactNode;
|
|
50
|
+
/** Main content. Ignored when ModalContent is provided as a child. */
|
|
51
|
+
content?: ReactNode;
|
|
52
|
+
/** Action content. Ignored when ModalActions is provided as a child. */
|
|
53
|
+
actions?: ReactNode;
|
|
54
|
+
/** Render through iOS FullWindowOverlay when portal is true. @default true */
|
|
55
|
+
useFullWindowOverlay?: boolean;
|
|
56
|
+
/** Ref to a BlurTarget wrapping screen content. Required for Android backdrop blur. */
|
|
57
|
+
blurTarget?: RefObject<View | null>;
|
|
58
|
+
/** Style applied to the modal surface. */
|
|
59
|
+
style?: StyleProp<ViewStyle>;
|
|
60
|
+
/** Ref to the modal surface. */
|
|
61
|
+
ref?: Ref<View>;
|
|
62
|
+
}
|
|
63
|
+
interface ModalTitleProps extends Omit<TextProps$1, 'ref'> {
|
|
64
|
+
/** The title content. */
|
|
65
|
+
children: ReactNode;
|
|
66
|
+
/** Ref to the underlying Text. */
|
|
67
|
+
ref?: TextProps$1['ref'];
|
|
68
|
+
}
|
|
69
|
+
interface ModalDescriptionProps extends Omit<TextProps$1, 'ref'> {
|
|
70
|
+
/** The description content. */
|
|
71
|
+
children: ReactNode;
|
|
72
|
+
/** Ref to the underlying Text. */
|
|
73
|
+
ref?: TextProps$1['ref'];
|
|
74
|
+
}
|
|
75
|
+
interface ModalContentProps extends Omit<ViewProps, 'children'> {
|
|
76
|
+
/** The main modal content. */
|
|
77
|
+
children?: ReactNode;
|
|
78
|
+
/** Style applied to the inner ScrollView content container when scrollBehavior is inside. */
|
|
79
|
+
contentContainerStyle?: ScrollViewProps['contentContainerStyle'];
|
|
80
|
+
/** Ref to the underlying View or ScrollView. */
|
|
81
|
+
ref?: Ref<View>;
|
|
82
|
+
}
|
|
83
|
+
interface ModalActionsProps extends Omit<ViewProps, 'children'> {
|
|
84
|
+
/** Action content. */
|
|
85
|
+
children?: ReactNode;
|
|
86
|
+
/** Additional content displayed at the start of the actions footer. */
|
|
87
|
+
startContent?: ReactNode;
|
|
88
|
+
/** Ref to the underlying View. */
|
|
89
|
+
ref?: Ref<View>;
|
|
90
|
+
}
|
|
91
|
+
interface ModalContextValue {
|
|
92
|
+
scrollBehavior: ModalScrollBehavior;
|
|
93
|
+
hasContent: boolean;
|
|
94
|
+
onScroll: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
95
|
+
onScrollInteractionBegin: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
96
|
+
onScrollInteractionEnd: () => void;
|
|
97
|
+
shouldRenderHeader: boolean;
|
|
98
|
+
}
|
|
99
|
+
interface ModalSlotComponent {
|
|
100
|
+
__modalSlot?: ModalSlot;
|
|
101
|
+
}
|
|
102
|
+
interface ModalRootTokens {
|
|
103
|
+
backgroundBlurColor?: string;
|
|
104
|
+
backgroundBlurRadius?: number;
|
|
105
|
+
backgroundColor?: string;
|
|
106
|
+
borderRadius?: number;
|
|
107
|
+
borderWidth?: number;
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
export { type ModalActionsProps, type ModalContentProps, type ModalContextValue, type ModalDescriptionProps, type ModalDimension, type ModalProps, type ModalRootTokens, type ModalScrollBehavior, type ModalSlot, type ModalSlotComponent, type ModalTitleProps };
|
|
111
|
+
//# sourceMappingURL=types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":[],"sources":["../../../src/components/Modal/types.ts"],"mappings":";;;;;;;KAeK,mBAAA;AAAA,KACA,cAAA,GAAiB,cAAA;AAAA,KACjB,SAAA;AAAA,UAEK,UAAA,SAAmB,IAAA,CAAK,SAAA;;EAEhC,IAAA;EANsB;EAQtB,QAAA,GAAW,SAAA;EAPM;EASjB,OAAA;EAToB;EAWpB,MAAA;EAVG;EAYH,MAAA;;EAEA,YAAA;EAdY;EAgBZ,WAAA;EAdmB;EAgBnB,iBAAA;EAhBgC;EAkBhC,YAAA;EAEY;EAAZ,SAAA,GAAY,YAAA;EAQA;EANZ,cAAA;EAcQ;EAZR,uBAAA;EAgBU;EAdV,QAAA,GAAW,cAAA;EAoBY;EAlBvB,SAAA,GAAY,cAAA;EAoBM;EAlBlB,SAAA;EAoBU;EAlBV,UAAA;EAhC2B;EAkC3B,cAAA,GAAiB,mBAAA;EAlCc;EAoC/B,KAAA,GAAQ,SAAA;EApCwB;EAsChC,WAAA,GAAc,SAAA;EAlCd;EAoCA,OAAA,GAAU,SAAA;EAlCV;EAoCA,OAAA,GAAU,SAAA;EAhCV;EAkCA,oBAAA;EA9BA;EAgCA,UAAA,GAAa,SAAA,CAAU,IAAA;EA5BvB;EA8BA,KAAA,GAAQ,SAAA,CAAU,SAAA;EA5BN;EA8BZ,GAAA,GAAM,GAAA,CAAI,IAAA;AAAA;AAAA,UAGF,eAAA,SAAwB,IAAA,CAAK,WAAA;EA3B1B;EA6BX,QAAA,EAAU,SAAA;EA3BE;EA6BZ,GAAA,GAAM,WAAA;AAAA;AAAA,UAGE,qBAAA,SAA8B,IAAA,CAAK,WAAA;EA1B1B;EA4BjB,QAAA,EAAU,SAAA;EA1BF;EA4BR,GAAA,GAAM,WAAA;AAAA;AAAA,UAGE,iBAAA,SAA0B,IAAA,CAAK,SAAA;EA3B7B;EA6BV,QAAA,GAAW,SAAA;EA3BD;EA6BV,qBAAA,GAAwB,eAAA;EAzBxB;EA2BA,GAAA,GAAM,GAAA,CAAI,IAAA;AAAA;AAAA,UAGF,iBAAA,SAA0B,IAAA,CAAK,SAAA;EA5B/B;EA8BR,QAAA,GAAW,SAAA;EA5BX;EA8BA,YAAA,GAAe,SAAA;EA9BL;EAgCV,GAAA,GAAM,GAAA,CAAI,IAAA;AAAA;AAAA,UAGF,iBAAA;EACR,cAAA,EAAgB,mBAAA;EAChB,UAAA;EACA,QAAA,GAAW,KAAA,EAAO,oBAAA,CAAqB,iBAAA;EACvC,wBAAA,GAA2B,KAAA,EAAO,oBAAA,CAAqB,iBAAA;EACvD,sBAAA;EACA,kBAAA;AAAA;AAAA,UAGQ,kBAAA;EACR,WAAA,GAAc,SAAA;AAAA;AAAA,UAGN,eAAA;EACR,mBAAA;EACA,oBAAA;EACA,eAAA;EACA,YAAA;EACA,WAAA;AAAA"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
|
|
2
|
+
import { IconSlotType } from "../IconSlot.js";
|
|
3
|
+
import { TextProps as TextProps$1 } from "../Text.js";
|
|
4
|
+
import { ReactNode, Ref, RefObject } from "react";
|
|
5
|
+
import { DimensionValue, NativeScrollEvent, NativeSyntheticEvent, ScrollViewProps, StyleProp, View, ViewProps, ViewStyle } from "react-native";
|
|
6
|
+
|
|
7
|
+
//#region src/components/Modal/types.d.ts
|
|
8
|
+
type ModalScrollBehavior = 'inside' | 'outside';
|
|
9
|
+
type ModalDimension = DimensionValue | `${number}px`;
|
|
10
|
+
type ModalSlot = 'title' | 'description' | 'content' | 'actions';
|
|
11
|
+
interface ModalProps extends Omit<ViewProps, 'children' | 'style'> {
|
|
12
|
+
/** Whether the modal is open. */
|
|
13
|
+
open: boolean;
|
|
14
|
+
/** The modal child slots. Prefer ModalTitle, ModalDescription, ModalContent, and ModalActions. */
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
/** Called when a dismiss action requests the modal to close. */
|
|
17
|
+
onClose?: () => void;
|
|
18
|
+
/** Called when `open` transitions from false to true. */
|
|
19
|
+
onOpen?: () => void;
|
|
20
|
+
/** Whether to render the modal through the UDS overlay portal. @default true */
|
|
21
|
+
portal?: boolean;
|
|
22
|
+
/** Overrides whether the backdrop scrim is rendered. @default true */
|
|
23
|
+
includeScrim?: boolean;
|
|
24
|
+
/** Whether scrim press and Android back can close the modal. @default true */
|
|
25
|
+
dismissible?: boolean;
|
|
26
|
+
/** Whether to hide the close button. @default false */
|
|
27
|
+
hideDismissButton?: boolean;
|
|
28
|
+
/** Disable motion and transition effects. @default false */
|
|
29
|
+
reduceMotion?: boolean;
|
|
30
|
+
/** Icon displayed inside the close button. Use `false` to hide. @default 'Cross' */
|
|
31
|
+
closeIcon?: IconSlotType | false;
|
|
32
|
+
/** Web parity alias for the close button accessibility label. @default 'Close' */
|
|
33
|
+
closeAriaLabel?: string;
|
|
34
|
+
/** Accessible label for the close button. @default closeAriaLabel ?? 'Close' */
|
|
35
|
+
closeAccessibilityLabel?: string;
|
|
36
|
+
/** Constrains the modal width. Supports numbers, percentages, and px strings. */
|
|
37
|
+
maxWidth?: ModalDimension;
|
|
38
|
+
/** Constrains the modal height. Supports numbers, percentages, and px strings. */
|
|
39
|
+
maxHeight?: ModalDimension;
|
|
40
|
+
/** Expand horizontally until the modal hits maxWidth or the configured gutter. @default false */
|
|
41
|
+
fullWidth?: boolean;
|
|
42
|
+
/** Expand vertically until the modal hits maxHeight or the configured gutter. @default false */
|
|
43
|
+
fullHeight?: boolean;
|
|
44
|
+
/** Determines how oversized modal content scrolls. @default 'outside' */
|
|
45
|
+
scrollBehavior?: ModalScrollBehavior;
|
|
46
|
+
/** Title content. Ignored when ModalTitle is provided as a child. */
|
|
47
|
+
title?: ReactNode;
|
|
48
|
+
/** Description content. Ignored when ModalDescription is provided as a child. */
|
|
49
|
+
description?: ReactNode;
|
|
50
|
+
/** Main content. Ignored when ModalContent is provided as a child. */
|
|
51
|
+
content?: ReactNode;
|
|
52
|
+
/** Action content. Ignored when ModalActions is provided as a child. */
|
|
53
|
+
actions?: ReactNode;
|
|
54
|
+
/** Render through iOS FullWindowOverlay when portal is true. @default true */
|
|
55
|
+
useFullWindowOverlay?: boolean;
|
|
56
|
+
/** Ref to a BlurTarget wrapping screen content. Required for Android backdrop blur. */
|
|
57
|
+
blurTarget?: RefObject<View | null>;
|
|
58
|
+
/** Style applied to the modal surface. */
|
|
59
|
+
style?: StyleProp<ViewStyle>;
|
|
60
|
+
/** Ref to the modal surface. */
|
|
61
|
+
ref?: Ref<View>;
|
|
62
|
+
}
|
|
63
|
+
interface ModalTitleProps extends Omit<TextProps$1, 'ref'> {
|
|
64
|
+
/** The title content. */
|
|
65
|
+
children: ReactNode;
|
|
66
|
+
/** Ref to the underlying Text. */
|
|
67
|
+
ref?: TextProps$1['ref'];
|
|
68
|
+
}
|
|
69
|
+
interface ModalDescriptionProps extends Omit<TextProps$1, 'ref'> {
|
|
70
|
+
/** The description content. */
|
|
71
|
+
children: ReactNode;
|
|
72
|
+
/** Ref to the underlying Text. */
|
|
73
|
+
ref?: TextProps$1['ref'];
|
|
74
|
+
}
|
|
75
|
+
interface ModalContentProps extends Omit<ViewProps, 'children'> {
|
|
76
|
+
/** The main modal content. */
|
|
77
|
+
children?: ReactNode;
|
|
78
|
+
/** Style applied to the inner ScrollView content container when scrollBehavior is inside. */
|
|
79
|
+
contentContainerStyle?: ScrollViewProps['contentContainerStyle'];
|
|
80
|
+
/** Ref to the underlying View or ScrollView. */
|
|
81
|
+
ref?: Ref<View>;
|
|
82
|
+
}
|
|
83
|
+
interface ModalActionsProps extends Omit<ViewProps, 'children'> {
|
|
84
|
+
/** Action content. */
|
|
85
|
+
children?: ReactNode;
|
|
86
|
+
/** Additional content displayed at the start of the actions footer. */
|
|
87
|
+
startContent?: ReactNode;
|
|
88
|
+
/** Ref to the underlying View. */
|
|
89
|
+
ref?: Ref<View>;
|
|
90
|
+
}
|
|
91
|
+
interface ModalContextValue {
|
|
92
|
+
scrollBehavior: ModalScrollBehavior;
|
|
93
|
+
hasContent: boolean;
|
|
94
|
+
onScroll: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
95
|
+
onScrollInteractionBegin: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
96
|
+
onScrollInteractionEnd: () => void;
|
|
97
|
+
shouldRenderHeader: boolean;
|
|
98
|
+
}
|
|
99
|
+
interface ModalSlotComponent {
|
|
100
|
+
__modalSlot?: ModalSlot;
|
|
101
|
+
}
|
|
102
|
+
interface ModalRootTokens {
|
|
103
|
+
backgroundBlurColor?: string;
|
|
104
|
+
backgroundBlurRadius?: number;
|
|
105
|
+
backgroundColor?: string;
|
|
106
|
+
borderRadius?: number;
|
|
107
|
+
borderWidth?: number;
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
export { type ModalActionsProps, type ModalContentProps, type ModalContextValue, type ModalDescriptionProps, type ModalDimension, type ModalProps, type ModalRootTokens, type ModalScrollBehavior, type ModalSlot, type ModalSlotComponent, type ModalTitleProps };
|
|
111
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/components/Modal/types.ts"],"mappings":";;;;;;;KAeK,mBAAA;AAAA,KACA,cAAA,GAAiB,cAAA;AAAA,KACjB,SAAA;AAAA,UAEK,UAAA,SAAmB,IAAA,CAAK,SAAA;;EAEhC,IAAA;EANsB;EAQtB,QAAA,GAAW,SAAA;EAPM;EASjB,OAAA;EAToB;EAWpB,MAAA;EAVG;EAYH,MAAA;;EAEA,YAAA;EAdY;EAgBZ,WAAA;EAdmB;EAgBnB,iBAAA;EAhBgC;EAkBhC,YAAA;EAEY;EAAZ,SAAA,GAAY,YAAA;EAQA;EANZ,cAAA;EAcQ;EAZR,uBAAA;EAgBU;EAdV,QAAA,GAAW,cAAA;EAoBY;EAlBvB,SAAA,GAAY,cAAA;EAoBM;EAlBlB,SAAA;EAoBU;EAlBV,UAAA;EAhC2B;EAkC3B,cAAA,GAAiB,mBAAA;EAlCc;EAoC/B,KAAA,GAAQ,SAAA;EApCwB;EAsChC,WAAA,GAAc,SAAA;EAlCd;EAoCA,OAAA,GAAU,SAAA;EAlCV;EAoCA,OAAA,GAAU,SAAA;EAhCV;EAkCA,oBAAA;EA9BA;EAgCA,UAAA,GAAa,SAAA,CAAU,IAAA;EA5BvB;EA8BA,KAAA,GAAQ,SAAA,CAAU,SAAA;EA5BN;EA8BZ,GAAA,GAAM,GAAA,CAAI,IAAA;AAAA;AAAA,UAGF,eAAA,SAAwB,IAAA,CAAK,WAAA;EA3B1B;EA6BX,QAAA,EAAU,SAAA;EA3BE;EA6BZ,GAAA,GAAM,WAAA;AAAA;AAAA,UAGE,qBAAA,SAA8B,IAAA,CAAK,WAAA;EA1B1B;EA4BjB,QAAA,EAAU,SAAA;EA1BF;EA4BR,GAAA,GAAM,WAAA;AAAA;AAAA,UAGE,iBAAA,SAA0B,IAAA,CAAK,SAAA;EA3B7B;EA6BV,QAAA,GAAW,SAAA;EA3BD;EA6BV,qBAAA,GAAwB,eAAA;EAzBxB;EA2BA,GAAA,GAAM,GAAA,CAAI,IAAA;AAAA;AAAA,UAGF,iBAAA,SAA0B,IAAA,CAAK,SAAA;EA5B/B;EA8BR,QAAA,GAAW,SAAA;EA5BX;EA8BA,YAAA,GAAe,SAAA;EA9BL;EAgCV,GAAA,GAAM,GAAA,CAAI,IAAA;AAAA;AAAA,UAGF,iBAAA;EACR,cAAA,EAAgB,mBAAA;EAChB,UAAA;EACA,QAAA,GAAW,KAAA,EAAO,oBAAA,CAAqB,iBAAA;EACvC,wBAAA,GAA2B,KAAA,EAAO,oBAAA,CAAqB,iBAAA;EACvD,sBAAA;EACA,kBAAA;AAAA;AAAA,UAGQ,kBAAA;EACR,WAAA,GAAc,SAAA;AAAA;AAAA,UAGN,eAAA;EACR,mBAAA;EACA,oBAAA;EACA,eAAA;EACA,YAAA;EACA,WAAA;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
require("../../_virtual/_rolldown/runtime.cjs");
|
|
4
|
+
let react = require("react");
|
|
5
|
+
//#region src/components/Modal/utils.ts
|
|
6
|
+
function getModalSlot(child) {
|
|
7
|
+
if (!(0, react.isValidElement)(child)) return null;
|
|
8
|
+
return child.type.__modalSlot ?? null;
|
|
9
|
+
}
|
|
10
|
+
function separateChildren(children) {
|
|
11
|
+
let title = null;
|
|
12
|
+
let description = null;
|
|
13
|
+
let content = null;
|
|
14
|
+
let actions = null;
|
|
15
|
+
react.Children.forEach(children, (child) => {
|
|
16
|
+
if (child == null || child === false || child === true || child === "") return;
|
|
17
|
+
const slot = getModalSlot(child);
|
|
18
|
+
if (slot === "title") title = child;
|
|
19
|
+
else if (slot === "description") description = child;
|
|
20
|
+
else if (slot === "content") content = child;
|
|
21
|
+
else if (slot === "actions") actions = child;
|
|
22
|
+
});
|
|
23
|
+
return {
|
|
24
|
+
title,
|
|
25
|
+
description,
|
|
26
|
+
content,
|
|
27
|
+
actions
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function resolveModalDimension(value) {
|
|
31
|
+
if (value === void 0 || value === null || value === "auto") return;
|
|
32
|
+
if (typeof value === "string" && value.endsWith("px")) {
|
|
33
|
+
const parsed = Number.parseFloat(value);
|
|
34
|
+
return Number.isFinite(parsed) ? parsed : void 0;
|
|
35
|
+
}
|
|
36
|
+
return value;
|
|
37
|
+
}
|
|
38
|
+
function getEventPagePoint(event) {
|
|
39
|
+
const nativeEvent = event?.nativeEvent;
|
|
40
|
+
const changedTouch = nativeEvent?.changedTouches?.[0];
|
|
41
|
+
const pageX = typeof nativeEvent?.pageX === "number" ? nativeEvent.pageX : changedTouch?.pageX;
|
|
42
|
+
const pageY = typeof nativeEvent?.pageY === "number" ? nativeEvent.pageY : changedTouch?.pageY;
|
|
43
|
+
if (typeof pageX !== "number" || typeof pageY !== "number") return null;
|
|
44
|
+
return {
|
|
45
|
+
x: pageX,
|
|
46
|
+
y: pageY
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function isPointInRect(point, rect) {
|
|
50
|
+
return point.x >= rect.x && point.x <= rect.x + rect.width && point.y >= rect.y && point.y <= rect.y + rect.height;
|
|
51
|
+
}
|
|
52
|
+
function shouldDismissModalRelease(point, surfaceRect) {
|
|
53
|
+
return !isPointInRect(point, surfaceRect);
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
exports.getEventPagePoint = getEventPagePoint;
|
|
57
|
+
exports.resolveModalDimension = resolveModalDimension;
|
|
58
|
+
exports.separateChildren = separateChildren;
|
|
59
|
+
exports.shouldDismissModalRelease = shouldDismissModalRelease;
|