From e424e1edc111058521a9da1fa2440effca4ac673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tommy=20Jos=C3=A9povic?= <44372776+tjosepo@users.noreply.github.com> Date: Thu, 12 Dec 2024 14:19:00 -0500 Subject: [PATCH] remove cicular import --- packages/components/src/accordion/src/useAccordionItems.ts | 2 +- packages/components/src/collection/src/index.ts | 1 - packages/components/src/collection/src/useCollection.ts | 3 ++- packages/components/src/shared/src/augmentElement.tsx | 2 +- .../src/{collection => shared}/src/getElementRef.tsx | 0 packages/components/src/tabs/src/useTabsItems.ts | 2 +- 6 files changed, 5 insertions(+), 5 deletions(-) rename packages/components/src/{collection => shared}/src/getElementRef.tsx (100%) diff --git a/packages/components/src/accordion/src/useAccordionItems.ts b/packages/components/src/accordion/src/useAccordionItems.ts index 5d83c5025..36ded84eb 100644 --- a/packages/components/src/accordion/src/useAccordionItems.ts +++ b/packages/components/src/accordion/src/useAccordionItems.ts @@ -1,7 +1,7 @@ import { Children, ReactElement, ReactNode, Ref, useMemo } from "react"; import { Content, Header } from "../../placeholders/index.ts"; import { isNil, mergeProps } from "../../shared/index.ts"; -import { getElementRef } from "@components/collection/index.ts"; +import { getElementRef } from "../../shared/src/getElementRef.tsx"; export interface AccordionBuilderItem { header: AccordionBuilderHeader; diff --git a/packages/components/src/collection/src/index.ts b/packages/components/src/collection/src/index.ts index 126d131ff..525caf9fe 100644 --- a/packages/components/src/collection/src/index.ts +++ b/packages/components/src/collection/src/index.ts @@ -7,4 +7,3 @@ export * from "./getItemText.tsx"; export * from "./reduceCollection.ts"; export * from "./Item.tsx"; export * from "./Section.tsx"; -export * from "./getElementRef.tsx"; diff --git a/packages/components/src/collection/src/useCollection.ts b/packages/components/src/collection/src/useCollection.ts index 24fa26b41..8bbda3934 100644 --- a/packages/components/src/collection/src/useCollection.ts +++ b/packages/components/src/collection/src/useCollection.ts @@ -1,6 +1,7 @@ import { Children, ElementType, ReactElement, ReactNode, Ref, useMemo } from "react"; import { Divider } from "../../divider/index.ts"; -import { getElementRef, Item, Section } from "../../collection/index.ts"; +import { Item, Section } from "../../collection/index.ts"; +import { getElementRef } from "../../shared/src/getElementRef.tsx"; import { TooltipTrigger, parseTooltipTrigger } from "../../tooltip/index.ts"; import { isNil, resolveChildren } from "../../shared/index.ts"; diff --git a/packages/components/src/shared/src/augmentElement.tsx b/packages/components/src/shared/src/augmentElement.tsx index 0d1a41a49..6389635cf 100644 --- a/packages/components/src/shared/src/augmentElement.tsx +++ b/packages/components/src/shared/src/augmentElement.tsx @@ -1,7 +1,7 @@ import { ReactElement, RefAttributes, cloneElement } from "react"; import { Size, SizeAdapter, normalizeSize } from "./size.ts"; import { mergeProps } from "./mergeProps.ts"; -import { getElementRef } from "@components/collection/index.ts"; +import { getElementRef } from "./getElementRef.tsx"; export function augmentElement(element: ReactElement & RefAttributes, newProps: Record) { const augmentedProps = mergeProps({ ...element.props, ref: getElementRef(element) }, newProps); diff --git a/packages/components/src/collection/src/getElementRef.tsx b/packages/components/src/shared/src/getElementRef.tsx similarity index 100% rename from packages/components/src/collection/src/getElementRef.tsx rename to packages/components/src/shared/src/getElementRef.tsx diff --git a/packages/components/src/tabs/src/useTabsItems.ts b/packages/components/src/tabs/src/useTabsItems.ts index 9d508a0a8..5e0d7d201 100644 --- a/packages/components/src/tabs/src/useTabsItems.ts +++ b/packages/components/src/tabs/src/useTabsItems.ts @@ -1,7 +1,7 @@ import { Children, ReactElement, ReactNode, Ref, RefAttributes, useMemo } from "react"; import { Content, Header } from "../../placeholders/index.ts"; import { isNil, mergeProps, resolveChildren } from "../../shared/index.ts"; -import { getElementRef } from "@components/collection/index.ts"; +import { getElementRef } from "../../shared/src/getElementRef.tsx"; export interface PanelType { disabled?: boolean;