diff --git a/package.json b/package.json index 53c9cd7..a7bc803 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@near-pagoda/ui", - "version": "3.0.1", + "version": "3.0.2", "description": "A React component library that implements the official NEAR design system.", "license": "MIT", "repository": { diff --git a/src/components/Combobox.tsx b/src/components/Combobox.tsx index 508b3ed..9aa68a5 100644 --- a/src/components/Combobox.tsx +++ b/src/components/Combobox.tsx @@ -8,8 +8,8 @@ import { forwardRef } from 'react'; import { useEffect } from 'react'; import { useState } from 'react'; +import { mergeRefs } from '../helpers/merge-refs'; import { useDebouncedValue } from '../hooks/debounce'; -import { mergeRefs } from '../utils/merge-refs'; import s from './Combobox.module.scss'; import { Input } from './Input'; import { SvgIcon } from './SvgIcon'; diff --git a/src/components/Input.tsx b/src/components/Input.tsx index 95e5bdf..428e7c4 100644 --- a/src/components/Input.tsx +++ b/src/components/Input.tsx @@ -4,8 +4,8 @@ import { MagnifyingGlass } from '@phosphor-icons/react'; import type { ComponentPropsWithRef, FormEventHandler, ReactElement } from 'react'; import { forwardRef } from 'react'; -import type { NumberInputHandlerOptions } from '../utils/input-handlers'; -import { numberInputHandler } from '../utils/input-handlers'; +import type { NumberInputHandlerOptions } from '../helpers/input-handlers'; +import { numberInputHandler } from '../helpers/input-handlers'; import { type ThemeInputVariant } from '../utils/theme'; import { AssistiveText } from './AssistiveText'; import s from './Input.module.scss'; diff --git a/src/components/Table/Table.tsx b/src/components/Table/Table.tsx index 82f63ca..19124f1 100644 --- a/src/components/Table/Table.tsx +++ b/src/components/Table/Table.tsx @@ -11,7 +11,7 @@ import type { import { createContext, forwardRef, useContext, useEffect, useRef } from 'react'; import { usePagodaUi } from '../../context/PagodaUi'; -import { mergeRefs } from '../../utils'; +import { mergeRefs } from '../../helpers/merge-refs'; import { Flex } from '../Flex'; import { Placeholder } from '../Placeholder'; import { SvgIcon } from '../SvgIcon'; diff --git a/src/components/Tabs/Tabs.tsx b/src/components/Tabs/Tabs.tsx index f1a5ef8..c8e9918 100644 --- a/src/components/Tabs/Tabs.tsx +++ b/src/components/Tabs/Tabs.tsx @@ -6,7 +6,7 @@ import { forwardRef } from 'react'; import { useEffect, useRef } from 'react'; import { usePagodaUi } from '../../context/PagodaUi'; -import { mergeRefs } from '../../utils/merge-refs'; +import { mergeRefs } from '../../helpers/merge-refs'; import s from './Tabs.module.scss'; type RootProps = Omit, 'size' | 'variant'> & { diff --git a/src/utils/clipboard.ts b/src/helpers/clipboard.ts similarity index 89% rename from src/utils/clipboard.ts rename to src/helpers/clipboard.ts index 761cb82..68bc9e3 100644 --- a/src/utils/clipboard.ts +++ b/src/helpers/clipboard.ts @@ -1,4 +1,4 @@ -import { openToast } from '../components/Toast/api'; +import { openToast } from '../components/Toast'; export async function copyTextToClipboard(content: string, description?: string) { try { diff --git a/src/utils/error.ts b/src/helpers/error.ts similarity index 84% rename from src/utils/error.ts rename to src/helpers/error.ts index 777f5a8..9b916e7 100644 --- a/src/utils/error.ts +++ b/src/helpers/error.ts @@ -1,4 +1,4 @@ -import { openToast } from '../components/Toast/api'; +import { openToast } from '../components/Toast'; export function handleClientError({ error, title, description }: { error: any; title?: string; description?: string }) { console.error(error); diff --git a/src/utils/input-handlers.ts b/src/helpers/input-handlers.ts similarity index 100% rename from src/utils/input-handlers.ts rename to src/helpers/input-handlers.ts diff --git a/src/utils/merge-refs.ts b/src/helpers/merge-refs.ts similarity index 100% rename from src/utils/merge-refs.ts rename to src/helpers/merge-refs.ts diff --git a/src/index.ts b/src/index.ts index 405fd38..3b0b269 100644 --- a/src/index.ts +++ b/src/index.ts @@ -52,3 +52,10 @@ export * from './hooks/debounce'; // Contexts export { PagodaUiProvider } from './context/PagodaUi'; + +// Helpers + +export * from './helpers/clipboard'; +export * from './helpers/error'; +export * from './helpers/input-handlers'; +export * from './helpers/merge-refs'; diff --git a/src/utils/index.ts b/src/utils/index.ts index 248d418..2a01950 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,7 +1,7 @@ -export * from './clipboard'; -export * from './error'; -export * from './input-handlers'; -export * from './merge-refs'; +/* + Utilities are very generic helper methods that can be used in React and non-React environments (eg: Node) +*/ + export * from './number'; export * from './theme'; export * from './unreachable';