@impulse-ui-native/popover 6.2.0 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/popover-root.js.map +1 -1
- package/dist/components/popover-surface.js.map +1 -1
- package/dist/components/popover-trigger.js.map +1 -1
- package/dist/hooks/use-popover-position.hook.js.map +1 -1
- package/dist/hooks/use-popover-surface.hook.js.map +1 -1
- package/dist/utils/popover-position.utils.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/popover-root.tsx"],"sourcesContent":["import type { View } from \"react-native\";\nimport { memo, useMemo, useRef } from \"react\";\n\nimport { useControllableState } from \"@impulse-ui-native/core\";\n\nimport type { PopoverRootProps } from \"../types\";\nimport { PopoverContext } from \"../contexts/popover.context\";\n\nexport const PopoverRoot = memo(function PopoverRoot({\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n disabled = false,\n placement = \"bottom\",\n surface = \"elevated\",\n portalName,\n}: PopoverRootProps) {\n const anchorRef = useRef<View>(null);\n\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n const context = useMemo(\n () => ({\n open: open && !disabled,\n disabled,\n setOpen,\n anchorRef,\n placement,\n surface,\n portalName,\n }),\n [open, disabled, setOpen, placement, surface, portalName],\n );\n\n return (\n <PopoverContext.Provider value={context}>\n {children}\n </PopoverContext.Provider>\n );\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/components/popover-root.tsx"],"sourcesContent":["import type { View } from \"react-native\";\nimport { memo, useMemo, useRef } from \"react\";\n\nimport { useControllableState } from \"@impulse-ui-native/core\";\n\nimport type { PopoverRootProps } from \"../types\";\nimport { PopoverContext } from \"../contexts/popover.context\";\n\nexport const PopoverRoot = memo(function PopoverRoot({\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n disabled = false,\n placement = \"bottom\",\n surface = \"elevated\",\n portalName,\n}: PopoverRootProps) {\n const anchorRef = useRef<View>(null);\n\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n const context = useMemo(\n () => ({\n open: open && !disabled,\n disabled,\n setOpen,\n anchorRef,\n placement,\n surface,\n portalName,\n }),\n [open, disabled, setOpen, placement, surface, portalName],\n );\n\n return (\n <PopoverContext.Provider value={context}>\n {children}\n </PopoverContext.Provider>\n );\n});\n"],"mappings":"AAwCI;AAvCJ,SAAS,MAAM,SAAS,cAAc;AAEtC,SAAS,4BAA4B;AAGrC,SAAS,sBAAsB;AAExB,MAAM,cAAc,KAAK,SAASA,aAAY;AAAA,EACnD;AAAA,EACA,MAAM;AAAA,EACN,cAAc;AAAA,EACd;AAAA,EACA,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,UAAU;AAAA,EACV;AACF,GAAqB;AACnB,QAAM,YAAY,OAAa,IAAI;AAEnC,QAAM,CAAC,MAAM,OAAO,IAAI,qBAAqB;AAAA,IAC3C,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,EACZ,CAAC;AAED,QAAM,UAAU;AAAA,IACd,OAAO;AAAA,MACL,MAAM,QAAQ,CAAC;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,MAAM,UAAU,SAAS,WAAW,SAAS,UAAU;AAAA,EAC1D;AAEA,SACE,oBAAC,eAAe,UAAf,EAAwB,OAAO,SAC7B,UACH;AAEJ,CAAC;","names":["PopoverRoot"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/popover-surface.tsx"],"sourcesContent":["import { memo, useMemo } from \"react\";\nimport { StyleSheet } from \"react-native\";\n\nimport type { AppTheme } from \"@impulse-ui-native/theme\";\nimport { Pressable, View } from \"@impulse-ui-native/primitives\";\nimport { useStyleProps, useThemedStyles } from \"@impulse-ui-native/theme\";\n\nimport type { PopoverContentProps } from \"../types\";\nimport type { PopoverSurfaceStyleProps } from \"../types/popover.types\";\nimport { usePopoverSurface } from \"../hooks/use-popover-surface.hook\";\nimport { getArrowStyle } from \"../utils/popover-position.utils\";\n\nexport const PopoverSurfaceView = memo(function PopoverSurfaceView({\n children,\n style,\n onLayout,\n ...props\n}: PopoverContentProps) {\n const { hostRef, styleProps, close, handleLayout } =\n usePopoverSurface(onLayout);\n const extractedStyleProps = useStyleProps(props);\n const styles = useThemedStyles(themedStyles, styleProps, [styleProps]);\n const panelStyle = useMemo(\n () => [styles.panel, extractedStyleProps, style, styles.position],\n [styles.panel, extractedStyleProps, style, styles.position],\n );\n\n return (\n <View\n ref={hostRef}\n collapsable={false}\n pointerEvents=\"box-none\"\n style={styles.host}\n >\n <Pressable style={StyleSheet.absoluteFill} onPress={close} />\n <View\n shadow=\"sm\"\n {...props}\n pointerEvents={styleProps.ready ? \"auto\" : \"none\"}\n style={panelStyle}\n onLayout={handleLayout}\n >\n {children}\n {styleProps.ready && styleProps.position?.showArrow ? (\n <View pointerEvents=\"none\" style={styles.arrow} />\n ) : null}\n </View>\n </View>\n );\n});\n\nfunction themedStyles(\n theme: AppTheme,\n { surface, bounds, host, position, ready }: PopoverSurfaceStyleProps,\n) {\n const tokens = theme.components.popover;\n const appearance = tokens.surfaces[surface];\n\n return StyleSheet.create({\n host: { ...StyleSheet.absoluteFill, zIndex: tokens.zIndexBase },\n position: {\n position: \"absolute\",\n left: (position?.x ?? bounds.x) - (host?.x ?? 0),\n top: (position?.y ?? bounds.y) - (host?.y ?? 0),\n maxWidth: Math.min(tokens.maxWidth, bounds.width),\n opacity: ready ? 1 : 0,\n },\n panel: {\n width: surface === \"elevated\" ? tokens.maxWidth : undefined,\n backgroundColor: appearance.value,\n borderColor: appearance.borderColor,\n borderWidth: appearance.borderWidth,\n borderRadius: appearance.borderRadius,\n paddingHorizontal: appearance.paddingHorizontal,\n paddingVertical: appearance.paddingVertical,\n gap: tokens.gap,\n },\n arrow: {\n position: \"absolute\",\n ...(position\n ? getArrowStyle(\n position,\n tokens.arrowSize,\n appearance.value,\n appearance.borderWidth,\n appearance.borderColor,\n )\n : {}),\n },\n });\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/components/popover-surface.tsx"],"sourcesContent":["import { memo, useMemo } from \"react\";\nimport { StyleSheet } from \"react-native\";\n\nimport type { AppTheme } from \"@impulse-ui-native/theme\";\nimport { Pressable, View } from \"@impulse-ui-native/primitives\";\nimport { useStyleProps, useThemedStyles } from \"@impulse-ui-native/theme\";\n\nimport type { PopoverContentProps } from \"../types\";\nimport type { PopoverSurfaceStyleProps } from \"../types/popover.types\";\nimport { usePopoverSurface } from \"../hooks/use-popover-surface.hook\";\nimport { getArrowStyle } from \"../utils/popover-position.utils\";\n\nexport const PopoverSurfaceView = memo(function PopoverSurfaceView({\n children,\n style,\n onLayout,\n ...props\n}: PopoverContentProps) {\n const { hostRef, styleProps, close, handleLayout } =\n usePopoverSurface(onLayout);\n\n const extractedStyleProps = useStyleProps(props);\n const styles = useThemedStyles(themedStyles, styleProps, [styleProps]);\n\n const panelStyle = useMemo(\n () => [styles.panel, extractedStyleProps, style, styles.position],\n [styles.panel, extractedStyleProps, style, styles.position],\n );\n\n return (\n <View\n ref={hostRef}\n collapsable={false}\n pointerEvents=\"box-none\"\n style={styles.host}\n >\n <Pressable style={StyleSheet.absoluteFill} onPress={close} />\n <View\n shadow=\"sm\"\n {...props}\n pointerEvents={styleProps.ready ? \"auto\" : \"none\"}\n style={panelStyle}\n onLayout={handleLayout}\n >\n {children}\n {styleProps.ready && styleProps.position?.showArrow ? (\n <View pointerEvents=\"none\" style={styles.arrow} />\n ) : null}\n </View>\n </View>\n );\n});\n\nfunction themedStyles(\n theme: AppTheme,\n { surface, bounds, host, position, ready }: PopoverSurfaceStyleProps,\n) {\n const tokens = theme.components.popover;\n const appearance = tokens.surfaces[surface];\n\n return StyleSheet.create({\n host: { ...StyleSheet.absoluteFill, zIndex: tokens.zIndexBase },\n\n position: {\n position: \"absolute\",\n left: (position?.x ?? bounds.x) - (host?.x ?? 0),\n top: (position?.y ?? bounds.y) - (host?.y ?? 0),\n maxWidth: Math.min(tokens.maxWidth, bounds.width),\n opacity: ready ? 1 : 0,\n },\n\n panel: {\n width: surface === \"elevated\" ? tokens.maxWidth : undefined,\n backgroundColor: appearance.value,\n borderColor: appearance.borderColor,\n borderWidth: appearance.borderWidth,\n borderRadius: appearance.borderRadius,\n paddingHorizontal: appearance.paddingHorizontal,\n paddingVertical: appearance.paddingVertical,\n gap: tokens.gap,\n },\n\n arrow: {\n position: \"absolute\",\n ...(position\n ? getArrowStyle(\n position,\n tokens.arrowSize,\n appearance.value,\n appearance.borderWidth,\n appearance.borderColor,\n )\n : {}),\n },\n });\n}\n"],"mappings":"AAoCM,cACA,YADA;AApCN,SAAS,MAAM,eAAe;AAC9B,SAAS,kBAAkB;AAG3B,SAAS,WAAW,YAAY;AAChC,SAAS,eAAe,uBAAuB;AAI/C,SAAS,yBAAyB;AAClC,SAAS,qBAAqB;AAEvB,MAAM,qBAAqB,KAAK,SAASA,oBAAmB;AAAA,EACjE;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAwB;AACtB,QAAM,EAAE,SAAS,YAAY,OAAO,aAAa,IAC/C,kBAAkB,QAAQ;AAE5B,QAAM,sBAAsB,cAAc,KAAK;AAC/C,QAAM,SAAS,gBAAgB,cAAc,YAAY,CAAC,UAAU,CAAC;AAErE,QAAM,aAAa;AAAA,IACjB,MAAM,CAAC,OAAO,OAAO,qBAAqB,OAAO,OAAO,QAAQ;AAAA,IAChE,CAAC,OAAO,OAAO,qBAAqB,OAAO,OAAO,QAAQ;AAAA,EAC5D;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL,aAAa;AAAA,MACb,eAAc;AAAA,MACd,OAAO,OAAO;AAAA,MAEd;AAAA,4BAAC,aAAU,OAAO,W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overSurfaceView"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/popover-trigger.tsx"],"sourcesContent":["import type { GestureResponderEvent } from \"react-native\";\nimport { memo } from \"react\";\n\nimport { useEventCallback } from \"@impulse-ui-native/core\";\nimport { Pressable } from \"@impulse-ui-native/primitives\";\n\nimport type { PopoverTriggerProps } from \"../types\";\nimport { usePopoverContext } from \"../hooks/use-popover-context.hook\";\n\nexport const PopoverTrigger = memo(function PopoverTrigger({\n trigger = \"press\",\n disabled,\n loading,\n onPress,\n onLongPress,\n ...props\n}: PopoverTriggerProps) {\n const context = usePopoverContext();\n const blocked = context.disabled || disabled === true || loading === true;\n\n const handlePress = useEventCallback((event: GestureResponderEvent) => {\n if (blocked) {\n return;\n }\n\n if (trigger === \"press\") {\n context.setOpen(!context.open);\n }\n\n onPress?.(event);\n });\n const handleLongPress = useEventCallback((event: GestureResponderEvent) => {\n if (blocked) {\n return;\n }\n\n if (trigger === \"longPress\") {\n context.setOpen(true);\n }\n\n onLongPress?.(event);\n });\n\n return (\n <Pressable\n {...props}\n ref={context.anchorRef}\n collapsable={false}\n disabled={blocked}\n onPress={handlePress}\n onLongPress={handleLongPress}\n />\n );\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/components/popover-trigger.tsx"],"sourcesContent":["import type { GestureResponderEvent } from \"react-native\";\nimport { memo } from \"react\";\n\nimport { useEventCallback } from \"@impulse-ui-native/core\";\nimport { Pressable } from \"@impulse-ui-native/primitives\";\n\nimport type { PopoverTriggerProps } from \"../types\";\nimport { usePopoverContext } from \"../hooks/use-popover-context.hook\";\n\nexport const PopoverTrigger = memo(function PopoverTrigger({\n trigger = \"press\",\n disabled,\n loading,\n onPress,\n onLongPress,\n ...props\n}: PopoverTriggerProps) {\n const context = usePopoverContext();\n const blocked = context.disabled || disabled === true || loading === true;\n\n const handlePress = useEventCallback((event: GestureResponderEvent) => {\n if (blocked) {\n return;\n }\n\n if (trigger === \"press\") {\n context.setOpen(!context.open);\n }\n\n onPress?.(event);\n });\n\n const handleLongPress = useEventCallback((event: GestureResponderEvent) => {\n if (blocked) {\n return;\n }\n\n if (trigger === \"longPress\") {\n context.setOpen(true);\n }\n\n onLongPress?.(event);\n });\n\n return (\n <Pressable\n {...props}\n ref={context.anchorRef}\n collapsable={false}\n disabled={blocked}\n onPress={handlePress}\n onLongPress={handleLongPress}\n />\n );\n});\n"],"mappings":"AA6CI;AA5CJ,SAAS,YAAY;AAErB,SAAS,wBAAwB;AACjC,SAAS,iBAAiB;AAG1B,SAAS,yBAAyB;AAE3B,MAAM,iBAAiB,KAAK,SAASA,gBAAe;AAAA,EACzD,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAwB;AACtB,QAAM,UAAU,kBAAkB;AAClC,QAAM,UAAU,QAAQ,YAAY,aAAa,QAAQ,YAAY;AAErE,QAAM,cAAc,iBAAiB,CAAC,UAAiC;AACrE,QAAI,SAAS;AACX;AAAA,IACF;AAEA,QAAI,YAAY,SAAS;AACvB,cAAQ,QAAQ,CAAC,QAAQ,IAAI;AAAA,IAC/B;AAEA,cAAU,KAAK;AAAA,EACjB,CAAC;AAED,QAAM,kBAAkB,iBAAiB,CAAC,UAAiC;AACzE,QAAI,SAAS;AACX;AAAA,IACF;AAEA,QAAI,YAAY,aAAa;AAC3B,cAAQ,QAAQ,IAAI;AAAA,IACtB;AAEA,kBAAc,KAAK;AAAA,EACrB,CAAC;AAED,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,KAAK,QAAQ;AAAA,MACb,aAAa;AAAA,MACb,UAAU;AAAA,MACV,SAAS;AAAA,MACT,aAAa;AAAA;AAAA,EACf;AAEJ,CAAC;","names":["PopoverTrigger"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/use-popover-position.hook.ts"],"sourcesContent":["import type { RefObject } from \"react\";\nimport type { View } from \"react-native\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport { useWindowDimensions } from \"react-native\";\nimport { useSafeAreaInsets } from \"react-native-safe-area-context\";\n\nimport { useComponentsTokens } from \"@impulse-ui-native/theme\";\n\nimport type { PopoverRect } from \"../types/popover.types\";\nimport { AnchorMeasureInterval } from \"../constants/popover.constants\";\nimport { equalRects } from \"../utils/popover-position.utils\";\nimport { usePopoverContext } from \"./use-popover-context.hook\";\n\nexport function usePopoverPosition(hostRef: RefObject<View | null>) {\n const { anchorRef } = usePopoverContext();\n const window = useWindowDimensions();\n const insets = useSafeAreaInsets();\n const [measurement, setMeasurement] = useState<{\n anchor: PopoverRect;\n host: PopoverRect;\n } | null>(null);\n\n const tokens = useComponentsTokens().popover;\n const bounds = useMemo(() => {\n const host = measurement?.host;\n const x = Math.max(host?.x ?? 0, insets.left) + tokens.edgeOffset;\n const y = Math.max(host?.y ?? 0, insets.top) + tokens.edgeOffset;\n const right =\n Math.min(\n host ? host.x + host.width : window.width,\n window.width - insets.right,\n ) - tokens.edgeOffset;\n const bottom =\n Math.min(\n host ? host.y + host.height : window.height,\n window.height - insets.bottom,\n ) - tokens.edgeOffset;\n\n return {\n x,\n y,\n width: Math.max(0, right - x),\n height: Math.max(0, bottom - y),\n };\n }, [\n measurement?.host,\n insets,\n window.width,\n window.height,\n tokens.edgeOffset,\n ]);\n\n useEffect(() => {\n let active = true;\n let measuring = false;\n\n const measure = () => {\n const anchorNode = anchorRef.current;\n const hostNode = hostRef.current;\n\n if (!anchorNode || !hostNode) {\n setMeasurement(null);\n\n return;\n }\n\n if (measuring) {\n return;\n }\n\n measuring = true;\n\n hostNode.measureInWindow((x, y, width, height) => {\n if (!active) {\n return;\n }\n\n const host = { x, y, width, height };\n\n anchorNode.measureInWindow((ax, ay, aw, ah) => {\n measuring = false;\n\n if (\n !active ||\n anchorRef.current !== anchorNode ||\n hostRef.current !== hostNode\n ) {\n return;\n }\n\n const anchor = { x: ax, y: ay, width: aw, height: ah };\n\n setMeasurement((previous) => {\n const sameAnchor = equalRects(previous?.anchor ?? null, anchor);\n const sameHost = equalRects(previous?.host ?? null, host);\n\n if (sameAnchor && sameHost) {\n return previous;\n }\n\n return {\n anchor,\n host: sameHost && previous ? previous.host : host,\n };\n });\n });\n });\n };\n\n measure();\n\n const timer = setInterval(measure, AnchorMeasureInterval);\n\n return () => {\n active = false;\n clearInterval(timer);\n };\n }, [anchorRef, hostRef, window.width, window.height]);\n\n const anchor = measurement?.anchor;\n const visible = Boolean(\n anchor &&\n anchor.width > 0 &&\n anchor.height > 0 &&\n bounds.width > 0 &&\n bounds.height > 0 &&\n anchor.x + anchor.width > bounds.x &&\n anchor.x < bounds.x + bounds.width &&\n anchor.y + anchor.height > bounds.y &&\n anchor.y < bounds.y + bounds.height,\n );\n\n return { measurement, bounds, visible };\n}\n"],"mappings":"AAEA,SAAS,WAAW,SAAS,gBAAgB;AAC7C,SAAS,2BAA2B;AACpC,SAAS,yBAAyB;AAElC,SAAS,2BAA2B;AAGpC,SAAS,6BAA6B;AACtC,SAAS,kBAAkB;AAC3B,SAAS,yBAAyB;AAE3B,SAAS,mBAAmB,SAAiC;AAClE,QAAM,EAAE,UAAU,IAAI,kBAAkB;AACxC,QAAM,SAAS,oBAAoB;AACnC,QAAM,SAAS,kBAAkB;
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/use-popover-position.hook.ts"],"sourcesContent":["import type { RefObject } from \"react\";\nimport type { View } from \"react-native\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport { useWindowDimensions } from \"react-native\";\nimport { useSafeAreaInsets } from \"react-native-safe-area-context\";\n\nimport { useComponentsTokens } from \"@impulse-ui-native/theme\";\n\nimport type { PopoverRect } from \"../types/popover.types\";\nimport { AnchorMeasureInterval } from \"../constants/popover.constants\";\nimport { equalRects } from \"../utils/popover-position.utils\";\nimport { usePopoverContext } from \"./use-popover-context.hook\";\n\nexport function usePopoverPosition(hostRef: RefObject<View | null>) {\n const { anchorRef } = usePopoverContext();\n const window = useWindowDimensions();\n const insets = useSafeAreaInsets();\n\n const [measurement, setMeasurement] = useState<{\n anchor: PopoverRect;\n host: PopoverRect;\n } | null>(null);\n\n const tokens = useComponentsTokens().popover;\n\n const bounds = useMemo(() => {\n const host = measurement?.host;\n const x = Math.max(host?.x ?? 0, insets.left) + tokens.edgeOffset;\n const y = Math.max(host?.y ?? 0, insets.top) + tokens.edgeOffset;\n const right =\n Math.min(\n host ? host.x + host.width : window.width,\n window.width - insets.right,\n ) - tokens.edgeOffset;\n const bottom =\n Math.min(\n host ? host.y + host.height : window.height,\n window.height - insets.bottom,\n ) - tokens.edgeOffset;\n\n return {\n x,\n y,\n width: Math.max(0, right - x),\n height: Math.max(0, bottom - y),\n };\n }, [\n measurement?.host,\n insets,\n window.width,\n window.height,\n tokens.edgeOffset,\n ]);\n\n useEffect(() => {\n let active = true;\n let measuring = false;\n\n const measure = () => {\n const anchorNode = anchorRef.current;\n const hostNode = hostRef.current;\n\n if (!anchorNode || !hostNode) {\n setMeasurement(null);\n\n return;\n }\n\n if (measuring) {\n return;\n }\n\n measuring = true;\n\n hostNode.measureInWindow((x, y, width, height) => {\n if (!active) {\n return;\n }\n\n const host = { x, y, width, height };\n\n anchorNode.measureInWindow((ax, ay, aw, ah) => {\n measuring = false;\n\n if (\n !active ||\n anchorRef.current !== anchorNode ||\n hostRef.current !== hostNode\n ) {\n return;\n }\n\n const anchor = { x: ax, y: ay, width: aw, height: ah };\n\n setMeasurement((previous) => {\n const sameAnchor = equalRects(previous?.anchor ?? null, anchor);\n const sameHost = equalRects(previous?.host ?? null, host);\n\n if (sameAnchor && sameHost) {\n return previous;\n }\n\n return {\n anchor,\n host: sameHost && previous ? previous.host : host,\n };\n });\n });\n });\n };\n\n measure();\n\n const timer = setInterval(measure, AnchorMeasureInterval);\n\n return () => {\n active = false;\n clearInterval(timer);\n };\n }, [anchorRef, hostRef, window.width, window.height]);\n\n const anchor = measurement?.anchor;\n\n const visible = Boolean(\n anchor &&\n anchor.width > 0 &&\n anchor.height > 0 &&\n bounds.width > 0 &&\n bounds.height > 0 &&\n anchor.x + anchor.width > bounds.x &&\n anchor.x < bounds.x + bounds.width &&\n anchor.y + anchor.height > bounds.y &&\n anchor.y < bounds.y + bounds.height,\n );\n\n return { measurement, bounds, visible };\n}\n"],"mappings":"AAEA,SAAS,WAAW,SAAS,gBAAgB;AAC7C,SAAS,2BAA2B;AACpC,SAAS,yBAAyB;AAElC,SAAS,2BAA2B;AAGpC,SAAS,6BAA6B;AACtC,SAAS,kBAAkB;AAC3B,SAAS,yBAAyB;AAE3B,SAAS,mBAAmB,SAAiC;AAClE,QAAM,EAAE,UAAU,IAAI,kBAAkB;AACxC,QAAM,SAAS,oBAAoB;AACnC,QAAM,SAAS,kBAAkB;AAEjC,QAAM,CAAC,aAAa,cAAc,IAAI,SAG5B,IAAI;AAEd,QAAM,SAAS,oBAAoB,EAAE;AAErC,QAAM,SAAS,QAAQ,MAAM;AAC3B,UAAM,OAAO,aAAa;AAC1B,UAAM,IAAI,KAAK,IAAI,MAAM,KAAK,GAAG,OAAO,IAAI,IAAI,OAAO;AACvD,UAAM,IAAI,KAAK,IAAI,MAAM,KAAK,GAAG,OAAO,GAAG,IAAI,OAAO;AACtD,UAAM,QACJ,KAAK;AAAA,MACH,OAAO,KAAK,IAAI,KAAK,QAAQ,OAAO;AAAA,MACpC,OAAO,QAAQ,OAAO;AAAA,IACxB,IAAI,OAAO;AACb,UAAM,SACJ,KAAK;AAAA,MACH,OAAO,KAAK,IAAI,KAAK,SAAS,OAAO;AAAA,MACrC,OAAO,SAAS,OAAO;AAAA,IACzB,IAAI,OAAO;AAEb,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA,OAAO,KAAK,IAAI,GAAG,QAAQ,CAAC;AAAA,MAC5B,QAAQ,KAAK,IAAI,GAAG,SAAS,CAAC;AAAA,IAChC;AAAA,EACF,GAAG;AAAA,IACD,aAAa;AAAA,IACb;AAAA,IACA,OAAO;AAAA,IACP,OAAO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AS,KAChB,OAAO,QAAQ,KACf,OAAO,SAAS,KAChB,OAAO,IAAI,OAAO,QAAQ,OAAO,KACjC,OAAO,IAAI,OAAO,IAAI,OAAO,SAC7B,OAAO,IAAI,OAAO,SAAS,OAAO,KAClC,OAAO,IAAI,OAAO,IAAI,OAAO;AAAA,EAC/B;AAEA,SAAO,EAAE,aAAa,QAAQ,QAAQ;AACxC;","names":["anchor"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/use-popover-surface.hook.ts"],"sourcesContent":["import type { LayoutChangeEvent, View } from \"react-native\";\nimport { useMemo, useRef, useState } from \"react\";\n\nimport { useBackHandler, useEventCallback } from \"@impulse-ui-native/core\";\nimport { useComponentsTokens } from \"@impulse-ui-native/theme\";\n\nimport type { PopoverContentProps } from \"../types\";\nimport type { PopoverSurfaceStyleProps } from \"../types/popover.types\";\nimport { getPopoverPosition } from \"../utils/popover-position.utils\";\nimport { usePopoverContext } from \"./use-popover-context.hook\";\nimport { usePopoverPosition } from \"./use-popover-position.hook\";\n\nexport function usePopoverSurface(onLayout: PopoverContentProps[\"onLayout\"]) {\n const { surface, placement, setOpen } = usePopoverContext();\n const [size, setSize] = useState({ width: 0, height: 0 });\n const hostRef = useRef<View>(null);\n\n const tokens = useComponentsTokens().popover;\n const { measurement, bounds, visible } = usePopoverPosition(hostRef);\n const position = useMemo(\n () =>\n measurement\n ? getPopoverPosition({\n anchor: measurement.anchor,\n bounds,\n ...size,\n placement,\n gap: tokens.gap,\n arrowInset:\n tokens.surfaces[surface].borderRadius + tokens.arrowSize,\n })\n : null,\n [measurement, bounds, size, placement, surface, tokens],\n );\n const ready = visible && size.width > 0 && size.height > 0;\n const styleProps = useMemo<PopoverSurfaceStyleProps>(\n () => ({ surface, bounds, host: measurement?.host, position, ready }),\n [surface, bounds, measurement?.host, position, ready],\n );\n\n const close = useEventCallback(() => setOpen(false));\n const handleLayout = useEventCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n\n setSize((previous) =>\n previous.width === width && previous.height === height\n ? previous\n : { width, height },\n );\n\n onLayout?.(event);\n });\n\n useBackHandler(() => {\n close();\n\n return true;\n });\n\n return { hostRef, styleProps, close, handleLayout };\n}\n"],"mappings":"AACA,SAAS,SAAS,QAAQ,gBAAgB;AAE1C,SAAS,gBAAgB,wBAAwB;AACjD,SAAS,2BAA2B;AAIpC,SAAS,0BAA0B;AACnC,SAAS,yBAAyB;AAClC,SAAS,0BAA0B;AAE5B,SAAS,kBAAkB,UAA2C;AAC3E,QAAM,EAAE,SAAS,WAAW,QAAQ,IAAI,kBAAkB;
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/use-popover-surface.hook.ts"],"sourcesContent":["import type { LayoutChangeEvent, View } from \"react-native\";\nimport { useMemo, useRef, useState } from \"react\";\n\nimport { useBackHandler, useEventCallback } from \"@impulse-ui-native/core\";\nimport { useComponentsTokens } from \"@impulse-ui-native/theme\";\n\nimport type { PopoverContentProps } from \"../types\";\nimport type { PopoverSurfaceStyleProps } from \"../types/popover.types\";\nimport { getPopoverPosition } from \"../utils/popover-position.utils\";\nimport { usePopoverContext } from \"./use-popover-context.hook\";\nimport { usePopoverPosition } from \"./use-popover-position.hook\";\n\nexport function usePopoverSurface(onLayout: PopoverContentProps[\"onLayout\"]) {\n const { surface, placement, setOpen } = usePopoverContext();\n\n const [size, setSize] = useState({ width: 0, height: 0 });\n const hostRef = useRef<View>(null);\n\n const tokens = useComponentsTokens().popover;\n const { measurement, bounds, visible } = usePopoverPosition(hostRef);\n\n const position = useMemo(\n () =>\n measurement\n ? getPopoverPosition({\n anchor: measurement.anchor,\n bounds,\n ...size,\n placement,\n gap: tokens.gap,\n arrowInset:\n tokens.surfaces[surface].borderRadius + tokens.arrowSize,\n })\n : null,\n [measurement, bounds, size, placement, surface, tokens],\n );\n\n const ready = visible && size.width > 0 && size.height > 0;\n const styleProps = useMemo<PopoverSurfaceStyleProps>(\n () => ({ surface, bounds, host: measurement?.host, position, ready }),\n [surface, bounds, measurement?.host, position, ready],\n );\n\n const close = useEventCallback(() => setOpen(false));\n\n const handleLayout = useEventCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n\n setSize((previous) =>\n previous.width === width && previous.height === height\n ? previous\n : { width, height },\n );\n\n onLayout?.(event);\n });\n\n useBackHandler(() => {\n close();\n\n return true;\n });\n\n return { hostRef, styleProps, close, handleLayout };\n}\n"],"mappings":"AACA,SAAS,SAAS,QAAQ,gBAAgB;AAE1C,SAAS,gBAAgB,wBAAwB;AACjD,SAAS,2BAA2B;AAIpC,SAAS,0BAA0B;AACnC,SAAS,yBAAyB;AAClC,SAAS,0BAA0B;AAE5B,SAAS,kBAAkB,UAA2C;AAC3E,QAAM,EAAE,SAAS,WAAW,QAAQ,IAAI,kBAAkB;AAE1D,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,EAAE,OAAO,GAAG,QAAQ,EAAE,CAAC;AACxD,QAAM,UAAU,OAAa,IAAI;AAEjC,QAAM,SAAS,oBAAoB,EAAE;AACrC,QAAM,EAAE,aAAa,QAAQ,QAAQ,IAAI,mBAAmB,OAAO;AAEnE,QAAM,WAAW;AAAA,IACf,MACE,cACI,mBAAmB;AAAA,MACjB,QAAQ,YAAY;AAAA,MACpB;AAAA,MACA,GAAG;AAAA,MACH;AAAA,MACA,KAAK,OAAO;AAAA,MACZ,YACE,OAAO,SAAS,OAAO,EAAE,eAAe,OAAO;AAAA,IACnD,CAAC,IACD;AAAA,IACN,CAAC,aAAa,QAAQ,MAAM,WAAW,SAAS,MAAM;AAAA,EACxD;AAEA,QAAM,QAAQ,WAAW,KAAK,QAAQ,KAAK,KAAK,SAAS;AACzD,QAAM,aAAa;AAAA,IACjB,OAAO,EAAE,SAAS,QAAQ,MAAM,aAAa,MAAM,UAAU,MAAM;AAAA,IACnE,CAAC,SAAS,QAAQ,aAAa,MAAM,UAAU,KAAK;AAAA,EACtD;AAEA,QAAM,QAAQ,iBAAiB,MAAM,QAAQ,KAAK,CAAC;AAEnD,QAAM,eAAe,iBAAiB,CAAC,UAA6B;AAClE,UAAM,EAAE,OAAO,OAAO,IAAI,MAAM,YAAY;AAE5C;AAAA,MAAQ,CAAC,aACP,SAAS,UAAU,SAAS,SAAS,WAAW,SAC5C,WACA,EAAE,OAAO,OAAO;AAAA,IACtB;AAEA,eAAW,KAAK;AAAA,EAClB,CAAC;AAED,iBAAe,MAAM;AACnB,UAAM;AAEN,WAAO;AAAA,EACT,CAAC;AAED,SAAO,EAAE,SAAS,YAAY,OAAO,aAAa;AACpD;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/popover-position.utils.ts"],"sourcesContent":["import type { ViewStyle } from \"react-native\";\n\nimport type {\n PopoverPlacement,\n PopoverPosition,\n PopoverPositionOptions,\n PopoverRect,\n} from \"../types/popover.types\";\nimport { OppositePlacement } from \"../constants/popover.constants\";\n\nexport function clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), Math.max(min, max));\n}\n\nexport function equalRects(a: PopoverRect | null, b: PopoverRect): boolean {\n return (\n a !== null &&\n a.x === b.x &&\n a.y === b.y &&\n a.width === b.width &&\n a.height === b.height\n );\n}\n\nexport function getPopoverPosition({\n anchor,\n bounds,\n width,\n height,\n placement: preferred,\n gap,\n arrowInset,\n}: PopoverPositionOptions): PopoverPosition {\n const right = bounds.x + bounds.width;\n const bottom = bounds.y + bounds.height;\n const available: Record<PopoverPlacement, number> = {\n top: anchor.y - bounds.y - gap,\n bottom: bottom - anchor.y - anchor.height - gap,\n left: anchor.x - bounds.x - gap,\n right: right - anchor.x - anchor.width - gap,\n };\n const vertical = preferred === \"top\" || preferred === \"bottom\";\n const extent = vertical ? height : width;\n const opposite = OppositePlacement[preferred];\n const placement =\n available[preferred] < extent && available[opposite] > available[preferred]\n ? opposite\n : preferred;\n const centerX = anchor.x + anchor.width / 2;\n const centerY = anchor.y + anchor.height / 2;\n const x = clamp(\n vertical\n ? centerX - width / 2\n : placement === \"left\"\n ? anchor.x - width - gap\n : anchor.x + anchor.width + gap,\n bounds.x,\n right - width,\n );\n const y = clamp(\n vertical\n ? placement === \"top\"\n ? anchor.y - height - gap\n : anchor.y + anchor.height + gap\n : centerY - height / 2,\n bounds.y,\n bottom - height,\n );\n const edgeLength = vertical ? width : height;\n const inset = Math.min(arrowInset, edgeLength / 2);\n const offset = vertical ? centerX - x : centerY - y;\n const facing =\n placement === \"top\"\n ? y + height <= anchor.y\n : placement === \"bottom\"\n ? y >= anchor.y + anchor.height\n : placement === \"left\"\n ? x + width <= anchor.x\n : x >= anchor.x + anchor.width;\n\n return {\n x,\n y,\n placement,\n arrowOffset: clamp(offset, inset, edgeLength - inset),\n showArrow: facing && offset >= inset && offset <= edgeLength - inset,\n };\n}\n\nexport function getArrowStyle(\n position: PopoverPosition,\n size: number,\n color: string,\n borderWidth: number,\n borderColor: string,\n): ViewStyle {\n const side = size * Math.SQRT2;\n const offset = position.arrowOffset - borderWidth - side / 2;\n const edge = -(side + borderWidth) / 2;\n // The inner half covers the panel's border; only the outward edges are outlined.\n const shared: ViewStyle = {\n width: side,\n height: side,\n backgroundColor: color,\n borderColor,\n transform: [{ rotate: \"45deg\" }],\n ...(position.placement === \"top\" || position.placement === \"bottom\"\n ? { left: offset }\n : { top: offset }),\n };\n\n switch (position.placement) {\n case \"top\":\n return {\n ...shared,\n bottom: edge,\n borderBottomWidth: borderWidth,\n borderRightWidth: borderWidth,\n };\n case \"bottom\":\n return {\n ...shared,\n top: edge,\n borderTopWidth: borderWidth,\n borderLeftWidth: borderWidth,\n };\n case \"left\":\n return {\n ...shared,\n right: edge,\n borderTopWidth: borderWidth,\n borderRightWidth: borderWidth,\n };\n case \"right\":\n return {\n ...shared,\n left: edge,\n borderBottomWidth: borderWidth,\n borderLeftWidth: borderWidth,\n };\n }\n}\n"],"mappings":"AAQA,SAAS,yBAAyB;AAE3B,SAAS,MAAM,OAAe,KAAa,KAAqB;AACrE,SAAO,KAAK,IAAI,KAAK,IAAI,OAAO,GAAG,GAAG,KAAK,IAAI,KAAK,GAAG,CAAC;AAC1D;AAEO,SAAS,WAAW,GAAuB,GAAyB;AACzE,SACE,MAAM,QACN,EAAE,MAAM,EAAE,KACV,EAAE,MAAM,EAAE,KACV,EAAE,UAAU,EAAE,SACd,EAAE,WAAW,EAAE;AAEnB;AAEO,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA;AACF,GAA4C;AAC1C,QAAM,QAAQ,OAAO,IAAI,OAAO;AAChC,QAAM,SAAS,OAAO,IAAI,OAAO;
|
|
1
|
+
{"version":3,"sources":["../../src/utils/popover-position.utils.ts"],"sourcesContent":["import type { ViewStyle } from \"react-native\";\n\nimport type {\n PopoverPlacement,\n PopoverPosition,\n PopoverPositionOptions,\n PopoverRect,\n} from \"../types/popover.types\";\nimport { OppositePlacement } from \"../constants/popover.constants\";\n\nexport function clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), Math.max(min, max));\n}\n\nexport function equalRects(a: PopoverRect | null, b: PopoverRect): boolean {\n return (\n a !== null &&\n a.x === b.x &&\n a.y === b.y &&\n a.width === b.width &&\n a.height === b.height\n );\n}\n\nexport function getPopoverPosition({\n anchor,\n bounds,\n width,\n height,\n placement: preferred,\n gap,\n arrowInset,\n}: PopoverPositionOptions): PopoverPosition {\n const right = bounds.x + bounds.width;\n const bottom = bounds.y + bounds.height;\n\n const available: Record<PopoverPlacement, number> = {\n top: anchor.y - bounds.y - gap,\n bottom: bottom - anchor.y - anchor.height - gap,\n left: anchor.x - bounds.x - gap,\n right: right - anchor.x - anchor.width - gap,\n };\n\n const vertical = preferred === \"top\" || preferred === \"bottom\";\n const extent = vertical ? height : width;\n const opposite = OppositePlacement[preferred];\n const placement =\n available[preferred] < extent && available[opposite] > available[preferred]\n ? opposite\n : preferred;\n\n const centerX = anchor.x + anchor.width / 2;\n const centerY = anchor.y + anchor.height / 2;\n const x = clamp(\n vertical\n ? centerX - width / 2\n : placement === \"left\"\n ? anchor.x - width - gap\n : anchor.x + anchor.width + gap,\n bounds.x,\n right - width,\n );\n const y = clamp(\n vertical\n ? placement === \"top\"\n ? anchor.y - height - gap\n : anchor.y + anchor.height + gap\n : centerY - height / 2,\n bounds.y,\n bottom - height,\n );\n\n const edgeLength = vertical ? width : height;\n const inset = Math.min(arrowInset, edgeLength / 2);\n const offset = vertical ? centerX - x : centerY - y;\n const facing =\n placement === \"top\"\n ? y + height <= anchor.y\n : placement === \"bottom\"\n ? y >= anchor.y + anchor.height\n : placement === \"left\"\n ? x + width <= anchor.x\n : x >= anchor.x + anchor.width;\n\n return {\n x,\n y,\n placement,\n arrowOffset: clamp(offset, inset, edgeLength - inset),\n showArrow: facing && offset >= inset && offset <= edgeLength - inset,\n };\n}\n\nexport function getArrowStyle(\n position: PopoverPosition,\n size: number,\n color: string,\n borderWidth: number,\n borderColor: string,\n): ViewStyle {\n const side = size * Math.SQRT2;\n const offset = position.arrowOffset - borderWidth - side / 2;\n const edge = -(side + borderWidth) / 2;\n\n // The inner half covers the panel's border; only the outward edges are outlined.\n const shared: ViewStyle = {\n width: side,\n height: side,\n backgroundColor: color,\n borderColor,\n transform: [{ rotate: \"45deg\" }],\n ...(position.placement === \"top\" || position.placement === \"bottom\"\n ? { left: offset }\n : { top: offset }),\n };\n\n switch (position.placement) {\n case \"top\":\n return {\n ...shared,\n bottom: edge,\n borderBottomWidth: borderWidth,\n borderRightWidth: borderWidth,\n };\n\n case \"bottom\":\n return {\n ...shared,\n top: edge,\n borderTopWidth: borderWidth,\n borderLeftWidth: borderWidth,\n };\n\n case \"left\":\n return {\n ...shared,\n right: edge,\n borderTopWidth: borderWidth,\n borderRightWidth: borderWidth,\n };\n\n case \"right\":\n return {\n ...shared,\n left: edge,\n borderBottomWidth: borderWidth,\n borderLeftWidth: borderWidth,\n };\n }\n}\n"],"mappings":"AAQA,SAAS,yBAAyB;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BAAkB;AAAA,MACpB;AAAA,IAEF,KAAK;AACH,aAAO;AAAA,QACL,GAAG;AAAA,QACH,MAAM;AAAA,QACN,mBAAmB;AAAA,QACnB,iBAAiB;AAAA,MACnB;AAAA,EACJ;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@impulse-ui-native/popover",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.0",
|
|
4
4
|
"description": "Portal-rendered tooltips and compound anchored popovers for ImpulseUI Native.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
],
|
|
28
28
|
"sideEffects": false,
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@impulse-ui-native/
|
|
31
|
-
"@impulse-ui-native/primitives": "6.
|
|
32
|
-
"@impulse-ui-native/
|
|
33
|
-
"@impulse-ui-native/
|
|
30
|
+
"@impulse-ui-native/core": "6.3.0",
|
|
31
|
+
"@impulse-ui-native/primitives": "6.3.0",
|
|
32
|
+
"@impulse-ui-native/portal": "6.3.0",
|
|
33
|
+
"@impulse-ui-native/theme": "6.3.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/react": "~19.2.14",
|