@lmb-it/kitsconcerto-native 0.1.261 → 0.1.264
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 -3
- package/animations/index.cjs.map +1 -1
- package/animations/index.js +6 -4
- package/animations/index.js.map +1 -1
- package/apps/mobile/src/Core/Dropdown/index.cjs +58 -6
- package/apps/mobile/src/Core/Dropdown/index.cjs.map +1 -1
- package/apps/mobile/src/Core/Dropdown/index.js +58 -6
- package/apps/mobile/src/Core/Dropdown/index.js.map +1 -1
- package/apps/mobile/src/Core/MultiSelect/index.cjs +17 -3
- package/apps/mobile/src/Core/MultiSelect/index.cjs.map +1 -1
- package/apps/mobile/src/Core/MultiSelect/index.js +17 -3
- 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 +3 -3
- package/components/overlay/Dialog/index.cjs.map +1 -1
- package/components/overlay/Dialog/index.js +5 -5
- package/components/overlay/Dialog/index.js.map +1 -1
- package/form/selects/Dropdown/index.cjs +3 -0
- package/form/selects/Dropdown/index.cjs.map +1 -1
- package/form/selects/Dropdown/index.js +3 -0
- package/form/selects/Dropdown/index.js.map +1 -1
- package/form/selects/MultiSelect/index.cjs +3 -0
- package/form/selects/MultiSelect/index.cjs.map +1 -1
- package/form/selects/MultiSelect/index.js +3 -0
- package/form/selects/MultiSelect/index.js.map +1 -1
- package/form-renderer/hooks/useFieldLogic.cjs +1 -1
- package/form-renderer/hooks/useFieldLogic.cjs.map +1 -1
- package/form-renderer/hooks/useFieldLogic.js +1 -1
- package/form-renderer/hooks/useFieldLogic.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,KA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AAA,EAAO;AAAA,GACX;AAAA,EACA,SAAA,EAAW;AAAA,IACP,eAAA,EAAiB,EAAA;AAAA,IACjB,iBAAA,EAAmB,EAAA;AAAA;AAAA;AAAA;AAAA,IAInB,YAAA,EAAc,GAAA;AAAA,IACd,QAAA,EAAU,GAAA;AAAA,IACV,UAAA,EAAY,QAAA;AAAA,IACZ,cAAA,EAAgB;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 font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Y,KAAA;AAAA,IACZ,QAAA,EAAU;AAAA,GACd;AAAA,EACA,eAAA,EAAiB;AAAA,IACb,UAAA,EAAY,KAAA;AAAA,IACZ,QAAA,EAAU;AAAA;AAElB,CAAC,CAAA;;;;"}
|
|
@@ -102,15 +102,15 @@ function KitsDialogControlled({ state, onHide }) {
|
|
|
102
102
|
Animated.View,
|
|
103
103
|
{
|
|
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 }),
|
|
109
109
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
110
110
|
Animated.View,
|
|
111
111
|
{
|
|
112
|
-
entering: isSheet ? Animated.SlideInDown.springify().damping(index.overlayAnimations.sheet.enter.damping).stiffness(index.overlayAnimations.sheet.enter.stiffness).mass(index.overlayAnimations.sheet.enter.mass) : Animated.ZoomIn.springify().damping(index.overlayAnimations.dialog.enter.damping).stiffness(index.overlayAnimations.dialog.enter.stiffness).mass(index.overlayAnimations.dialog.enter.mass),
|
|
113
|
-
exiting: (isSheet ? Animated.SlideOutDown.duration(index.overlayAnimations.sheet.exitDuration).easing(Animated.Easing.in(Animated.Easing.ease)) : Animated.ZoomOut.duration(index.overlayAnimations.dialog.exitDuration).easing(Animated.Easing.in(Animated.Easing.ease))).withCallback((finished) => {
|
|
112
|
+
entering: isSheet ? Animated.SlideInDown.springify().damping(index.overlayAnimations.sheet.enter.damping).stiffness(index.overlayAnimations.sheet.enter.stiffness).mass(index.overlayAnimations.sheet.enter.mass).reduceMotion(Animated.ReduceMotion.Never ) : Animated.ZoomIn.springify().damping(index.overlayAnimations.dialog.enter.damping).stiffness(index.overlayAnimations.dialog.enter.stiffness).mass(index.overlayAnimations.dialog.enter.mass),
|
|
113
|
+
exiting: (isSheet ? Animated.SlideOutDown.duration(index.overlayAnimations.sheet.exitDuration).easing(Animated.Easing.in(Animated.Easing.ease)).reduceMotion(Animated.ReduceMotion.Never ) : Animated.ZoomOut.duration(index.overlayAnimations.dialog.exitDuration).easing(Animated.Easing.in(Animated.Easing.ease))).withCallback((finished) => {
|
|
114
114
|
"worklet";
|
|
115
115
|
if (finished) Animated.runOnJS(handleExitFinished)();
|
|
116
116
|
}),
|
|
@@ -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, 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 entering={isSheet\n ? SlideInDown.springify().damping(anim.sheet.enter.damping).stiffness(anim.sheet.enter.stiffness).mass(anim.sheet.enter.mass ?? 1)\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 : 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","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,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,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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,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;AA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}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { useWindowDimensions, Modal, Pressable, StyleSheet, View, ScrollView } from 'react-native';
|
|
4
|
-
import Animated, { SlideOutDown, Easing, ZoomOut, runOnJS, SlideInDown, ZoomIn, FadeOut, FadeIn } from 'react-native-reanimated';
|
|
4
|
+
import Animated, { SlideOutDown, Easing, ReduceMotion, ZoomOut, runOnJS, SlideInDown, ZoomIn, FadeOut, FadeIn } from 'react-native-reanimated';
|
|
5
5
|
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,15 +98,15 @@ 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 }),
|
|
105
105
|
/* @__PURE__ */ jsx(
|
|
106
106
|
Animated.View,
|
|
107
107
|
{
|
|
108
|
-
entering: isSheet ? SlideInDown.springify().damping(overlayAnimations.sheet.enter.damping).stiffness(overlayAnimations.sheet.enter.stiffness).mass(overlayAnimations.sheet.enter.mass) : ZoomIn.springify().damping(overlayAnimations.dialog.enter.damping).stiffness(overlayAnimations.dialog.enter.stiffness).mass(overlayAnimations.dialog.enter.mass),
|
|
109
|
-
exiting: (isSheet ? SlideOutDown.duration(overlayAnimations.sheet.exitDuration).easing(Easing.in(Easing.ease)) : ZoomOut.duration(overlayAnimations.dialog.exitDuration).easing(Easing.in(Easing.ease))).withCallback((finished) => {
|
|
108
|
+
entering: isSheet ? SlideInDown.springify().damping(overlayAnimations.sheet.enter.damping).stiffness(overlayAnimations.sheet.enter.stiffness).mass(overlayAnimations.sheet.enter.mass).reduceMotion(ReduceMotion.Never ) : ZoomIn.springify().damping(overlayAnimations.dialog.enter.damping).stiffness(overlayAnimations.dialog.enter.stiffness).mass(overlayAnimations.dialog.enter.mass),
|
|
109
|
+
exiting: (isSheet ? SlideOutDown.duration(overlayAnimations.sheet.exitDuration).easing(Easing.in(Easing.ease)).reduceMotion(ReduceMotion.Never ) : ZoomOut.duration(overlayAnimations.dialog.exitDuration).easing(Easing.in(Easing.ease))).withCallback((finished) => {
|
|
110
110
|
"worklet";
|
|
111
111
|
if (finished) runOnJS(handleExitFinished)();
|
|
112
112
|
}),
|
|
@@ -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, 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 entering={isSheet\n ? SlideInDown.springify().damping(anim.sheet.enter.damping).stiffness(anim.sheet.enter.stiffness).mass(anim.sheet.enter.mass ?? 1)\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 : 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,EAA0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AAA;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.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,UA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AChB;AAAA,EACA,OAAA,EAAS;AAAA,IACL,KAAA,EAAO,EAAA;AAAA,IACP,MAAA,EAAQ,CAAA;AAAA,IACR,YAAA,EAAc,GAAA;AAAA,IACd,SAAA,EAAW,QAAA;AAAA,IACX,YAAA,EAAc;AAAA,GAClB;AAAA,EACA,KAAA,EAAO;AAAA;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;;;;"}
|
|
@@ -90,6 +90,7 @@ var locale = require('../../../hooks/locale.cjs');
|
|
|
90
90
|
require('../../../contexts/DialogContext.cjs');
|
|
91
91
|
var useComponentDefaults = require('../../../hooks/useComponentDefaults.cjs');
|
|
92
92
|
var useResolvedStyle = require('../../../hooks/useResolvedStyle.cjs');
|
|
93
|
+
var useThemedFont = require('../../../hooks/useThemedFont.cjs');
|
|
93
94
|
var SelectPopupOverlay_native = require('../helpers/SelectPopupOverlay.cjs');
|
|
94
95
|
var index_native = require('../../helpers/FormContainer/index.cjs');
|
|
95
96
|
require('axios');
|
|
@@ -126,6 +127,7 @@ const KitsDropdown = ({ className, ref, ...rawProps }) => {
|
|
|
126
127
|
} = props;
|
|
127
128
|
const { list, keys, onChange, selectedValue } = useSelectBase.useSelectBase();
|
|
128
129
|
const { t, isRTL } = locale.useLanguage();
|
|
130
|
+
const bodyFont = useThemedFont.default("body");
|
|
129
131
|
const ClState = Functions.ClHelper({
|
|
130
132
|
inputSize: inputSize ?? "",
|
|
131
133
|
isChecked: false,
|
|
@@ -139,6 +141,7 @@ const KitsDropdown = ({ className, ref, ...rawProps }) => {
|
|
|
139
141
|
emptyFilterMessage: emptyFilterMessage ?? t("emptyFilterMessage"),
|
|
140
142
|
filterPlaceholder: t("searchPlaceholder"),
|
|
141
143
|
isRTL,
|
|
144
|
+
fontFamily: bodyFont,
|
|
142
145
|
popup,
|
|
143
146
|
popupTitle: label ?? placeholder,
|
|
144
147
|
renderPopup: ({ visible, onClose, title, children }) => /* @__PURE__ */ jsxRuntime.jsx(SelectPopupOverlay_native.default, { visible, onClose, title, children }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../src/form/selects/Dropdown/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport { Dropdown } from \"@lmb-it/kitsconcertomobile\";\nimport type { IDropdownSelect } from \"@lmb-it/kitsconcerto-types\";\nimport { KitsContainer } from \"../../../_compat\";\nimport { ClHelper } from \"../../helpers/Functions\";\nimport { useSelectBase } from \"../hooks/useSelectBase\";\nimport {useComponentDefaults, useLanguage, useResolvedStyle} from \"../../../hooks\";\nimport SelectPopupOverlay from \"../helpers/SelectPopupOverlay\";\n\nconst KitsDropdown = ({ className, ref, ...rawProps }: IDropdownSelect) => {\n const {mergedProps: props, themeStyle, elementStyles} = useComponentDefaults('DropdownSelect', rawProps, 'Select');\n const resolvedThemeStyle = useResolvedStyle(themeStyle);\n const resolvedRootStyle = useResolvedStyle(elementStyles?.root || {});\n const {\n id,\n rightAddon,\n leftAddon,\n errors,\n invalid,\n disabled,\n required,\n label,\n localProps,\n helperText,\n isFloatedLabel,\n withFilter,\n attached,\n inputSize,\n placeholder,\n hideError,\n virtualScroll,\n emptyFilterMessage,\n filterBy,\n loading,\n showClear,\n containerStyle,\n popup,\n } = props;\n\n const { list, keys, onChange, selectedValue } = useSelectBase();\n\n /* The panel's own copy. The native Dropdown lives in `apps/mobile`, which\n this package imports, so it cannot reach LocaleContext itself without a\n cycle between the two workspaces — the sentence is resolved here, where\n `useLanguage()` already is, and passed down as a prop.\n\n ⛔ `isRTL` is the READER's language, never `I18nManager.isRTL`. A\n consumer that forces RTL at boot keeps that process direction after the\n reader switches to English, and the filter field must follow the reader. */\n const { t, isRTL } = useLanguage();\n\n const ClState = ClHelper({\n inputSize: inputSize ?? \"\",\n isChecked: false,\n isInvalid: !!invalid,\n isDisabled: !!disabled,\n });\n\n const dropdownValue = selectedValue != null && typeof selectedValue !== 'object'\n ? selectedValue.toString()\n : selectedValue;\n\n const Element = (\n <Dropdown\n emptyFilterMessage={emptyFilterMessage ?? t('emptyFilterMessage')}\n filterPlaceholder={t('searchPlaceholder')}\n isRTL={isRTL}\n popup={popup}\n popupTitle={label ?? placeholder}\n /* The container is this library's own Dialog. It is injected rather\n than imported by the native Dropdown because that component lives\n in `apps/mobile`, which this package imports — the reverse import\n would be a cycle between the two workspaces. */\n renderPopup={({visible, onClose, title, children}: {\n visible: boolean;\n onClose: () => void;\n title?: React.ReactNode;\n children: React.ReactNode;\n }) => (\n <SelectPopupOverlay visible={visible} onClose={onClose} title={title}>\n {children}\n </SelectPopupOverlay>\n )}\n value={dropdownValue}\n placeholder={placeholder}\n options={Array.isArray(list) ? list : []}\n disabled={disabled}\n loading={loading}\n showClear={showClear ?? (!required && selectedValue != null)}\n style={{ width: '100%', height: attached ? '100%' : undefined, borderRadius: 0, ...(resolvedRootStyle && Object.keys(resolvedRootStyle).length > 0 ? resolvedRootStyle : resolvedThemeStyle) }}\n onChange={onChange}\n {...keys}\n invalid={hideError && !!invalid}\n filter={!!withFilter}\n filterBy={filterBy ?? 'label'}\n virtualScrollerOptions={virtualScroll}\n className={`w-full ${className ?? ''} ${ClState}`}\n {...(localProps ? localProps : {})}\n />\n );\n\n if (attached) {\n return Element;\n }\n\n return (\n <KitsContainer\n id={id}\n inputSize={inputSize}\n isFloatedLabel={isFloatedLabel}\n rightAddon={rightAddon}\n leftAddon={leftAddon}\n required={required}\n hideError={hideError}\n errors={errors}\n helperText={helperText}\n invalid={invalid}\n label={label}\n containerStyle={containerStyle}\n elementStyles={elementStyles}\n >\n {Element}\n </KitsContainer>\n );\n}\nexport default KitsDropdown;\n"],"names":["useComponentDefaults","useResolvedStyle","useSelectBase","useLanguage","ClHelper","jsx","Dropdown","SelectPopupOverlay","KitsContainer"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../../src/form/selects/Dropdown/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport { Dropdown } from \"@lmb-it/kitsconcertomobile\";\nimport type { IDropdownSelect } from \"@lmb-it/kitsconcerto-types\";\nimport { KitsContainer } from \"../../../_compat\";\nimport { ClHelper } from \"../../helpers/Functions\";\nimport { useSelectBase } from \"../hooks/useSelectBase\";\nimport {useComponentDefaults, useLanguage, useResolvedStyle} from \"../../../hooks\";\nimport SelectPopupOverlay from \"../helpers/SelectPopupOverlay\";\nimport useThemedFont from \"../../../hooks/useThemedFont\";\n\nconst KitsDropdown = ({ className, ref, ...rawProps }: IDropdownSelect) => {\n const {mergedProps: props, themeStyle, elementStyles} = useComponentDefaults('DropdownSelect', rawProps, 'Select');\n const resolvedThemeStyle = useResolvedStyle(themeStyle);\n const resolvedRootStyle = useResolvedStyle(elementStyles?.root || {});\n const {\n id,\n rightAddon,\n leftAddon,\n errors,\n invalid,\n disabled,\n required,\n label,\n localProps,\n helperText,\n isFloatedLabel,\n withFilter,\n attached,\n inputSize,\n placeholder,\n hideError,\n virtualScroll,\n emptyFilterMessage,\n filterBy,\n loading,\n showClear,\n containerStyle,\n popup,\n } = props;\n\n const { list, keys, onChange, selectedValue } = useSelectBase();\n\n /* The panel's own copy. The native Dropdown lives in `apps/mobile`, which\n this package imports, so it cannot reach LocaleContext itself without a\n cycle between the two workspaces — the sentence is resolved here, where\n `useLanguage()` already is, and passed down as a prop.\n\n ⛔ `isRTL` is the READER's language, never `I18nManager.isRTL`. A\n consumer that forces RTL at boot keeps that process direction after the\n reader switches to English, and the filter field must follow the reader. */\n const { t, isRTL } = useLanguage();\n /* The face the consuming app's theme names for body text. React Native does\n not cascade fontFamily through Views, so the panel has to be told. */\n const bodyFont = useThemedFont('body');\n\n const ClState = ClHelper({\n inputSize: inputSize ?? \"\",\n isChecked: false,\n isInvalid: !!invalid,\n isDisabled: !!disabled,\n });\n\n const dropdownValue = selectedValue != null && typeof selectedValue !== 'object'\n ? selectedValue.toString()\n : selectedValue;\n\n const Element = (\n <Dropdown\n emptyFilterMessage={emptyFilterMessage ?? t('emptyFilterMessage')}\n filterPlaceholder={t('searchPlaceholder')}\n isRTL={isRTL}\n fontFamily={bodyFont}\n popup={popup}\n popupTitle={label ?? placeholder}\n /* The container is this library's own Dialog. It is injected rather\n than imported by the native Dropdown because that component lives\n in `apps/mobile`, which this package imports — the reverse import\n would be a cycle between the two workspaces. */\n renderPopup={({visible, onClose, title, children}: {\n visible: boolean;\n onClose: () => void;\n title?: React.ReactNode;\n children: React.ReactNode;\n }) => (\n <SelectPopupOverlay visible={visible} onClose={onClose} title={title}>\n {children}\n </SelectPopupOverlay>\n )}\n value={dropdownValue}\n placeholder={placeholder}\n options={Array.isArray(list) ? list : []}\n disabled={disabled}\n loading={loading}\n showClear={showClear ?? (!required && selectedValue != null)}\n style={{ width: '100%', height: attached ? '100%' : undefined, borderRadius: 0, ...(resolvedRootStyle && Object.keys(resolvedRootStyle).length > 0 ? resolvedRootStyle : resolvedThemeStyle) }}\n onChange={onChange}\n {...keys}\n invalid={hideError && !!invalid}\n filter={!!withFilter}\n filterBy={filterBy ?? 'label'}\n virtualScrollerOptions={virtualScroll}\n className={`w-full ${className ?? ''} ${ClState}`}\n {...(localProps ? localProps : {})}\n />\n );\n\n if (attached) {\n return Element;\n }\n\n return (\n <KitsContainer\n id={id}\n inputSize={inputSize}\n isFloatedLabel={isFloatedLabel}\n rightAddon={rightAddon}\n leftAddon={leftAddon}\n required={required}\n hideError={hideError}\n errors={errors}\n helperText={helperText}\n invalid={invalid}\n label={label}\n containerStyle={containerStyle}\n elementStyles={elementStyles}\n >\n {Element}\n </KitsContainer>\n );\n}\nexport default KitsDropdown;\n"],"names":["useComponentDefaults","useResolvedStyle","useSelectBase","useLanguage","useThemedFont","ClHelper","jsx","Dropdown","SelectPopupOverlay","KitsContainer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,MAAM,eAAe,CAAC,EAAE,WAAW,GAAA,EAAK,GAAG,UAAS,KAAuB;AACvE,EAAA,MAAM,EAAC,aAAa,KAAA,EAAO,UAAA,EAAY,eAAa,GAAIA,4BAAA,CAAqB,gBAAA,EAAkB,QAAA,EAAU,QAAQ,CAAA;AACjH,EAAA,MAAM,kBAAA,GAAqBC,yBAAiB,UAAU,CAAA;AACtD,EAAA,MAAM,iBAAA,GAAoBA,wBAAA,CAAiB,aAAA,EAAe,IAAA,IAAQ,EAAE,CAAA;AACpE,EAAA,MAAM;AAAA,IACF,EAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;AA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ACL;AAER;;;;"}
|
|
@@ -86,6 +86,7 @@ import { useLanguage } from '../../../hooks/locale.js';
|
|
|
86
86
|
import '../../../contexts/DialogContext.js';
|
|
87
87
|
import useComponentDefaults from '../../../hooks/useComponentDefaults.js';
|
|
88
88
|
import useResolvedStyle from '../../../hooks/useResolvedStyle.js';
|
|
89
|
+
import useThemedFont from '../../../hooks/useThemedFont.js';
|
|
89
90
|
import SelectPopupOverlay from '../helpers/SelectPopupOverlay.js';
|
|
90
91
|
import KitsContainer from '../../helpers/FormContainer/index.js';
|
|
91
92
|
import 'axios';
|
|
@@ -122,6 +123,7 @@ const KitsDropdown = ({ className, ref, ...rawProps }) => {
|
|
|
122
123
|
} = props;
|
|
123
124
|
const { list, keys, onChange, selectedValue } = useSelectBase();
|
|
124
125
|
const { t, isRTL } = useLanguage();
|
|
126
|
+
const bodyFont = useThemedFont("body");
|
|
125
127
|
const ClState = ClHelper({
|
|
126
128
|
inputSize: inputSize ?? "",
|
|
127
129
|
isChecked: false,
|
|
@@ -135,6 +137,7 @@ const KitsDropdown = ({ className, ref, ...rawProps }) => {
|
|
|
135
137
|
emptyFilterMessage: emptyFilterMessage ?? t("emptyFilterMessage"),
|
|
136
138
|
filterPlaceholder: t("searchPlaceholder"),
|
|
137
139
|
isRTL,
|
|
140
|
+
fontFamily: bodyFont,
|
|
138
141
|
popup,
|
|
139
142
|
popupTitle: label ?? placeholder,
|
|
140
143
|
renderPopup: ({ visible, onClose, title, children }) => /* @__PURE__ */ jsx(SelectPopupOverlay, { visible, onClose, title, children }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/form/selects/Dropdown/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport { Dropdown } from \"@lmb-it/kitsconcertomobile\";\nimport type { IDropdownSelect } from \"@lmb-it/kitsconcerto-types\";\nimport { KitsContainer } from \"../../../_compat\";\nimport { ClHelper } from \"../../helpers/Functions\";\nimport { useSelectBase } from \"../hooks/useSelectBase\";\nimport {useComponentDefaults, useLanguage, useResolvedStyle} from \"../../../hooks\";\nimport SelectPopupOverlay from \"../helpers/SelectPopupOverlay\";\n\nconst KitsDropdown = ({ className, ref, ...rawProps }: IDropdownSelect) => {\n const {mergedProps: props, themeStyle, elementStyles} = useComponentDefaults('DropdownSelect', rawProps, 'Select');\n const resolvedThemeStyle = useResolvedStyle(themeStyle);\n const resolvedRootStyle = useResolvedStyle(elementStyles?.root || {});\n const {\n id,\n rightAddon,\n leftAddon,\n errors,\n invalid,\n disabled,\n required,\n label,\n localProps,\n helperText,\n isFloatedLabel,\n withFilter,\n attached,\n inputSize,\n placeholder,\n hideError,\n virtualScroll,\n emptyFilterMessage,\n filterBy,\n loading,\n showClear,\n containerStyle,\n popup,\n } = props;\n\n const { list, keys, onChange, selectedValue } = useSelectBase();\n\n /* The panel's own copy. The native Dropdown lives in `apps/mobile`, which\n this package imports, so it cannot reach LocaleContext itself without a\n cycle between the two workspaces — the sentence is resolved here, where\n `useLanguage()` already is, and passed down as a prop.\n\n ⛔ `isRTL` is the READER's language, never `I18nManager.isRTL`. A\n consumer that forces RTL at boot keeps that process direction after the\n reader switches to English, and the filter field must follow the reader. */\n const { t, isRTL } = useLanguage();\n\n const ClState = ClHelper({\n inputSize: inputSize ?? \"\",\n isChecked: false,\n isInvalid: !!invalid,\n isDisabled: !!disabled,\n });\n\n const dropdownValue = selectedValue != null && typeof selectedValue !== 'object'\n ? selectedValue.toString()\n : selectedValue;\n\n const Element = (\n <Dropdown\n emptyFilterMessage={emptyFilterMessage ?? t('emptyFilterMessage')}\n filterPlaceholder={t('searchPlaceholder')}\n isRTL={isRTL}\n popup={popup}\n popupTitle={label ?? placeholder}\n /* The container is this library's own Dialog. It is injected rather\n than imported by the native Dropdown because that component lives\n in `apps/mobile`, which this package imports — the reverse import\n would be a cycle between the two workspaces. */\n renderPopup={({visible, onClose, title, children}: {\n visible: boolean;\n onClose: () => void;\n title?: React.ReactNode;\n children: React.ReactNode;\n }) => (\n <SelectPopupOverlay visible={visible} onClose={onClose} title={title}>\n {children}\n </SelectPopupOverlay>\n )}\n value={dropdownValue}\n placeholder={placeholder}\n options={Array.isArray(list) ? list : []}\n disabled={disabled}\n loading={loading}\n showClear={showClear ?? (!required && selectedValue != null)}\n style={{ width: '100%', height: attached ? '100%' : undefined, borderRadius: 0, ...(resolvedRootStyle && Object.keys(resolvedRootStyle).length > 0 ? resolvedRootStyle : resolvedThemeStyle) }}\n onChange={onChange}\n {...keys}\n invalid={hideError && !!invalid}\n filter={!!withFilter}\n filterBy={filterBy ?? 'label'}\n virtualScrollerOptions={virtualScroll}\n className={`w-full ${className ?? ''} ${ClState}`}\n {...(localProps ? localProps : {})}\n />\n );\n\n if (attached) {\n return Element;\n }\n\n return (\n <KitsContainer\n id={id}\n inputSize={inputSize}\n isFloatedLabel={isFloatedLabel}\n rightAddon={rightAddon}\n leftAddon={leftAddon}\n required={required}\n hideError={hideError}\n errors={errors}\n helperText={helperText}\n invalid={invalid}\n label={label}\n containerStyle={containerStyle}\n elementStyles={elementStyles}\n >\n {Element}\n </KitsContainer>\n );\n}\nexport default KitsDropdown;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/form/selects/Dropdown/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport { Dropdown } from \"@lmb-it/kitsconcertomobile\";\nimport type { IDropdownSelect } from \"@lmb-it/kitsconcerto-types\";\nimport { KitsContainer } from \"../../../_compat\";\nimport { ClHelper } from \"../../helpers/Functions\";\nimport { useSelectBase } from \"../hooks/useSelectBase\";\nimport {useComponentDefaults, useLanguage, useResolvedStyle} from \"../../../hooks\";\nimport SelectPopupOverlay from \"../helpers/SelectPopupOverlay\";\nimport useThemedFont from \"../../../hooks/useThemedFont\";\n\nconst KitsDropdown = ({ className, ref, ...rawProps }: IDropdownSelect) => {\n const {mergedProps: props, themeStyle, elementStyles} = useComponentDefaults('DropdownSelect', rawProps, 'Select');\n const resolvedThemeStyle = useResolvedStyle(themeStyle);\n const resolvedRootStyle = useResolvedStyle(elementStyles?.root || {});\n const {\n id,\n rightAddon,\n leftAddon,\n errors,\n invalid,\n disabled,\n required,\n label,\n localProps,\n helperText,\n isFloatedLabel,\n withFilter,\n attached,\n inputSize,\n placeholder,\n hideError,\n virtualScroll,\n emptyFilterMessage,\n filterBy,\n loading,\n showClear,\n containerStyle,\n popup,\n } = props;\n\n const { list, keys, onChange, selectedValue } = useSelectBase();\n\n /* The panel's own copy. The native Dropdown lives in `apps/mobile`, which\n this package imports, so it cannot reach LocaleContext itself without a\n cycle between the two workspaces — the sentence is resolved here, where\n `useLanguage()` already is, and passed down as a prop.\n\n ⛔ `isRTL` is the READER's language, never `I18nManager.isRTL`. A\n consumer that forces RTL at boot keeps that process direction after the\n reader switches to English, and the filter field must follow the reader. */\n const { t, isRTL } = useLanguage();\n /* The face the consuming app's theme names for body text. React Native does\n not cascade fontFamily through Views, so the panel has to be told. */\n const bodyFont = useThemedFont('body');\n\n const ClState = ClHelper({\n inputSize: inputSize ?? \"\",\n isChecked: false,\n isInvalid: !!invalid,\n isDisabled: !!disabled,\n });\n\n const dropdownValue = selectedValue != null && typeof selectedValue !== 'object'\n ? selectedValue.toString()\n : selectedValue;\n\n const Element = (\n <Dropdown\n emptyFilterMessage={emptyFilterMessage ?? t('emptyFilterMessage')}\n filterPlaceholder={t('searchPlaceholder')}\n isRTL={isRTL}\n fontFamily={bodyFont}\n popup={popup}\n popupTitle={label ?? placeholder}\n /* The container is this library's own Dialog. It is injected rather\n than imported by the native Dropdown because that component lives\n in `apps/mobile`, which this package imports — the reverse import\n would be a cycle between the two workspaces. */\n renderPopup={({visible, onClose, title, children}: {\n visible: boolean;\n onClose: () => void;\n title?: React.ReactNode;\n children: React.ReactNode;\n }) => (\n <SelectPopupOverlay visible={visible} onClose={onClose} title={title}>\n {children}\n </SelectPopupOverlay>\n )}\n value={dropdownValue}\n placeholder={placeholder}\n options={Array.isArray(list) ? list : []}\n disabled={disabled}\n loading={loading}\n showClear={showClear ?? (!required && selectedValue != null)}\n style={{ width: '100%', height: attached ? '100%' : undefined, borderRadius: 0, ...(resolvedRootStyle && Object.keys(resolvedRootStyle).length > 0 ? resolvedRootStyle : resolvedThemeStyle) }}\n onChange={onChange}\n {...keys}\n invalid={hideError && !!invalid}\n filter={!!withFilter}\n filterBy={filterBy ?? 'label'}\n virtualScrollerOptions={virtualScroll}\n className={`w-full ${className ?? ''} ${ClState}`}\n {...(localProps ? localProps : {})}\n />\n );\n\n if (attached) {\n return Element;\n }\n\n return (\n <KitsContainer\n id={id}\n inputSize={inputSize}\n isFloatedLabel={isFloatedLabel}\n rightAddon={rightAddon}\n leftAddon={leftAddon}\n required={required}\n hideError={hideError}\n errors={errors}\n helperText={helperText}\n invalid={invalid}\n label={label}\n containerStyle={containerStyle}\n elementStyles={elementStyles}\n >\n {Element}\n </KitsContainer>\n );\n}\nexport default KitsDropdown;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,MAAM,eAAe,CAAC,EAAE,WAAW,GAAA,EAAK,GAAG,UAAS,KAAuB;AACvE,EAAA,MAAM,EAAC,aAAa,KAAA,EAAO,UAAA,EAAY,eAAa,GAAI,oBAAA,CAAqB,gBAAA,EAAkB,QAAA,EAAU,QAAQ,CAAA;AACjH,EAAA,MAAM,kBAAA,GAAqB,iBAAiB,UAAU,CAAA;AACtD,EAAA,MAAM,iBAAA,GAAoB,gBAAA,CAAiB,aAAA,EAAe,IAAA,IAAQ,EAAE,CAAA;AACpE,EAAA,MAAM;AAAA,IACF,EAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,cAAA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