@bigbinary/neeto-molecules 1.12.1 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,51 @@
1
+ import React from "react";
2
+ import { TextareaProps } from "@bigbinary/neetoui";
3
+ export interface AdaptiveInputProps extends TextareaProps {
4
+ label: string;
5
+ className?: string;
6
+ size: "small" | "medium" | "large";
7
+ required?: boolean;
8
+ disabled?: boolean;
9
+ suffix?: React.ReactNode;
10
+ }
11
+ export interface FormikAdaptiveInputProps extends AdaptiveInputProps {
12
+ name: string;
13
+ }
14
+ export
15
+ /**
16
+ *
17
+ * An input component that dynamically adjusts between single-line and multi-line
18
+ *
19
+ * input based on content length.
20
+ *
21
+ * @example
22
+ *
23
+ * import { AdaptiveInput } from "@bigbinary/neeto-molecules/AdaptiveInput";
24
+ *
25
+ * const Description = () => (
26
+ * <div className="flex-grow">
27
+ * <AdaptiveInput required label="Description" />
28
+ * </div>
29
+ * );
30
+ * @endexample
31
+ * The AdaptiveInput component wrapped in Formik.
32
+ *
33
+ * @example
34
+ *
35
+ * import { FormikAdaptiveInput } from "@bigbinary/neeto-molecules/AdaptiveInput";
36
+ * import { Form } from "@bigbinary/neetoui/formik";
37
+ *
38
+ * const App = () => (
39
+ * <Form
40
+ * formikProps={{
41
+ * initialValues: { description: "Sample description" },
42
+ * validationSchema: yup.string().required(),
43
+ * }}
44
+ * >
45
+ * <FormikAdaptiveInput required name="description" />
46
+ * </Form>
47
+ * );
48
+ * @endexample
49
+ */
50
+ const AdaptiveInput: React.ForwardRefExoticComponent<AdaptiveInputProps>;
51
+ export const FormikAdaptiveInput: React.ForwardRefExoticComponent<FormikAdaptiveInputProps>;