@toptal/picasso-forms 6.0.4 → 6.0.5
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/CHANGELOG.md +657 -0
- package/{Autocomplete → dist-package/Autocomplete}/Autocomplete.d.ts +0 -0
- package/{Autocomplete → dist-package/Autocomplete}/Autocomplete.js +0 -0
- package/{Autocomplete → dist-package/Autocomplete}/Autocomplete.js.map +0 -0
- package/{Autocomplete → dist-package/Autocomplete}/index.d.ts +0 -0
- package/{Autocomplete → dist-package/Autocomplete}/index.js +0 -0
- package/{Autocomplete → dist-package/Autocomplete}/index.js.map +0 -0
- package/{ButtonCheckbox → dist-package/ButtonCheckbox}/ButtonCheckbox.d.ts +0 -0
- package/{ButtonCheckbox → dist-package/ButtonCheckbox}/ButtonCheckbox.js +0 -0
- package/{ButtonCheckbox → dist-package/ButtonCheckbox}/ButtonCheckbox.js.map +0 -0
- package/{ButtonCheckbox → dist-package/ButtonCheckbox}/index.d.ts +0 -0
- package/{ButtonCheckbox → dist-package/ButtonCheckbox}/index.js +0 -0
- package/{ButtonCheckbox → dist-package/ButtonCheckbox}/index.js.map +0 -0
- package/{ButtonRadio → dist-package/ButtonRadio}/ButtonRadio.d.ts +0 -0
- package/{ButtonRadio → dist-package/ButtonRadio}/ButtonRadio.js +0 -0
- package/{ButtonRadio → dist-package/ButtonRadio}/ButtonRadio.js.map +0 -0
- package/{ButtonRadio → dist-package/ButtonRadio}/index.d.ts +0 -0
- package/{ButtonRadio → dist-package/ButtonRadio}/index.js +0 -0
- package/{ButtonRadio → dist-package/ButtonRadio}/index.js.map +0 -0
- package/{Checkbox → dist-package/Checkbox}/Checkbox.d.ts +0 -0
- package/{Checkbox → dist-package/Checkbox}/Checkbox.js +0 -0
- package/{Checkbox → dist-package/Checkbox}/Checkbox.js.map +0 -0
- package/{Checkbox → dist-package/Checkbox}/index.d.ts +0 -0
- package/{Checkbox → dist-package/Checkbox}/index.js +0 -0
- package/{Checkbox → dist-package/Checkbox}/index.js.map +0 -0
- package/{CheckboxGroup → dist-package/CheckboxGroup}/CheckboxGroup.d.ts +0 -0
- package/{CheckboxGroup → dist-package/CheckboxGroup}/CheckboxGroup.js +0 -0
- package/{CheckboxGroup → dist-package/CheckboxGroup}/CheckboxGroup.js.map +0 -0
- package/{CheckboxGroup → dist-package/CheckboxGroup}/CheckboxGroupContext.d.ts +0 -0
- package/{CheckboxGroup → dist-package/CheckboxGroup}/CheckboxGroupContext.js +0 -0
- package/{CheckboxGroup → dist-package/CheckboxGroup}/CheckboxGroupContext.js.map +0 -0
- package/{CheckboxGroup → dist-package/CheckboxGroup}/index.d.ts +0 -0
- package/{CheckboxGroup → dist-package/CheckboxGroup}/index.js +0 -0
- package/{CheckboxGroup → dist-package/CheckboxGroup}/index.js.map +0 -0
- package/{DatePicker → dist-package/DatePicker}/DatePicker.d.ts +0 -0
- package/{DatePicker → dist-package/DatePicker}/DatePicker.js +0 -0
- package/{DatePicker → dist-package/DatePicker}/DatePicker.js.map +0 -0
- package/{DatePicker → dist-package/DatePicker}/index.d.ts +0 -0
- package/{DatePicker → dist-package/DatePicker}/index.js +0 -0
- package/{DatePicker → dist-package/DatePicker}/index.js.map +0 -0
- package/{FieldWrapper → dist-package/FieldWrapper}/FieldWrapper.d.ts +0 -0
- package/{FieldWrapper → dist-package/FieldWrapper}/FieldWrapper.js +0 -0
- package/{FieldWrapper → dist-package/FieldWrapper}/FieldWrapper.js.map +0 -0
- package/{FieldWrapper → dist-package/FieldWrapper}/index.d.ts +0 -0
- package/{FieldWrapper → dist-package/FieldWrapper}/index.js +0 -0
- package/{FieldWrapper → dist-package/FieldWrapper}/index.js.map +0 -0
- package/{FileInput → dist-package/FileInput}/FileInput.d.ts +0 -0
- package/{FileInput → dist-package/FileInput}/FileInput.js +0 -0
- package/{FileInput → dist-package/FileInput}/FileInput.js.map +0 -0
- package/{FileInput → dist-package/FileInput}/index.d.ts +0 -0
- package/{FileInput → dist-package/FileInput}/index.js +0 -0
- package/{FileInput → dist-package/FileInput}/index.js.map +0 -0
- package/{Form → dist-package/Form}/Form.d.ts +0 -0
- package/{Form → dist-package/Form}/Form.js +0 -0
- package/{Form → dist-package/Form}/Form.js.map +0 -0
- package/{Form → dist-package/Form}/FormContext.d.ts +0 -0
- package/{Form → dist-package/Form}/FormContext.js +0 -0
- package/{Form → dist-package/Form}/FormContext.js.map +0 -0
- package/{Form → dist-package/Form}/index.d.ts +0 -0
- package/{Form → dist-package/Form}/index.js +0 -0
- package/{Form → dist-package/Form}/index.js.map +0 -0
- package/{FormConfig → dist-package/FormConfig}/FormConfig.d.ts +0 -0
- package/{FormConfig → dist-package/FormConfig}/FormConfig.js +0 -0
- package/{FormConfig → dist-package/FormConfig}/FormConfig.js.map +0 -0
- package/{FormConfig → dist-package/FormConfig}/index.d.ts +0 -0
- package/{FormConfig → dist-package/FormConfig}/index.js +0 -0
- package/{FormConfig → dist-package/FormConfig}/index.js.map +0 -0
- package/{Input → dist-package/Input}/Input.d.ts +0 -0
- package/{Input → dist-package/Input}/Input.js +0 -0
- package/{Input → dist-package/Input}/Input.js.map +0 -0
- package/{Input → dist-package/Input}/index.d.ts +0 -0
- package/{Input → dist-package/Input}/index.js +0 -0
- package/{Input → dist-package/Input}/index.js.map +0 -0
- package/{Input → dist-package/Input}/utils/get-input-name.d.ts +0 -0
- package/{Input → dist-package/Input}/utils/get-input-name.js +0 -0
- package/{Input → dist-package/Input}/utils/get-input-name.js.map +0 -0
- package/{Input → dist-package/Input}/utils/get-input-name.test.d.ts +0 -0
- package/{Input → dist-package/Input}/utils/get-input-name.test.js +0 -0
- package/{Input → dist-package/Input}/utils/get-input-name.test.js.map +0 -0
- package/{NumberInput → dist-package/NumberInput}/NumberInput.d.ts +0 -0
- package/{NumberInput → dist-package/NumberInput}/NumberInput.js +0 -0
- package/{NumberInput → dist-package/NumberInput}/NumberInput.js.map +0 -0
- package/{NumberInput → dist-package/NumberInput}/index.d.ts +0 -0
- package/{NumberInput → dist-package/NumberInput}/index.js +0 -0
- package/{NumberInput → dist-package/NumberInput}/index.js.map +0 -0
- package/dist-package/README.md +29 -0
- package/{Radio → dist-package/Radio}/Radio.d.ts +0 -0
- package/{Radio → dist-package/Radio}/Radio.js +0 -0
- package/{Radio → dist-package/Radio}/Radio.js.map +0 -0
- package/{Radio → dist-package/Radio}/index.d.ts +0 -0
- package/{Radio → dist-package/Radio}/index.js +0 -0
- package/{Radio → dist-package/Radio}/index.js.map +0 -0
- package/{RadioGroup → dist-package/RadioGroup}/RadioGroup.d.ts +0 -0
- package/{RadioGroup → dist-package/RadioGroup}/RadioGroup.js +0 -0
- package/{RadioGroup → dist-package/RadioGroup}/RadioGroup.js.map +0 -0
- package/{RadioGroup → dist-package/RadioGroup}/RadioGroupContext.d.ts +0 -0
- package/{RadioGroup → dist-package/RadioGroup}/RadioGroupContext.js +0 -0
- package/{RadioGroup → dist-package/RadioGroup}/RadioGroupContext.js.map +0 -0
- package/{RadioGroup → dist-package/RadioGroup}/index.d.ts +0 -0
- package/{RadioGroup → dist-package/RadioGroup}/index.js +0 -0
- package/{RadioGroup → dist-package/RadioGroup}/index.js.map +0 -0
- package/{Rating → dist-package/Rating}/Rating.d.ts +0 -0
- package/{Rating → dist-package/Rating}/Rating.js +0 -0
- package/{Rating → dist-package/Rating}/Rating.js.map +0 -0
- package/{Rating → dist-package/Rating}/index.d.ts +0 -0
- package/{Rating → dist-package/Rating}/index.js +0 -0
- package/{Rating → dist-package/Rating}/index.js.map +0 -0
- package/{Select → dist-package/Select}/Select.d.ts +0 -0
- package/{Select → dist-package/Select}/Select.js +0 -0
- package/{Select → dist-package/Select}/Select.js.map +0 -0
- package/{Select → dist-package/Select}/index.d.ts +0 -0
- package/{Select → dist-package/Select}/index.js +0 -0
- package/{Select → dist-package/Select}/index.js.map +0 -0
- package/{SubmitButton → dist-package/SubmitButton}/SubmitButton.d.ts +0 -0
- package/{SubmitButton → dist-package/SubmitButton}/SubmitButton.js +0 -0
- package/{SubmitButton → dist-package/SubmitButton}/SubmitButton.js.map +0 -0
- package/{SubmitButton → dist-package/SubmitButton}/index.d.ts +0 -0
- package/{SubmitButton → dist-package/SubmitButton}/index.js +0 -0
- package/{SubmitButton → dist-package/SubmitButton}/index.js.map +0 -0
- package/{Switch → dist-package/Switch}/Switch.d.ts +0 -0
- package/{Switch → dist-package/Switch}/Switch.js +0 -0
- package/{Switch → dist-package/Switch}/Switch.js.map +0 -0
- package/{Switch → dist-package/Switch}/index.d.ts +0 -0
- package/{Switch → dist-package/Switch}/index.js +0 -0
- package/{Switch → dist-package/Switch}/index.js.map +0 -0
- package/{TagSelector → dist-package/TagSelector}/TagSelector.d.ts +0 -0
- package/{TagSelector → dist-package/TagSelector}/TagSelector.js +0 -0
- package/{TagSelector → dist-package/TagSelector}/TagSelector.js.map +0 -0
- package/{TagSelector → dist-package/TagSelector}/index.d.ts +0 -0
- package/{TagSelector → dist-package/TagSelector}/index.js +0 -0
- package/{TagSelector → dist-package/TagSelector}/index.js.map +0 -0
- package/{TimePicker → dist-package/TimePicker}/TimePicker.d.ts +0 -0
- package/{TimePicker → dist-package/TimePicker}/TimePicker.js +0 -0
- package/{TimePicker → dist-package/TimePicker}/TimePicker.js.map +0 -0
- package/{TimePicker → dist-package/TimePicker}/index.d.ts +0 -0
- package/{TimePicker → dist-package/TimePicker}/index.js +0 -0
- package/{TimePicker → dist-package/TimePicker}/index.js.map +0 -0
- package/{index.d.ts → dist-package/index.d.ts} +2 -1
- package/{index.js → dist-package/index.js} +0 -1
- package/dist-package/index.js.map +1 -0
- package/dist-package/package.json +44 -0
- package/{utils → dist-package/utils}/flat-map.d.ts +0 -0
- package/{utils → dist-package/utils}/flat-map.js +0 -0
- package/{utils → dist-package/utils}/flat-map.js.map +0 -0
- package/{utils → dist-package/utils}/index.d.ts +0 -0
- package/{utils → dist-package/utils}/index.js +0 -0
- package/{utils → dist-package/utils}/index.js.map +0 -0
- package/{utils → dist-package/utils}/scroll-to-error-decorator.d.ts +0 -0
- package/{utils → dist-package/utils}/scroll-to-error-decorator.js +0 -0
- package/{utils → dist-package/utils}/scroll-to-error-decorator.js.map +0 -0
- package/{utils → dist-package/utils}/validators.d.ts +0 -0
- package/{utils → dist-package/utils}/validators.js +0 -0
- package/{utils → dist-package/utils}/validators.js.map +0 -0
- package/package.json +4 -5
- package/src/Autocomplete/Autocomplete.tsx +21 -0
- package/src/Autocomplete/index.ts +1 -0
- package/src/ButtonCheckbox/ButtonCheckbox.tsx +57 -0
- package/src/ButtonCheckbox/index.ts +1 -0
- package/src/ButtonRadio/ButtonRadio.tsx +24 -0
- package/src/ButtonRadio/index.ts +1 -0
- package/src/Checkbox/Checkbox.tsx +73 -0
- package/src/Checkbox/__snapshots__/test.tsx.snap +254 -0
- package/src/Checkbox/index.ts +1 -0
- package/src/Checkbox/test.tsx +91 -0
- package/src/CheckboxGroup/CheckboxGroup.tsx +30 -0
- package/src/CheckboxGroup/CheckboxGroupContext.ts +3 -0
- package/src/CheckboxGroup/index.ts +3 -0
- package/src/CheckboxGroup/test.tsx +35 -0
- package/src/DatePicker/DatePicker.tsx +26 -0
- package/src/DatePicker/index.ts +1 -0
- package/src/FieldWrapper/FieldWrapper.tsx +287 -0
- package/src/FieldWrapper/index.ts +2 -0
- package/src/FieldWrapper/story/index.jsx +137 -0
- package/src/FileInput/FileInput.tsx +66 -0
- package/src/FileInput/index.ts +1 -0
- package/src/Form/Form.tsx +181 -0
- package/src/Form/FormContext.ts +38 -0
- package/src/Form/__image_snapshots__/form-default-snap.png +0 -0
- package/src/Form/__image_snapshots__/form-form-level-configurations-snap.png +0 -0
- package/src/Form/__snapshots__/test.tsx.snap +61 -0
- package/src/Form/index.ts +1 -0
- package/src/Form/story/BackendCommunication.example.tsx +139 -0
- package/src/Form/story/CustomFormLevelConfiguration.example.tsx +26 -0
- package/src/Form/story/CustomValidator.example.tsx +45 -0
- package/src/Form/story/Default.example.tsx +177 -0
- package/src/Form/story/FileInput.example.tsx +42 -0
- package/src/Form/story/ParseInput.example.tsx +28 -0
- package/src/Form/story/TitleCase.example.tsx +167 -0
- package/src/Form/story/ValidateOnSubmit.example.tsx +85 -0
- package/src/Form/story/index.jsx +203 -0
- package/src/Form/test.tsx +27 -0
- package/src/FormConfig/FormConfig.ts +12 -0
- package/src/FormConfig/index.ts +1 -0
- package/src/FormConfig/test.tsx +44 -0
- package/src/Input/Input.tsx +27 -0
- package/src/Input/index.ts +1 -0
- package/src/Input/test.tsx +34 -0
- package/src/Input/utils/get-input-name.test.ts +16 -0
- package/src/Input/utils/get-input-name.ts +11 -0
- package/src/NumberInput/NumberInput.tsx +45 -0
- package/src/NumberInput/index.ts +1 -0
- package/src/Radio/Radio.tsx +24 -0
- package/src/Radio/__snapshots__/test.tsx.snap +231 -0
- package/src/Radio/index.ts +1 -0
- package/src/Radio/test.tsx +49 -0
- package/src/RadioGroup/RadioGroup.tsx +39 -0
- package/src/RadioGroup/RadioGroupContext.ts +3 -0
- package/src/RadioGroup/index.ts +3 -0
- package/src/RadioGroup/test.tsx +35 -0
- package/src/Rating/Rating.tsx +22 -0
- package/src/Rating/index.ts +1 -0
- package/src/Select/Select.tsx +47 -0
- package/src/Select/index.ts +1 -0
- package/src/SubmitButton/SubmitButton.tsx +70 -0
- package/src/SubmitButton/__image_snapshots__/submitbutton-button-types-snap.png +0 -0
- package/src/SubmitButton/__image_snapshots__/submitbutton-default-snap.png +0 -0
- package/src/SubmitButton/index.ts +6 -0
- package/src/SubmitButton/story/ButtonTypes.example.tsx +46 -0
- package/src/SubmitButton/story/Default.example.tsx +15 -0
- package/src/SubmitButton/story/index.jsx +32 -0
- package/src/Switch/Switch.tsx +23 -0
- package/src/Switch/index.ts +1 -0
- package/src/TagSelector/TagSelector.tsx +25 -0
- package/src/TagSelector/index.ts +1 -0
- package/src/TimePicker/TimePicker.tsx +24 -0
- package/src/TimePicker/index.ts +1 -0
- package/src/index.ts +16 -0
- package/src/story/Deserialization.example.tsx +34 -0
- package/src/story/FormSpy.example.tsx +42 -0
- package/src/story/index.jsx +37 -0
- package/src/utils/flat-map.ts +4 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/scroll-to-error-decorator.ts +78 -0
- package/src/utils/validators.ts +18 -0
- package/tsconfig.build.json +7 -0
- package/index.js.map +0 -1
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# @toptal/picasso-forms
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@toptal/picasso-forms)
|
|
4
|
+
|
|
5
|
+
This package combines the state-management power of [React Final Form](https://final-form.org/react) with the amazing UX of Picasso. It also provides access to [React Final Form Arrays](https://github.com/final-form/react-final-form-arrays).
|
|
6
|
+
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
The following peer dependencies are required:
|
|
10
|
+
|
|
11
|
+
- `@toptal/picasso`
|
|
12
|
+
- `@toptal/picasso-lab`
|
|
13
|
+
- `@toptal/picasso-shared`
|
|
14
|
+
- `react`
|
|
15
|
+
- `react-dom`
|
|
16
|
+
|
|
17
|
+
## Setup
|
|
18
|
+
|
|
19
|
+
- `yarn add @toptal/picasso-forms`
|
|
20
|
+
|
|
21
|
+
## Limitations
|
|
22
|
+
|
|
23
|
+
Not all final-form features are exposed through this package. If you find a missing one, please [open a Pull Request](../../CONTRIBUTING.md) and add it!
|
|
24
|
+
|
|
25
|
+
For more info on what's available, check [the index](./src/index.ts).
|
|
26
|
+
|
|
27
|
+
## Documentation
|
|
28
|
+
|
|
29
|
+
Documentation and demos are available at [picasso.toptal.net](https://picasso.toptal.net/).
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export type { FormApi, MutableState, AnyObject, FieldValidator, SubmissionErrors, Config } from 'final-form';
|
|
2
|
+
export { FORM_ERROR, setIn } from 'final-form';
|
|
2
3
|
export { useForm, useField, useFormState, FormSpy, Form as FinalForm, Field as FinalField } from 'react-final-form';
|
|
3
4
|
export type { FieldMetaState, FieldRenderProps, FormRenderProps, FieldProps, FormProps, FieldInputProps } from 'react-final-form';
|
|
4
5
|
export { default as arrayMutators } from 'final-form-arrays';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAEnH,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEnE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEzF,wBAAwB;AACxB,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAA;AACxC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAExD,qEAAqE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@toptal/picasso-forms",
|
|
3
|
+
"version": "6.0.5",
|
|
4
|
+
"description": "Picasso form components",
|
|
5
|
+
"author": "Toptal",
|
|
6
|
+
"homepage": "https://github.com/toptal/picasso/tree/master/packages/picasso-forms#readme",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"main": "index.js",
|
|
9
|
+
"module": "index.js",
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/toptal/picasso.git"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build:package": "cross-env NODE_ENV=production node ../../bin/build.js --tsConfig=./tsconfig.build.json",
|
|
19
|
+
"prepublishOnly": "../../bin/prepublish.js"
|
|
20
|
+
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/toptal/picasso/issues"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"@toptal/picasso": "^13.4.2",
|
|
26
|
+
"@toptal/picasso-lab": "^9.3.1",
|
|
27
|
+
"@toptal/picasso-shared": "^7",
|
|
28
|
+
"react": "^16.12.0",
|
|
29
|
+
"react-dom": "^16.12.0"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"classnames": "^2.3.1",
|
|
33
|
+
"final-form": "^4.20.2",
|
|
34
|
+
"final-form-arrays": "^3.0.2",
|
|
35
|
+
"react-final-form": "^6.5.1",
|
|
36
|
+
"react-final-form-arrays": "^3.1.3",
|
|
37
|
+
"react-final-form-listeners": "^1.0.3"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/classnames": "^2.3.1",
|
|
41
|
+
"@types/react-final-form-listeners": "^1.0.0",
|
|
42
|
+
"storybook-readme": "^5.0.9"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toptal/picasso-forms",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.5",
|
|
4
4
|
"description": "Picasso form components",
|
|
5
5
|
"author": "Toptal",
|
|
6
6
|
"homepage": "https://github.com/toptal/picasso/tree/master/packages/picasso-forms#readme",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"url": "https://github.com/toptal/picasso/issues"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@toptal/picasso": "^
|
|
26
|
-
"@toptal/picasso-lab": "^9",
|
|
25
|
+
"@toptal/picasso": "^13.4.2",
|
|
26
|
+
"@toptal/picasso-lab": "^9.3.1",
|
|
27
27
|
"@toptal/picasso-shared": "^7",
|
|
28
28
|
"react": "^16.12.0",
|
|
29
29
|
"react-dom": "^16.12.0"
|
|
@@ -40,6 +40,5 @@
|
|
|
40
40
|
"@types/classnames": "^2.3.1",
|
|
41
41
|
"@types/react-final-form-listeners": "^1.0.0",
|
|
42
42
|
"storybook-readme": "^5.0.9"
|
|
43
|
-
}
|
|
44
|
-
"gitHead": "a167adf3dd929f357f80d33d86f22fd70f8a8366"
|
|
43
|
+
}
|
|
45
44
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {
|
|
3
|
+
Autocomplete as PicassoAutocomplete,
|
|
4
|
+
AutocompleteProps
|
|
5
|
+
} from '@toptal/picasso'
|
|
6
|
+
|
|
7
|
+
import FieldWrapper, { FieldProps } from '../FieldWrapper'
|
|
8
|
+
|
|
9
|
+
export type Props = AutocompleteProps & FieldProps<AutocompleteProps['value']>
|
|
10
|
+
|
|
11
|
+
export const Autocomplete = (props: Props) => (
|
|
12
|
+
<FieldWrapper<AutocompleteProps> {...props}>
|
|
13
|
+
{(inputProps: AutocompleteProps) => {
|
|
14
|
+
return <PicassoAutocomplete {...inputProps} />
|
|
15
|
+
}}
|
|
16
|
+
</FieldWrapper>
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
Autocomplete.displayName = 'Autocomplete'
|
|
20
|
+
|
|
21
|
+
export default Autocomplete
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Autocomplete'
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React, { useContext } from 'react'
|
|
2
|
+
import { Button, ButtonCheckboxProps } from '@toptal/picasso'
|
|
3
|
+
import {
|
|
4
|
+
Field,
|
|
5
|
+
FieldRenderProps as FinalFormFieldProps
|
|
6
|
+
} from 'react-final-form'
|
|
7
|
+
|
|
8
|
+
import FieldWrapper, { FieldProps } from '../FieldWrapper'
|
|
9
|
+
import { CheckboxGroupContext } from '../CheckboxGroup'
|
|
10
|
+
|
|
11
|
+
type CheckboxValue =
|
|
12
|
+
| ButtonCheckboxProps['value']
|
|
13
|
+
| ButtonCheckboxProps['checked']
|
|
14
|
+
|
|
15
|
+
type CheckboxFormProps = Omit<ButtonCheckboxProps, 'requiredDecoration'> & {
|
|
16
|
+
required?: boolean
|
|
17
|
+
}
|
|
18
|
+
type CheckboxWithoutGroup = CheckboxFormProps & FieldProps<CheckboxValue>
|
|
19
|
+
type CheckboxInGroup = CheckboxFormProps & { name?: string }
|
|
20
|
+
|
|
21
|
+
export type Props = CheckboxWithoutGroup | CheckboxInGroup
|
|
22
|
+
|
|
23
|
+
const ButtonCheckbox = ({ name, value, required, ...restProps }: Props) => {
|
|
24
|
+
const groupName = useContext(CheckboxGroupContext)
|
|
25
|
+
const isCheckboxInGroup = Boolean(groupName)
|
|
26
|
+
|
|
27
|
+
if (isCheckboxInGroup) {
|
|
28
|
+
return (
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
30
|
+
<Field type='checkbox' name={name || groupName!} value={value}>
|
|
31
|
+
{({
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
33
|
+
input: { value: inputValue, type, ...restInput }
|
|
34
|
+
}: FinalFormFieldProps<CheckboxValue>) => {
|
|
35
|
+
return <Button.Checkbox {...restProps} {...restInput} />
|
|
36
|
+
}}
|
|
37
|
+
</Field>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<FieldWrapper
|
|
43
|
+
type='checkbox'
|
|
44
|
+
hideFieldLabel
|
|
45
|
+
required={required}
|
|
46
|
+
{...restProps}
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
48
|
+
name={name!}
|
|
49
|
+
>
|
|
50
|
+
{(input: ButtonCheckboxProps) => <Button.Checkbox {...input} />}
|
|
51
|
+
</FieldWrapper>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
ButtonCheckbox.displayName = 'ButtonCheckbox'
|
|
56
|
+
|
|
57
|
+
export default ButtonCheckbox
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ButtonCheckbox'
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React, { useContext } from 'react'
|
|
2
|
+
import { Button, ButtonRadioProps } from '@toptal/picasso'
|
|
3
|
+
import { Field } from 'react-final-form'
|
|
4
|
+
|
|
5
|
+
import { RadioGroupContext } from '../RadioGroup'
|
|
6
|
+
|
|
7
|
+
export type Props = ButtonRadioProps & {
|
|
8
|
+
name?: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const ButtonRadio = ({ name, ...rest }: Props) => {
|
|
12
|
+
const groupName = useContext(RadioGroupContext)
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
16
|
+
<Field name={name || groupName!} type='radio' value={rest.value}>
|
|
17
|
+
{({ input }) => <Button.Radio checked={input.checked} {...rest} />}
|
|
18
|
+
</Field>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
ButtonRadio.displayName = 'ButtonRadio'
|
|
23
|
+
|
|
24
|
+
export default ButtonRadio
|