Skip to content

Commit

Permalink
feature/CC 3 drop down (#12)
Browse files Browse the repository at this point in the history
* Fix imports Reac Hook Form, perDependencies

* Fix types

* Update version package-lock
  • Loading branch information
joaltoroc authored Jan 2, 2024
1 parent 8ae205f commit 0b1dfcd
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 23 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ yarn add @creativecodeco/ui
### Dependencies

```bash
npm install --save-dev tailwindcss postcss postcss-import autoprefixer
npm install --save-dev tailwindcss postcss postcss-import autoprefixer usehooks-ts

or

yarn add -D tailwindcss postcss postcss-import autoprefixer
yarn add -D tailwindcss postcss postcss-import autoprefixer usehooks-ts
```

### Setting Tailwind
Expand Down
17 changes: 9 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"UI",
"Framework Design"
],
"version": "0.0.3",
"version": "0.0.4",
"homepage": "https://github.com/creativecodeco/ui",
"author": {
"name": "John Toro",
Expand Down Expand Up @@ -43,18 +43,19 @@
"postcss-import": "15.1.0",
"react": "18.2.0",
"react-hook-form": "7.49.2",
"tailwindcss": "3.4.0"
"tailwindcss": "3.4.0",
"usehooks-ts": "2.9.1"
},
"devDependencies": {
"@babel/core": "7.23.7",
"@babel/preset-env": "^7.23.7",
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@babel/preset-env": "7.23.7",
"@babel/preset-react": "7.23.3",
"@babel/preset-typescript": "7.23.3",
"@jest/globals": "29.7.0",
"@storybook/addon-essentials": "7.6.7",
"@storybook/addon-interactions": "7.6.7",
"@storybook/addon-links": "7.6.7",
"@storybook/addon-mdx-gfm": "^7.6.7",
"@storybook/addon-mdx-gfm": "7.6.7",
"@storybook/blocks": "7.6.7",
"@storybook/react": "7.6.7",
"@storybook/react-webpack5": "7.6.7",
Expand Down Expand Up @@ -111,7 +112,7 @@
"tsc-alias": "1.8.8",
"tsconfig-paths-webpack-plugin": "4.1.0",
"typescript": "5.3.3",
"usehooks-ts": "^2.9.1"
"usehooks-ts": "2.9.1"
},
"files": [
"lib"
Expand Down
4 changes: 2 additions & 2 deletions src/docs/getting-started.docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ yarn add @creativecodeco/ui
### Dependencies

```bash
npm install --save-dev tailwindcss postcss postcss-import autoprefixer
npm install --save-dev tailwindcss postcss postcss-import autoprefixer usehooks-ts

or

yarn add -D tailwindcss postcss postcss-import autoprefixer
yarn add -D tailwindcss postcss postcss-import autoprefixer usehooks-ts
```

### Setting Tailwind
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/react-hook-form/controller.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
Controller as RHFController
} from 'react-hook-form';

import { ControllerType } from '@/types/helpers/controller.types';
import type { ControllerType } from '@/types/helpers/controller.types';

export default function Controller<
TFieldValues extends FieldValues = FieldValues,
Expand Down
4 changes: 3 additions & 1 deletion src/helpers/react-hook-form/controller.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { act, render, renderHook, screen } from '@testing-library/react';
import { useForm } from 'react-hook-form';
import Controller from './controller.component';

import { TextBox } from '@/ui/forms';

import Controller from './controller.component';

describe('<Controller />', () => {
test('render the input with value', () => {
const { result } = renderHook(() => useForm());
Expand Down
8 changes: 6 additions & 2 deletions src/types/helpers/controller.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ import type {
ControllerProps as RHFControllerProps
} from 'react-hook-form';

import { TextBox } from '@/ui/forms';
import { DropDown, TextBox } from '@/ui/forms';

type TextBoxType = {
as: typeof TextBox;
} & React.ComponentProps<typeof TextBox>;

type Inputs = TextBoxType;
type DropDownType = {
as: typeof DropDown;
} & React.ComponentProps<typeof DropDown>;

type Inputs = TextBoxType | DropDownType;

export type ControllerType<
TFieldValues extends FieldValues = FieldValues,
Expand Down

0 comments on commit 0b1dfcd

Please sign in to comment.