Skip to content

Commit

Permalink
fix: refactor forms (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
totraev authored Dec 12, 2024
1 parent b137d89 commit fb1cd98
Show file tree
Hide file tree
Showing 22 changed files with 24 additions and 19 deletions.
5 changes: 5 additions & 0 deletions .changeset/giant-queens-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@babylonlabs-io/bbn-core-ui": patch
---

refactor form
14 changes: 7 additions & 7 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ export * from "./components/Loader";
export * from "./components/Table";
export * from "./components/Popover";

export * from "./widgets/inputs/Form";
export * from "./widgets/inputs/NumberField";
export * from "./widgets/inputs/TextField";
export * from "./widgets/inputs/CheckboxField";
export * from "./widgets/inputs/RadioField";
export * from "./widgets/inputs/SelectField";
export * from "./widgets/inputs/hooks";
export * from "./widgets/form/Form";
export * from "./widgets/form/NumberField";
export * from "./widgets/form/TextField";
export * from "./widgets/form/CheckboxField";
export * from "./widgets/form/RadioField";
export * from "./widgets/form/SelectField";
export * from "./widgets/form/hooks";

export { ScrollLocker } from "./context/Dialog.context";
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from "@storybook/react";

import { Form } from "../Form";
import { Form } from "@/widgets/form/Form";

import { CheckboxField } from "./CheckboxField";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type CheckboxProps, Checkbox } from "@/components/Form/Checkbox";
import { useField } from "../hooks";
import { useField } from "@/widgets/form/hooks";

export interface CheckboxFieldProps extends CheckboxProps {
name: string;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as yup from "yup";

import { Form } from "./Form";

import { useField } from "../hooks";
import { useField } from "@/widgets/form/hooks";
import { Input, FormControl } from "@/components/Form";

const meta: Meta<typeof Form> = {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react";
import * as yup from "yup";

import { NumberField } from "./NumberField";
import { Form } from "../Form";
import { Form } from "@/widgets/form/Form";

const meta: Meta<typeof NumberField> = {
component: NumberField,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ChangeEventHandler, ReactNode } from "react";

import { FormControl, Input } from "@/components/Form";
import type { FieldProps } from "../types";
import { useField } from "../hooks";
import type { FieldProps } from "@/widgets/form/types";
import { useField } from "@/widgets/form/hooks";

export interface NumberFieldProps extends FieldProps {
type?: "text" | "hidden" | "number" | "password" | "tel" | "url" | "email";
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from "@storybook/react";

import { Form } from "../Form";
import { Form } from "@/widgets/form/Form";

import { RadioField } from "./RadioField";

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ReactNode } from "react";

import { type Option, FormControl, Select } from "@/components/Form";
import type { FieldProps } from "../types";
import { useField } from "../hooks";
import type { FieldProps } from "@/widgets/form/types";
import { useField } from "@/widgets/form/hooks";

export interface SelectFieldProps extends FieldProps {
open?: boolean;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/react";
import * as yup from "yup";

import { TextField } from "./TextField";
import { Form } from "../Form";
import { Form } from "@/widgets/form/Form";

const meta: Meta<typeof TextField> = {
component: TextField,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ReactNode } from "react";

import { FormControl, Input } from "@/components/Form";
import type { FieldProps } from "../types";
import { useField } from "../hooks";
import type { FieldProps } from "@/widgets/form/types";
import { useField } from "@/widgets/form/hooks";

export interface TextFieldProps extends FieldProps {
type?: "text" | "hidden" | "number" | "password" | "tel" | "url" | "email";
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit fb1cd98

Please sign in to comment.