@bigbinary/neeto-molecules 1.1.44 → 1.1.46

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-molecules",
3
- "version": "1.1.44",
3
+ "version": "1.1.46",
4
4
  "description": "A package of reusable molecular components for neeto products.",
5
5
  "repository": "git@github.com:bigbinary/neeto-molecules.git",
6
6
  "author": "Amaljith K <amaljith.k@bigbinary.com>",
@@ -1,4 +1,23 @@
1
1
  import React from "react";
2
+ import { InputProps, ButtonProps } from "@bigbinary/neetoui";
3
+ export interface InlineInput extends InputProps {
4
+ className?: string;
5
+ value?: string;
6
+ nullable?: boolean;
7
+ isSaving?: boolean;
8
+ saveOnBlur?: boolean;
9
+ clearOnSave?: boolean;
10
+ submitButtonProps?: ButtonProps;
11
+ cancelButtonProps?: ButtonProps;
12
+ handleSubmit: (value: string) => void;
13
+ handleCancel: (value: string) => void;
14
+ }
15
+ export interface FormikInlineInputProps extends InlineInputProps {
16
+ name: string;
17
+ handleSubmit?: (value: string) => void;
18
+ handleCancel?: (value: string) => void;
19
+ }
20
+ export
2
21
  /**
3
22
  *
4
23
  * An input field with built-in functionality for handling saving and cancelling
@@ -38,15 +57,29 @@ import React from "react";
38
57
  * );
39
58
  * };
40
59
  * @endexample
60
+ * The InlineInput component wrapped in Formik.
61
+ *
62
+ * @example
63
+ *
64
+ * import { FormikInlineInput } from "@bigbinary/neeto-molecules/InlineInput";
65
+ * import { Form } from "@bigbinary/neetoui/formik";
66
+ *
67
+ * const App = () => (
68
+ * return (
69
+ * <Form
70
+ * formikProps={{
71
+ * initialValues: { taskName: "task" },
72
+ * validationSchema: yup.object({ taskName: yup
73
+ * .string()
74
+ * .matches(/^[a-z]+$/, "All letters should be lowercase") }),
75
+ * onSubmit: handleSubmit,
76
+ * }}
77
+ * >
78
+ * <FormikInlineInput name="taskName" />
79
+ * </Form>
80
+ * );
81
+ * );
82
+ * @endexample
41
83
  */
42
- const InlineInput: React.FC<{
43
- className?: string;
44
- value?: string;
45
- nullable?: boolean;
46
- isSaving?: boolean;
47
- saveOnBlur?: boolean;
48
- clearOnSave?: boolean;
49
- handleSubmit: (value: string) => void;
50
- handleCancel: (value: string) => void;
51
- }>;
52
- export default InlineInput;
84
+ const InlineInput: React.ForwardRefExoticComponent<InlineInputProps>;
85
+ export const FormikInlineInput: React.ForwardRefExoticComponent<FormikInlineInputProps>;