diff --git a/pages/app-layout/fill-content-area.page.tsx b/pages/app-layout/fill-content-area.page.tsx index 6c467195e4..f6a47c14b9 100644 --- a/pages/app-layout/fill-content-area.page.tsx +++ b/pages/app-layout/fill-content-area.page.tsx @@ -8,7 +8,7 @@ import { Navigation, Tools, Breadcrumbs } from './utils/content-blocks'; import * as toolsContent from './utils/tools-content'; import labels from './utils/labels'; import Box from '~components/box'; -import { getIsRtl } from '~components/internal/direction'; +import { getIsRtl } from '@cloudscape-design/component-toolkit/internal'; export default function () { return ( diff --git a/pages/popover/container-test.page.tsx b/pages/popover/container-test.page.tsx index 758e355400..90c7b369c3 100644 --- a/pages/popover/container-test.page.tsx +++ b/pages/popover/container-test.page.tsx @@ -3,7 +3,7 @@ import React, { useCallback, useMemo, useRef, useState } from 'react'; import ScreenshotArea from '../utils/screenshot-area'; import PopoverContainer from '~components/popover/container'; -import { getIsRtl } from '~components/internal/direction'; +import { getIsRtl } from '@cloudscape-design/component-toolkit/internal'; import clsx from 'clsx'; // eslint-disable-next-line @typescript-eslint/ban-ts-comment diff --git a/src/app-layout/__tests__/widgetized-layout.test.tsx b/src/app-layout/__tests__/widgetized-layout.test.tsx index 7f801933b8..0b1f36010f 100644 --- a/src/app-layout/__tests__/widgetized-layout.test.tsx +++ b/src/app-layout/__tests__/widgetized-layout.test.tsx @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React from 'react'; import { render } from '@testing-library/react'; -import { createWidgetizedAppLayout } from '../../../lib/components/app-layout/widget'; +import { createWidgetizedAppLayout } from '../../../lib/components/app-layout/implementation'; import { AppLayoutProps, AppLayoutPropsWithDefaults } from '../../../lib/components/app-layout/interfaces'; import { FlagsHolder, awsuiGlobalFlagsSymbol } from '../../../lib/components/internal/utils/global-flags'; import { useVisualRefresh } from '../../../lib/components/internal/hooks/use-visual-mode'; diff --git a/src/app-layout/internal.tsx b/src/app-layout/internal.tsx index 1f41c06b1e..6d02b9f8f7 100644 --- a/src/app-layout/internal.tsx +++ b/src/app-layout/internal.tsx @@ -1,5 +1,5 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -import { createWidgetizedAppLayout } from './widget'; +import { createWidgetizedAppLayout } from './implementation'; export const AppLayoutInternal = createWidgetizedAppLayout(); diff --git a/src/app-layout/utils/use-app-layout-placement.ts b/src/app-layout/utils/use-app-layout-placement.ts index 51f481f763..a12bce161c 100644 --- a/src/app-layout/utils/use-app-layout-placement.ts +++ b/src/app-layout/utils/use-app-layout-placement.ts @@ -3,7 +3,7 @@ import { useCallback, useEffect, useRef, useState } from 'react'; import { useObservedElement } from './use-observed-element'; import { useResizeObserver } from '@cloudscape-design/component-toolkit/internal'; -import { getLogicalBoundingClientRect } from '../../internal/direction'; +import { getLogicalBoundingClientRect } from '@cloudscape-design/component-toolkit/internal'; export function useAppLayoutPlacement(headerSelector: string, footerSelector: string) { const mainElementRef = useRef(null); diff --git a/src/app-layout/utils/use-pointer-events.ts b/src/app-layout/utils/use-pointer-events.ts index eb0cae1c9a..91f0846a22 100644 --- a/src/app-layout/utils/use-pointer-events.ts +++ b/src/app-layout/utils/use-pointer-events.ts @@ -3,7 +3,11 @@ import { useCallback } from 'react'; import styles from '../styles.css.js'; import { SizeControlProps } from './interfaces'; -import { getIsRtl, getLogicalClientX, getLogicalBoundingClientRect } from '../../internal/direction.js'; +import { + getIsRtl, + getLogicalClientX, + getLogicalBoundingClientRect, +} from '@cloudscape-design/component-toolkit/internal'; export const usePointerEvents = ({ position, diff --git a/src/app-layout/visual-refresh/context.tsx b/src/app-layout/visual-refresh/context.tsx index f9030cf4d0..1f81e4407b 100644 --- a/src/app-layout/visual-refresh/context.tsx +++ b/src/app-layout/visual-refresh/context.tsx @@ -29,7 +29,7 @@ import useBackgroundOverlap from './use-background-overlap'; import { useDrawers } from '../utils/use-drawers'; import { useUniqueId } from '../../internal/hooks/use-unique-id'; import { SPLIT_PANEL_MIN_WIDTH } from '../split-panel'; -import { getOffsetInlineStart } from '../../internal/direction'; +import { getOffsetInlineStart } from '@cloudscape-design/component-toolkit/internal'; interface AppLayoutInternals extends AppLayoutPropsWithDefaults { activeDrawerId: string | null; diff --git a/src/app-layout/widget.tsx b/src/app-layout/widget.tsx deleted file mode 100644 index b8c51a8a43..0000000000 --- a/src/app-layout/widget.tsx +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 -export { createWidgetizedAppLayout } from './implementation'; diff --git a/src/area-chart/internal.tsx b/src/area-chart/internal.tsx index dc0da1a923..6f782fd38f 100644 --- a/src/area-chart/internal.tsx +++ b/src/area-chart/internal.tsx @@ -22,7 +22,7 @@ import { useMergeRefs } from '../internal/hooks/use-merge-refs'; import { SomeRequired } from '../internal/types'; import { nodeBelongs } from '../internal/utils/node-belongs'; import { ChartWrapper } from '../internal/components/chart-wrapper'; -import { getIsRtl } from '../internal/direction'; +import { getIsRtl } from '@cloudscape-design/component-toolkit/internal'; type InternalAreaChartProps = SomeRequired< AreaChartProps, diff --git a/src/internal/components/cartesian-chart/inline-start-labels.tsx b/src/internal/components/cartesian-chart/inline-start-labels.tsx index c1a95babb9..3b4c5dc5ac 100644 --- a/src/internal/components/cartesian-chart/inline-start-labels.tsx +++ b/src/internal/components/cartesian-chart/inline-start-labels.tsx @@ -11,7 +11,7 @@ import { formatTicks, getSVGTextSize, getVisibleTicks } from './label-utils'; import { ChartDataTypes } from '../../../mixed-line-bar-chart/interfaces'; import { useInternalI18n } from '../../../i18n/context'; import ResponsiveText from '../responsive-text'; -import { getIsRtl } from '../../direction'; +import { getIsRtl } from '@cloudscape-design/component-toolkit/internal'; const OFFSET_PX = 12; diff --git a/src/internal/components/dropdown/dropdown-fit-handler.ts b/src/internal/components/dropdown/dropdown-fit-handler.ts index 51d74dc186..730d11c5c5 100644 --- a/src/internal/components/dropdown/dropdown-fit-handler.ts +++ b/src/internal/components/dropdown/dropdown-fit-handler.ts @@ -1,7 +1,7 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { getBreakpointValue } from '../../breakpoints'; -import { getLogicalBoundingClientRect } from '../../direction'; +import { getLogicalBoundingClientRect } from '@cloudscape-design/component-toolkit/internal'; import { BoundingBox, getOverflowParents, getOverflowParentDimensions } from '../../utils/scrollable-containers'; import styles from './styles.css.js'; diff --git a/src/internal/components/dropdown/index.tsx b/src/internal/components/dropdown/index.tsx index 543455d7c9..070f290133 100644 --- a/src/internal/components/dropdown/index.tsx +++ b/src/internal/components/dropdown/index.tsx @@ -25,7 +25,7 @@ import { useUniqueId } from '../../hooks/use-unique-id/index.js'; import customCssProps from '../../generated/custom-css-properties'; import { useResizeObserver } from '@cloudscape-design/component-toolkit/internal'; import { nodeBelongs } from '../../utils/node-belongs'; -import { getLogicalBoundingClientRect } from '../../direction.js'; +import { getLogicalBoundingClientRect } from '@cloudscape-design/component-toolkit/internal'; interface DropdownContainerProps { children?: React.ReactNode; diff --git a/src/internal/components/responsive-text/__tests__/responsive-text.test.tsx b/src/internal/components/responsive-text/__tests__/responsive-text.test.tsx index 8fef3b9cba..f12ec5aa61 100644 --- a/src/internal/components/responsive-text/__tests__/responsive-text.test.tsx +++ b/src/internal/components/responsive-text/__tests__/responsive-text.test.tsx @@ -4,15 +4,15 @@ import React from 'react'; import { render } from '@testing-library/react'; import ResponsiveText from '../../../../../lib/components/internal/components/responsive-text'; import { getTextWidth } from '../../../../../lib/components/internal/components/responsive-text/responsive-text-utils'; -import { getIsRtl } from '../../../../../lib/components/internal/direction'; +import { getIsRtl } from '@cloudscape-design/component-toolkit/internal'; jest.mock('../../../../../lib/components/internal/components/responsive-text/responsive-text-utils', () => ({ ...jest.requireActual('../../../../../lib/components/internal/components/responsive-text/responsive-text-utils'), getTextWidth: jest.fn().mockReturnValue(0), })); -jest.mock('../../../../../lib/components/internal/direction', () => ({ - ...jest.requireActual('../../../../../lib/components/internal/direction'), +jest.mock('@cloudscape-design/component-toolkit/internal', () => ({ + ...jest.requireActual('@cloudscape-design/component-toolkit/internal'), getIsRtl: jest.fn().mockReturnValue(false), })); diff --git a/src/internal/components/responsive-text/index.tsx b/src/internal/components/responsive-text/index.tsx index 5eded74b82..93e6fe2ccf 100644 --- a/src/internal/components/responsive-text/index.tsx +++ b/src/internal/components/responsive-text/index.tsx @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React, { memo, useEffect, useRef } from 'react'; import { getTextWidth } from './responsive-text-utils'; -import { getIsRtl } from '../../direction'; +import { getIsRtl } from '@cloudscape-design/component-toolkit/internal'; interface ResponsiveTextProps { x: number; diff --git a/src/internal/direction.ts b/src/internal/direction.ts deleted file mode 100644 index 0c14510768..0000000000 --- a/src/internal/direction.ts +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -export function getIsRtl(element: null | HTMLElement | SVGElement): boolean { - if (!element) { - return false; - } - return getComputedStyle(element).direction === 'rtl'; -} - -export function getOffsetInlineStart(element: HTMLElement) { - const offsetParentWidth = element.offsetParent?.clientWidth ?? 0; - return getIsRtl(element) ? offsetParentWidth - element.offsetWidth - element.offsetLeft : element.offsetLeft; -} - -/** - * The scrollLeft value will be a negative number if the direction is RTL and - * needs to be converted to a positive value for direction independent scroll - * computations. Additionally, the scrollLeft value can be a decimal value on - * systems using display scaling requiring the floor and ceiling calls. - */ -export function getScrollInlineStart(element: HTMLElement) { - return getIsRtl(element) ? Math.floor(element.scrollLeft) * -1 : Math.ceil(element.scrollLeft); -} - -/** - * The clientX position needs to be converted so it is relative to the right of - * the document in order for computations to yield the same result in both - * element directions. - */ -export function getLogicalClientX(event: PointerEvent, IsRtl: boolean) { - return IsRtl ? document.documentElement.clientWidth - event.clientX : event.clientX; -} - -/** - * The getBoundingClientRect() function returns values relative to the top left - * corner of the document regardless of document direction. The left/right position - * will be transformed to insetInlineStart based on element direction in order to - * support direction agnostic position computation. - */ -export function getLogicalBoundingClientRect(element: HTMLElement | SVGElement) { - const boundingClientRect = element.getBoundingClientRect(); - - const blockSize = boundingClientRect.height; - const inlineSize = boundingClientRect.width; - const insetBlockStart = boundingClientRect.top; - const insetBlockEnd = boundingClientRect.bottom; - const insetInlineStart = getIsRtl(element) - ? document.documentElement.clientWidth - boundingClientRect.right - : boundingClientRect.left; - const insetInlineEnd = insetInlineStart + inlineSize; - - return { - blockSize, - inlineSize, - insetBlockStart, - insetBlockEnd, - insetInlineStart, - insetInlineEnd, - }; -} - -/** - * The pageX position needs to be converted so it is relative to the right of - * the document in order for computations to yield the same result in both - * element directions. - */ -export function getLogicalPageX(event: MouseEvent) { - return event.target instanceof HTMLElement && getIsRtl(event.target) - ? document.documentElement.clientWidth - event.pageX - : event.pageX; -} diff --git a/src/internal/utils/handle-key.ts b/src/internal/utils/handle-key.ts index b5fd92c36c..f04420524d 100644 --- a/src/internal/utils/handle-key.ts +++ b/src/internal/utils/handle-key.ts @@ -1,7 +1,7 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { KeyCode } from '../keycode'; -import { getIsRtl } from '../direction'; +import { getIsRtl } from '@cloudscape-design/component-toolkit/internal'; export function isEventLike(event: any): event is EventLike { return event.currentTarget instanceof HTMLElement || event.currentTarget instanceof SVGElement; diff --git a/src/mixed-line-bar-chart/__tests__/mixed-chart.test.tsx b/src/mixed-line-bar-chart/__tests__/mixed-chart.test.tsx index 6b4122d175..26d1b1c18b 100644 --- a/src/mixed-line-bar-chart/__tests__/mixed-chart.test.tsx +++ b/src/mixed-line-bar-chart/__tests__/mixed-chart.test.tsx @@ -12,7 +12,7 @@ import { lineSeries3, renderMixedChart } from './common'; import createComputedTextLengthMock from './computed-text-length-mock'; import { KeyCode } from '@cloudscape-design/test-utils-core/dist/utils'; import positions from '../../../lib/components/popover/utils/positions'; -import { getIsRtl } from '../../../lib/components/internal/direction'; +import { getIsRtl } from '@cloudscape-design/component-toolkit/internal'; jest.mock('../../../lib/components/popover/utils/positions', () => { return { @@ -21,8 +21,8 @@ jest.mock('../../../lib/components/popover/utils/positions', () => { }; }); -jest.mock('../../../lib/components/internal/direction', () => ({ - ...jest.requireActual('../../../lib/components/internal/direction'), +jest.mock('@cloudscape-design/component-toolkit/internal', () => ({ + ...jest.requireActual('@cloudscape-design/component-toolkit/internal'), getIsRtl: jest.fn().mockReturnValue(false), })); diff --git a/src/mixed-line-bar-chart/chart-container.tsx b/src/mixed-line-bar-chart/chart-container.tsx index 771ec94615..f9ffc8a6f2 100644 --- a/src/mixed-line-bar-chart/chart-container.tsx +++ b/src/mixed-line-bar-chart/chart-container.tsx @@ -34,7 +34,7 @@ import { useMergeRefs } from '../internal/hooks/use-merge-refs'; import { nodeBelongs } from '../internal/utils/node-belongs'; import { CartesianChartContainer } from '../internal/components/cartesian-chart/chart-container'; import { useHeightMeasure } from '../internal/hooks/container-queries/use-height-measure'; -import { getIsRtl } from '../internal/direction'; +import { getIsRtl } from '@cloudscape-design/component-toolkit/internal'; const INLINE_START_LABELS_MARGIN = 16; const BLOCK_END_LABELS_OFFSET = 12; diff --git a/src/pie-chart/__tests__/responsive-text.test.tsx b/src/pie-chart/__tests__/responsive-text.test.tsx index b9914d3b99..2ad084f029 100644 --- a/src/pie-chart/__tests__/responsive-text.test.tsx +++ b/src/pie-chart/__tests__/responsive-text.test.tsx @@ -4,15 +4,15 @@ import React from 'react'; import { render, waitFor } from '@testing-library/react'; import ResponsiveText from '../../../lib/components/pie-chart/responsive-text'; import { renderTextContent } from '../../../lib/components/internal/components/responsive-text/index'; -import { getIsRtl } from '../../../lib/components/internal/direction'; +import { getIsRtl } from '@cloudscape-design/component-toolkit/internal'; jest.mock('../../../lib/components/internal/components/responsive-text/index', () => ({ ...jest.requireActual('../../../lib/components/internal/components/responsive-text/index'), renderTextContent: jest.fn(), })); -jest.mock('../../../lib/components/internal/direction', () => ({ - ...jest.requireActual('../../../lib/components/internal/direction'), +jest.mock('@cloudscape-design/component-toolkit/internal', () => ({ + ...jest.requireActual('@cloudscape-design/component-toolkit/internal'), getIsRtl: jest.fn().mockReturnValue(false), })); diff --git a/src/pie-chart/responsive-text.tsx b/src/pie-chart/responsive-text.tsx index c6bb37626d..5ef9c604df 100644 --- a/src/pie-chart/responsive-text.tsx +++ b/src/pie-chart/responsive-text.tsx @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React, { memo, useEffect, useRef } from 'react'; import { renderTextContent } from '../internal/components/responsive-text'; -import { getIsRtl } from '../internal/direction'; +import { getIsRtl } from '@cloudscape-design/component-toolkit/internal'; interface ResponsiveTextProps { x: number; diff --git a/src/popover/use-popover-position.ts b/src/popover/use-popover-position.ts index 817d368d6e..4d88e706bc 100644 --- a/src/popover/use-popover-position.ts +++ b/src/popover/use-popover-position.ts @@ -11,7 +11,7 @@ import { scrollRectangleIntoView, } from '../internal/utils/scrollable-containers'; import { getContainingBlock } from '../internal/utils/dom'; -import { getLogicalBoundingClientRect } from '../internal/direction'; +import { getLogicalBoundingClientRect } from '@cloudscape-design/component-toolkit/internal'; export default function usePopoverPosition({ popoverRef, diff --git a/src/split-panel/__tests__/widgetized-panel.test.tsx b/src/split-panel/__tests__/widgetized-panel.test.tsx index 4380420255..788afad156 100644 --- a/src/split-panel/__tests__/widgetized-panel.test.tsx +++ b/src/split-panel/__tests__/widgetized-panel.test.tsx @@ -5,7 +5,7 @@ import { render } from '@testing-library/react'; import { FlagsHolder, awsuiGlobalFlagsSymbol } from '../../../lib/components/internal/utils/global-flags'; import { useVisualRefresh } from '../../../lib/components/internal/hooks/use-visual-mode'; import createWrapper from '../../../lib/components/test-utils/dom'; -import { createWidgetizedSplitPanel } from '../../../lib/components/split-panel/widget'; +import { createWidgetizedSplitPanel } from '../../../lib/components/split-panel/implementation'; import { SplitPanelProps } from '../../../lib/components/split-panel/interfaces'; import { SplitPanelContextProvider } from '../../../lib/components/internal/context/split-panel-context'; import { defaultSplitPanelContextProps } from './helpers'; diff --git a/src/split-panel/internal.tsx b/src/split-panel/internal.tsx index 34bc55894d..e63afb7be1 100644 --- a/src/split-panel/internal.tsx +++ b/src/split-panel/internal.tsx @@ -1,5 +1,5 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -import { createWidgetizedSplitPanel } from './widget'; +import { createWidgetizedSplitPanel } from './implementation'; export const SplitPanelInternal = createWidgetizedSplitPanel(); diff --git a/src/split-panel/widget.tsx b/src/split-panel/widget.tsx deleted file mode 100644 index fcefb66362..0000000000 --- a/src/split-panel/widget.tsx +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 -export { createWidgetizedSplitPanel } from './implementation'; diff --git a/src/table/resizer/index.tsx b/src/table/resizer/index.tsx index 6f425a6b0e..97c2c460b6 100644 --- a/src/table/resizer/index.tsx +++ b/src/table/resizer/index.tsx @@ -9,7 +9,7 @@ import { useStableCallback } from '@cloudscape-design/component-toolkit/internal import { useUniqueId } from '../../internal/hooks/use-unique-id'; import { getHeaderWidth, getResizerElements } from './resizer-lookup'; import { useSingleTabStopNavigation } from '../../internal/context/single-tab-stop-navigation-context.js'; -import { getIsRtl, getLogicalBoundingClientRect, getLogicalPageX } from '../../internal/direction.js'; +import { getIsRtl, getLogicalBoundingClientRect, getLogicalPageX } from '@cloudscape-design/component-toolkit/internal'; import handleKey, { isEventLike } from '../../internal/utils/handle-key'; interface ResizerProps { diff --git a/src/table/resizer/resizer-lookup.ts b/src/table/resizer/resizer-lookup.ts index 5c2e6902c3..71496dd0f0 100644 --- a/src/table/resizer/resizer-lookup.ts +++ b/src/table/resizer/resizer-lookup.ts @@ -5,7 +5,7 @@ import { findUpUntil } from '@cloudscape-design/component-toolkit/dom'; import tableStyles from '../styles.css.js'; import resizerStyles from './styles.css.js'; import { getOverflowParents } from '../../internal/utils/scrollable-containers.js'; -import { getLogicalBoundingClientRect } from '../../internal/direction'; +import { getLogicalBoundingClientRect } from '@cloudscape-design/component-toolkit/internal'; export function getResizerElements(resizerElement: null | HTMLElement) { if (!resizerElement) { diff --git a/src/table/sticky-columns/use-sticky-columns.ts b/src/table/sticky-columns/use-sticky-columns.ts index 9693ab7662..3b06eb91ba 100644 --- a/src/table/sticky-columns/use-sticky-columns.ts +++ b/src/table/sticky-columns/use-sticky-columns.ts @@ -13,7 +13,7 @@ import { StickyColumnsWrapperState, } from './interfaces'; import { isCellStatesEqual, isWrapperStatesEqual, updateCellOffsets } from './utils'; -import { getScrollInlineStart, getLogicalBoundingClientRect } from '../../internal/direction'; +import { getScrollInlineStart, getLogicalBoundingClientRect } from '@cloudscape-design/component-toolkit/internal'; // We allow the table to have a minimum of 148px of available space besides the sum of the widths of the sticky columns // This value is an UX recommendation and is approximately 1/3 of our smallest breakpoint (465px) diff --git a/src/table/sticky-columns/utils.ts b/src/table/sticky-columns/utils.ts index 8bd2933693..f99a5b2a1a 100644 --- a/src/table/sticky-columns/utils.ts +++ b/src/table/sticky-columns/utils.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { CellOffsets, StickyColumnsCellState, StickyColumnsProps, StickyColumnsWrapperState } from './interfaces'; -import { getLogicalBoundingClientRect } from '../../internal/direction'; +import { getLogicalBoundingClientRect } from '@cloudscape-design/component-toolkit/internal'; export function isCellStatesEqual(s1: null | StickyColumnsCellState, s2: null | StickyColumnsCellState): boolean { if (s1 && s2) { diff --git a/src/table/sticky-scrollbar/use-sticky-scrollbar.ts b/src/table/sticky-scrollbar/use-sticky-scrollbar.ts index c3c410990c..3029d40263 100644 --- a/src/table/sticky-scrollbar/use-sticky-scrollbar.ts +++ b/src/table/sticky-scrollbar/use-sticky-scrollbar.ts @@ -7,7 +7,7 @@ import { getContainingBlock } from '../../internal/utils/dom'; import { getOverflowParents } from '../../internal/utils/scrollable-containers'; import { browserScrollbarSize } from '../../internal/utils/browser-scrollbar-size'; import globalVars from '../../internal/styles/global-vars'; -import { getLogicalBoundingClientRect } from '../../internal/direction.js'; +import { getLogicalBoundingClientRect } from '@cloudscape-design/component-toolkit/internal'; export const updatePosition = ( tableEl: HTMLElement | null, diff --git a/src/table/sticky-scrolling.ts b/src/table/sticky-scrolling.ts index d31533c01f..204abcc192 100644 --- a/src/table/sticky-scrolling.ts +++ b/src/table/sticky-scrolling.ts @@ -1,7 +1,7 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { getOverflowParents } from '../internal/utils/scrollable-containers'; -import { getLogicalBoundingClientRect } from '../internal/direction'; +import { getLogicalBoundingClientRect } from '@cloudscape-design/component-toolkit/internal'; /** * @param containerRef ref to surrounding container with sticky element diff --git a/src/table/use-column-widths.tsx b/src/table/use-column-widths.tsx index a64f8b378e..3ed5f68be6 100644 --- a/src/table/use-column-widths.tsx +++ b/src/table/use-column-widths.tsx @@ -3,7 +3,7 @@ import { useResizeObserver, useStableCallback } from '@cloudscape-design/component-toolkit/internal'; import React, { useEffect, useRef, useState, createContext, useContext } from 'react'; import { setElementWidths } from './column-widths-utils'; -import { getLogicalBoundingClientRect } from '../internal/direction'; +import { getLogicalBoundingClientRect } from '@cloudscape-design/component-toolkit/internal'; export const DEFAULT_COLUMN_WIDTH = 120; diff --git a/src/tabs/scroll-utils.ts b/src/tabs/scroll-utils.ts index 5288462aeb..1944eaf5ae 100644 --- a/src/tabs/scroll-utils.ts +++ b/src/tabs/scroll-utils.ts @@ -1,7 +1,7 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import smoothScroll from './smooth-scroll'; -import { getIsRtl, getScrollInlineStart } from '../internal/direction'; +import { getIsRtl, getScrollInlineStart } from '@cloudscape-design/component-toolkit/internal'; export const onPaginationClick = ( headerBarRef: React.RefObject,