diff --git a/packages/react/package.json b/packages/react/package.json index 0bfa2a92dc5..5ba7a724525 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -9,6 +9,14 @@ "import": "./lib-esm/index.js", "require": "./lib/index.js" }, + "./utils/*": { + "import": "./lib-esm/utils/*", + "require": "./lib/utils/*" + }, + "./utils": { + "import": "./lib-esm/utils/index.js", + "require": "./lib/utils/index.js" + }, "./experimental": { "import": "./lib-esm/experimental/index.js", "require": "./lib/experimental/index.js" diff --git a/packages/react/src/RelativeTime/RelativeTime.tsx b/packages/react/src/RelativeTime/RelativeTime.tsx index 12eb1776669..b0f943a20f4 100644 --- a/packages/react/src/RelativeTime/RelativeTime.tsx +++ b/packages/react/src/RelativeTime/RelativeTime.tsx @@ -1,7 +1,7 @@ import React from 'react' import {RelativeTimeElement} from '@github/relative-time-element' import type {ComponentProps} from '../utils/types' -import {createComponent} from '../utils/custom-element' +import {createComponent} from '../utils/customElement' const RelativeTimeComponent = createComponent(RelativeTimeElement, 'relative-time') diff --git a/packages/react/src/drafts/TabPanels/TabPanels.tsx b/packages/react/src/drafts/TabPanels/TabPanels.tsx index 85bd5de263b..e1d303ab051 100644 --- a/packages/react/src/drafts/TabPanels/TabPanels.tsx +++ b/packages/react/src/drafts/TabPanels/TabPanels.tsx @@ -4,7 +4,7 @@ import React from 'react' import styled from 'styled-components' import {get} from '../../constants' import {TabContainerElement} from '@github/tab-container-element' -import {createComponent} from '../../utils/custom-element' +import {createComponent} from '../../utils/customElement' import sx, {type SxProp} from '../../sx' import type {ComponentProps} from '../../utils/types' import getGlobalFocusStyles from '../../internal/utils/getGlobalFocusStyles' diff --git a/packages/react/src/utils/custom-element.ts b/packages/react/src/utils/createComponent.ts similarity index 100% rename from packages/react/src/utils/custom-element.ts rename to packages/react/src/utils/createComponent.ts diff --git a/packages/react/src/utils/index.tsx b/packages/react/src/utils/index.tsx new file mode 100644 index 00000000000..f1f3c6bbc6e --- /dev/null +++ b/packages/react/src/utils/index.tsx @@ -0,0 +1,21 @@ +import isNumeric from './isNumeric' +import useIsomorpyhicLayoutEffect from './useIsomorphicLayoutEffect' + +export {isNumeric, useIsomorpyhicLayoutEffect} + +export * from './createComponent' +export * from './defaultSxProp' +export * from './deprecate' +export * from './environment' +export * from './form-story-helpers' +export * from './getBreakpointDeclarations' +export * from './invariant' +export * from './layout' +export * from './scroll' +export * from './ssr' +export * from './theme' +export * from './use-force-update' +export * from './warning' + +export type * from './types' +export type {ForwardRefComponent, OwnProps, IntrinsicElement} from './polymorphic'