@lmb-it/kitsconcerto-native 0.1.262 → 0.1.265
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/animations/index.cjs +6 -2
- package/animations/index.cjs.map +1 -1
- package/animations/index.js +6 -3
- package/animations/index.js.map +1 -1
- package/apps/mobile/src/Core/Dropdown/index.cjs +49 -31
- package/apps/mobile/src/Core/Dropdown/index.cjs.map +1 -1
- package/apps/mobile/src/Core/Dropdown/index.js +49 -31
- package/apps/mobile/src/Core/Dropdown/index.js.map +1 -1
- package/apps/mobile/src/Core/MultiSelect/index.cjs +13 -11
- package/apps/mobile/src/Core/MultiSelect/index.cjs.map +1 -1
- package/apps/mobile/src/Core/MultiSelect/index.js +13 -11
- package/apps/mobile/src/Core/MultiSelect/index.js.map +1 -1
- package/apps/mobile/src/Factory/helpers/readerEdge.cjs +14 -0
- package/apps/mobile/src/Factory/helpers/readerEdge.cjs.map +1 -0
- package/apps/mobile/src/Factory/helpers/readerEdge.js +12 -0
- package/apps/mobile/src/Factory/helpers/readerEdge.js.map +1 -0
- package/components/overlay/ConfirmDialog/index.cjs +3 -3
- package/components/overlay/ConfirmDialog/index.cjs.map +1 -1
- package/components/overlay/ConfirmDialog/index.js +4 -4
- package/components/overlay/ConfirmDialog/index.js.map +1 -1
- package/components/overlay/Dialog/index.cjs +1 -1
- package/components/overlay/Dialog/index.cjs.map +1 -1
- package/components/overlay/Dialog/index.js +2 -2
- package/components/overlay/Dialog/index.js.map +1 -1
- package/form/selects/helpers/SelectPopupOverlay.cjs +20 -8
- package/form/selects/helpers/SelectPopupOverlay.cjs.map +1 -1
- package/form/selects/helpers/SelectPopupOverlay.js +20 -8
- package/form/selects/helpers/SelectPopupOverlay.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/overlay/ConfirmDialog/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport {Modal, Pressable, StyleSheet, View} from \"react-native\";\nimport Animated, {Easing, FadeIn, FadeOut, runOnJS, SlideInDown, SlideOutDown, ZoomIn, ZoomOut} from \"react-native-reanimated\";\nimport {useSafeAreaInsets} from \"react-native-safe-area-context\";\nimport {Icon, Text} from \"../../../_compat\";\nimport type {IConfirmDialogProps} from \"@lmb-it/kitsconcerto-types\";\nimport {useKitsTheme} from \"../../../contexts/Theme\";\nimport {useSeverityColors, useAllSeverityColors} from \"../../../hooks/useSeverityColors\";\nimport {useResolvedStyle} from \"../../../hooks\";\nimport {overlayAnimations as anim} from \"../../../animations\";\n\n/**\n * Keeps the RN Modal mounted through the exit animation. `visible` drives the\n * inner scrim + panel entering/exiting; the Modal itself stays mounted until\n * the panel's exit animation reports finished, then unmounts.\n *\n * Re-entrancy: a new `visible=true` during an exit cancels the panel's exit\n * (reanimated reports `finished=false`, so the unmount is skipped) and the\n * inner re-enters cleanly; `visibleRef` is a second guard for the case where\n * the exit had already completed.\n */\nfunction useOverlayPresence(visible: boolean) {\n const [mounted, setMounted] = React.useState(visible);\n const visibleRef = React.useRef(visible);\n React.useEffect(() => {\n visibleRef.current = visible;\n if (visible) setMounted(true);\n }, [visible]);\n // Runs on the JS thread (dispatched via runOnJS from the exit worklet).\n const handleExitFinished = React.useCallback(() => {\n if (!visibleRef.current) setMounted(false);\n }, []);\n return {mounted, handleExitFinished};\n}\n\nexport default function KitsConfirm(props: IConfirmDialogProps) {\n const {\n visible,\n header,\n message,\n icon,\n type = \"secondary\",\n accept,\n reject,\n acceptLabel = \"Accept\",\n rejectLabel = \"Reject\",\n buttons,\n headless,\n defaultUI,\n async: asyncMode,\n onHide,\n content,\n children,\n position = \"center\",\n style,\n contentStyle,\n headerStyle,\n maskStyle,\n // LEGIT-PLATFORM-ONLY (web): acceptIcon/rejectIcon take PrimeReact\n // icon classes ('pi pi-*') with no native rendering path — use the\n // `buttons` array for custom native actions. acceptClassName/\n // rejectClassName are CSS classes; appendTo is a DOM portal target.\n ...rest\n } = props;\n\n const {resolveToken, theme} = useKitsTheme();\n const colors = useSeverityColors(type);\n const allColors = useAllSeverityColors();\n const insets = useSafeAreaInsets();\n\n const surfaceColor = resolveToken('surface-card');\n const textColor = resolveToken('text');\n const subtextColor = resolveToken('gray.500');\n const grabberColor = resolveToken('gray.300');\n // Scrim via the literal alpha overlay token → rgba(0,0,0,0.4) in both modes.\n const scrimColor = resolveToken('black-alpha-40');\n const brandLogo = type === 'brand' ? theme.config.logo : null;\n\n const resolvedStyle = useResolvedStyle(style || {});\n const resolvedContentStyle = useResolvedStyle(contentStyle || {});\n const resolvedHeaderStyle = useResolvedStyle(headerStyle || {});\n const resolvedMaskStyle = useResolvedStyle(maskStyle || {});\n\n const {mounted, handleExitFinished} = useOverlayPresence(!!visible);\n if (!mounted) return null;\n\n const isSheet = position === 'bottom';\n const hide = () => onHide?.('hide');\n\n const doClick = async (callback?: () => void) => {\n if (asyncMode) {\n await callback?.();\n hide();\n } else {\n hide();\n callback?.();\n }\n };\n\n const showIcon = icon != null || brandLogo != null;\n // Panel always uses surface-card. Severity (danger/success/...) only colours\n // the icon bubble and the action button — not the whole panel — otherwise\n // a danger confirm renders as a red wash with the underlying screen\n // bleeding through.\n const panelBg = surfaceColor;\n\n // Shared action row. `stretch` makes each button flex:1 (bottom-sheet,\n // full-width). The default accept/reject pair is ordered accept-first in the\n // centered card but reject-first (Cancel | Confirm) in the sheet, matching\n // the platform-native bottom-sheet convention.\n const renderActions = (stretch: boolean) => {\n if (buttons?.length) {\n return (\n <View style={styles.buttonRow}>\n {buttons.map((b, i) => {\n const btnColor = allColors[b.type ?? type]?.solid ?? colors.solid;\n return (\n <Pressable\n key={i}\n disabled={b.disabled}\n style={[\n styles.actionBtn,\n stretch && styles.actionBtnSheet,\n stretch && {flex: 1},\n b.outlined\n ? {backgroundColor: \"transparent\", borderColor: btnColor, borderWidth: 1.5}\n : {backgroundColor: btnColor},\n b.rounded && {borderRadius: 999},\n b.disabled && {opacity: 0.5},\n ]}\n onPress={() => b.onClick(hide, accept, reject)}\n >\n <Text style={{\n color: b.outlined ? btnColor : \"#fff\",\n fontWeight: \"600\",\n fontSize: 14,\n }}>\n {b.title}\n </Text>\n </Pressable>\n );\n })}\n </View>\n );\n }\n\n const acceptBtn = (\n <Pressable\n key=\"accept\"\n style={[styles.actionBtn, stretch && styles.actionBtnSheet, {backgroundColor: colors.solid, flex: 1}]}\n onPress={() => doClick(accept)}\n >\n <Text style={styles.btnTextPrimary}>{acceptLabel}</Text>\n </Pressable>\n );\n const rejectBtn = !defaultUI ? (\n <Pressable\n key=\"reject\"\n style={[styles.actionBtn, styles.actionBtnOutlined, stretch && styles.actionBtnSheet, {borderColor: colors.solid, flex: 1}]}\n onPress={() => doClick(reject)}\n >\n <Text style={[styles.btnTextOutlined, {color: colors.solid}]}>{rejectLabel}</Text>\n </Pressable>\n ) : null;\n\n return (\n <View style={styles.buttonRow}>\n {stretch ? <>{rejectBtn}{acceptBtn}</> : <>{acceptBtn}{rejectBtn}</>}\n </View>\n );\n };\n\n // ── Bottom sheet ────────────────────────────────────────\n if (isSheet) {\n return (\n <Modal visible transparent animationType=\"none\" onRequestClose={hide}>\n {visible && (\n <Animated.View\n entering={FadeIn.duration(anim.scrim.enterDuration)}\n exiting={FadeOut.duration(anim.scrim.exitDuration)}\n style={[styles.sheetOverlay, {backgroundColor: scrimColor}, resolvedMaskStyle as any]}\n >\n <Pressable style={StyleSheet.absoluteFill} onPress={hide}/>\n <Animated.View\n entering={SlideInDown.springify().damping(anim.sheet.enter.damping).stiffness(anim.sheet.enter.stiffness).mass(anim.sheet.enter.mass ?? 1)}\n exiting={SlideOutDown.duration(anim.sheet.exitDuration).easing(Easing.in(Easing.ease)).withCallback((finished) => {\n 'worklet';\n if (finished) runOnJS(handleExitFinished)();\n })}\n style={[\n styles.sheetPanel,\n {backgroundColor: panelBg, paddingBottom: 24 + insets.bottom},\n resolvedStyle as any,\n resolvedContentStyle as any,\n ]}\n >\n {/* Grabber */}\n <View style={[styles.grabber, {backgroundColor: grabberColor}]}/>\n\n {/* Header */}\n {header != null && (\n <Text style={[styles.sheetHeader, {color: textColor}, resolvedHeaderStyle as any]}>\n {header as React.ReactNode}\n </Text>\n )}\n\n {/* Message */}\n {message != null && (\n <Text style={[styles.sheetMessage, {color: subtextColor}]}>\n {message as React.ReactNode}\n </Text>\n )}\n\n {/* Injected item / extra content */}\n {children}\n\n {/* Actions */}\n {renderActions(true)}\n </Animated.View>\n </Animated.View>\n )}\n </Modal>\n );\n }\n\n // ── Content-only mode (prompt) ──────────────────────────\n if (content) {\n return (\n <Modal visible transparent animationType=\"none\" onRequestClose={hide}>\n {visible && (\n <Animated.View\n entering={FadeIn.duration(anim.scrim.enterDuration)}\n exiting={FadeOut.duration(anim.scrim.exitDuration)}\n style={[styles.overlay, {backgroundColor: scrimColor}, resolvedMaskStyle as any]}\n >\n <Pressable style={StyleSheet.absoluteFill} onPress={hide}/>\n <Animated.View\n entering={ZoomIn.springify().damping(anim.confirm.content.damping).stiffness(anim.confirm.content.stiffness).mass(anim.confirm.content.mass ?? 1)}\n exiting={ZoomOut.duration(anim.confirm.exitDuration).easing(Easing.in(Easing.ease)).withCallback((finished) => {\n 'worklet';\n if (finished) runOnJS(handleExitFinished)();\n })}\n style={[\n styles.panel,\n {backgroundColor: surfaceColor, minWidth: 250, maxWidth: 380},\n resolvedStyle as any,\n resolvedContentStyle as any,\n ]}\n >\n {content as React.ReactNode}\n </Animated.View>\n </Animated.View>\n )}\n </Modal>\n );\n }\n\n return (\n <Modal visible transparent animationType=\"none\" onRequestClose={hide}>\n {visible && (\n <Animated.View\n entering={FadeIn.duration(anim.scrim.enterDuration)}\n exiting={FadeOut.duration(anim.scrim.exitDuration)}\n style={[styles.overlay, {backgroundColor: scrimColor}, resolvedMaskStyle as any]}\n >\n <Pressable style={StyleSheet.absoluteFill} onPress={hide}/>\n\n {/* Card + icon stack: icon sits above the card */}\n <View style={styles.cardStack}>\n {/* Soft-circle icon bubble */}\n {showIcon && (\n <Animated.View\n entering={ZoomIn.springify().damping(anim.confirm.icon.damping).stiffness(anim.confirm.icon.stiffness).mass(anim.confirm.icon.mass ?? 1).delay(anim.confirm.icon.delay ?? 0)}\n exiting={ZoomOut.duration(anim.confirm.exitDuration).easing(Easing.in(Easing.ease))}\n style={[styles.iconBubble, {backgroundColor: colors.iconBg}]}\n >\n {brandLogo ? brandLogo : typeof icon === \"string\" ? (\n <Icon name={icon as never} size={'xl'} color={colors.iconFg}/>\n ) : (\n icon\n )}\n </Animated.View>\n )}\n\n {/* Panel */}\n <Animated.View\n entering={ZoomIn.springify().damping(anim.confirm.enter.damping).stiffness(anim.confirm.enter.stiffness).mass(anim.confirm.enter.mass ?? 1)}\n exiting={ZoomOut.duration(anim.confirm.exitDuration).easing(Easing.in(Easing.ease)).withCallback((finished) => {\n 'worklet';\n if (finished) runOnJS(handleExitFinished)();\n })}\n style={[\n styles.panel,\n {\n backgroundColor: panelBg,\n paddingTop: showIcon ? 48 : 24,\n gap: 10,\n },\n resolvedStyle as any,\n resolvedContentStyle as any,\n ]}\n >\n {/* Close button */}\n <Pressable style={styles.closeBtn} onPress={hide} hitSlop={12}>\n <Text style={{fontSize: 18, color: subtextColor}}>✕</Text>\n </Pressable>\n\n {/* Header */}\n {header != null && (\n <Text style={[styles.header, {color: textColor}, resolvedHeaderStyle as any]}>\n {header as React.ReactNode}\n </Text>\n )}\n\n {/* Message */}\n {message != null && (\n <Text style={[styles.message, {color: subtextColor}]}>\n {message as React.ReactNode}\n </Text>\n )}\n\n {/* Children */}\n {children}\n\n {/* Buttons */}\n {renderActions(false)}\n </Animated.View>\n </View>\n </Animated.View>\n )}\n </Modal>\n );\n}\n\nconst styles = StyleSheet.create({\n overlay: {\n flex: 1,\n justifyContent: \"center\",\n alignItems: \"center\",\n padding: 28,\n },\n sheetOverlay: {\n flex: 1,\n justifyContent: \"flex-end\",\n },\n sheetPanel: {\n // 24 == radii.2xl, top corners only (bottom stays square).\n borderTopLeftRadius: 24,\n borderTopRightRadius: 24,\n paddingHorizontal: 24,\n paddingTop: 10,\n gap: 14,\n // Subtle elevation (upward for a sheet): low opacity, wide blur, minimal offset.\n elevation: 6,\n shadowColor: \"#000\",\n shadowOffset: {width: 0, height: -2},\n shadowOpacity: 0.15,\n shadowRadius: 20,\n },\n grabber: {\n width: 40,\n height: 5,\n borderRadius: 999,\n alignSelf: \"center\",\n marginBottom: 6,\n },\n sheetHeader: {\n fontSize: 24,\n fontWeight: \"700\",\n textAlign: \"left\",\n },\n sheetMessage: {\n fontSize: 15,\n lineHeight: 22,\n textAlign: \"left\",\n },\n cardStack: {\n minWidth: 250,\n maxWidth: 380,\n alignItems: \"center\",\n },\n iconBubble: {\n width: 72,\n height: 72,\n borderRadius: 36,\n justifyContent: \"center\",\n alignItems: \"center\",\n zIndex: 2,\n marginBottom: -36,\n elevation: 8,\n shadowColor: \"#000\",\n shadowOffset: {width: 0, height: 4},\n shadowOpacity: 0.15,\n shadowRadius: 8,\n },\n panel: {\n alignSelf: \"stretch\",\n // 20 == radii.xl. Side padding (24) == bottom padding (24) for even rhythm.\n borderRadius: 20,\n paddingHorizontal: 24,\n paddingBottom: 24,\n // Subtle elevation: low opacity, wide blur, minimal offset.\n elevation: 6,\n shadowColor: \"#000\",\n shadowOffset: {width: 0, height: 2},\n shadowOpacity: 0.15,\n shadowRadius: 20,\n alignItems: \"center\",\n },\n closeBtn: {\n position: \"absolute\",\n top: 12,\n right: 14,\n zIndex: 3,\n },\n header: {\n fontSize: 22,\n fontWeight: \"700\",\n textAlign: \"center\",\n marginBottom: 8,\n },\n message: {\n fontSize: 14,\n textAlign: \"center\",\n lineHeight: 20,\n // Tightened so top/bottom whitespace around the actions reads balanced.\n marginBottom: 16,\n },\n buttonRow: {\n flexDirection: \"row\",\n justifyContent: \"center\",\n gap: 12,\n width: \"100%\",\n },\n actionBtn: {\n paddingVertical: 12,\n paddingHorizontal: 24,\n // Pill (== radii.pill). Buttons here are raw Pressables, not kits Button,\n // so the pill comes from borderRadius — the pattern the `buttons` array\n // path (`b.rounded && {borderRadius: 999}`) already uses in this file.\n borderRadius: 999,\n minWidth: 100,\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n // Taller buttons for the bottom-sheet action row (pill shape shared).\n actionBtnSheet: {\n paddingVertical: 16,\n borderRadius: 999,\n },\n actionBtnOutlined: {\n backgroundColor: \"transparent\",\n borderWidth: 1.5,\n },\n btnTextPrimary: {\n color: \"#fff\",\n fontWeight: \"600\",\n fontSize: 14,\n },\n btnTextOutlined: {\n fontWeight: \"600\",\n fontSize: 14,\n },\n});\n"],"names":["anim"],"mappings":";;;;;;;;;;;;;AAqBA,SAAS,mBAAmB,OAAA,EAAkB;AAC1C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,KAAA,CAAM,SAAS,OAAO,CAAA;AACpD,EAAA,MAAM,UAAA,GAAa,KAAA,CAAM,MAAA,CAAO,OAAO,CAAA;AACvC,EAAA,KAAA,CAAM,UAAU,MAAM;AAClB,IAAA,UAAA,CAAW,OAAA,GAAU,OAAA;AACrB,IAAA,IAAI,OAAA,aAAoB,IAAI,CAAA;AAAA,EAChC,CAAA,EAAG,CAAC,OAAO,CAAC,CAAA;AAEZ,EAAA,MAAM,kBAAA,GAAqB,KAAA,CAAM,WAAA,CAAY,MAAM;AAC/C,IAAA,IAAI,CAAC,UAAA,CAAW,OAAA,EAAS,UAAA,CAAW,KAAK,CAAA;AAAA,EAC7C,CAAA,EAAG,EAAE,CAAA;AACL,EAAA,OAAO,EAAC,SAAS,kBAAA,EAAkB;AACvC;AAEA,SAAwB,YAAY,KAAA,EAA4B;AAC5D,EAAA,MAAM;AAAA,IACF,OAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA,GAAO,WAAA;AAAA,IACP,MAAA;AAAA,IACA,MAAA;AAAA,IACA,WAAA,GAAc,QAAA;AAAA,IACd,WAAA,GAAc,QAAA;AAAA,IACd,OAAA;A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B;AAAA,GACpB;AAAA;AAAA,EAEA,cAAA,EAAgB;AAAA,IACZ,eAAA,EAAiB,EAAA;AAAA,IACjB,YAAA,EAAc;AAAA,GAClB;AAAA,EACA,iBAAA,EAAmB;AAAA,IACf,eAAA,EAAiB,aAAA;AAAA,IACjB,WAAA,EAAa;AAAA,GACjB;AAAA,EACA,cAAA,EAAgB;AAAA,IACZ,KAAA,EAAO,MAAA;AAAA,IACP,UAAA,EAAY,KAAA;AAAA,IACZ,QAAA,EAAU;AAAA,GACd;AAAA,EACA,eAAA,EAAiB;AAAA,IACb,UAAA,EAAY,KAAA;AAAA,IACZ,QAAA,EAAU;AAAA;AAElB,CAAC,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/overlay/ConfirmDialog/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport {Modal, Pressable, StyleSheet, View} from \"react-native\";\nimport Animated, {Easing, FadeIn, FadeOut, runOnJS, SlideInDown, SlideOutDown, ZoomIn, ZoomOut} from \"react-native-reanimated\";\nimport {useSafeAreaInsets} from \"react-native-safe-area-context\";\nimport {Icon, Text} from \"../../../_compat\";\nimport type {IConfirmDialogProps} from \"@lmb-it/kitsconcerto-types\";\nimport {useKitsTheme} from \"../../../contexts/Theme\";\nimport {useSeverityColors, useAllSeverityColors} from \"../../../hooks/useSeverityColors\";\nimport {useResolvedStyle} from \"../../../hooks\";\nimport {overlayAnimations as anim, scrimExitDuration} from \"../../../animations\";\n\n/**\n * Keeps the RN Modal mounted through the exit animation. `visible` drives the\n * inner scrim + panel entering/exiting; the Modal itself stays mounted until\n * the panel's exit animation reports finished, then unmounts.\n *\n * Re-entrancy: a new `visible=true` during an exit cancels the panel's exit\n * (reanimated reports `finished=false`, so the unmount is skipped) and the\n * inner re-enters cleanly; `visibleRef` is a second guard for the case where\n * the exit had already completed.\n */\nfunction useOverlayPresence(visible: boolean) {\n const [mounted, setMounted] = React.useState(visible);\n const visibleRef = React.useRef(visible);\n React.useEffect(() => {\n visibleRef.current = visible;\n if (visible) setMounted(true);\n }, [visible]);\n // Runs on the JS thread (dispatched via runOnJS from the exit worklet).\n const handleExitFinished = React.useCallback(() => {\n if (!visibleRef.current) setMounted(false);\n }, []);\n return {mounted, handleExitFinished};\n}\n\nexport default function KitsConfirm(props: IConfirmDialogProps) {\n const {\n visible,\n header,\n message,\n icon,\n type = \"secondary\",\n accept,\n reject,\n acceptLabel = \"Accept\",\n rejectLabel = \"Reject\",\n buttons,\n headless,\n defaultUI,\n async: asyncMode,\n onHide,\n content,\n children,\n position = \"center\",\n style,\n contentStyle,\n headerStyle,\n maskStyle,\n // LEGIT-PLATFORM-ONLY (web): acceptIcon/rejectIcon take PrimeReact\n // icon classes ('pi pi-*') with no native rendering path — use the\n // `buttons` array for custom native actions. acceptClassName/\n // rejectClassName are CSS classes; appendTo is a DOM portal target.\n ...rest\n } = props;\n\n const {resolveToken, theme} = useKitsTheme();\n const colors = useSeverityColors(type);\n const allColors = useAllSeverityColors();\n const insets = useSafeAreaInsets();\n\n const surfaceColor = resolveToken('surface-card');\n const textColor = resolveToken('text');\n const subtextColor = resolveToken('gray.500');\n const grabberColor = resolveToken('gray.300');\n // Scrim via the literal alpha overlay token → rgba(0,0,0,0.4) in both modes.\n const scrimColor = resolveToken('black-alpha-40');\n const brandLogo = type === 'brand' ? theme.config.logo : null;\n\n const resolvedStyle = useResolvedStyle(style || {});\n const resolvedContentStyle = useResolvedStyle(contentStyle || {});\n const resolvedHeaderStyle = useResolvedStyle(headerStyle || {});\n const resolvedMaskStyle = useResolvedStyle(maskStyle || {});\n\n const {mounted, handleExitFinished} = useOverlayPresence(!!visible);\n if (!mounted) return null;\n\n const isSheet = position === 'bottom';\n const hide = () => onHide?.('hide');\n\n const doClick = async (callback?: () => void) => {\n if (asyncMode) {\n await callback?.();\n hide();\n } else {\n hide();\n callback?.();\n }\n };\n\n const showIcon = icon != null || brandLogo != null;\n // Panel always uses surface-card. Severity (danger/success/...) only colours\n // the icon bubble and the action button — not the whole panel — otherwise\n // a danger confirm renders as a red wash with the underlying screen\n // bleeding through.\n const panelBg = surfaceColor;\n\n // Shared action row. `stretch` makes each button flex:1 (bottom-sheet,\n // full-width). The default accept/reject pair is ordered accept-first in the\n // centered card but reject-first (Cancel | Confirm) in the sheet, matching\n // the platform-native bottom-sheet convention.\n const renderActions = (stretch: boolean) => {\n if (buttons?.length) {\n return (\n <View style={styles.buttonRow}>\n {buttons.map((b, i) => {\n const btnColor = allColors[b.type ?? type]?.solid ?? colors.solid;\n return (\n <Pressable\n key={i}\n disabled={b.disabled}\n style={[\n styles.actionBtn,\n stretch && styles.actionBtnSheet,\n stretch && {flex: 1},\n b.outlined\n ? {backgroundColor: \"transparent\", borderColor: btnColor, borderWidth: 1.5}\n : {backgroundColor: btnColor},\n b.rounded && {borderRadius: 999},\n b.disabled && {opacity: 0.5},\n ]}\n onPress={() => b.onClick(hide, accept, reject)}\n >\n <Text style={{\n color: b.outlined ? btnColor : \"#fff\",\n fontWeight: \"600\",\n fontSize: 14,\n }}>\n {b.title}\n </Text>\n </Pressable>\n );\n })}\n </View>\n );\n }\n\n const acceptBtn = (\n <Pressable\n key=\"accept\"\n style={[styles.actionBtn, stretch && styles.actionBtnSheet, {backgroundColor: colors.solid, flex: 1}]}\n onPress={() => doClick(accept)}\n >\n <Text style={styles.btnTextPrimary}>{acceptLabel}</Text>\n </Pressable>\n );\n const rejectBtn = !defaultUI ? (\n <Pressable\n key=\"reject\"\n style={[styles.actionBtn, styles.actionBtnOutlined, stretch && styles.actionBtnSheet, {borderColor: colors.solid, flex: 1}]}\n onPress={() => doClick(reject)}\n >\n <Text style={[styles.btnTextOutlined, {color: colors.solid}]}>{rejectLabel}</Text>\n </Pressable>\n ) : null;\n\n return (\n <View style={styles.buttonRow}>\n {stretch ? <>{rejectBtn}{acceptBtn}</> : <>{acceptBtn}{rejectBtn}</>}\n </View>\n );\n };\n\n // ── Bottom sheet ────────────────────────────────────────\n if (isSheet) {\n return (\n <Modal visible transparent animationType=\"none\" onRequestClose={hide}>\n {visible && (\n <Animated.View\n entering={FadeIn.duration(anim.scrim.enterDuration)}\n /* Contains the sheet — see `scrimExitDuration`. */\n exiting={FadeOut.duration(scrimExitDuration(anim.sheet.exitDuration))}\n style={[styles.sheetOverlay, {backgroundColor: scrimColor}, resolvedMaskStyle as any]}\n >\n <Pressable style={StyleSheet.absoluteFill} onPress={hide}/>\n <Animated.View\n entering={SlideInDown.springify().damping(anim.sheet.enter.damping).stiffness(anim.sheet.enter.stiffness).mass(anim.sheet.enter.mass ?? 1)}\n exiting={SlideOutDown.duration(anim.sheet.exitDuration).easing(Easing.in(Easing.ease)).withCallback((finished) => {\n 'worklet';\n if (finished) runOnJS(handleExitFinished)();\n })}\n style={[\n styles.sheetPanel,\n {backgroundColor: panelBg, paddingBottom: 24 + insets.bottom},\n resolvedStyle as any,\n resolvedContentStyle as any,\n ]}\n >\n {/* Grabber */}\n <View style={[styles.grabber, {backgroundColor: grabberColor}]}/>\n\n {/* Header */}\n {header != null && (\n <Text style={[styles.sheetHeader, {color: textColor}, resolvedHeaderStyle as any]}>\n {header as React.ReactNode}\n </Text>\n )}\n\n {/* Message */}\n {message != null && (\n <Text style={[styles.sheetMessage, {color: subtextColor}]}>\n {message as React.ReactNode}\n </Text>\n )}\n\n {/* Injected item / extra content */}\n {children}\n\n {/* Actions */}\n {renderActions(true)}\n </Animated.View>\n </Animated.View>\n )}\n </Modal>\n );\n }\n\n // ── Content-only mode (prompt) ──────────────────────────\n if (content) {\n return (\n <Modal visible transparent animationType=\"none\" onRequestClose={hide}>\n {visible && (\n <Animated.View\n entering={FadeIn.duration(anim.scrim.enterDuration)}\n /* Contains the centred panel — see `scrimExitDuration`. */\n exiting={FadeOut.duration(scrimExitDuration(anim.confirm.exitDuration))}\n style={[styles.overlay, {backgroundColor: scrimColor}, resolvedMaskStyle as any]}\n >\n <Pressable style={StyleSheet.absoluteFill} onPress={hide}/>\n <Animated.View\n entering={ZoomIn.springify().damping(anim.confirm.content.damping).stiffness(anim.confirm.content.stiffness).mass(anim.confirm.content.mass ?? 1)}\n exiting={ZoomOut.duration(anim.confirm.exitDuration).easing(Easing.in(Easing.ease)).withCallback((finished) => {\n 'worklet';\n if (finished) runOnJS(handleExitFinished)();\n })}\n style={[\n styles.panel,\n {backgroundColor: surfaceColor, minWidth: 250, maxWidth: 380},\n resolvedStyle as any,\n resolvedContentStyle as any,\n ]}\n >\n {content as React.ReactNode}\n </Animated.View>\n </Animated.View>\n )}\n </Modal>\n );\n }\n\n return (\n <Modal visible transparent animationType=\"none\" onRequestClose={hide}>\n {visible && (\n <Animated.View\n entering={FadeIn.duration(anim.scrim.enterDuration)}\n /* Contains the centred panel — see `scrimExitDuration`. */\n exiting={FadeOut.duration(scrimExitDuration(anim.confirm.exitDuration))}\n style={[styles.overlay, {backgroundColor: scrimColor}, resolvedMaskStyle as any]}\n >\n <Pressable style={StyleSheet.absoluteFill} onPress={hide}/>\n\n {/* Card + icon stack: icon sits above the card */}\n <View style={styles.cardStack}>\n {/* Soft-circle icon bubble */}\n {showIcon && (\n <Animated.View\n entering={ZoomIn.springify().damping(anim.confirm.icon.damping).stiffness(anim.confirm.icon.stiffness).mass(anim.confirm.icon.mass ?? 1).delay(anim.confirm.icon.delay ?? 0)}\n exiting={ZoomOut.duration(anim.confirm.exitDuration).easing(Easing.in(Easing.ease))}\n style={[styles.iconBubble, {backgroundColor: colors.iconBg}]}\n >\n {brandLogo ? brandLogo : typeof icon === \"string\" ? (\n <Icon name={icon as never} size={'xl'} color={colors.iconFg}/>\n ) : (\n icon\n )}\n </Animated.View>\n )}\n\n {/* Panel */}\n <Animated.View\n entering={ZoomIn.springify().damping(anim.confirm.enter.damping).stiffness(anim.confirm.enter.stiffness).mass(anim.confirm.enter.mass ?? 1)}\n exiting={ZoomOut.duration(anim.confirm.exitDuration).easing(Easing.in(Easing.ease)).withCallback((finished) => {\n 'worklet';\n if (finished) runOnJS(handleExitFinished)();\n })}\n style={[\n styles.panel,\n {\n backgroundColor: panelBg,\n paddingTop: showIcon ? 48 : 24,\n gap: 10,\n },\n resolvedStyle as any,\n resolvedContentStyle as any,\n ]}\n >\n {/* Close button */}\n <Pressable style={styles.closeBtn} onPress={hide} hitSlop={12}>\n <Text style={{fontSize: 18, color: subtextColor}}>✕</Text>\n </Pressable>\n\n {/* Header */}\n {header != null && (\n <Text style={[styles.header, {color: textColor}, resolvedHeaderStyle as any]}>\n {header as React.ReactNode}\n </Text>\n )}\n\n {/* Message */}\n {message != null && (\n <Text style={[styles.message, {color: subtextColor}]}>\n {message as React.ReactNode}\n </Text>\n )}\n\n {/* Children */}\n {children}\n\n {/* Buttons */}\n {renderActions(false)}\n </Animated.View>\n </View>\n </Animated.View>\n )}\n </Modal>\n );\n}\n\nconst styles = StyleSheet.create({\n overlay: {\n flex: 1,\n justifyContent: \"center\",\n alignItems: \"center\",\n padding: 28,\n },\n sheetOverlay: {\n flex: 1,\n justifyContent: \"flex-end\",\n },\n sheetPanel: {\n // 24 == radii.2xl, top corners only (bottom stays square).\n borderTopLeftRadius: 24,\n borderTopRightRadius: 24,\n paddingHorizontal: 24,\n paddingTop: 10,\n gap: 14,\n // Subtle elevation (upward for a sheet): low opacity, wide blur, minimal offset.\n elevation: 6,\n shadowColor: \"#000\",\n shadowOffset: {width: 0, height: -2},\n shadowOpacity: 0.15,\n shadowRadius: 20,\n },\n grabber: {\n width: 40,\n height: 5,\n borderRadius: 999,\n alignSelf: \"center\",\n marginBottom: 6,\n },\n sheetHeader: {\n fontSize: 24,\n fontWeight: \"700\",\n textAlign: \"left\",\n },\n sheetMessage: {\n fontSize: 15,\n lineHeight: 22,\n textAlign: \"left\",\n },\n cardStack: {\n minWidth: 250,\n maxWidth: 380,\n alignItems: \"center\",\n },\n iconBubble: {\n width: 72,\n height: 72,\n borderRadius: 36,\n justifyContent: \"center\",\n alignItems: \"center\",\n zIndex: 2,\n marginBottom: -36,\n elevation: 8,\n shadowColor: \"#000\",\n shadowOffset: {width: 0, height: 4},\n shadowOpacity: 0.15,\n shadowRadius: 8,\n },\n panel: {\n alignSelf: \"stretch\",\n // 20 == radii.xl. Side padding (24) == bottom padding (24) for even rhythm.\n borderRadius: 20,\n paddingHorizontal: 24,\n paddingBottom: 24,\n // Subtle elevation: low opacity, wide blur, minimal offset.\n elevation: 6,\n shadowColor: \"#000\",\n shadowOffset: {width: 0, height: 2},\n shadowOpacity: 0.15,\n shadowRadius: 20,\n alignItems: \"center\",\n },\n closeBtn: {\n position: \"absolute\",\n top: 12,\n right: 14,\n zIndex: 3,\n },\n header: {\n fontSize: 22,\n fontWeight: \"700\",\n textAlign: \"center\",\n marginBottom: 8,\n },\n message: {\n fontSize: 14,\n textAlign: \"center\",\n lineHeight: 20,\n // Tightened so top/bottom whitespace around the actions reads balanced.\n marginBottom: 16,\n },\n buttonRow: {\n flexDirection: \"row\",\n justifyContent: \"center\",\n gap: 12,\n width: \"100%\",\n },\n actionBtn: {\n paddingVertical: 12,\n paddingHorizontal: 24,\n // Pill (== radii.pill). Buttons here are raw Pressables, not kits Button,\n // so the pill comes from borderRadius — the pattern the `buttons` array\n // path (`b.rounded && {borderRadius: 999}`) already uses in this file.\n borderRadius: 999,\n minWidth: 100,\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n // Taller buttons for the bottom-sheet action row (pill shape shared).\n actionBtnSheet: {\n paddingVertical: 16,\n borderRadius: 999,\n },\n actionBtnOutlined: {\n backgroundColor: \"transparent\",\n borderWidth: 1.5,\n },\n btnTextPrimary: {\n color: \"#fff\",\n fontWeight: \"600\",\n fontSize: 14,\n },\n btnTextOutlined: {\n fontWeight: \"600\",\n fontSize: 14,\n },\n});\n"],"names":["anim"],"mappings":";;;;;;;;;;;;;AAqBA,SAAS,mBAAmB,OAAA,EAAkB;AAC1C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,KAAA,CAAM,SAAS,OAAO,CAAA;AACpD,EAAA,MAAM,UAAA,GAAa,KAAA,CAAM,MAAA,C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{
|
|
104
104
|
entering: Animated.FadeIn.duration(index.overlayAnimations.scrim.enterDuration),
|
|
105
|
-
exiting: Animated.FadeOut.duration(index.overlayAnimations.
|
|
105
|
+
exiting: Animated.FadeOut.duration(index.scrimExitDuration(isSheet ? index.overlayAnimations.sheet.exitDuration : index.overlayAnimations.dialog.exitDuration)),
|
|
106
106
|
style: [isSheet ? styles.sheetOverlay : styles.overlay, { backgroundColor: scrimColor }, resolvedMaskStyle],
|
|
107
107
|
children: [
|
|
108
108
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style: reactNative.StyleSheet.absoluteFill, onPress: dismissableMask ? hide : void 0 }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../src/components/overlay/Dialog/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport {Modal, Pressable, ScrollView, StyleSheet, View, useWindowDimensions} from \"react-native\";\nimport Animated, {Easing, FadeIn, FadeOut, ReduceMotion, runOnJS, SlideInDown, SlideOutDown, ZoomIn, ZoomOut} from \"react-native-reanimated\";\nimport {useSafeAreaInsets} from \"react-native-safe-area-context\";\nimport {Icon, Text} from \"../../../_compat\";\nimport type {IKitsDialogControlled} from \"@lmb-it/kitsconcerto-types\";\nimport {useKitsTheme} from \"../../../contexts/Theme\";\nimport {useSeverityColors} from \"../../../hooks/useSeverityColors\";\nimport {useResolvedStyle} from \"../../../hooks\";\nimport {overlayAnimations as anim} from \"../../../animations\";\n\n/**\n * Keeps the RN Modal mounted through the exit animation. `visible` drives the\n * inner scrim + panel entering/exiting; the Modal itself stays mounted until\n * the panel's exit animation reports finished, then unmounts.\n *\n * Re-entrancy: a new `visible=true` during an exit re-renders the inner (which\n * re-enters), and the still-pending exit callback is ignored because\n * `visibleRef` is already back to `true` — so the Modal is never torn down\n * mid-reopen.\n */\nfunction useOverlayPresence(visible: boolean) {\n const [mounted, setMounted] = React.useState(visible);\n const visibleRef = React.useRef(visible);\n React.useEffect(() => {\n visibleRef.current = visible;\n if (visible) setMounted(true);\n }, [visible]);\n // Runs on the JS thread (dispatched via runOnJS from the exit worklet).\n const handleExitFinished = React.useCallback(() => {\n if (!visibleRef.current) setMounted(false);\n }, []);\n return {mounted, handleExitFinished};\n}\n\nexport default function KitsDialogControlled({state, onHide}: IKitsDialogControlled) {\n const {\n children,\n content: contentProp,\n onClose,\n asyncClose,\n type,\n icon,\n style,\n contentStyle,\n headerStyle,\n maskStyle,\n position = 'center',\n responsive = true,\n hideHeader,\n headerRender,\n footerRender,\n footerStyle,\n canClose,\n bodyStyle,\n closeIcon,\n // Native default true preserves historical tap-to-dismiss; web's\n // PrimeReact default is false — pass explicitly in shared code.\n dismissableMask = true,\n breakpoints,\n ...rest\n } = state;\n const {resolveToken, theme} = useKitsTheme();\n const severityColors = useSeverityColors(type || 'secondary');\n const colors = type ? severityColors : null;\n const insets = useSafeAreaInsets();\n const isSheet = position === 'bottom';\n\n const surfaceColor = resolveToken('surface-card');\n const textColor = resolveToken('text');\n const borderColor = colors?.border ?? resolveToken('border');\n const subtextColor = resolveToken('gray.500');\n const grabberColor = resolveToken('gray.300');\n // Scrim via the literal alpha overlay token → rgba(0,0,0,0.4) in both modes.\n const scrimColor = resolveToken('black-alpha-40');\n const brandLogo = type === 'brand' ? theme.config.logo : null;\n\n const resolvedStyle = useResolvedStyle(style || {});\n const resolvedContentStyle = useResolvedStyle(contentStyle || {});\n const resolvedHeaderStyle = useResolvedStyle(headerStyle || {});\n const resolvedMaskStyle = useResolvedStyle(maskStyle || {});\n const resolvedFooterStyle = useResolvedStyle(footerStyle || {});\n const resolvedBodyStyle = useResolvedStyle(bodyStyle || {});\n\n const {width: screenWidth} = useWindowDimensions();\n // Consumer `breakpoints` ({'960px': '75vw'}) mirrors the web prop: the\n // smallest max-width threshold >= the screen width wins; vw/% both map\n // to a percentage of the window width. Falls back to the responsive\n // default (50% tablets/desktop, 95% phones <=641px).\n const breakpointWidth = (() => {\n if (!breakpoints) return null;\n const matches = Object.entries(breakpoints)\n .map(([k, v]) => [parseFloat(k), v] as const)\n .filter(([px]) => !Number.isNaN(px) && screenWidth <= px)\n .sort(([a], [b]) => a - b);\n const value = matches[0]?.[1];\n if (value == null) return null;\n const num = parseFloat(value);\n return Number.isNaN(num) ? null : `${num}%`;\n })();\n const responsiveWidth = breakpointWidth ?? (screenWidth > 641 ? '50%' : '95%');\n const hasExplicitWidth = (resolvedStyle as any).width != null;\n\n const hide = async () => {\n // canClose gate — intercepts every close path (backdrop Pressable,\n // built-in X Pressable, RN Modal onRequestClose). When blocked,\n // onClose is suppressed and the dialog stays open.\n if (canClose === false || (typeof canClose === 'function' && !canClose())) {\n return;\n }\n if (asyncClose && typeof onClose === \"function\") {\n await onClose();\n } else {\n onClose?.();\n }\n onHide();\n };\n\n const {mounted, handleExitFinished} = useOverlayPresence(!!state.visible);\n if (!mounted) return null;\n\n const content = typeof children === \"function\" ? children(hide) : children;\n // Content-mode override (mirrors web): consumer node replaces the whole\n // header / body / footer template inside the panel.\n const contentMode = contentProp != null\n ? (typeof contentProp === \"function\" ? contentProp({hide}) : contentProp)\n : null;\n\n return (\n <Modal visible transparent animationType=\"none\" onRequestClose={hide}>\n {state.visible && (\n <Animated.View\n entering={FadeIn.duration(anim.scrim.enterDuration)}\n exiting={FadeOut.duration(anim.scrim.exitDuration)}\n style={[isSheet ? styles.sheetOverlay : styles.overlay, {backgroundColor: scrimColor}, resolvedMaskStyle as any]}\n >\n <Pressable style={StyleSheet.absoluteFill} onPress={dismissableMask ? hide : undefined}/>\n <Animated.View\n /* The sheet asks Reanimated to keep moving under iOS\n \"Reduce Motion\" — see `overlayAnimations.sheet`. Without\n it the panel appears in one frame and the only motion\n left is the scrim, which reads as a fade. The centred\n dialog keeps the system default. */\n entering={isSheet\n ? SlideInDown.springify().damping(anim.sheet.enter.damping).stiffness(anim.sheet.enter.stiffness).mass(anim.sheet.enter.mass ?? 1)\n .reduceMotion(anim.sheet.keepMotionWhenReduced ? ReduceMotion.Never : ReduceMotion.System)\n : ZoomIn.springify().damping(anim.dialog.enter.damping).stiffness(anim.dialog.enter.stiffness).mass(anim.dialog.enter.mass ?? 1)}\n exiting={(isSheet\n ? SlideOutDown.duration(anim.sheet.exitDuration).easing(Easing.in(Easing.ease))\n .reduceMotion(anim.sheet.keepMotionWhenReduced ? ReduceMotion.Never : ReduceMotion.System)\n : ZoomOut.duration(anim.dialog.exitDuration).easing(Easing.in(Easing.ease))\n ).withCallback((finished) => {\n 'worklet';\n if (finished) runOnJS(handleExitFinished)();\n })}\n style={[\n styles.panel,\n isSheet && styles.sheetPanel,\n {backgroundColor: surfaceColor, borderColor},\n // Explicit `breakpoints` win even when responsive=false (web parity)\n !isSheet && !hasExplicitWidth && (breakpoints != null || responsive) ? {width: responsiveWidth} : null,\n resolvedStyle as any,\n resolvedContentStyle as any,\n ]}\n >\n {contentMode != null ? contentMode : <>\n {/* Grabber (bottom-sheet) */}\n {isSheet && <View style={[styles.grabber, {backgroundColor: grabberColor}]}/>}\n\n {/* Severity accent strip */}\n {colors && !isSheet && (\n <View style={{height: 4, backgroundColor: colors.solid, borderTopLeftRadius: 20, borderTopRightRadius: 20}}/>\n )}\n\n {/* Custom header (headerRender) — fully replaces the built-in header\n View when provided. Wins over the default header even if `header`\n is also set. */}\n {!hideHeader && headerRender != null && headerRender({close: () => { void hide(); }})}\n\n {/* Header (default) — rendered when no headerRender and `header` is set. */}\n {!hideHeader && headerRender == null && rest.header != null && (\n <View style={[styles.header, {borderBottomColor: borderColor}, resolvedHeaderStyle as any]}>\n {/* Inline severity icon */}\n {(icon || brandLogo) && colors && (\n <View style={{\n width: 36,\n height: 36,\n borderRadius: 18,\n backgroundColor: colors.iconBg,\n alignItems: 'center',\n justifyContent: 'center',\n marginRight: 12,\n }}>\n {brandLogo ? brandLogo : typeof icon === 'string' ? (\n <Icon name={icon as never} size={'lg'} color={colors.iconFg}/>\n ) : icon}\n </View>\n )}\n <Text style={{fontSize: 18, fontWeight: \"700\", color: textColor, flex: 1}}>\n {rest.header as React.ReactNode}\n </Text>\n <Pressable onPress={hide} hitSlop={8}>\n {closeIcon ?? <Text style={{fontSize: 18, color: subtextColor}}>✕</Text>}\n </Pressable>\n </View>\n )}\n\n {/* Body — bodyStyle is applied AFTER the built-in maxHeight: 400,\n so consumers can lift the cap (`maxHeight: 600`) or unlock flex\n sizing (`minHeight: 0`) without losing the default behavior when\n bodyStyle is unset. */}\n <ScrollView\n style={[styles.body, resolvedBodyStyle as any]}\n contentContainerStyle={styles.bodyContent}\n showsVerticalScrollIndicator={false}\n >\n {content}\n </ScrollView>\n\n {/* Footer — footerRender takes precedence over `footer`. footerStyle\n is merged AFTER the built-in flex defaults so consumers can override\n alignment (e.g. justifyContent: 'space-between' for left-delete /\n right-actions layouts) without losing the borderTop / padding. */}\n {(footerRender != null || rest.footer != null) && (\n <View style={[\n styles.footer,\n {borderTopColor: borderColor},\n isSheet && {paddingBottom: 12 + insets.bottom},\n resolvedFooterStyle as any,\n ]}>\n {footerRender\n ? footerRender({close: () => { void hide(); }})\n : (rest.footer as React.ReactNode)}\n </View>\n )}\n </>}\n </Animated.View>\n </Animated.View>\n )}\n </Modal>\n );\n}\n\nconst styles = StyleSheet.create({\n overlay: {\n flex: 1,\n justifyContent: \"center\",\n alignItems: \"center\",\n padding: 24,\n },\n sheetOverlay: {\n flex: 1,\n justifyContent: \"flex-end\",\n },\n sheetPanel: {\n width: \"100%\",\n maxWidth: \"100%\",\n maxHeight: \"90%\",\n borderWidth: 0,\n borderTopLeftRadius: 24,\n borderTopRightRadius: 24,\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n paddingTop: 10,\n },\n grabber: {\n width: 40,\n height: 5,\n borderRadius: 999,\n alignSelf: \"center\",\n marginBottom: 6,\n },\n panel: {\n // 20 == radii.xl (no numeric radii resolver on native — see report).\n borderRadius: 20,\n borderWidth: 1,\n minWidth: 250,\n maxWidth: \"90%\",\n maxHeight: \"80%\",\n overflow: \"hidden\",\n // Subtle elevation: low opacity, wide blur, minimal offset.\n elevation: 6,\n shadowColor: \"#000\",\n shadowOffset: {width: 0, height: 2},\n shadowOpacity: 0.15,\n shadowRadius: 20,\n },\n header: {\n flexDirection: \"row\",\n alignItems: \"center\",\n paddingHorizontal: 20,\n paddingVertical: 16,\n borderBottomWidth: 1,\n },\n body: {\n maxHeight: 400,\n },\n bodyContent: {\n padding: 20,\n },\n footer: {\n flexDirection: \"row\",\n justifyContent: \"flex-end\",\n paddingHorizontal: 20,\n paddingVertical: 12,\n borderTopWidth: 1,\n gap: 8,\n },\n});\n"],"names":["useKitsTheme","useSeverityColors","useSafeAreaInsets","useResolvedStyle","useWindowDimensions","jsx","Modal","jsxs","FadeIn","anim","FadeOut","Pressable","StyleSheet","SlideInDown","ReduceMotion","ZoomIn","SlideOutDown","Easing","ZoomOut","runOnJS","Fragment","View","Icon","Text","ScrollView"],"mappings":";;;;;;;;;;;;;;;;;AAqBA,SAAS,mBAAmB,OAAA,EAAkB;AAC1C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,KAAA,CAAM,SAAS,OAAO,CAAA;AACpD,EAAA,MAAM,UAAA,GAAa,KAAA,CAAM,MAAA,CAAO,OAAO,CAAA;AACvC,EAAA,KAAA,CAAM,UAAU,MAAM;AAClB,IAAA,UAAA,CAAW,OAAA,GAAU,OAAA;AACrB,IAAA,IAAI,OAAA,aAAoB,IAAI,CAAA;AAAA,EAChC,CAAA,EAAG,CAAC,OAAO,CAAC,CAAA;AAEZ,EAAA,MAAM,kBAAA,GAAqB,KAAA,CAAM,WAAA,CAAY,MAAM;AAC/C,IAAA,IAAI,CAAC,UAAA,CAAW,OAAA,EAAS,UAAA,CAAW,KAAK,CAAA;AAAA,EAC7C,CAAA,EAAG,EAAE,CAAA;AACL,EAAA,OAAO,EAAC,SAAS,kBAAA,EAAkB;AACvC;AAEA,SAAwB,oBAAA,CAAqB,EAAC,KAAA,EAAO,MAAA,EAAM,EAA0B;AACjF,EAAA,MAAM;AAAA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A;AAAA,IAEH,YAAA,EAAc,EAAA;AAAA,IACd,WAAA,EAAa,CAAA;AAAA,IACb,QAAA,EAAU,GAAA;AAAA,IACV,QAAA,EAAU,KAAA;AAAA,IACV,SAAA,EAAW,KAAA;AAAA,IACX,QAAA,EAAU,QAAA;AAAA;AAAA,IAEV,SAAA,EAAW,CAAA;AAAA,IACX,WAAA,EAAa,MAAA;AAAA,IACb,YAAA,EAAc,EAAC,KAAA,EAAO,CAAA,EAAG,QAAQ,CAAA,EAAC;AAAA,IAClC,aAAA,EAAe,IAAA;AAAA,IACf,YAAA,EAAc;AAAA,GAClB;AAAA,EACA,MAAA,EAAQ;AAAA,IACJ,aAAA,EAAe,KAAA;AAAA,IACf,UAAA,EAAY,QAAA;AAAA,IACZ,iBAAA,EAAmB,EAAA;AAAA,IACnB,eAAA,EAAiB,EAAA;AAAA,IACjB,iBAAA,EAAmB;AAAA,GACvB;AAAA,EACA,IAAA,EAAM;AAAA,IACF,SAAA,EAAW;AAAA,GACf;AAAA,EACA,WAAA,EAAa;AAAA,IACT,OAAA,EAAS;AAAA,GACb;AAAA,EACA,MAAA,EAAQ;AAAA,IACJ,aAAA,EAAe,KAAA;AAAA,IACf,cAAA,EAAgB,UAAA;AAAA,IAChB,iBAAA,EAAmB,EAAA;AAAA,IACnB,eAAA,EAAiB,EAAA;AAAA,IACjB,cAAA,EAAgB,CAAA;AAAA,IAChB,GAAA,EAAK;AAAA;AAEb,CAAC,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../../src/components/overlay/Dialog/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport {Modal, Pressable, ScrollView, StyleSheet, View, useWindowDimensions} from \"react-native\";\nimport Animated, {Easing, FadeIn, FadeOut, ReduceMotion, runOnJS, SlideInDown, SlideOutDown, ZoomIn, ZoomOut} from \"react-native-reanimated\";\nimport {useSafeAreaInsets} from \"react-native-safe-area-context\";\nimport {Icon, Text} from \"../../../_compat\";\nimport type {IKitsDialogControlled} from \"@lmb-it/kitsconcerto-types\";\nimport {useKitsTheme} from \"../../../contexts/Theme\";\nimport {useSeverityColors} from \"../../../hooks/useSeverityColors\";\nimport {useResolvedStyle} from \"../../../hooks\";\nimport {overlayAnimations as anim, scrimExitDuration} from \"../../../animations\";\n\n/**\n * Keeps the RN Modal mounted through the exit animation. `visible` drives the\n * inner scrim + panel entering/exiting; the Modal itself stays mounted until\n * the panel's exit animation reports finished, then unmounts.\n *\n * Re-entrancy: a new `visible=true` during an exit re-renders the inner (which\n * re-enters), and the still-pending exit callback is ignored because\n * `visibleRef` is already back to `true` — so the Modal is never torn down\n * mid-reopen.\n */\nfunction useOverlayPresence(visible: boolean) {\n const [mounted, setMounted] = React.useState(visible);\n const visibleRef = React.useRef(visible);\n React.useEffect(() => {\n visibleRef.current = visible;\n if (visible) setMounted(true);\n }, [visible]);\n // Runs on the JS thread (dispatched via runOnJS from the exit worklet).\n const handleExitFinished = React.useCallback(() => {\n if (!visibleRef.current) setMounted(false);\n }, []);\n return {mounted, handleExitFinished};\n}\n\nexport default function KitsDialogControlled({state, onHide}: IKitsDialogControlled) {\n const {\n children,\n content: contentProp,\n onClose,\n asyncClose,\n type,\n icon,\n style,\n contentStyle,\n headerStyle,\n maskStyle,\n position = 'center',\n responsive = true,\n hideHeader,\n headerRender,\n footerRender,\n footerStyle,\n canClose,\n bodyStyle,\n closeIcon,\n // Native default true preserves historical tap-to-dismiss; web's\n // PrimeReact default is false — pass explicitly in shared code.\n dismissableMask = true,\n breakpoints,\n ...rest\n } = state;\n const {resolveToken, theme} = useKitsTheme();\n const severityColors = useSeverityColors(type || 'secondary');\n const colors = type ? severityColors : null;\n const insets = useSafeAreaInsets();\n const isSheet = position === 'bottom';\n\n const surfaceColor = resolveToken('surface-card');\n const textColor = resolveToken('text');\n const borderColor = colors?.border ?? resolveToken('border');\n const subtextColor = resolveToken('gray.500');\n const grabberColor = resolveToken('gray.300');\n // Scrim via the literal alpha overlay token → rgba(0,0,0,0.4) in both modes.\n const scrimColor = resolveToken('black-alpha-40');\n const brandLogo = type === 'brand' ? theme.config.logo : null;\n\n const resolvedStyle = useResolvedStyle(style || {});\n const resolvedContentStyle = useResolvedStyle(contentStyle || {});\n const resolvedHeaderStyle = useResolvedStyle(headerStyle || {});\n const resolvedMaskStyle = useResolvedStyle(maskStyle || {});\n const resolvedFooterStyle = useResolvedStyle(footerStyle || {});\n const resolvedBodyStyle = useResolvedStyle(bodyStyle || {});\n\n const {width: screenWidth} = useWindowDimensions();\n // Consumer `breakpoints` ({'960px': '75vw'}) mirrors the web prop: the\n // smallest max-width threshold >= the screen width wins; vw/% both map\n // to a percentage of the window width. Falls back to the responsive\n // default (50% tablets/desktop, 95% phones <=641px).\n const breakpointWidth = (() => {\n if (!breakpoints) return null;\n const matches = Object.entries(breakpoints)\n .map(([k, v]) => [parseFloat(k), v] as const)\n .filter(([px]) => !Number.isNaN(px) && screenWidth <= px)\n .sort(([a], [b]) => a - b);\n const value = matches[0]?.[1];\n if (value == null) return null;\n const num = parseFloat(value);\n return Number.isNaN(num) ? null : `${num}%`;\n })();\n const responsiveWidth = breakpointWidth ?? (screenWidth > 641 ? '50%' : '95%');\n const hasExplicitWidth = (resolvedStyle as any).width != null;\n\n const hide = async () => {\n // canClose gate — intercepts every close path (backdrop Pressable,\n // built-in X Pressable, RN Modal onRequestClose). When blocked,\n // onClose is suppressed and the dialog stays open.\n if (canClose === false || (typeof canClose === 'function' && !canClose())) {\n return;\n }\n if (asyncClose && typeof onClose === \"function\") {\n await onClose();\n } else {\n onClose?.();\n }\n onHide();\n };\n\n const {mounted, handleExitFinished} = useOverlayPresence(!!state.visible);\n if (!mounted) return null;\n\n const content = typeof children === \"function\" ? children(hide) : children;\n // Content-mode override (mirrors web): consumer node replaces the whole\n // header / body / footer template inside the panel.\n const contentMode = contentProp != null\n ? (typeof contentProp === \"function\" ? contentProp({hide}) : contentProp)\n : null;\n\n return (\n <Modal visible transparent animationType=\"none\" onRequestClose={hide}>\n {state.visible && (\n <Animated.View\n entering={FadeIn.duration(anim.scrim.enterDuration)}\n /* The panel is a CHILD of this view, so this fade must not\n finish first — see `scrimExitDuration`. */\n exiting={FadeOut.duration(scrimExitDuration(isSheet ? anim.sheet.exitDuration : anim.dialog.exitDuration))}\n style={[isSheet ? styles.sheetOverlay : styles.overlay, {backgroundColor: scrimColor}, resolvedMaskStyle as any]}\n >\n <Pressable style={StyleSheet.absoluteFill} onPress={dismissableMask ? hide : undefined}/>\n <Animated.View\n /* The sheet asks Reanimated to keep moving under iOS\n \"Reduce Motion\" — see `overlayAnimations.sheet`. Without\n it the panel appears in one frame and the only motion\n left is the scrim, which reads as a fade. The centred\n dialog keeps the system default. */\n entering={isSheet\n ? SlideInDown.springify().damping(anim.sheet.enter.damping).stiffness(anim.sheet.enter.stiffness).mass(anim.sheet.enter.mass ?? 1)\n .reduceMotion(anim.sheet.keepMotionWhenReduced ? ReduceMotion.Never : ReduceMotion.System)\n : ZoomIn.springify().damping(anim.dialog.enter.damping).stiffness(anim.dialog.enter.stiffness).mass(anim.dialog.enter.mass ?? 1)}\n exiting={(isSheet\n ? SlideOutDown.duration(anim.sheet.exitDuration).easing(Easing.in(Easing.ease))\n .reduceMotion(anim.sheet.keepMotionWhenReduced ? ReduceMotion.Never : ReduceMotion.System)\n : ZoomOut.duration(anim.dialog.exitDuration).easing(Easing.in(Easing.ease))\n ).withCallback((finished) => {\n 'worklet';\n if (finished) runOnJS(handleExitFinished)();\n })}\n style={[\n styles.panel,\n isSheet && styles.sheetPanel,\n {backgroundColor: surfaceColor, borderColor},\n // Explicit `breakpoints` win even when responsive=false (web parity)\n !isSheet && !hasExplicitWidth && (breakpoints != null || responsive) ? {width: responsiveWidth} : null,\n resolvedStyle as any,\n resolvedContentStyle as any,\n ]}\n >\n {contentMode != null ? contentMode : <>\n {/* Grabber (bottom-sheet) */}\n {isSheet && <View style={[styles.grabber, {backgroundColor: grabberColor}]}/>}\n\n {/* Severity accent strip */}\n {colors && !isSheet && (\n <View style={{height: 4, backgroundColor: colors.solid, borderTopLeftRadius: 20, borderTopRightRadius: 20}}/>\n )}\n\n {/* Custom header (headerRender) — fully replaces the built-in header\n View when provided. Wins over the default header even if `header`\n is also set. */}\n {!hideHeader && headerRender != null && headerRender({close: () => { void hide(); }})}\n\n {/* Header (default) — rendered when no headerRender and `header` is set. */}\n {!hideHeader && headerRender == null && rest.header != null && (\n <View style={[styles.header, {borderBottomColor: borderColor}, resolvedHeaderStyle as any]}>\n {/* Inline severity icon */}\n {(icon || brandLogo) && colors && (\n <View style={{\n width: 36,\n height: 36,\n borderRadius: 18,\n backgroundColor: colors.iconBg,\n alignItems: 'center',\n justifyContent: 'center',\n marginRight: 12,\n }}>\n {brandLogo ? brandLogo : typeof icon === 'string' ? (\n <Icon name={icon as never} size={'lg'} color={colors.iconFg}/>\n ) : icon}\n </View>\n )}\n <Text style={{fontSize: 18, fontWeight: \"700\", color: textColor, flex: 1}}>\n {rest.header as React.ReactNode}\n </Text>\n <Pressable onPress={hide} hitSlop={8}>\n {closeIcon ?? <Text style={{fontSize: 18, color: subtextColor}}>✕</Text>}\n </Pressable>\n </View>\n )}\n\n {/* Body — bodyStyle is applied AFTER the built-in maxHeight: 400,\n so consumers can lift the cap (`maxHeight: 600`) or unlock flex\n sizing (`minHeight: 0`) without losing the default behavior when\n bodyStyle is unset. */}\n <ScrollView\n style={[styles.body, resolvedBodyStyle as any]}\n contentContainerStyle={styles.bodyContent}\n showsVerticalScrollIndicator={false}\n >\n {content}\n </ScrollView>\n\n {/* Footer — footerRender takes precedence over `footer`. footerStyle\n is merged AFTER the built-in flex defaults so consumers can override\n alignment (e.g. justifyContent: 'space-between' for left-delete /\n right-actions layouts) without losing the borderTop / padding. */}\n {(footerRender != null || rest.footer != null) && (\n <View style={[\n styles.footer,\n {borderTopColor: borderColor},\n isSheet && {paddingBottom: 12 + insets.bottom},\n resolvedFooterStyle as any,\n ]}>\n {footerRender\n ? footerRender({close: () => { void hide(); }})\n : (rest.footer as React.ReactNode)}\n </View>\n )}\n </>}\n </Animated.View>\n </Animated.View>\n )}\n </Modal>\n );\n}\n\nconst styles = StyleSheet.create({\n overlay: {\n flex: 1,\n justifyContent: \"center\",\n alignItems: \"center\",\n padding: 24,\n },\n sheetOverlay: {\n flex: 1,\n justifyContent: \"flex-end\",\n },\n sheetPanel: {\n width: \"100%\",\n maxWidth: \"100%\",\n maxHeight: \"90%\",\n borderWidth: 0,\n borderTopLeftRadius: 24,\n borderTopRightRadius: 24,\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n paddingTop: 10,\n },\n grabber: {\n width: 40,\n height: 5,\n borderRadius: 999,\n alignSelf: \"center\",\n marginBottom: 6,\n },\n panel: {\n // 20 == radii.xl (no numeric radii resolver on native — see report).\n borderRadius: 20,\n borderWidth: 1,\n minWidth: 250,\n maxWidth: \"90%\",\n maxHeight: \"80%\",\n overflow: \"hidden\",\n // Subtle elevation: low opacity, wide blur, minimal offset.\n elevation: 6,\n shadowColor: \"#000\",\n shadowOffset: {width: 0, height: 2},\n shadowOpacity: 0.15,\n shadowRadius: 20,\n },\n header: {\n flexDirection: \"row\",\n alignItems: \"center\",\n paddingHorizontal: 20,\n paddingVertical: 16,\n borderBottomWidth: 1,\n },\n body: {\n maxHeight: 400,\n },\n bodyContent: {\n padding: 20,\n },\n footer: {\n flexDirection: \"row\",\n justifyContent: \"flex-end\",\n paddingHorizontal: 20,\n paddingVertical: 12,\n borderTopWidth: 1,\n gap: 8,\n },\n});\n"],"names":["useKitsTheme","useSeverityColors","useSafeAreaInsets","useResolvedStyle","useWindowDimensions","jsx","Modal","jsxs","FadeIn","anim","FadeOut","scrimExitDuration","Pressable","StyleSheet","SlideInDown","ReduceMotion","ZoomIn","SlideOutDown","Easing","ZoomOut","runOnJS","Fragment","View","Icon","Text","ScrollView"],"mappings":";;;;;;;;;;;;;;;;;AAqBA,SAAS,mBAAmB,OAAA,EAAkB;AAC1C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,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AAA,EACA,IAAA,EAAM;AAAA,IACF,SAAA,EAAW;AAAA,GACf;AAAA,EACA,WAAA,EAAa;AAAA,IACT,OAAA,EAAS;AAAA,GACb;AAAA,EACA,MAAA,EAAQ;AAAA,IACJ,aAAA,EAAe,KAAA;AAAA,IACf,cAAA,EAAgB,UAAA;AAAA,IAChB,iBAAA,EAAmB,EAAA;AAAA,IACnB,eAAA,EAAiB,EAAA;AAAA,IACjB,cAAA,EAAgB,CAAA;AAAA,IAChB,GAAA,EAAK;AAAA;AAEb,CAAC,CAAA;;;;"}
|
|
@@ -6,7 +6,7 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
|
6
6
|
import { useSeverityColors } from '../../../hooks/useSeverityColors.js';
|
|
7
7
|
import '../../../contexts/DialogContext.js';
|
|
8
8
|
import useResolvedStyle from '../../../hooks/useResolvedStyle.js';
|
|
9
|
-
import { overlayAnimations } from '../../../animations/index.js';
|
|
9
|
+
import { overlayAnimations, scrimExitDuration } from '../../../animations/index.js';
|
|
10
10
|
import { useKitsTheme } from '../../../contexts/Theme/KitsThemeProvider.js';
|
|
11
11
|
import { Icon } from '../../../primitives/Icon/index.js';
|
|
12
12
|
import Text from '../../../primitives/Text/index.js';
|
|
@@ -98,7 +98,7 @@ function KitsDialogControlled({ state, onHide }) {
|
|
|
98
98
|
Animated.View,
|
|
99
99
|
{
|
|
100
100
|
entering: FadeIn.duration(overlayAnimations.scrim.enterDuration),
|
|
101
|
-
exiting: FadeOut.duration(overlayAnimations.
|
|
101
|
+
exiting: FadeOut.duration(scrimExitDuration(isSheet ? overlayAnimations.sheet.exitDuration : overlayAnimations.dialog.exitDuration)),
|
|
102
102
|
style: [isSheet ? styles.sheetOverlay : styles.overlay, { backgroundColor: scrimColor }, resolvedMaskStyle],
|
|
103
103
|
children: [
|
|
104
104
|
/* @__PURE__ */ jsx(Pressable, { style: StyleSheet.absoluteFill, onPress: dismissableMask ? hide : void 0 }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/overlay/Dialog/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport {Modal, Pressable, ScrollView, StyleSheet, View, useWindowDimensions} from \"react-native\";\nimport Animated, {Easing, FadeIn, FadeOut, ReduceMotion, runOnJS, SlideInDown, SlideOutDown, ZoomIn, ZoomOut} from \"react-native-reanimated\";\nimport {useSafeAreaInsets} from \"react-native-safe-area-context\";\nimport {Icon, Text} from \"../../../_compat\";\nimport type {IKitsDialogControlled} from \"@lmb-it/kitsconcerto-types\";\nimport {useKitsTheme} from \"../../../contexts/Theme\";\nimport {useSeverityColors} from \"../../../hooks/useSeverityColors\";\nimport {useResolvedStyle} from \"../../../hooks\";\nimport {overlayAnimations as anim} from \"../../../animations\";\n\n/**\n * Keeps the RN Modal mounted through the exit animation. `visible` drives the\n * inner scrim + panel entering/exiting; the Modal itself stays mounted until\n * the panel's exit animation reports finished, then unmounts.\n *\n * Re-entrancy: a new `visible=true` during an exit re-renders the inner (which\n * re-enters), and the still-pending exit callback is ignored because\n * `visibleRef` is already back to `true` — so the Modal is never torn down\n * mid-reopen.\n */\nfunction useOverlayPresence(visible: boolean) {\n const [mounted, setMounted] = React.useState(visible);\n const visibleRef = React.useRef(visible);\n React.useEffect(() => {\n visibleRef.current = visible;\n if (visible) setMounted(true);\n }, [visible]);\n // Runs on the JS thread (dispatched via runOnJS from the exit worklet).\n const handleExitFinished = React.useCallback(() => {\n if (!visibleRef.current) setMounted(false);\n }, []);\n return {mounted, handleExitFinished};\n}\n\nexport default function KitsDialogControlled({state, onHide}: IKitsDialogControlled) {\n const {\n children,\n content: contentProp,\n onClose,\n asyncClose,\n type,\n icon,\n style,\n contentStyle,\n headerStyle,\n maskStyle,\n position = 'center',\n responsive = true,\n hideHeader,\n headerRender,\n footerRender,\n footerStyle,\n canClose,\n bodyStyle,\n closeIcon,\n // Native default true preserves historical tap-to-dismiss; web's\n // PrimeReact default is false — pass explicitly in shared code.\n dismissableMask = true,\n breakpoints,\n ...rest\n } = state;\n const {resolveToken, theme} = useKitsTheme();\n const severityColors = useSeverityColors(type || 'secondary');\n const colors = type ? severityColors : null;\n const insets = useSafeAreaInsets();\n const isSheet = position === 'bottom';\n\n const surfaceColor = resolveToken('surface-card');\n const textColor = resolveToken('text');\n const borderColor = colors?.border ?? resolveToken('border');\n const subtextColor = resolveToken('gray.500');\n const grabberColor = resolveToken('gray.300');\n // Scrim via the literal alpha overlay token → rgba(0,0,0,0.4) in both modes.\n const scrimColor = resolveToken('black-alpha-40');\n const brandLogo = type === 'brand' ? theme.config.logo : null;\n\n const resolvedStyle = useResolvedStyle(style || {});\n const resolvedContentStyle = useResolvedStyle(contentStyle || {});\n const resolvedHeaderStyle = useResolvedStyle(headerStyle || {});\n const resolvedMaskStyle = useResolvedStyle(maskStyle || {});\n const resolvedFooterStyle = useResolvedStyle(footerStyle || {});\n const resolvedBodyStyle = useResolvedStyle(bodyStyle || {});\n\n const {width: screenWidth} = useWindowDimensions();\n // Consumer `breakpoints` ({'960px': '75vw'}) mirrors the web prop: the\n // smallest max-width threshold >= the screen width wins; vw/% both map\n // to a percentage of the window width. Falls back to the responsive\n // default (50% tablets/desktop, 95% phones <=641px).\n const breakpointWidth = (() => {\n if (!breakpoints) return null;\n const matches = Object.entries(breakpoints)\n .map(([k, v]) => [parseFloat(k), v] as const)\n .filter(([px]) => !Number.isNaN(px) && screenWidth <= px)\n .sort(([a], [b]) => a - b);\n const value = matches[0]?.[1];\n if (value == null) return null;\n const num = parseFloat(value);\n return Number.isNaN(num) ? null : `${num}%`;\n })();\n const responsiveWidth = breakpointWidth ?? (screenWidth > 641 ? '50%' : '95%');\n const hasExplicitWidth = (resolvedStyle as any).width != null;\n\n const hide = async () => {\n // canClose gate — intercepts every close path (backdrop Pressable,\n // built-in X Pressable, RN Modal onRequestClose). When blocked,\n // onClose is suppressed and the dialog stays open.\n if (canClose === false || (typeof canClose === 'function' && !canClose())) {\n return;\n }\n if (asyncClose && typeof onClose === \"function\") {\n await onClose();\n } else {\n onClose?.();\n }\n onHide();\n };\n\n const {mounted, handleExitFinished} = useOverlayPresence(!!state.visible);\n if (!mounted) return null;\n\n const content = typeof children === \"function\" ? children(hide) : children;\n // Content-mode override (mirrors web): consumer node replaces the whole\n // header / body / footer template inside the panel.\n const contentMode = contentProp != null\n ? (typeof contentProp === \"function\" ? contentProp({hide}) : contentProp)\n : null;\n\n return (\n <Modal visible transparent animationType=\"none\" onRequestClose={hide}>\n {state.visible && (\n <Animated.View\n entering={FadeIn.duration(anim.scrim.enterDuration)}\n exiting={FadeOut.duration(anim.scrim.exitDuration)}\n style={[isSheet ? styles.sheetOverlay : styles.overlay, {backgroundColor: scrimColor}, resolvedMaskStyle as any]}\n >\n <Pressable style={StyleSheet.absoluteFill} onPress={dismissableMask ? hide : undefined}/>\n <Animated.View\n /* The sheet asks Reanimated to keep moving under iOS\n \"Reduce Motion\" — see `overlayAnimations.sheet`. Without\n it the panel appears in one frame and the only motion\n left is the scrim, which reads as a fade. The centred\n dialog keeps the system default. */\n entering={isSheet\n ? SlideInDown.springify().damping(anim.sheet.enter.damping).stiffness(anim.sheet.enter.stiffness).mass(anim.sheet.enter.mass ?? 1)\n .reduceMotion(anim.sheet.keepMotionWhenReduced ? ReduceMotion.Never : ReduceMotion.System)\n : ZoomIn.springify().damping(anim.dialog.enter.damping).stiffness(anim.dialog.enter.stiffness).mass(anim.dialog.enter.mass ?? 1)}\n exiting={(isSheet\n ? SlideOutDown.duration(anim.sheet.exitDuration).easing(Easing.in(Easing.ease))\n .reduceMotion(anim.sheet.keepMotionWhenReduced ? ReduceMotion.Never : ReduceMotion.System)\n : ZoomOut.duration(anim.dialog.exitDuration).easing(Easing.in(Easing.ease))\n ).withCallback((finished) => {\n 'worklet';\n if (finished) runOnJS(handleExitFinished)();\n })}\n style={[\n styles.panel,\n isSheet && styles.sheetPanel,\n {backgroundColor: surfaceColor, borderColor},\n // Explicit `breakpoints` win even when responsive=false (web parity)\n !isSheet && !hasExplicitWidth && (breakpoints != null || responsive) ? {width: responsiveWidth} : null,\n resolvedStyle as any,\n resolvedContentStyle as any,\n ]}\n >\n {contentMode != null ? contentMode : <>\n {/* Grabber (bottom-sheet) */}\n {isSheet && <View style={[styles.grabber, {backgroundColor: grabberColor}]}/>}\n\n {/* Severity accent strip */}\n {colors && !isSheet && (\n <View style={{height: 4, backgroundColor: colors.solid, borderTopLeftRadius: 20, borderTopRightRadius: 20}}/>\n )}\n\n {/* Custom header (headerRender) — fully replaces the built-in header\n View when provided. Wins over the default header even if `header`\n is also set. */}\n {!hideHeader && headerRender != null && headerRender({close: () => { void hide(); }})}\n\n {/* Header (default) — rendered when no headerRender and `header` is set. */}\n {!hideHeader && headerRender == null && rest.header != null && (\n <View style={[styles.header, {borderBottomColor: borderColor}, resolvedHeaderStyle as any]}>\n {/* Inline severity icon */}\n {(icon || brandLogo) && colors && (\n <View style={{\n width: 36,\n height: 36,\n borderRadius: 18,\n backgroundColor: colors.iconBg,\n alignItems: 'center',\n justifyContent: 'center',\n marginRight: 12,\n }}>\n {brandLogo ? brandLogo : typeof icon === 'string' ? (\n <Icon name={icon as never} size={'lg'} color={colors.iconFg}/>\n ) : icon}\n </View>\n )}\n <Text style={{fontSize: 18, fontWeight: \"700\", color: textColor, flex: 1}}>\n {rest.header as React.ReactNode}\n </Text>\n <Pressable onPress={hide} hitSlop={8}>\n {closeIcon ?? <Text style={{fontSize: 18, color: subtextColor}}>✕</Text>}\n </Pressable>\n </View>\n )}\n\n {/* Body — bodyStyle is applied AFTER the built-in maxHeight: 400,\n so consumers can lift the cap (`maxHeight: 600`) or unlock flex\n sizing (`minHeight: 0`) without losing the default behavior when\n bodyStyle is unset. */}\n <ScrollView\n style={[styles.body, resolvedBodyStyle as any]}\n contentContainerStyle={styles.bodyContent}\n showsVerticalScrollIndicator={false}\n >\n {content}\n </ScrollView>\n\n {/* Footer — footerRender takes precedence over `footer`. footerStyle\n is merged AFTER the built-in flex defaults so consumers can override\n alignment (e.g. justifyContent: 'space-between' for left-delete /\n right-actions layouts) without losing the borderTop / padding. */}\n {(footerRender != null || rest.footer != null) && (\n <View style={[\n styles.footer,\n {borderTopColor: borderColor},\n isSheet && {paddingBottom: 12 + insets.bottom},\n resolvedFooterStyle as any,\n ]}>\n {footerRender\n ? footerRender({close: () => { void hide(); }})\n : (rest.footer as React.ReactNode)}\n </View>\n )}\n </>}\n </Animated.View>\n </Animated.View>\n )}\n </Modal>\n );\n}\n\nconst styles = StyleSheet.create({\n overlay: {\n flex: 1,\n justifyContent: \"center\",\n alignItems: \"center\",\n padding: 24,\n },\n sheetOverlay: {\n flex: 1,\n justifyContent: \"flex-end\",\n },\n sheetPanel: {\n width: \"100%\",\n maxWidth: \"100%\",\n maxHeight: \"90%\",\n borderWidth: 0,\n borderTopLeftRadius: 24,\n borderTopRightRadius: 24,\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n paddingTop: 10,\n },\n grabber: {\n width: 40,\n height: 5,\n borderRadius: 999,\n alignSelf: \"center\",\n marginBottom: 6,\n },\n panel: {\n // 20 == radii.xl (no numeric radii resolver on native — see report).\n borderRadius: 20,\n borderWidth: 1,\n minWidth: 250,\n maxWidth: \"90%\",\n maxHeight: \"80%\",\n overflow: \"hidden\",\n // Subtle elevation: low opacity, wide blur, minimal offset.\n elevation: 6,\n shadowColor: \"#000\",\n shadowOffset: {width: 0, height: 2},\n shadowOpacity: 0.15,\n shadowRadius: 20,\n },\n header: {\n flexDirection: \"row\",\n alignItems: \"center\",\n paddingHorizontal: 20,\n paddingVertical: 16,\n borderBottomWidth: 1,\n },\n body: {\n maxHeight: 400,\n },\n bodyContent: {\n padding: 20,\n },\n footer: {\n flexDirection: \"row\",\n justifyContent: \"flex-end\",\n paddingHorizontal: 20,\n paddingVertical: 12,\n borderTopWidth: 1,\n gap: 8,\n },\n});\n"],"names":["anim"],"mappings":";;;;;;;;;;;;;AAqBA,SAAS,mBAAmB,OAAA,EAAkB;AAC1C,EAAA,MAAM,CAAC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A,EAAe,KAAA;AAAA,IACf,cAAA,EAAgB,UAAA;AAAA,IAChB,iBAAA,EAAmB,EAAA;AAAA,IACnB,eAAA,EAAiB,EAAA;AAAA,IACjB,cAAA,EAAgB,CAAA;AAAA,IAChB,GAAA,EAAK;AAAA;AAEb,CAAC,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/overlay/Dialog/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport {Modal, Pressable, ScrollView, StyleSheet, View, useWindowDimensions} from \"react-native\";\nimport Animated, {Easing, FadeIn, FadeOut, ReduceMotion, runOnJS, SlideInDown, SlideOutDown, ZoomIn, ZoomOut} from \"react-native-reanimated\";\nimport {useSafeAreaInsets} from \"react-native-safe-area-context\";\nimport {Icon, Text} from \"../../../_compat\";\nimport type {IKitsDialogControlled} from \"@lmb-it/kitsconcerto-types\";\nimport {useKitsTheme} from \"../../../contexts/Theme\";\nimport {useSeverityColors} from \"../../../hooks/useSeverityColors\";\nimport {useResolvedStyle} from \"../../../hooks\";\nimport {overlayAnimations as anim, scrimExitDuration} from \"../../../animations\";\n\n/**\n * Keeps the RN Modal mounted through the exit animation. `visible` drives the\n * inner scrim + panel entering/exiting; the Modal itself stays mounted until\n * the panel's exit animation reports finished, then unmounts.\n *\n * Re-entrancy: a new `visible=true` during an exit re-renders the inner (which\n * re-enters), and the still-pending exit callback is ignored because\n * `visibleRef` is already back to `true` — so the Modal is never torn down\n * mid-reopen.\n */\nfunction useOverlayPresence(visible: boolean) {\n const [mounted, setMounted] = React.useState(visible);\n const visibleRef = React.useRef(visible);\n React.useEffect(() => {\n visibleRef.current = visible;\n if (visible) setMounted(true);\n }, [visible]);\n // Runs on the JS thread (dispatched via runOnJS from the exit worklet).\n const handleExitFinished = React.useCallback(() => {\n if (!visibleRef.current) setMounted(false);\n }, []);\n return {mounted, handleExitFinished};\n}\n\nexport default function KitsDialogControlled({state, onHide}: IKitsDialogControlled) {\n const {\n children,\n content: contentProp,\n onClose,\n asyncClose,\n type,\n icon,\n style,\n contentStyle,\n headerStyle,\n maskStyle,\n position = 'center',\n responsive = true,\n hideHeader,\n headerRender,\n footerRender,\n footerStyle,\n canClose,\n bodyStyle,\n closeIcon,\n // Native default true preserves historical tap-to-dismiss; web's\n // PrimeReact default is false — pass explicitly in shared code.\n dismissableMask = true,\n breakpoints,\n ...rest\n } = state;\n const {resolveToken, theme} = useKitsTheme();\n const severityColors = useSeverityColors(type || 'secondary');\n const colors = type ? severityColors : null;\n const insets = useSafeAreaInsets();\n const isSheet = position === 'bottom';\n\n const surfaceColor = resolveToken('surface-card');\n const textColor = resolveToken('text');\n const borderColor = colors?.border ?? resolveToken('border');\n const subtextColor = resolveToken('gray.500');\n const grabberColor = resolveToken('gray.300');\n // Scrim via the literal alpha overlay token → rgba(0,0,0,0.4) in both modes.\n const scrimColor = resolveToken('black-alpha-40');\n const brandLogo = type === 'brand' ? theme.config.logo : null;\n\n const resolvedStyle = useResolvedStyle(style || {});\n const resolvedContentStyle = useResolvedStyle(contentStyle || {});\n const resolvedHeaderStyle = useResolvedStyle(headerStyle || {});\n const resolvedMaskStyle = useResolvedStyle(maskStyle || {});\n const resolvedFooterStyle = useResolvedStyle(footerStyle || {});\n const resolvedBodyStyle = useResolvedStyle(bodyStyle || {});\n\n const {width: screenWidth} = useWindowDimensions();\n // Consumer `breakpoints` ({'960px': '75vw'}) mirrors the web prop: the\n // smallest max-width threshold >= the screen width wins; vw/% both map\n // to a percentage of the window width. Falls back to the responsive\n // default (50% tablets/desktop, 95% phones <=641px).\n const breakpointWidth = (() => {\n if (!breakpoints) return null;\n const matches = Object.entries(breakpoints)\n .map(([k, v]) => [parseFloat(k), v] as const)\n .filter(([px]) => !Number.isNaN(px) && screenWidth <= px)\n .sort(([a], [b]) => a - b);\n const value = matches[0]?.[1];\n if (value == null) return null;\n const num = parseFloat(value);\n return Number.isNaN(num) ? null : `${num}%`;\n })();\n const responsiveWidth = breakpointWidth ?? (screenWidth > 641 ? '50%' : '95%');\n const hasExplicitWidth = (resolvedStyle as any).width != null;\n\n const hide = async () => {\n // canClose gate — intercepts every close path (backdrop Pressable,\n // built-in X Pressable, RN Modal onRequestClose). When blocked,\n // onClose is suppressed and the dialog stays open.\n if (canClose === false || (typeof canClose === 'function' && !canClose())) {\n return;\n }\n if (asyncClose && typeof onClose === \"function\") {\n await onClose();\n } else {\n onClose?.();\n }\n onHide();\n };\n\n const {mounted, handleExitFinished} = useOverlayPresence(!!state.visible);\n if (!mounted) return null;\n\n const content = typeof children === \"function\" ? children(hide) : children;\n // Content-mode override (mirrors web): consumer node replaces the whole\n // header / body / footer template inside the panel.\n const contentMode = contentProp != null\n ? (typeof contentProp === \"function\" ? contentProp({hide}) : contentProp)\n : null;\n\n return (\n <Modal visible transparent animationType=\"none\" onRequestClose={hide}>\n {state.visible && (\n <Animated.View\n entering={FadeIn.duration(anim.scrim.enterDuration)}\n /* The panel is a CHILD of this view, so this fade must not\n finish first — see `scrimExitDuration`. */\n exiting={FadeOut.duration(scrimExitDuration(isSheet ? anim.sheet.exitDuration : anim.dialog.exitDuration))}\n style={[isSheet ? styles.sheetOverlay : styles.overlay, {backgroundColor: scrimColor}, resolvedMaskStyle as any]}\n >\n <Pressable style={StyleSheet.absoluteFill} onPress={dismissableMask ? hide : undefined}/>\n <Animated.View\n /* The sheet asks Reanimated to keep moving under iOS\n \"Reduce Motion\" — see `overlayAnimations.sheet`. Without\n it the panel appears in one frame and the only motion\n left is the scrim, which reads as a fade. The centred\n dialog keeps the system default. */\n entering={isSheet\n ? SlideInDown.springify().damping(anim.sheet.enter.damping).stiffness(anim.sheet.enter.stiffness).mass(anim.sheet.enter.mass ?? 1)\n .reduceMotion(anim.sheet.keepMotionWhenReduced ? ReduceMotion.Never : ReduceMotion.System)\n : ZoomIn.springify().damping(anim.dialog.enter.damping).stiffness(anim.dialog.enter.stiffness).mass(anim.dialog.enter.mass ?? 1)}\n exiting={(isSheet\n ? SlideOutDown.duration(anim.sheet.exitDuration).easing(Easing.in(Easing.ease))\n .reduceMotion(anim.sheet.keepMotionWhenReduced ? ReduceMotion.Never : ReduceMotion.System)\n : ZoomOut.duration(anim.dialog.exitDuration).easing(Easing.in(Easing.ease))\n ).withCallback((finished) => {\n 'worklet';\n if (finished) runOnJS(handleExitFinished)();\n })}\n style={[\n styles.panel,\n isSheet && styles.sheetPanel,\n {backgroundColor: surfaceColor, borderColor},\n // Explicit `breakpoints` win even when responsive=false (web parity)\n !isSheet && !hasExplicitWidth && (breakpoints != null || responsive) ? {width: responsiveWidth} : null,\n resolvedStyle as any,\n resolvedContentStyle as any,\n ]}\n >\n {contentMode != null ? contentMode : <>\n {/* Grabber (bottom-sheet) */}\n {isSheet && <View style={[styles.grabber, {backgroundColor: grabberColor}]}/>}\n\n {/* Severity accent strip */}\n {colors && !isSheet && (\n <View style={{height: 4, backgroundColor: colors.solid, borderTopLeftRadius: 20, borderTopRightRadius: 20}}/>\n )}\n\n {/* Custom header (headerRender) — fully replaces the built-in header\n View when provided. Wins over the default header even if `header`\n is also set. */}\n {!hideHeader && headerRender != null && headerRender({close: () => { void hide(); }})}\n\n {/* Header (default) — rendered when no headerRender and `header` is set. */}\n {!hideHeader && headerRender == null && rest.header != null && (\n <View style={[styles.header, {borderBottomColor: borderColor}, resolvedHeaderStyle as any]}>\n {/* Inline severity icon */}\n {(icon || brandLogo) && colors && (\n <View style={{\n width: 36,\n height: 36,\n borderRadius: 18,\n backgroundColor: colors.iconBg,\n alignItems: 'center',\n justifyContent: 'center',\n marginRight: 12,\n }}>\n {brandLogo ? brandLogo : typeof icon === 'string' ? (\n <Icon name={icon as never} size={'lg'} color={colors.iconFg}/>\n ) : icon}\n </View>\n )}\n <Text style={{fontSize: 18, fontWeight: \"700\", color: textColor, flex: 1}}>\n {rest.header as React.ReactNode}\n </Text>\n <Pressable onPress={hide} hitSlop={8}>\n {closeIcon ?? <Text style={{fontSize: 18, color: subtextColor}}>✕</Text>}\n </Pressable>\n </View>\n )}\n\n {/* Body — bodyStyle is applied AFTER the built-in maxHeight: 400,\n so consumers can lift the cap (`maxHeight: 600`) or unlock flex\n sizing (`minHeight: 0`) without losing the default behavior when\n bodyStyle is unset. */}\n <ScrollView\n style={[styles.body, resolvedBodyStyle as any]}\n contentContainerStyle={styles.bodyContent}\n showsVerticalScrollIndicator={false}\n >\n {content}\n </ScrollView>\n\n {/* Footer — footerRender takes precedence over `footer`. footerStyle\n is merged AFTER the built-in flex defaults so consumers can override\n alignment (e.g. justifyContent: 'space-between' for left-delete /\n right-actions layouts) without losing the borderTop / padding. */}\n {(footerRender != null || rest.footer != null) && (\n <View style={[\n styles.footer,\n {borderTopColor: borderColor},\n isSheet && {paddingBottom: 12 + insets.bottom},\n resolvedFooterStyle as any,\n ]}>\n {footerRender\n ? footerRender({close: () => { void hide(); }})\n : (rest.footer as React.ReactNode)}\n </View>\n )}\n </>}\n </Animated.View>\n </Animated.View>\n )}\n </Modal>\n );\n}\n\nconst styles = StyleSheet.create({\n overlay: {\n flex: 1,\n justifyContent: \"center\",\n alignItems: \"center\",\n padding: 24,\n },\n sheetOverlay: {\n flex: 1,\n justifyContent: \"flex-end\",\n },\n sheetPanel: {\n width: \"100%\",\n maxWidth: \"100%\",\n maxHeight: \"90%\",\n borderWidth: 0,\n borderTopLeftRadius: 24,\n borderTopRightRadius: 24,\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n paddingTop: 10,\n },\n grabber: {\n width: 40,\n height: 5,\n borderRadius: 999,\n alignSelf: \"center\",\n marginBottom: 6,\n },\n panel: {\n // 20 == radii.xl (no numeric radii resolver on native — see report).\n borderRadius: 20,\n borderWidth: 1,\n minWidth: 250,\n maxWidth: \"90%\",\n maxHeight: \"80%\",\n overflow: \"hidden\",\n // Subtle elevation: low opacity, wide blur, minimal offset.\n elevation: 6,\n shadowColor: \"#000\",\n shadowOffset: {width: 0, height: 2},\n shadowOpacity: 0.15,\n shadowRadius: 20,\n },\n header: {\n flexDirection: \"row\",\n alignItems: \"center\",\n paddingHorizontal: 20,\n paddingVertical: 16,\n borderBottomWidth: 1,\n },\n body: {\n maxHeight: 400,\n },\n bodyContent: {\n padding: 20,\n },\n footer: {\n flexDirection: \"row\",\n justifyContent: \"flex-end\",\n paddingHorizontal: 20,\n paddingVertical: 12,\n borderTopWidth: 1,\n gap: 8,\n },\n});\n"],"names":["anim"],"mappings":";;;;;;;;;;;;;AAqBA,SAAS,mBAAmB,OAAA,EAAkB;AAC1C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,KAAA,CAAM,SAAS,OAAO,CAAA;AACpD,EAAA,MAAM,UAAA,GAAa,KAAA,CAAM,MAAA,CAAO,OAAO,CAAA;AACvC,EAAA,KAAA,CAAM,UAAU,MAAM;AAClB,IAAA,UAAA,CAAW,OAAA,GAAU,OAAA;AACrB,IAAA,IAAI,OAAA,aAAoB,IAAI,CAAA;AAAA,EAChC,CAAA,EAAG,CAAC,OAAO,CAAC,CAAA;AAEZ,EAAA,MAAM,kBAAA,GAAqB,KAAA,CAAM,WAAA,CAAY,MAAM;AAC/C,IAAA,IAAI,CAAC,UAAA,CAAW,OAAA,EAAS,UAAA,CAAW,KAAK,CAAA;AAAA,EAC7C,CAAA,EAAG,EAAE,CAAA;AACL,EAAA,OAAO,EAAC,SAAS,kBAAA,EAAkB;AACvC;AAEA,SAAwB,oBAAA,CAAqB,EAAC,KAAA,EAAO,MAAA,EAAM,EAA0B;AACjF,EAAA,MAAM;AAAA,IACF,QAAA;AAAA,IACA,OAAA,EAAS,WAAA;AAAA,IACT,OAAA;AAAA,IACA,UAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,IACA,YAAA;AAAA,IACA,WAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA,GAAW,QAAA;AAAA,IACX,UAAA,GAAa,IAAA;AAAA,IACb,UAAA;AAAA,IACA,YAAA;AAAA,IACA,YAAA;AAAA,IACA,WAAA;AAAA,IACA,QAAA;AAAA,I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AAA;AAAA,IACf,YAAA,EAAc;AAAA,GAClB;AAAA,EACA,MAAA,EAAQ;AAAA,IACJ,aAAA,EAAe,KAAA;AAAA,IACf,UAAA,EAAY,QAAA;AAAA,IACZ,iBAAA,EAAmB,EAAA;AAAA,IACnB,eAAA,EAAiB,EAAA;AAAA,IACjB,iBAAA,EAAmB;AAAA,GACvB;AAAA,EACA,IAAA,EAAM;AAAA,IACF,SAAA,EAAW;AAAA,GACf;AAAA,EACA,WAAA,EAAa;AAAA,IACT,OAAA,EAAS;AAAA,GACb;AAAA,EACA,MAAA,EAAQ;AAAA,IACJ,aAAA,EAAe,KAAA;AAAA,IACf,cAAA,EAAgB,UAAA;AAAA,IAChB,iBAAA,EAAmB,EAAA;AAAA,IACnB,eAAA,EAAiB,EAAA;AAAA,IACjB,cAAA,EAAgB,CAAA;AAAA,IAChB,GAAA,EAAK;AAAA;AAEb,CAAC,CAAA;;;;"}
|
|
@@ -65,6 +65,7 @@ require('../../../packages/types/src/Theme/alphaColors.cjs');
|
|
|
65
65
|
require('../../../apps/mobile/src/Factory/helpers/cssVarMap.cjs');
|
|
66
66
|
require('../../../apps/mobile/src/Factory/DimensionsContext.cjs');
|
|
67
67
|
var useKeyboardHeight = require('../../../apps/mobile/src/Factory/helpers/useKeyboardHeight.cjs');
|
|
68
|
+
var readerEdge = require('../../../apps/mobile/src/Factory/helpers/readerEdge.cjs');
|
|
68
69
|
require('i18next');
|
|
69
70
|
require('react-i18next');
|
|
70
71
|
require('../../../apps/mobile/src/Core/AutoComplete/index.cjs');
|
|
@@ -96,6 +97,7 @@ const SHEET_MIN_HEIGHT = 240;
|
|
|
96
97
|
const SelectPopupOverlay = ({ visible, onClose, title, children }) => {
|
|
97
98
|
const { resolveToken } = KitsThemeProvider_native.useKitsTheme();
|
|
98
99
|
const { isRTL } = locale.useLanguage();
|
|
100
|
+
const edge = readerEdge.readerEdge(isRTL);
|
|
99
101
|
const insets = reactNativeSafeAreaContext.useSafeAreaInsets();
|
|
100
102
|
const { height: windowHeight } = reactNative.useWindowDimensions();
|
|
101
103
|
const headingFont = useThemedFont.default("heading");
|
|
@@ -135,9 +137,17 @@ const SelectPopupOverlay = ({ visible, onClose, title, children }) => {
|
|
|
135
137
|
style: [
|
|
136
138
|
styles.header,
|
|
137
139
|
{ borderBottomColor: borderColor },
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
140
|
+
/* ⛔ THE PHYSICAL EDGE IS COMPUTED, NEVER NAMED.
|
|
141
|
+
React Native mirrors `flexDirection: 'row'`
|
|
142
|
+
and `textAlign` when the process is RTL — the
|
|
143
|
+
App calls `I18nManager.forceRTL` — so naming
|
|
144
|
+
the RTL edge for an RTL reader asks for it
|
|
145
|
+
twice and lands on the LTR one. That is why
|
|
146
|
+
this header drew its title LEFT and its ✕
|
|
147
|
+
RIGHT in Arabic while the option rows below
|
|
148
|
+
it, which already went through `readerEdge`,
|
|
149
|
+
were correct. See `readerEdge`. */
|
|
150
|
+
{ flexDirection: edge.flexDirection }
|
|
141
151
|
],
|
|
142
152
|
children: [
|
|
143
153
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -147,7 +157,13 @@ const SelectPopupOverlay = ({ visible, onClose, title, children }) => {
|
|
|
147
157
|
style: [
|
|
148
158
|
styles.title,
|
|
149
159
|
{ color: textColor, fontFamily: headingFont },
|
|
150
|
-
|
|
160
|
+
{
|
|
161
|
+
textAlign: edge.textAlign,
|
|
162
|
+
/* `writingDirection` is NOT mirrored — it
|
|
163
|
+
orders glyphs inside the line, so it
|
|
164
|
+
takes the reader's own direction. */
|
|
165
|
+
writingDirection: isRTL ? "rtl" : "ltr"
|
|
166
|
+
}
|
|
151
167
|
],
|
|
152
168
|
children: title
|
|
153
169
|
}
|
|
@@ -182,15 +198,11 @@ const styles = reactNative.StyleSheet.create({
|
|
|
182
198
|
borderBottomWidth: 1,
|
|
183
199
|
gap: 12
|
|
184
200
|
},
|
|
185
|
-
headerLtr: { flexDirection: "row" },
|
|
186
|
-
headerRtl: { flexDirection: "row-reverse" },
|
|
187
201
|
title: {
|
|
188
202
|
flex: 1,
|
|
189
203
|
fontSize: 17,
|
|
190
204
|
fontWeight: "700"
|
|
191
205
|
},
|
|
192
|
-
titleLtr: { textAlign: "left", writingDirection: "ltr" },
|
|
193
|
-
titleRtl: { textAlign: "right", writingDirection: "rtl" },
|
|
194
206
|
close: {
|
|
195
207
|
fontSize: 18
|
|
196
208
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectPopupOverlay.cjs","sources":["../../../../../src/form/selects/helpers/SelectPopupOverlay.native.tsx"],"sourcesContent":["import React from 'react';\nimport {Pressable, StyleSheet, Text, View, useWindowDimensions} from 'react-native';\nimport {useSafeAreaInsets} from 'react-native-safe-area-context';\nimport {useKeyboardHeight} from '@lmb-it/kitsconcertomobile';\nimport KitsDialogControlled from '../../../components/overlay/Dialog';\nimport {useKitsTheme} from '../../../contexts/Theme';\nimport {useLanguage} from '../../../hooks';\nimport useThemedFont from '../../../hooks/useThemedFont';\n\n/**\n * The container a select's options live in when `popup` is on.\n *\n * ⛔ THIS IS NOT A SECOND OVERLAY MECHANISM. It is the library's own\n * `KitsDialogControlled` in bottom-sheet position, so the scrim, the slide\n * animation, the safe-area insets, `dismissableMask` and Android's hardware\n * back all come from the one place that already owns them. The only thing\n * this file adds is the header row and the sizing a picker needs.\n *\n * ⛔ IT USES `content` MODE ON PURPOSE. The Dialog's default template puts its\n * children inside a ScrollView with `maxHeight: 400`. A FlatList inside a\n * ScrollView scrolls badly and warns, and a 400pt cap is the very thing the\n * popup exists to escape. `content` replaces the whole header/body/footer\n * template, so the caller's search field can be pinned and its list can own\n * the remaining height.\n *\n * WHY A FIXED FRACTION OF THE SCREEN. The popup's whole purpose is that its\n * height does not depend on where the trigger happens to sit or on whether the\n * keyboard is up. It takes a fixed share of the window, the search field sits\n * at the top of it, and the list takes the rest.\n */\n\nexport interface ISelectPopupOverlayProps {\n /** Open state. */\n visible: boolean;\n /** Called for every dismissal route — the ✕, the scrim, Android back. */\n onClose: () => void;\n /** Title shown beside the close control. Falls back to the field's label. */\n title?: React.ReactNode;\n /** The search field and the list. */\n children: React.ReactNode;\n}\n\n/** Share of the window height the sheet occupies when the keyboard is down. */\nconst SHEET_HEIGHT_RATIO = 0.75;\n/** Never shorter than this, even on a small screen with the keyboard up. */\nconst SHEET_MIN_HEIGHT = 240;\n\nconst SelectPopupOverlay = ({visible, onClose, title, children}: ISelectPopupOverlayProps) => {\n const {resolveToken} = useKitsTheme();\n const {isRTL} = useLanguage();\n const insets = useSafeAreaInsets();\n const {height: windowHeight} = useWindowDimensions();\n /* Raw RN <Text> does not inherit `fontFamily` through View parents, so a\n consumer that swaps the theme font would see it everywhere except here.\n See useThemedFont's own note. */\n const headingFont = useThemedFont('heading');\n const keyboardHeight = useKeyboardHeight();\n\n /*\n * ⛔ \"OWNS THE SCREEN\" MEANS ABOVE THE KEYBOARD, NOT BEHIND IT. A sheet\n * pinned to the bottom at a fixed 75% still has its lower half under the\n * keyboard the moment the search field takes focus, and the list is back to\n * competing for the gap — the exact fault the popup exists to escape, one\n * layer along. The sheet is capped to what is actually visible.\n *\n * The keyboard replaces the bottom inset rather than adding to it: it\n * covers the home indicator.\n */\n const visibleHeight = windowHeight - Math.max(insets.bottom, keyboardHeight) - insets.top;\n const sheetHeight = Math.max(\n Math.min(SHEET_MIN_HEIGHT, visibleHeight),\n Math.min(Math.round(windowHeight * SHEET_HEIGHT_RATIO), visibleHeight),\n );\n\n const textColor = resolveToken('text');\n const borderColor = resolveToken('border');\n const grabberColor = resolveToken('gray.300');\n const subtextColor = resolveToken('gray.500');\n\n return (\n <KitsDialogControlled\n onHide={onClose}\n state={{\n visible,\n position: 'bottom',\n // Tap-outside dismiss. `onRequestClose` inside the Dialog gives\n // Android's back button the same route.\n dismissableMask: true,\n onClose,\n style: {\n height: sheetHeight,\n // The keyboard already clears the home indicator, so the\n // inset is only owed when the keyboard is down.\n paddingBottom: keyboardHeight > 0 ? 0 : insets.bottom,\n marginBottom: keyboardHeight,\n },\n content: ({hide}: {hide: () => void}) => (\n <View style={styles.root}>\n <View style={[styles.grabber, {backgroundColor: grabberColor}]} />\n <View\n style={[\n styles.header,\n {borderBottomColor: borderColor},\n // The header mirrors with the reader, like every\n // other row this library draws.\n isRTL ? styles.headerRtl : styles.headerLtr,\n ]}>\n <Text\n numberOfLines={1}\n style={[\n styles.title,\n {color: textColor, fontFamily: headingFont},\n isRTL ? styles.titleRtl : styles.titleLtr,\n ]}>\n {title}\n </Text>\n <Pressable onPress={hide} hitSlop={12} accessibilityRole=\"button\">\n <Text style={[styles.close, {color: subtextColor}]}>✕</Text>\n </Pressable>\n </View>\n {children}\n </View>\n ),\n }}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n root: {\n flex: 1,\n minHeight: 0,\n },\n grabber: {\n width: 40,\n height: 4,\n borderRadius: 2,\n alignSelf: 'center',\n marginTop: 8,\n marginBottom: 4,\n },\n header: {\n alignItems: 'center',\n paddingHorizontal: 16,\n paddingVertical: 12,\n borderBottomWidth: 1,\n gap: 12,\n },\n headerLtr: {flexDirection: 'row'},\n headerRtl: {flexDirection: 'row-reverse'},\n title: {\n flex: 1,\n fontSize: 17,\n fontWeight: '700',\n },\n titleLtr: {textAlign: 'left', writingDirection: 'ltr'},\n titleRtl: {textAlign: 'right', writingDirection: 'rtl'},\n close: {\n fontSize: 18,\n },\n});\n\nexport default SelectPopupOverlay;\n"],"names":["useKitsTheme","useLanguage","useSafeAreaInsets","useWindowDimensions","useThemedFont","useKeyboardHeight","jsx","KitsDialogControlled","jsxs","View","Text","Pressable","StyleSheet"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,MAAM,kBAAA,GAAqB,IAAA;AAE3B,MAAM,gBAAA,GAAmB,GAAA;AAEzB,MAAM,qBAAqB,CAAC,EAA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AA,EAAM;AAAA,IACF,IAAA,EAAM,CAAA;AAAA,IACN,SAAA,EAAW;AAAA,GACf;AAAA,EACA,OAAA,EAAS;AAAA,IACL,KAAA,EAAO,EAAA;AAAA,IACP,MAAA,EAAQ,CAAA;AAAA,IACR,YAAA,EAAc,CAAA;AAAA,IACd,SAAA,EAAW,QAAA;AAAA,IACX,SAAA,EAAW,CAAA;AAAA,IACX,YAAA,EAAc;AAAA,GAClB;AAAA,EACA,MAAA,EAAQ;AAAA,IACJ,UAAA,EAAY,QAAA;AAAA,IACZ,iBAAA,EAAmB,EAAA;AAAA,IACnB,eAAA,EAAiB,EAAA;AAAA,IACjB,iBAAA,EAAmB,CAAA;AAAA,IACnB,GAAA,EAAK;AAAA,GACT;AAAA,EACA,SAAA,EAAW,EAAC,aAAA,EAAe,KAAA,EAAK;AAAA,EAChC,SAAA,EAAW,EAAC,aAAA,EAAe,aAAA,EAAa;AAAA,EACxC,KAAA,EAAO;AAAA,IACH,IAAA,EAAM,CAAA;AAAA,IACN,QAAA,EAAU,EAAA;AAAA,IACV,UAAA,EAAY;AAAA,GAChB;AAAA,EACA,QAAA,EAAU,EAAC,SAAA,EAAW,MAAA,EAAQ,kBAAkB,KAAA,EAAK;AAAA,EACrD,QAAA,EAAU,EAAC,SAAA,EAAW,OAAA,EAAS,kBAAkB,KAAA,EAAK;AAAA,EACtD,KAAA,EAAO;AAAA,IACH,QAAA,EAAU;AAAA;AAElB,CAAC,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"SelectPopupOverlay.cjs","sources":["../../../../../src/form/selects/helpers/SelectPopupOverlay.native.tsx"],"sourcesContent":["import React from 'react';\nimport {Pressable, StyleSheet, Text, View, useWindowDimensions} from 'react-native';\nimport {useSafeAreaInsets} from 'react-native-safe-area-context';\nimport {readerEdge, useKeyboardHeight} from '@lmb-it/kitsconcertomobile';\nimport KitsDialogControlled from '../../../components/overlay/Dialog';\nimport {useKitsTheme} from '../../../contexts/Theme';\nimport {useLanguage} from '../../../hooks';\nimport useThemedFont from '../../../hooks/useThemedFont';\n\n/**\n * The container a select's options live in when `popup` is on.\n *\n * ⛔ THIS IS NOT A SECOND OVERLAY MECHANISM. It is the library's own\n * `KitsDialogControlled` in bottom-sheet position, so the scrim, the slide\n * animation, the safe-area insets, `dismissableMask` and Android's hardware\n * back all come from the one place that already owns them. The only thing\n * this file adds is the header row and the sizing a picker needs.\n *\n * ⛔ IT USES `content` MODE ON PURPOSE. The Dialog's default template puts its\n * children inside a ScrollView with `maxHeight: 400`. A FlatList inside a\n * ScrollView scrolls badly and warns, and a 400pt cap is the very thing the\n * popup exists to escape. `content` replaces the whole header/body/footer\n * template, so the caller's search field can be pinned and its list can own\n * the remaining height.\n *\n * WHY A FIXED FRACTION OF THE SCREEN. The popup's whole purpose is that its\n * height does not depend on where the trigger happens to sit or on whether the\n * keyboard is up. It takes a fixed share of the window, the search field sits\n * at the top of it, and the list takes the rest.\n */\n\nexport interface ISelectPopupOverlayProps {\n /** Open state. */\n visible: boolean;\n /** Called for every dismissal route — the ✕, the scrim, Android back. */\n onClose: () => void;\n /** Title shown beside the close control. Falls back to the field's label. */\n title?: React.ReactNode;\n /** The search field and the list. */\n children: React.ReactNode;\n}\n\n/** Share of the window height the sheet occupies when the keyboard is down. */\nconst SHEET_HEIGHT_RATIO = 0.75;\n/** Never shorter than this, even on a small screen with the keyboard up. */\nconst SHEET_MIN_HEIGHT = 240;\n\nconst SelectPopupOverlay = ({visible, onClose, title, children}: ISelectPopupOverlayProps) => {\n const {resolveToken} = useKitsTheme();\n const {isRTL} = useLanguage();\n /* Physical edges to write so the header lands where the reader starts. */\n const edge = readerEdge(isRTL);\n const insets = useSafeAreaInsets();\n const {height: windowHeight} = useWindowDimensions();\n /* Raw RN <Text> does not inherit `fontFamily` through View parents, so a\n consumer that swaps the theme font would see it everywhere except here.\n See useThemedFont's own note. */\n const headingFont = useThemedFont('heading');\n const keyboardHeight = useKeyboardHeight();\n\n /*\n * ⛔ \"OWNS THE SCREEN\" MEANS ABOVE THE KEYBOARD, NOT BEHIND IT. A sheet\n * pinned to the bottom at a fixed 75% still has its lower half under the\n * keyboard the moment the search field takes focus, and the list is back to\n * competing for the gap — the exact fault the popup exists to escape, one\n * layer along. The sheet is capped to what is actually visible.\n *\n * The keyboard replaces the bottom inset rather than adding to it: it\n * covers the home indicator.\n */\n const visibleHeight = windowHeight - Math.max(insets.bottom, keyboardHeight) - insets.top;\n const sheetHeight = Math.max(\n Math.min(SHEET_MIN_HEIGHT, visibleHeight),\n Math.min(Math.round(windowHeight * SHEET_HEIGHT_RATIO), visibleHeight),\n );\n\n const textColor = resolveToken('text');\n const borderColor = resolveToken('border');\n const grabberColor = resolveToken('gray.300');\n const subtextColor = resolveToken('gray.500');\n\n return (\n <KitsDialogControlled\n onHide={onClose}\n state={{\n visible,\n position: 'bottom',\n // Tap-outside dismiss. `onRequestClose` inside the Dialog gives\n // Android's back button the same route.\n dismissableMask: true,\n onClose,\n style: {\n height: sheetHeight,\n // The keyboard already clears the home indicator, so the\n // inset is only owed when the keyboard is down.\n paddingBottom: keyboardHeight > 0 ? 0 : insets.bottom,\n marginBottom: keyboardHeight,\n },\n content: ({hide}: {hide: () => void}) => (\n <View style={styles.root}>\n <View style={[styles.grabber, {backgroundColor: grabberColor}]} />\n <View\n style={[\n styles.header,\n {borderBottomColor: borderColor},\n /* ⛔ THE PHYSICAL EDGE IS COMPUTED, NEVER NAMED.\n React Native mirrors `flexDirection: 'row'`\n and `textAlign` when the process is RTL — the\n App calls `I18nManager.forceRTL` — so naming\n the RTL edge for an RTL reader asks for it\n twice and lands on the LTR one. That is why\n this header drew its title LEFT and its ✕\n RIGHT in Arabic while the option rows below\n it, which already went through `readerEdge`,\n were correct. See `readerEdge`. */\n {flexDirection: edge.flexDirection},\n ]}>\n <Text\n numberOfLines={1}\n style={[\n styles.title,\n {color: textColor, fontFamily: headingFont},\n {\n textAlign: edge.textAlign,\n /* `writingDirection` is NOT mirrored — it\n orders glyphs inside the line, so it\n takes the reader's own direction. */\n writingDirection: isRTL ? ('rtl' as const) : ('ltr' as const),\n },\n ]}>\n {title}\n </Text>\n <Pressable onPress={hide} hitSlop={12} accessibilityRole=\"button\">\n <Text style={[styles.close, {color: subtextColor}]}>✕</Text>\n </Pressable>\n </View>\n {children}\n </View>\n ),\n }}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n root: {\n flex: 1,\n minHeight: 0,\n },\n grabber: {\n width: 40,\n height: 4,\n borderRadius: 2,\n alignSelf: 'center',\n marginTop: 8,\n marginBottom: 4,\n },\n header: {\n alignItems: 'center',\n paddingHorizontal: 16,\n paddingVertical: 12,\n borderBottomWidth: 1,\n gap: 12,\n },\n title: {\n flex: 1,\n fontSize: 17,\n fontWeight: '700',\n },\n close: {\n fontSize: 18,\n },\n});\n\nexport default SelectPopupOverlay;\n"],"names":["useKitsTheme","useLanguage","readerEdge","useSafeAreaInsets","useWindowDimensions","useThemedFont","useKeyboardHeight","jsx","KitsDialogControlled","jsxs","View","Text","Pressable","StyleSheet"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,MAAM,kBAAA,GAAqB,IAAA;AAE3B,MAAM,gBAAA,GAAmB,GAAA;AAEzB,MAAM,qBAAqB,CAAC,EAAC,SAAS,OAAA,EAAS,KAAA,EAAO,UAAQ,KAAgC;AAC1F,EAAA,MAAM,EAAC,YAAA,EAAY,GAAIA,qCAAA,EAAa;AACpC,EAAA,MAAM,EAAC,KAAA,EAAK,GAAIC,kBAAA,EAAY;AAE5B,EAAA,MAAM,IAAA,GAAOC,sBAAW,KAAK,CAAA;AAC7B,EAAA,MAAM,SAASC,4CAAA,EAAkB;AACjC,EAAA,MAAM,EAAC,MAAA,EAAQ,YAAA,EAAY,GAAIC,+BAAA,EAAoB;AAInD,EAAA,MAAM,WAAA,GAAcC,sBAAc,SAAS,CAAA;AAC3C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