Skip to content

Commit

Permalink
Fixing handleClientError and copyTextToClipboard openToast()
Browse files Browse the repository at this point in the history
  • Loading branch information
calebjacob committed Dec 12, 2024
1 parent 9672a70 commit 664893b
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Combobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
4 changes: 2 additions & 2 deletions src/components/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Tabs/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<ComponentProps<typeof Primitive.Root>, 'size' | 'variant'> & {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/clipboard.ts → src/helpers/clipboard.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { openToast } from '../components/Toast/api';
import { openToast } from '../components/Toast';

export async function copyTextToClipboard(content: string, description?: string) {
try {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/error.ts → src/helpers/error.ts
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
8 changes: 4 additions & 4 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -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';

0 comments on commit 664893b

Please sign in to comment.