Skip to content

Commit

Permalink
Merge branch 'feat/TUP-700-core-components-node-pkg--wrappers' into f…
Browse files Browse the repository at this point in the history
…eat/TUP-700-core-components-node-pkg--storybook
  • Loading branch information
wesleyboar committed May 10, 2024
2 parents 63307c3 + de94a2f commit faa8d23
Show file tree
Hide file tree
Showing 58 changed files with 53 additions and 189 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React, { useCallback, useMemo } from 'react';
import useWizardValues, { UIWizardProvider } from './useWizardValues';
import { UIWizardStep, UIWizardSchema, UIWizardExtra } from '.';
import { Wizard, WizardStep } from '@tacc/core-wrappers';
import { Wizard, WizardStep } from '@tacc/core-components';
import wizardSteps from './steps';

export const UIPatternsComplexWizardRender: React.FC<{
Expand All @@ -26,7 +26,7 @@ export const UIPatternsComplexWizardRender: React.FC<{
[add]
);

// Map Array of UIWizardSteps into an array of @tacc/core-wrappers/WizardStep
// Map Array of UIWizardSteps into an array of @tacc/core-components/WizardStep
const steps: Array<WizardStep<UIWizardSchema>> = useMemo(() => {
return wizardSteps.map((jobStep) => {
const { generateInitialValues, validateThunk, ...stepProps } = jobStep;
Expand Down
2 changes: 1 addition & 1 deletion apps/ui-patterns/src/app/UIPatternsComplexWizard/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export type InitialValueGenerator = (hookValues: {
extra: UIWizardExtra;
}) => Partial<UIWizardSchema>;

// An adapter type for mapping additional values to @tacc/core-wrappers/Wizard
// An adapter type for mapping additional values to @tacc/core-components/Wizard
export type UIWizardStep = {
id: string;
name: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useCallback, useState, useMemo } from 'react';
import * as Yup from 'yup';
import { UIWizardStep, UIWizardSchema, InitialValueGenerator } from '..';
import { Button } from '@tacc/core-components';
import { SubmitWrapper } from '@tacc/core-wrappers';
import { SubmitWrapper } from '@tacc/core-components';
import { validationSchema as stepOneValidationSchema } from './StepOne';
import { validationSchema as stepTwoValidationSchema } from './StepTwo';
import { validationSchema as stepThreeValidationSchema } from './StepThree';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FormikInput } from '@tacc/core-wrappers';
import { FormikInput } from '@tacc/core-components';
import * as Yup from 'yup';
import { UIWizardStep, useWizardValues, InitialValueGenerator } from '..';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { FormGroup } from 'reactstrap';
import { Collapse, Button } from '@tacc/core-components';
import { FieldArray, useFormikContext, FieldArrayRenderProps } from 'formik';
import { FormikInput, FormikCheck } from '@tacc/core-wrappers';
import { FormikInput, FormikCheck } from '@tacc/core-components';
import * as Yup from 'yup';
import fieldArrayStyles from './FieldArray.module.css';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Button } from '@tacc/core-components';
import fieldArrayStyles from './FieldArray.module.css';
import { Collapse } from '@tacc/core-components';
import { FieldArray, useFormikContext, FieldArrayRenderProps } from 'formik';
import { FormikInput, FormikCheck } from '@tacc/core-wrappers';
import { FormikInput, FormikCheck } from '@tacc/core-components';
import {
UIWizardStep,
UIWizardComplexField,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React, { useCallback } from 'react';
import { UIWizardSchema } from '.';
import { UIWizardProvider, useWizardValues } from '.';
import { Wizard } from '@tacc/core-wrappers';
import { Wizard } from '@tacc/core-components';
import wizardSteps from './steps';

const UIPatternsWizardRender: React.FC = () => {
Expand Down
4 changes: 2 additions & 2 deletions apps/ui-patterns/src/app/UIPatternsWizard/steps/LastStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React, { useCallback, useState, useMemo } from 'react';
import * as Yup from 'yup';
import { UIWizardSchema, useWizardValues } from '..';
import { Button } from '@tacc/core-components';
import { SubmitWrapper } from '@tacc/core-wrappers';
import { WizardStep } from '@tacc/core-wrappers';
import { SubmitWrapper } from '@tacc/core-components';
import { WizardStep } from '@tacc/core-components';
import { validationSchema as stepOneValidationSchema } from './StepOne';
import { validationSchema as stepTwoValidationSchema } from './StepTwo';
import { validationSchema as stepThreeValidationSchema } from './StepThree';
Expand Down
4 changes: 2 additions & 2 deletions apps/ui-patterns/src/app/UIPatternsWizard/steps/StepOne.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FormikInput } from '@tacc/core-wrappers';
import { WizardStep } from '@tacc/core-wrappers';
import { FormikInput } from '@tacc/core-components';
import { WizardStep } from '@tacc/core-components';
import * as Yup from 'yup';
import { useWizardValues, UIWizardSchema } from '..';

Expand Down
4 changes: 2 additions & 2 deletions apps/ui-patterns/src/app/UIPatternsWizard/steps/StepThree.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FormikInput } from '@tacc/core-wrappers';
import { WizardStep } from '@tacc/core-wrappers';
import { FormikInput } from '@tacc/core-components';
import { WizardStep } from '@tacc/core-components';
import * as Yup from 'yup';
import { useWizardValues, UIWizardSchema } from '..';

Expand Down
4 changes: 2 additions & 2 deletions apps/ui-patterns/src/app/UIPatternsWizard/steps/StepTwo.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FormikInput } from '@tacc/core-wrappers';
import { WizardStep } from '@tacc/core-wrappers';
import { FormikInput } from '@tacc/core-components';
import { WizardStep } from '@tacc/core-components';
import * as Yup from 'yup';
import { useWizardValues, UIWizardSchema } from '..';

Expand Down
16 changes: 16 additions & 0 deletions libs/core-components/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { WizardStep as WizardStepType } from './lib/Wizard';

export { default as Button } from './lib/Button';
export { default as Icon } from './lib/Icon';
export { default as Section } from './lib/Section';
Expand All @@ -19,4 +21,18 @@ export { default as Collapse } from './lib/Collapse';
export { default as TextCopyField } from './lib/TextCopyField';
export * from './lib/Form';

export { Navbar, NavItem, QueryNavItem, AnchorNavItem } from './lib/Navbar';
export { default as QueryWrapper } from './lib/QueryWrapper';
export { default as SubmitWrapper } from './lib/SubmitWrapper';
export { default as Wizard, useWizard, WizardNavigation } from './lib/Wizard';
export type WizardStep<T> = WizardStepType<T>;
export {
FormikFieldWrapper,
FormikInput,
FormikSelect,
FormikCheck,
FormikTextarea,
FormikFileInput,
} from './lib/FormikFieldWrapper';

export { default as withBuilder } from './utils/withBuilder';
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useState } from 'react';
import { testRender } from '@tacc/tup-testing';
import { render } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';
import FileDropzone from './FileDropzone';
import { screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
Expand Down Expand Up @@ -28,7 +29,7 @@ describe('dropzone', () => {
const smallFile = new File(['file'], 'myfile.json', {
type: 'application/json',
});
testRender(<FileDropzoneWrapper maxSize={100000} />);
render(<FileDropzoneWrapper maxSize={100000} />);
const input = screen.getByTestId('dropzone-input');
await userEvent.upload(input, smallFile);
expect(screen.getByText('myfile.json')).toBeDefined();
Expand All @@ -37,7 +38,7 @@ describe('dropzone', () => {

it('Shows error when file is too big.', async () => {
const bigFile = new File(['hi'], 'myfile', { type: 'image/jpeg' });
testRender(<FileDropzoneWrapper maxSize={0} />);
render(<FileDropzoneWrapper maxSize={0} />);
const input = screen.getByTestId('dropzone-input');
await userEvent.upload(input, bigFile);
expect(screen.getByText(/Exceeds File Size Limit/)).toBeDefined();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, useState } from 'react';
import { NavLink } from 'react-router-dom';
import { Icon } from '@tacc/core-components';
import styles from './NavbarWrapper.module.css';
import styles from './Navbar.module.css';

type sizes = 'xs' | 'sm' | 'md' | 'lg';

Expand Down
2 changes: 2 additions & 0 deletions libs/core-components/src/lib/Navbar/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as Navbar } from './Navbar';
export { NavItem, QueryNavItem, AnchorNavItem } from './Navbar';
File renamed without changes.
18 changes: 0 additions & 18 deletions libs/core-wrappers/.eslintrc.json

This file was deleted.

7 changes: 0 additions & 7 deletions libs/core-wrappers/README.md

This file was deleted.

21 changes: 0 additions & 21 deletions libs/core-wrappers/project.json

This file was deleted.

19 changes: 0 additions & 19 deletions libs/core-wrappers/src/index.ts

This file was deleted.

2 changes: 0 additions & 2 deletions libs/core-wrappers/src/lib/NavbarWrapper/index.ts

This file was deleted.

21 changes: 0 additions & 21 deletions libs/core-wrappers/tsconfig.json

This file was deleted.

22 changes: 0 additions & 22 deletions libs/core-wrappers/tsconfig.lib.json

This file was deleted.

19 changes: 0 additions & 19 deletions libs/core-wrappers/tsconfig.spec.json

This file was deleted.

29 changes: 0 additions & 29 deletions libs/core-wrappers/vite.config.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useCallback } from 'react';
import { useLocation, Location, useSearchParams } from 'react-router-dom';
import { useAuth } from '@tacc/tup-hooks';
import { Formik, Form } from 'formik';
import { FormikInput } from '@tacc/core-wrappers';
import { FormikInput } from '@tacc/core-components';
import { Button } from '@tacc/core-components';
import styles from './LoginComponent.module.css';
import { blackLogo } from '../../../assets';
Expand Down
2 changes: 1 addition & 1 deletion libs/tup-components/src/layout/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Navbar, NavItem } from '@tacc/core-wrappers';
import { Navbar, NavItem } from '@tacc/core-components';
// import { useAuth } from '@tacc/tup-hooks';
import styles from './Sidebar.module.css';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { QueryNavItem } from '@tacc/core-wrappers';
import { QueryNavItem } from '@tacc/core-components';
import { useLocation } from 'react-router-dom';
import styles from './ProjectsListing.module.css';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import {
useProjectScienceField,
ProjectEditBody,
} from '@tacc/tup-hooks';
import { FormikInput, FormikSelect, FormikTextarea } from '@tacc/core-wrappers';
import {
FormikInput,
FormikSelect,
FormikTextarea,
} from '@tacc/core-components';
import * as Yup from 'yup';
import { ModalFooter } from 'reactstrap';
import { Button, SectionMessage } from '@tacc/core-components';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

import { useProjectScienceField } from '@tacc/tup-hooks';
import { FormikInput, FormikSelect } from '@tacc/core-wrappers';
import { FormikInput, FormikSelect } from '@tacc/core-components';
import { LoadingSpinner } from '@tacc/core-components';

import styles from './ProjectGrantForm.module.css';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { Field } from 'formik';
//import ReCAPTCHA from 'react-google-recaptcha';
import { FormikInput } from '@tacc/core-wrappers';
import { FormikInput } from '@tacc/core-components';
import styles from './ProjectPublicationForm.module.css';

const ProjectPublicationFormFields: React.FC = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { useProjectUsers } from '@tacc/tup-hooks';
import { NavItem } from '@tacc/core-wrappers';
import { NavItem } from '@tacc/core-components';
import styles from './UserList.module.css';
import { LoadingSpinner } from '@tacc/core-components';
import ManageTeam from './ManageTeam';
Expand Down
Loading

0 comments on commit faa8d23

Please sign in to comment.