{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "native-internal-utils-get-element-by-display-name", "type": "registry:lib", "title": "Get Element By Display Name", "description": "Get Element By Display Name from @pitsi-ui/native for native projects.", "dependencies": [ "@gorhom/bottom-sheet@^5.2.8", "react-native-reanimated@^4.1.1", "tailwind-variants@^3.2.2" ], "registryDependencies": [], "files": [ { "path": "registry/native-ui/src/helpers/internal/types/animation.ts", "content": "import type {\n BaseAnimationBuilder,\n EntryOrExitLayoutType,\n LayoutAnimationFunction,\n WithSpringConfig,\n WithTimingConfig,\n} from \"react-native-reanimated\";\n\n/**\n * Universal animation prop type\n * - `true` or `undefined`: Use default animations\n * - `false` or `\"disabled\"`: Disable all animations\n * - `object`: Custom animation configuration\n * - Can include `state?: 'disabled' | boolean | undefined` to disable animations while customizing properties\n */\nexport type Animation = Record> =\n | boolean\n | \"disabled\"\n | (TConfig & { state?: \"disabled\" | boolean });\n\nexport type AnimationDisabled = \"disabled\" | false;\n\n/**\n * Root-level animation prop type with cascading control\n * - `true` or `undefined`: Use default animations\n * - `false` or `\"disabled\"`: Disable only root animations (children can still animate)\n * - `\"disable-all\"`: Disable all animations including children (cascades down)\n * - `object`: Custom animation configuration\n * - Can include `state?: 'disabled' | 'disable-all' | boolean` to disable animations while customizing properties\n */\nexport type AnimationRoot = Record> =\n | boolean\n | \"disabled\"\n | \"disable-all\"\n | (TConfig & { state?: \"disabled\" | \"disable-all\" | boolean });\n\nexport type AnimationRootDisableAll = Extract;\n\n/**\n * Animation value that can be a custom config\n * Used for granular animation control within a component\n */\nexport type AnimationValue = Record> = TConfig;\n\nexport type LayoutTransition =\n | BaseAnimationBuilder\n | LayoutAnimationFunction\n | typeof BaseAnimationBuilder\n | undefined;\n\n/**\n * Spring animation configuration\n */\nexport interface SpringAnimationConfig {\n type: \"spring\";\n config?: WithSpringConfig;\n}\n\n/**\n * Timing animation configuration\n */\nexport interface TimingAnimationConfig {\n type: \"timing\";\n config?: WithTimingConfig;\n}\n\n/**\n * Animation configuration for popup overlay components (Dialog, Select, BottomSheet, Popover, etc.)\n * Supports both progress-based opacity animation and entering/exiting animations\n */\nexport type PopupOverlayAnimation = Animation<{\n /**\n * Opacity animation configuration (progress-based)\n * Takes effect for bottom-sheet/dialog presentation\n * @default [0, 1, 0] - opacity values for [idle, open, close] states\n */\n opacity?: AnimationValue<{\n /**\n * Opacity values [idle, open, close]\n * @default [0, 1, 0]\n */\n value?: [number, number, number];\n }>;\n /**\n * Takes effect for popover presentation\n * @default FadeIn with duration 200ms\n */\n entering?: EntryOrExitLayoutType;\n /**\n * Takes effect for popover presentation\n * @default FadeOut with duration 150ms\n */\n exiting?: EntryOrExitLayoutType;\n}>;\n\n/**\n * Animation configuration for popup dialog content components (Dialog, Select dialog presentation)\n * Supports opacity and scale animations\n */\nexport type PopupDialogContentAnimation = Animation<{\n /**\n * Custom Keyframe animation for entering transition\n * @default Keyframe with scale, and opacity (200ms)\n */\n entering?: EntryOrExitLayoutType;\n /**\n * Custom Keyframe animation for exiting transition\n * @default Keyframe mirroring entering animation (150ms)\n */\n exiting?: EntryOrExitLayoutType;\n}>;\n\n/**\n * Animation configuration for popup popover content components (Popover, Select popover presentation)\n * Supports custom Keyframe animations for entering and exiting transitions\n */\nexport type PopupPopoverContentAnimation = Animation<{\n /**\n * Custom Keyframe animation for entering transition\n * @default Keyframe with translateY/translateX, scale, and opacity (200ms)\n */\n entering?: EntryOrExitLayoutType;\n /**\n * Custom Keyframe animation for exiting transition\n * @default Keyframe mirroring entering animation (150ms)\n */\n exiting?: EntryOrExitLayoutType;\n}>;\n", "type": "registry:lib", "target": "@components/pitsi-ui/native-ui/src/helpers/internal/types/animation.ts" }, { "path": "registry/native-ui/src/helpers/internal/types/bottom-sheet.ts", "content": "import type { BottomSheetViewProps } from \"@gorhom/bottom-sheet/lib/typescript/components/bottomSheetView/types\";\nimport type { ReactNode } from \"react\";\nimport type { SharedValue } from \"react-native-reanimated\";\nimport type { AnimationDisabled } from \"./animation\";\n\n/**\n * State type for bottom sheet content container animation coordination\n */\nexport type BottomSheetContentContainerState = \"idle\" | \"open\" | \"close\";\n\n/**\n * Props for the reusable BottomSheetContentContainer component\n */\nexport interface BottomSheetContentContainerProps {\n /**\n * The content to be rendered inside the container\n */\n children?: ReactNode;\n /**\n * Additional CSS class for the content container\n */\n contentContainerClassName?: string;\n /**\n * Props for the content container\n */\n contentContainerProps?: Omit;\n /**\n * Whether the bottom sheet is open\n */\n isOpen: boolean;\n /**\n * Animation progress shared value (0=idle, 1=open, 2=close)\n */\n progress: SharedValue;\n /**\n * Whether the bottom sheet is dragging\n */\n isDragging: SharedValue;\n /**\n * Whether the bottom sheet is pan activated\n */\n isPanActivated: SharedValue;\n /**\n * Whether the bottom sheet is closing on swipe\n */\n isClosingOnSwipe: SharedValue;\n /**\n * Initial index of the bottom sheet\n */\n initialIndex: number;\n /**\n * Callback when the bottom sheet is opened\n */\n onOpenChange: (open: boolean) => void;\n /**\n * Whether the bottom sheet can be closed by panning down\n */\n enablePanDownToClose: boolean;\n}\n\n/**\n * Base props shared across BottomSheet Content components\n * Used by BottomSheet, Popover, and Select components when using bottom-sheet presentation\n */\nexport interface BaseBottomSheetContentProps {\n /**\n * The bottom sheet content\n */\n children?: ReactNode;\n /**\n * Additional CSS class for the bottom sheet\n */\n className?: string;\n /**\n * Additional CSS class for the container\n */\n containerClassName?: string;\n /**\n * Additional CSS class for the content container\n */\n contentContainerClassName?: string;\n /**\n * Additional CSS class for the background\n */\n backgroundClassName?: string;\n /**\n * Additional CSS class for the handle\n */\n handleClassName?: string;\n /**\n * Additional CSS class for the handle indicator\n */\n handleIndicatorClassName?: string;\n /**\n * Props for the content container\n */\n contentContainerProps?: Omit;\n /**\n * Animation configuration for bottom sheet content\n * - `false` or `\"disabled\"`: Disable all animations\n */\n animation?: AnimationDisabled;\n}\n", "type": "registry:lib", "target": "@components/pitsi-ui/native-ui/src/helpers/internal/types/bottom-sheet.ts" }, { "path": "registry/native-ui/src/helpers/internal/types/index.ts", "content": "export * from \"./animation\";\nexport * from \"./bottom-sheet\";\nexport * from \"./misc\";\nexport * from \"./primitives\";\nexport * from \"./theme\";\n", "type": "registry:lib", "target": "@components/pitsi-ui/native-ui/src/helpers/internal/types/index.ts" }, { "path": "registry/native-ui/src/helpers/internal/types/misc.ts", "content": "type ReactChild =\n | string\n | number\n | bigint\n | React.ReactElement>\n | Iterable\n | React.ReactPortal\n | Promise;\n\nexport type { ReactChild };\n", "type": "registry:lib", "target": "@components/pitsi-ui/native-ui/src/helpers/internal/types/misc.ts" }, { "path": "registry/native-ui/src/helpers/internal/types/primitives.ts", "content": "import type { Pressable, Text, View, ViewStyle } from \"react-native\";\n\n// Base utility types\n\n/**\n * Component props with optional asChild prop for polymorphic components\n * Allows components to render as different elements when asChild is true\n */\ntype ComponentPropsWithAsChild> =\n React.ComponentPropsWithoutRef & { asChild?: boolean };\n\n// Ref types\n\n/**\n * Reference type for React Native View component\n * Used for forwarding refs to View elements\n */\ntype ViewRef = React.ComponentRef;\n\n/**\n * Reference type for React Native Pressable component\n * Used for forwarding refs to Pressable elements\n */\ntype PressableRef = React.ComponentRef;\n\n/**\n * Reference type for React Native Text component\n * Used for forwarding refs to Text elements\n */\ntype TextRef = React.ComponentRef;\n\n// Slottable component props\n\n/**\n * View component props with asChild support for slot composition\n * Enables View components to be used with the Slot pattern\n */\ntype SlottableViewProps = ComponentPropsWithAsChild;\n\n/**\n * Pressable component props with asChild support for slot composition\n * Enables Pressable components to be used with the Slot pattern\n */\ntype SlottablePressableProps = ComponentPropsWithAsChild;\n\n/**\n * Text component props with asChild support for slot composition\n * Enables Text components to be used with the Slot pattern\n */\ntype SlottableTextProps = ComponentPropsWithAsChild;\n\n/**\n * Interface for components that can be force mounted even when normally hidden\n */\ninterface ForceMountable {\n /**\n * Whether to force mount the component in the DOM\n * Useful for animation purposes when component needs to be present but hidden\n */\n forceMount?: true | undefined;\n}\n\n/**\n * Interface for defining spacing/padding from screen edges\n */\ninterface Insets {\n /**\n * Distance from the top edge in pixels\n */\n top?: number;\n /**\n * Distance from the bottom edge in pixels\n */\n bottom?: number;\n /**\n * Distance from the left edge in pixels\n */\n left?: number;\n /**\n * Distance from the right edge in pixels\n */\n right?: number;\n}\n\n/**\n * Props for components that need to be positioned relative to a trigger element\n * Certain props are only available on the native version of the component.\n * @docs For the web version, see the Radix documentation https://www.radix-ui.com/primitives\n */\ninterface PositionedContentProps {\n /**\n * Whether to force mount the component in the DOM\n */\n forceMount?: true | undefined;\n /**\n * Custom styles to apply to the positioned content\n */\n style?: ViewStyle;\n /**\n * Offset along the alignment axis in pixels\n */\n alignOffset?: number;\n /**\n * Screen edge insets to respect when positioning\n */\n insets?: Insets;\n /**\n * Whether to automatically adjust position to avoid screen edges\n * @default true\n */\n avoidCollisions?: boolean;\n /**\n * Alignment relative to the trigger element\n * @default 'start'\n */\n align?: \"start\" | \"center\" | \"end\";\n /**\n * Preferred placement of the trigger element to position against\n * @default 'bottom'\n */\n placement?: \"top\" | \"bottom\" | \"left\" | \"right\";\n /**\n * Offset from the trigger element in pixels\n * @default 0\n */\n offset?: number;\n /**\n * Whether to disable the automatic positioning styles\n * Useful when you want to handle positioning manually\n * @default false\n */\n disablePositioningStyle?: boolean;\n}\n\nexport type {\n ComponentPropsWithAsChild,\n ForceMountable,\n Insets,\n PositionedContentProps,\n PressableRef,\n SlottablePressableProps,\n SlottableTextProps,\n SlottableViewProps,\n TextRef,\n ViewRef,\n};\n", "type": "registry:lib", "target": "@components/pitsi-ui/native-ui/src/helpers/internal/types/primitives.ts" }, { "path": "registry/native-ui/src/helpers/internal/types/theme.ts", "content": "import type { ClassValue } from \"tailwind-variants\";\n\n/**\n * This Typescript utility transform a list of slots into a list of {slot: classes}\n */\ntype ElementSlots = {\n [key in S]?: Exclude;\n};\n\n/**\n * Type helper that preserves the exact type of combined style objects\n * This ensures that VariantProps inference works correctly for each style\n */\ntype CombinedStyles> = {\n [K in keyof T]: T[K];\n};\n\nexport type { CombinedStyles, ElementSlots };\n", "type": "registry:lib", "target": "@components/pitsi-ui/native-ui/src/helpers/internal/types/theme.ts" }, { "path": "registry/native-ui/src/helpers/internal/utils/get-element-by-display-name.ts", "content": "import React from \"react\";\nimport type { ReactChild } from \"../types\";\n\nexport const getElementByDisplayName = (\n children: React.ReactNode,\n displayName: string,\n): ReactChild | undefined => {\n const element = React.Children.toArray(children).find(\n (child) => React.isValidElement(child) && (child.type as any)?.displayName === displayName,\n );\n\n return element;\n};\n", "type": "registry:lib", "target": "@components/pitsi-ui/native-ui/src/helpers/internal/utils/get-element-by-display-name.ts" } ], "categories": [ "native", "react-native", "internal-lib" ], "meta": { "package": "@pitsi-ui/native", "packageSlug": "native-ui", "platform": "native" } }