0.4.5 • Published 9 months ago

@highoutput/hds-forms v0.4.5

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

Getting started

We aim to build a library of custom ReactJS components that implements our unique UI design conventions. The ReactJS components will be based primarily on Chakra UI components. React Storybook will be used for documentation and testing.

Commands

To install the package, use:

npm i @highoutput/hds-forms

Usage

// feedback-form.tsx
import { chakra } from '@chakra-ui/react';
import { yupResolver } from '@hookform/resolvers/yup';
import * as React from 'react';
import { useForm } from 'react-hook-form';
import * as yup from 'yup';
import { TextAreaField } from './src';

const schema = yup.object({
  feedback: yup.string().min(5).max(150).trim(),
});

type Schema = yup.InferType<typeof schema>;

export default function Component() {
  const { register, formState, handleSubmit } = useForm<Schema>({
    shouldUnregister: true,
    shouldFocusError: true,
    resolver: yupResolver(schema),
    defaultValues: {
      feedback: '',
    },
  });

  return (
    <chakra.form onSubmit={handleSubmit(function noop() {})}>
      <TextAreaField
        label="Leave a Feedback"
        errorMsg={formState.errors.feedback?.message}
        placeholder="Enter comment..."
        {...register('feedback')}
      />

      <chakra.button type="submit" disabled={formState.isSubmitting}>
        Submit
      </chakra.button>
    </chakra.form>
  );
}
0.4.5

9 months ago

0.3.6

1 year ago

0.3.5

1 year ago

0.3.2

1 year ago

0.3.1

1 year ago

0.4.4

11 months ago

0.4.3

11 months ago

0.4.2

12 months ago

0.2.16

1 year ago

0.2.14

1 year ago

0.2.13

1 year ago

0.2.12

1 year ago

0.2.11

1 year ago

0.2.10

1 year ago

0.3.0

1 year ago

0.2.6

1 year ago

0.2.9

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.29

1 year ago

0.1.28

1 year ago

0.1.27

1 year ago

0.1.26

1 year ago

0.1.25

1 year ago

0.1.24

1 year ago

0.1.23

1 year ago

0.1.22

1 year ago

0.1.21

1 year ago

0.1.20

1 year ago

0.1.19

1 year ago

0.1.18

1 year ago

0.1.17

1 year ago

0.1.16

1 year ago

0.1.15

1 year ago

0.1.12

1 year ago

0.1.11

1 year ago

0.1.10

1 year ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago