@intlayer/design-system 4.1.7 → 4.1.9
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/dist/.vite/manifest.json +12 -12
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs +2 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs +2 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs.map +1 -1
- package/dist/components/Auth/useAuth/useOAuth2.d.ts +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +2 -2
- package/dist/{index-CKhNmnU1.cjs → index-NyRxk54x.cjs} +2 -4
- package/dist/index-NyRxk54x.cjs.map +1 -0
- package/dist/{index-B0Lvoony.js → index-ikcnTPvJ.js} +2 -4
- package/dist/index-ikcnTPvJ.js.map +1 -0
- package/package.json +22 -19
- package/dist/CodeBlockShiki-BlmZyrr7.cjs +0 -29
- package/dist/CodeBlockShiki-BlmZyrr7.cjs.map +0 -1
- package/dist/CodeBlockShiki-CcpV9SVi.js +0 -29
- package/dist/CodeBlockShiki-CcpV9SVi.js.map +0 -1
- package/dist/CopyButton-Cxu3goRg.cjs +0 -59
- package/dist/CopyButton-Cxu3goRg.cjs.map +0 -1
- package/dist/CopyButton-DlcDlf6U.js +0 -60
- package/dist/CopyButton-DlcDlf6U.js.map +0 -1
- package/dist/Form-0D7KBafQ.cjs +0 -311
- package/dist/Form-0D7KBafQ.cjs.map +0 -1
- package/dist/Form-7BqwvjVI.cjs +0 -320
- package/dist/Form-7BqwvjVI.cjs.map +0 -1
- package/dist/Form-B2UufQRJ.cjs +0 -319
- package/dist/Form-B2UufQRJ.cjs.map +0 -1
- package/dist/Form-BB0kpER9.cjs +0 -301
- package/dist/Form-BB0kpER9.cjs.map +0 -1
- package/dist/Form-BDcoNTLV.cjs +0 -300
- package/dist/Form-BDcoNTLV.cjs.map +0 -1
- package/dist/Form-BTogr-fp.js +0 -312
- package/dist/Form-BTogr-fp.js.map +0 -1
- package/dist/Form-BVkkvSKP.js +0 -312
- package/dist/Form-BVkkvSKP.js.map +0 -1
- package/dist/Form-Be6Uhb5-.js +0 -312
- package/dist/Form-Be6Uhb5-.js.map +0 -1
- package/dist/Form-BmQQnl-6.js +0 -312
- package/dist/Form-BmQQnl-6.js.map +0 -1
- package/dist/Form-BoWOdiwq.js +0 -321
- package/dist/Form-BoWOdiwq.js.map +0 -1
- package/dist/Form-Bp_ubH9I.cjs +0 -311
- package/dist/Form-Bp_ubH9I.cjs.map +0 -1
- package/dist/Form-BtqRbgLu.cjs +0 -311
- package/dist/Form-BtqRbgLu.cjs.map +0 -1
- package/dist/Form-COVZyto7.cjs +0 -311
- package/dist/Form-COVZyto7.cjs.map +0 -1
- package/dist/Form-CVD_3nCD.js +0 -312
- package/dist/Form-CVD_3nCD.js.map +0 -1
- package/dist/Form-Cfklj1_H.js +0 -320
- package/dist/Form-Cfklj1_H.js.map +0 -1
- package/dist/Form-ClAAiVNm.cjs +0 -311
- package/dist/Form-ClAAiVNm.cjs.map +0 -1
- package/dist/Form-DGLgTAdY.js +0 -302
- package/dist/Form-DGLgTAdY.js.map +0 -1
- package/dist/Form-DhsgC7kB.js +0 -301
- package/dist/Form-DhsgC7kB.js.map +0 -1
- package/dist/Form-Dv0uHqbL.cjs +0 -320
- package/dist/Form-Dv0uHqbL.cjs.map +0 -1
- package/dist/Form-OK9zfg6E.js +0 -321
- package/dist/Form-OK9zfg6E.js.map +0 -1
- package/dist/components/ContentEditor/ContentEditorCode.cjs +0 -78
- package/dist/components/ContentEditor/ContentEditorCode.cjs.map +0 -1
- package/dist/components/ContentEditor/ContentEditorCode.d.ts +0 -11
- package/dist/components/ContentEditor/ContentEditorCode.d.ts.map +0 -1
- package/dist/components/ContentEditor/ContentEditorCode.mjs +0 -78
- package/dist/components/ContentEditor/ContentEditorCode.mjs.map +0 -1
- package/dist/components/DictionaryEditor/useEditedContentStore.cjs +0 -490
- package/dist/components/DictionaryEditor/useEditedContentStore.cjs.map +0 -1
- package/dist/components/DictionaryEditor/useEditedContentStore.d.ts +0 -28
- package/dist/components/DictionaryEditor/useEditedContentStore.d.ts.map +0 -1
- package/dist/components/DictionaryEditor/useEditedContentStore.mjs +0 -490
- package/dist/components/DictionaryEditor/useEditedContentStore.mjs.map +0 -1
- package/dist/components/DictionaryEditor/useEditionPanelStore.cjs +0 -15
- package/dist/components/DictionaryEditor/useEditionPanelStore.cjs.map +0 -1
- package/dist/components/DictionaryEditor/useEditionPanelStore.d.ts +0 -15
- package/dist/components/DictionaryEditor/useEditionPanelStore.d.ts.map +0 -1
- package/dist/components/DictionaryEditor/useEditionPanelStore.mjs +0 -15
- package/dist/components/DictionaryEditor/useEditionPanelStore.mjs.map +0 -1
- package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelector.d.ts +0 -8
- package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelector.d.ts.map +0 -1
- package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelectorContext.d.ts +0 -13
- package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelectorContext.d.ts.map +0 -1
- package/dist/components/DictionaryFieldEditor/LocaleSelector/localeSelector.content.d.ts +0 -9
- package/dist/components/DictionaryFieldEditor/LocaleSelector/localeSelector.content.d.ts.map +0 -1
- package/dist/components/DropDown/types.cjs +0 -2
- package/dist/components/DropDown/types.cjs.map +0 -1
- package/dist/components/DropDown/types.d.ts +0 -19
- package/dist/components/DropDown/types.d.ts.map +0 -1
- package/dist/components/DropDown/types.mjs +0 -2
- package/dist/components/DropDown/types.mjs.map +0 -1
- package/dist/components/IDE/CodeBlock.cjs +0 -54
- package/dist/components/IDE/CodeBlock.cjs.map +0 -1
- package/dist/components/IDE/CodeBlock.d.ts +0 -12
- package/dist/components/IDE/CodeBlock.d.ts.map +0 -1
- package/dist/components/IDE/CodeBlock.mjs +0 -54
- package/dist/components/IDE/CodeBlock.mjs.map +0 -1
- package/dist/components/IDE/CodeBlockLoader.cjs +0 -28
- package/dist/components/IDE/CodeBlockLoader.cjs.map +0 -1
- package/dist/components/IDE/CodeBlockLoader.d.ts +0 -4
- package/dist/components/IDE/CodeBlockLoader.d.ts.map +0 -1
- package/dist/components/IDE/CodeBlockLoader.mjs +0 -28
- package/dist/components/IDE/CodeBlockLoader.mjs.map +0 -1
- package/dist/components/IDE/CodeBlockShiki.d.ts +0 -3
- package/dist/components/IDE/CodeBlockShiki.d.ts.map +0 -1
- package/dist/components/IDE/CodeRender copy.cjs +0 -141
- package/dist/components/IDE/CodeRender copy.cjs.map +0 -1
- package/dist/components/IDE/CodeRender copy.d.ts +0 -14
- package/dist/components/IDE/CodeRender copy.d.ts.map +0 -1
- package/dist/components/IDE/CodeRender copy.mjs +0 -141
- package/dist/components/IDE/CodeRender copy.mjs.map +0 -1
- package/dist/components/IDE/CodeRender.cjs +0 -49
- package/dist/components/IDE/CodeRender.cjs.map +0 -1
- package/dist/components/IDE/CodeRender.d.ts +0 -9
- package/dist/components/IDE/CodeRender.d.ts.map +0 -1
- package/dist/components/IDE/CodeRender.mjs +0 -49
- package/dist/components/IDE/CodeRender.mjs.map +0 -1
- package/dist/components/IDE/CodeRenderer.cjs +0 -27
- package/dist/components/IDE/CodeRenderer.cjs.map +0 -1
- package/dist/components/IDE/CodeRenderer.d.ts +0 -5
- package/dist/components/IDE/CodeRenderer.d.ts.map +0 -1
- package/dist/components/IDE/CodeRenderer.mjs +0 -27
- package/dist/components/IDE/CodeRenderer.mjs.map +0 -1
- package/dist/components/IDE/EditableCodeBlock.d.ts +0 -9
- package/dist/components/IDE/EditableCodeBlock.d.ts.map +0 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSelectorContext.d.ts +0 -13
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSelectorContext.d.ts.map +0 -1
- package/dist/design-system.css +0 -235
- package/dist/index-Ai6eeqZH.js +0 -702
- package/dist/index-Ai6eeqZH.js.map +0 -1
- package/dist/index-B-VAyQ9R.js +0 -673
- package/dist/index-B-VAyQ9R.js.map +0 -1
- package/dist/index-B0Lvoony.js.map +0 -1
- package/dist/index-B1nU1-65.cjs +0 -690
- package/dist/index-B1nU1-65.cjs.map +0 -1
- package/dist/index-B2UElBcQ.cjs +0 -200
- package/dist/index-B2UElBcQ.cjs.map +0 -1
- package/dist/index-BIV0x_z2.js +0 -206
- package/dist/index-BIV0x_z2.js.map +0 -1
- package/dist/index-BIyA5LAs.js +0 -691
- package/dist/index-BIyA5LAs.js.map +0 -1
- package/dist/index-BMzh1_UJ.js +0 -201
- package/dist/index-BMzh1_UJ.js.map +0 -1
- package/dist/index-BNH9wXVj.cjs +0 -205
- package/dist/index-BNH9wXVj.cjs.map +0 -1
- package/dist/index-BbqOa6BU.cjs +0 -701
- package/dist/index-BbqOa6BU.cjs.map +0 -1
- package/dist/index-BdTa-9zc.js +0 -201
- package/dist/index-BdTa-9zc.js.map +0 -1
- package/dist/index-BqZwP4Lr.js +0 -691
- package/dist/index-BqZwP4Lr.js.map +0 -1
- package/dist/index-BtZWYJhL.cjs +0 -200
- package/dist/index-BtZWYJhL.cjs.map +0 -1
- package/dist/index-Buecpjbh.cjs +0 -690
- package/dist/index-Buecpjbh.cjs.map +0 -1
- package/dist/index-CDEJjmId.js +0 -694
- package/dist/index-CDEJjmId.js.map +0 -1
- package/dist/index-CKhNmnU1.cjs.map +0 -1
- package/dist/index-CTAyk6RY.cjs +0 -693
- package/dist/index-CTAyk6RY.cjs.map +0 -1
- package/dist/index-CVC2sfEj.js +0 -693
- package/dist/index-CVC2sfEj.js.map +0 -1
- package/dist/index-CVz0RdK6.js +0 -691
- package/dist/index-CVz0RdK6.js.map +0 -1
- package/dist/index-CjF2ksU7.cjs +0 -693
- package/dist/index-CjF2ksU7.cjs.map +0 -1
- package/dist/index-CuQs5759.cjs +0 -692
- package/dist/index-CuQs5759.cjs.map +0 -1
- package/dist/index-D69JRZcQ.js +0 -206
- package/dist/index-D69JRZcQ.js.map +0 -1
- package/dist/index-D9oaKvKC.js +0 -201
- package/dist/index-D9oaKvKC.js.map +0 -1
- package/dist/index-DFc7og1d.cjs +0 -671
- package/dist/index-DFc7og1d.cjs.map +0 -1
- package/dist/index-DTCehvKe.cjs +0 -200
- package/dist/index-DTCehvKe.cjs.map +0 -1
- package/dist/index-D_MDocy7.cjs +0 -690
- package/dist/index-D_MDocy7.cjs.map +0 -1
- package/dist/index-DcWYZrJW.js +0 -672
- package/dist/index-DcWYZrJW.js.map +0 -1
- package/dist/index-Djo2Jnua.cjs +0 -693
- package/dist/index-Djo2Jnua.cjs.map +0 -1
- package/dist/index-LFTthFne.js +0 -694
- package/dist/index-LFTthFne.js.map +0 -1
- package/dist/index-SOIahRpS.cjs +0 -205
- package/dist/index-SOIahRpS.cjs.map +0 -1
- package/dist/index-T-TjVQoD.js +0 -671
- package/dist/index-T-TjVQoD.js.map +0 -1
- package/dist/index-f8_VC6c8.cjs +0 -672
- package/dist/index-f8_VC6c8.cjs.map +0 -1
- package/dist/index-llGIfxqV.cjs +0 -670
- package/dist/index-llGIfxqV.cjs.map +0 -1
- package/dist/index-xZoGTokf.js +0 -694
- package/dist/index-xZoGTokf.js.map +0 -1
- package/dist/jsx-runtime-CL03FswV.cjs +0 -506
- package/dist/jsx-runtime-CL03FswV.cjs.map +0 -1
- package/dist/jsx-runtime-DaNGiM0W.js +0 -945
- package/dist/jsx-runtime-DaNGiM0W.js.map +0 -1
- package/dist/jsx-runtime-XHKiWCTo.cjs +0 -944
- package/dist/jsx-runtime-XHKiWCTo.cjs.map +0 -1
- package/dist/jsx-runtime-kmx34TxC.js +0 -507
- package/dist/jsx-runtime-kmx34TxC.js.map +0 -1
- package/dist/libs/index.cjs +0 -6
- package/dist/libs/index.cjs.map +0 -1
- package/dist/libs/index.d.ts +0 -2
- package/dist/libs/index.d.ts.map +0 -1
- package/dist/libs/index.mjs +0 -6
- package/dist/libs/index.mjs.map +0 -1
- package/dist/libs/intlayer-api/ai.cjs +0 -64
- package/dist/libs/intlayer-api/ai.cjs.map +0 -1
- package/dist/libs/intlayer-api/ai.d.ts +0 -18
- package/dist/libs/intlayer-api/ai.d.ts.map +0 -1
- package/dist/libs/intlayer-api/ai.mjs +0 -64
- package/dist/libs/intlayer-api/ai.mjs.map +0 -1
- package/dist/libs/intlayer-api/auth.cjs +0 -141
- package/dist/libs/intlayer-api/auth.cjs.map +0 -1
- package/dist/libs/intlayer-api/auth.d.ts +0 -38
- package/dist/libs/intlayer-api/auth.d.ts.map +0 -1
- package/dist/libs/intlayer-api/auth.mjs +0 -141
- package/dist/libs/intlayer-api/auth.mjs.map +0 -1
- package/dist/libs/intlayer-api/dictionary.cjs +0 -78
- package/dist/libs/intlayer-api/dictionary.cjs.map +0 -1
- package/dist/libs/intlayer-api/dictionary.d.ts +0 -22
- package/dist/libs/intlayer-api/dictionary.d.ts.map +0 -1
- package/dist/libs/intlayer-api/dictionary.mjs +0 -78
- package/dist/libs/intlayer-api/dictionary.mjs.map +0 -1
- package/dist/libs/intlayer-api/fetcher.cjs +0 -73
- package/dist/libs/intlayer-api/fetcher.cjs.map +0 -1
- package/dist/libs/intlayer-api/fetcher.d.ts +0 -70
- package/dist/libs/intlayer-api/fetcher.d.ts.map +0 -1
- package/dist/libs/intlayer-api/fetcher.mjs +0 -73
- package/dist/libs/intlayer-api/fetcher.mjs.map +0 -1
- package/dist/libs/intlayer-api/index.cjs +0 -24
- package/dist/libs/intlayer-api/index.cjs.map +0 -1
- package/dist/libs/intlayer-api/index.d.ts +0 -157
- package/dist/libs/intlayer-api/index.d.ts.map +0 -1
- package/dist/libs/intlayer-api/index.mjs +0 -24
- package/dist/libs/intlayer-api/index.mjs.map +0 -1
- package/dist/libs/intlayer-api/organization.cjs +0 -96
- package/dist/libs/intlayer-api/organization.cjs.map +0 -1
- package/dist/libs/intlayer-api/organization.d.ts +0 -26
- package/dist/libs/intlayer-api/organization.d.ts.map +0 -1
- package/dist/libs/intlayer-api/organization.mjs +0 -96
- package/dist/libs/intlayer-api/organization.mjs.map +0 -1
- package/dist/libs/intlayer-api/project.cjs +0 -110
- package/dist/libs/intlayer-api/project.cjs.map +0 -1
- package/dist/libs/intlayer-api/project.d.ts +0 -28
- package/dist/libs/intlayer-api/project.d.ts.map +0 -1
- package/dist/libs/intlayer-api/project.mjs +0 -110
- package/dist/libs/intlayer-api/project.mjs.map +0 -1
- package/dist/libs/intlayer-api/stripe.cjs +0 -31
- package/dist/libs/intlayer-api/stripe.cjs.map +0 -1
- package/dist/libs/intlayer-api/stripe.d.ts +0 -8
- package/dist/libs/intlayer-api/stripe.d.ts.map +0 -1
- package/dist/libs/intlayer-api/stripe.mjs +0 -31
- package/dist/libs/intlayer-api/stripe.mjs.map +0 -1
- package/dist/libs/intlayer-api/tag.cjs +0 -52
- package/dist/libs/intlayer-api/tag.cjs.map +0 -1
- package/dist/libs/intlayer-api/tag.d.ts +0 -16
- package/dist/libs/intlayer-api/tag.d.ts.map +0 -1
- package/dist/libs/intlayer-api/tag.mjs +0 -52
- package/dist/libs/intlayer-api/tag.mjs.map +0 -1
- package/dist/libs/intlayer-api/user.cjs +0 -70
- package/dist/libs/intlayer-api/user.cjs.map +0 -1
- package/dist/libs/intlayer-api/user.d.ts +0 -22
- package/dist/libs/intlayer-api/user.d.ts.map +0 -1
- package/dist/libs/intlayer-api/user.mjs +0 -70
- package/dist/libs/intlayer-api/user.mjs.map +0 -1
- package/dist/navigation-CE0LMHcY.cjs +0 -8538
- package/dist/navigation-CE0LMHcY.cjs.map +0 -1
- package/dist/navigation-DFabQmdZ.js +0 -914
- package/dist/navigation-DFabQmdZ.js.map +0 -1
- package/dist/navigation-DRtAVQJF.js +0 -8521
- package/dist/navigation-DRtAVQJF.js.map +0 -1
- package/dist/navigation-a7EfWhxz.cjs +0 -913
- package/dist/navigation-a7EfWhxz.cjs.map +0 -1
- package/dist/shallow-lhDIFtEp.cjs +0 -48
- package/dist/shallow-lhDIFtEp.cjs.map +0 -1
- package/dist/shallow-m9BpCkKh.js +0 -49
- package/dist/shallow-m9BpCkKh.js.map +0 -1
- package/dist/useGetAllDictionaries-B1sqs2IB.cjs +0 -34
- package/dist/useGetAllDictionaries-B1sqs2IB.cjs.map +0 -1
- package/dist/useGetAllDictionaries-BbH8vTkY.js +0 -35
- package/dist/useGetAllDictionaries-BbH8vTkY.js.map +0 -1
- package/dist/useGetAllDictionaries-Bgkytpa2.cjs +0 -34
- package/dist/useGetAllDictionaries-Bgkytpa2.cjs.map +0 -1
- package/dist/useGetAllDictionaries-D8ma3h41.cjs +0 -33
- package/dist/useGetAllDictionaries-D8ma3h41.cjs.map +0 -1
- package/dist/useGetAllDictionaries-DHgHEbD5.js +0 -34
- package/dist/useGetAllDictionaries-DHgHEbD5.js.map +0 -1
- package/dist/useGetAllDictionaries-DUzm0rIa.js +0 -35
- package/dist/useGetAllDictionaries-DUzm0rIa.js.map +0 -1
- package/dist/utils/dictionary.cjs +0 -158
- package/dist/utils/dictionary.cjs.map +0 -1
- package/dist/utils/dictionary.d.ts +0 -7
- package/dist/utils/dictionary.d.ts.map +0 -1
- package/dist/utils/dictionary.mjs +0 -158
- package/dist/utils/dictionary.mjs.map +0 -1
- /package/dist/components/IDE/{CodeBlockclient.d.ts → CodeBlockClient.d.ts} +0 -0
- /package/dist/components/IDE/{CodeBlockclient.d.ts.map → CodeBlockClient.d.ts.map} +0 -0
package/dist/Form-COVZyto7.cjs
DELETED
|
@@ -1,311 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
const components_Button_Button = require("./components/Button/Button.cjs");
|
|
4
|
-
const jsxRuntime = require("./jsx-runtime-XHKiWCTo.cjs");
|
|
5
|
-
const reactHookForm = require("react-hook-form");
|
|
6
|
-
const components_Input_Input = require("./components/Input/Input.cjs");
|
|
7
|
-
const components_Input_InputPassword = require("./components/Input/InputPassword.cjs");
|
|
8
|
-
const components_Input_Checkbox = require("./components/Input/Checkbox.cjs");
|
|
9
|
-
const components_TextArea_TextArea = require("./components/TextArea/TextArea.cjs");
|
|
10
|
-
const components_EditableField_EditableFieldInput = require("./components/EditableField/EditableFieldInput.cjs");
|
|
11
|
-
const components_EditableField_EditableFieldTextArea = require("./components/EditableField/EditableFieldTextArea.cjs");
|
|
12
|
-
const components_TextArea_AutoSizeTextArea = require("./components/TextArea/AutoSizeTextArea.cjs");
|
|
13
|
-
const require$$0 = require("react");
|
|
14
|
-
const components_Select_Multiselect = require("./components/Select/Multiselect.cjs");
|
|
15
|
-
const components_Form_FormField = require("./components/Form/FormField.cjs");
|
|
16
|
-
const components_Form_layout_FormLabelLayout = require("./components/Form/layout/FormLabelLayout.cjs");
|
|
17
|
-
const components_Select_Select = require("./components/Select/Select.cjs");
|
|
18
|
-
const components_SwitchSelector_index = require("./components/SwitchSelector/index.cjs");
|
|
19
|
-
const components_Form_FormBase = require("./components/Form/FormBase.cjs");
|
|
20
|
-
const components_Form_FormControl = require("./components/Form/FormControl.cjs");
|
|
21
|
-
const components_Form_FormDescription = require("./components/Form/FormDescription.cjs");
|
|
22
|
-
const components_Form_FormItem = require("./components/Form/FormItem.cjs");
|
|
23
|
-
const components_Form_FormMessage = require("./components/Form/FormMessage.cjs");
|
|
24
|
-
require("clsx");
|
|
25
|
-
require("tailwind-merge");
|
|
26
|
-
require("./components/Form/FormLabel.cjs");
|
|
27
|
-
const FormItemLayout = ({
|
|
28
|
-
label,
|
|
29
|
-
description,
|
|
30
|
-
isRequired,
|
|
31
|
-
info,
|
|
32
|
-
children,
|
|
33
|
-
showErrorMessage = true,
|
|
34
|
-
htmlFor
|
|
35
|
-
}) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(Form.Item, { className: "w-full space-y-2", children: [
|
|
36
|
-
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("div", { className: "space-y-1 leading-none", children: [
|
|
37
|
-
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Form_layout_FormLabelLayout.FormLabelLayout, { isRequired, info, htmlFor, children: label }),
|
|
38
|
-
description && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(Form.Description, { children: description })
|
|
39
|
-
] }),
|
|
40
|
-
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(Form.Control, { children }),
|
|
41
|
-
showErrorMessage && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(Form.Message, { "data-testid": "error-message" })
|
|
42
|
-
] });
|
|
43
|
-
const FormFieldElement = ({
|
|
44
|
-
field,
|
|
45
|
-
name,
|
|
46
|
-
label,
|
|
47
|
-
Element,
|
|
48
|
-
isRequired = false,
|
|
49
|
-
info,
|
|
50
|
-
description,
|
|
51
|
-
showErrorMessage = true,
|
|
52
|
-
...props
|
|
53
|
-
}) => {
|
|
54
|
-
const { error } = components_Form_FormField.useFormField();
|
|
55
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
56
|
-
FormItemLayout,
|
|
57
|
-
{
|
|
58
|
-
htmlFor: name,
|
|
59
|
-
label,
|
|
60
|
-
description,
|
|
61
|
-
isRequired,
|
|
62
|
-
info,
|
|
63
|
-
showErrorMessage,
|
|
64
|
-
"aria-invalid": !!error,
|
|
65
|
-
children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(Element, { "data-testid": "element", id: name, ...field, ...props, children: props.children })
|
|
66
|
-
}
|
|
67
|
-
);
|
|
68
|
-
};
|
|
69
|
-
const FormElement = (props) => {
|
|
70
|
-
const { control } = reactHookForm.useFormContext();
|
|
71
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
72
|
-
Form.Field,
|
|
73
|
-
{
|
|
74
|
-
control,
|
|
75
|
-
name: props.name,
|
|
76
|
-
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(FormFieldElement, { ...props, field })
|
|
77
|
-
}
|
|
78
|
-
);
|
|
79
|
-
};
|
|
80
|
-
const InputElement = (props) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
81
|
-
FormElement,
|
|
82
|
-
{
|
|
83
|
-
id: props.name,
|
|
84
|
-
"data-testid": props.name,
|
|
85
|
-
Element: components_Input_Input.Input,
|
|
86
|
-
...props
|
|
87
|
-
}
|
|
88
|
-
);
|
|
89
|
-
const InputPasswordElement = ({
|
|
90
|
-
autoComplete,
|
|
91
|
-
...props
|
|
92
|
-
}) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
93
|
-
FormElement,
|
|
94
|
-
{
|
|
95
|
-
Element: components_Input_InputPassword.InputPassword,
|
|
96
|
-
id: props.name,
|
|
97
|
-
"data-testid": props.name,
|
|
98
|
-
autoComplete,
|
|
99
|
-
minLength: 6,
|
|
100
|
-
maxLength: 255,
|
|
101
|
-
...props
|
|
102
|
-
}
|
|
103
|
-
);
|
|
104
|
-
const TextAreaElement = (props) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
105
|
-
FormElement,
|
|
106
|
-
{
|
|
107
|
-
Element: components_TextArea_TextArea.TextArea,
|
|
108
|
-
id: props.name,
|
|
109
|
-
"data-testid": props.name,
|
|
110
|
-
...props
|
|
111
|
-
}
|
|
112
|
-
);
|
|
113
|
-
const EditableFieldInputElement = (props) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
114
|
-
FormElement,
|
|
115
|
-
{
|
|
116
|
-
id: props.name,
|
|
117
|
-
"data-testid": props.name,
|
|
118
|
-
Element: components_EditableField_EditableFieldInput.EditableFieldInput,
|
|
119
|
-
...props
|
|
120
|
-
}
|
|
121
|
-
);
|
|
122
|
-
const EditableFieldTextAreaElement = (props) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
123
|
-
FormElement,
|
|
124
|
-
{
|
|
125
|
-
id: props.name,
|
|
126
|
-
"data-testid": props.name,
|
|
127
|
-
Element: components_EditableField_EditableFieldTextArea.EditableFieldTextArea,
|
|
128
|
-
...props
|
|
129
|
-
}
|
|
130
|
-
);
|
|
131
|
-
const AutoSizedTextAreaElement = (props) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
132
|
-
FormElement,
|
|
133
|
-
{
|
|
134
|
-
Element: components_TextArea_AutoSizeTextArea.AutoSizedTextArea,
|
|
135
|
-
id: props.name,
|
|
136
|
-
"data-testid": props.name,
|
|
137
|
-
...props
|
|
138
|
-
}
|
|
139
|
-
);
|
|
140
|
-
const CheckboxComponent = require$$0.forwardRef(
|
|
141
|
-
({ inputLabel, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_Input_Checkbox.Checkbox, { ref, ...props, label: inputLabel })
|
|
142
|
-
);
|
|
143
|
-
CheckboxComponent.displayName = "CheckboxComponent";
|
|
144
|
-
const CheckboxElement = ({
|
|
145
|
-
autoComplete,
|
|
146
|
-
...props
|
|
147
|
-
}) => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
148
|
-
FormElement,
|
|
149
|
-
{
|
|
150
|
-
Element: CheckboxComponent,
|
|
151
|
-
id: props.name,
|
|
152
|
-
"data-testid": props.name,
|
|
153
|
-
autoComplete,
|
|
154
|
-
minLength: 6,
|
|
155
|
-
maxLength: 255,
|
|
156
|
-
...props
|
|
157
|
-
}
|
|
158
|
-
);
|
|
159
|
-
const MultiSelectElement = ({
|
|
160
|
-
name,
|
|
161
|
-
description,
|
|
162
|
-
label,
|
|
163
|
-
isRequired,
|
|
164
|
-
info,
|
|
165
|
-
showErrorMessage,
|
|
166
|
-
children,
|
|
167
|
-
...props
|
|
168
|
-
}) => {
|
|
169
|
-
const { control } = reactHookForm.useFormContext();
|
|
170
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
171
|
-
Form.Field,
|
|
172
|
-
{
|
|
173
|
-
control,
|
|
174
|
-
name,
|
|
175
|
-
render: ({ field }) => {
|
|
176
|
-
const { error } = components_Form_FormField.useFormField();
|
|
177
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
178
|
-
FormItemLayout,
|
|
179
|
-
{
|
|
180
|
-
htmlFor: name,
|
|
181
|
-
label,
|
|
182
|
-
description,
|
|
183
|
-
isRequired,
|
|
184
|
-
info,
|
|
185
|
-
showErrorMessage,
|
|
186
|
-
"aria-invalid": !!error,
|
|
187
|
-
children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
188
|
-
components_Select_Multiselect.MultiSelect,
|
|
189
|
-
{
|
|
190
|
-
onValueChange: field.onChange,
|
|
191
|
-
values: field.value,
|
|
192
|
-
...props,
|
|
193
|
-
children
|
|
194
|
-
}
|
|
195
|
-
)
|
|
196
|
-
}
|
|
197
|
-
);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
);
|
|
201
|
-
};
|
|
202
|
-
const SelectElement = ({
|
|
203
|
-
name,
|
|
204
|
-
description,
|
|
205
|
-
label,
|
|
206
|
-
isRequired,
|
|
207
|
-
info,
|
|
208
|
-
showErrorMessage,
|
|
209
|
-
children,
|
|
210
|
-
...props
|
|
211
|
-
}) => {
|
|
212
|
-
const { control } = reactHookForm.useFormContext();
|
|
213
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
214
|
-
Form.Field,
|
|
215
|
-
{
|
|
216
|
-
control,
|
|
217
|
-
name,
|
|
218
|
-
render: ({ field }) => {
|
|
219
|
-
const { error } = components_Form_FormField.useFormField();
|
|
220
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
221
|
-
FormItemLayout,
|
|
222
|
-
{
|
|
223
|
-
htmlFor: name,
|
|
224
|
-
label,
|
|
225
|
-
description,
|
|
226
|
-
isRequired,
|
|
227
|
-
info,
|
|
228
|
-
showErrorMessage,
|
|
229
|
-
"aria-invalid": !!error,
|
|
230
|
-
children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
231
|
-
components_Select_Select.Select,
|
|
232
|
-
{
|
|
233
|
-
onValueChange: field.onChange,
|
|
234
|
-
defaultValue: field.value,
|
|
235
|
-
...props,
|
|
236
|
-
children
|
|
237
|
-
}
|
|
238
|
-
)
|
|
239
|
-
}
|
|
240
|
-
);
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
);
|
|
244
|
-
};
|
|
245
|
-
const SwitchSelectorElement = ({
|
|
246
|
-
name,
|
|
247
|
-
description,
|
|
248
|
-
label,
|
|
249
|
-
isRequired,
|
|
250
|
-
info,
|
|
251
|
-
showErrorMessage,
|
|
252
|
-
children,
|
|
253
|
-
...props
|
|
254
|
-
}) => {
|
|
255
|
-
const { control } = reactHookForm.useFormContext();
|
|
256
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
257
|
-
Form.Field,
|
|
258
|
-
{
|
|
259
|
-
control,
|
|
260
|
-
name,
|
|
261
|
-
render: ({ field }) => {
|
|
262
|
-
const { error } = components_Form_FormField.useFormField();
|
|
263
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
264
|
-
FormItemLayout,
|
|
265
|
-
{
|
|
266
|
-
htmlFor: name,
|
|
267
|
-
label,
|
|
268
|
-
description,
|
|
269
|
-
isRequired,
|
|
270
|
-
info,
|
|
271
|
-
showErrorMessage,
|
|
272
|
-
"aria-invalid": !!error,
|
|
273
|
-
children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(components_SwitchSelector_index.SwitchSelector, { ...field, ...props, children })
|
|
274
|
-
}
|
|
275
|
-
);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
);
|
|
279
|
-
};
|
|
280
|
-
const Form = components_Form_FormBase.Form;
|
|
281
|
-
Form.Description = components_Form_FormDescription.FormDescription;
|
|
282
|
-
Form.Control = components_Form_FormControl.FormControl;
|
|
283
|
-
Form.Field = components_Form_FormField.FormField;
|
|
284
|
-
Form.Item = components_Form_FormItem.FormItem;
|
|
285
|
-
Form.Label = components_Form_layout_FormLabelLayout.FormLabelLayout;
|
|
286
|
-
Form.Message = components_Form_FormMessage.FormMessage;
|
|
287
|
-
Form.Element = FormElement;
|
|
288
|
-
Form.Input = InputElement;
|
|
289
|
-
Form.InputPassword = InputPasswordElement;
|
|
290
|
-
Form.Checkbox = CheckboxElement;
|
|
291
|
-
Form.TextArea = TextAreaElement;
|
|
292
|
-
Form.AutoSizedTextArea = AutoSizedTextAreaElement;
|
|
293
|
-
Form.Button = components_Button_Button.Button;
|
|
294
|
-
Form.Select = SelectElement;
|
|
295
|
-
Form.MultiSelect = MultiSelectElement;
|
|
296
|
-
Form.EditableFieldInput = EditableFieldInputElement;
|
|
297
|
-
Form.EditableFieldTextArea = EditableFieldTextAreaElement;
|
|
298
|
-
Form.SwitchSelector = SwitchSelectorElement;
|
|
299
|
-
exports.CheckboxElement = CheckboxElement;
|
|
300
|
-
exports.EditableFieldInputElement = EditableFieldInputElement;
|
|
301
|
-
exports.EditableFieldTextAreaElement = EditableFieldTextAreaElement;
|
|
302
|
-
exports.Form = Form;
|
|
303
|
-
exports.FormElement = FormElement;
|
|
304
|
-
exports.FormItemLayout = FormItemLayout;
|
|
305
|
-
exports.InputElement = InputElement;
|
|
306
|
-
exports.InputPasswordElement = InputPasswordElement;
|
|
307
|
-
exports.MultiSelectElement = MultiSelectElement;
|
|
308
|
-
exports.SelectElement = SelectElement;
|
|
309
|
-
exports.SwitchSelectorElement = SwitchSelectorElement;
|
|
310
|
-
exports.TextAreaElement = TextAreaElement;
|
|
311
|
-
//# sourceMappingURL=Form-COVZyto7.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Form-COVZyto7.cjs","sources":["../src/components/Form/layout/FormItemLayout.tsx","../src/components/Form/elements/FormElement.tsx","../src/components/Form/elements/InputElement.tsx","../src/components/Form/elements/InputPasswordElement.tsx","../src/components/Form/elements/TextAreaElement.tsx","../src/components/Form/elements/EditableFieldInputElement.tsx","../src/components/Form/elements/EditableFieldTextAreaElement.tsx","../src/components/Form/elements/AutoSizeTextAreaElement.tsx","../src/components/Form/elements/CheckboxElement.tsx","../src/components/Form/elements/MultiselectElement.tsx","../src/components/Form/elements/SelectElement.tsx","../src/components/Form/elements/SwitchSelectorElement.tsx","../src/components/Form/Form.tsx"],"sourcesContent":["/* eslint-disable import/no-cycle */\nimport type { FC, ReactNode } from 'react';\nimport { Form } from '../Form';\nimport { FormLabelLayout, type FormLabelLayoutProps } from './FormLabelLayout';\n\nexport type FormItemLayoutProps = Omit<FormLabelLayoutProps, 'children'> & {\n label?: ReactNode;\n description?: ReactNode;\n children: ReactNode;\n showErrorMessage?: boolean;\n};\n\nexport const FormItemLayout: FC<FormItemLayoutProps> = ({\n label,\n description,\n isRequired,\n info,\n children,\n showErrorMessage = true,\n htmlFor,\n}) => (\n <Form.Item className=\"w-full space-y-2\">\n <div className=\"space-y-1 leading-none\">\n <FormLabelLayout isRequired={isRequired} info={info} htmlFor={htmlFor}>\n {label}\n </FormLabelLayout>\n {description && <Form.Description>{description}</Form.Description>}\n </div>\n <Form.Control>{children}</Form.Control>\n\n {showErrorMessage && <Form.Message data-testid=\"error-message\" />}\n </Form.Item>\n);\n","/* eslint-disable import/no-cycle */\n'use client';\n\nimport type { ComponentProps, ElementType, ReactNode } from 'react';\nimport {\n useFormContext,\n type ControllerRenderProps,\n type FieldValues,\n} from 'react-hook-form';\nimport { Form } from '../Form';\nimport { useFormField } from '../FormField';\nimport { FormItemLayout, FormItemLayoutProps } from '../layout';\n\nexport type FormElementProps<T extends ElementType> = {\n name: string;\n Element: T;\n label?: ReactNode;\n isRequired?: boolean;\n info?: string;\n showErrorMessage?: boolean;\n focus?: boolean;\n} & Omit<FormItemLayoutProps, 'children'>;\n\ntype FormFieldElementProps<T extends ElementType> = FormElementProps<T> &\n ComponentProps<T> & {\n field: ControllerRenderProps<FieldValues, string>;\n };\n\nconst FormFieldElement = <T extends ElementType>({\n field,\n name,\n label,\n Element,\n isRequired = false,\n info,\n description,\n showErrorMessage = true,\n ...props\n}: FormFieldElementProps<T>) => {\n const { error } = useFormField();\n\n return (\n <FormItemLayout\n htmlFor={name}\n label={label}\n description={description}\n isRequired={isRequired}\n info={info}\n showErrorMessage={showErrorMessage}\n aria-invalid={!!error}\n >\n <Element data-testid=\"element\" id={name} {...field} {...props}>\n {props.children}\n </Element>\n </FormItemLayout>\n );\n};\n\n/**\n * FormElement is a component that allows you to create a form element with a label, description, error message, and validation.\n *\n * The Element prop is the type of the element that will be rendered.\n * This element will interact with the FormContext and will be controlled by the FormControl component.\n * The props used to control the element will be `value` and `onChange`.\n */\nexport const FormElement = <T extends ElementType>(\n props: FormElementProps<T> & ComponentProps<T>\n) => {\n const { control } = useFormContext();\n\n return (\n <Form.Field\n control={control}\n name={props.name}\n render={({ field }) => <FormFieldElement {...props} field={field} />}\n />\n );\n};\n","/* eslint-disable import/no-cycle */\nimport type { ComponentProps, FC } from 'react';\nimport { Input } from '../../../components/Input';\nimport { FormElementProps, FormElement } from './FormElement';\n\ntype InputElementProps = Omit<FormElementProps<typeof Input>, 'Element'> &\n ComponentProps<typeof Input> & {\n name: string;\n };\n\nexport const InputElement: FC<InputElementProps> = (props) => (\n <FormElement\n id={props.name}\n data-testid={props.name}\n Element={Input}\n {...props}\n />\n);\n","/* eslint-disable import/no-cycle */\nimport type { ComponentProps, FC } from 'react';\nimport { InputPassword } from '../../Input';\nimport { FormElementProps, FormElement } from './FormElement';\n\ntype InputPasswordElementProps = Omit<\n FormElementProps<typeof InputPassword>,\n 'Element'\n> &\n ComponentProps<typeof InputPassword> & {\n name: string;\n autoComplete: 'current-password' | 'new-password';\n };\n\nexport const InputPasswordElement: FC<InputPasswordElementProps> = ({\n autoComplete,\n ...props\n}) => (\n <FormElement\n Element={InputPassword}\n id={props.name}\n data-testid={props.name}\n autoComplete={autoComplete}\n minLength={6}\n maxLength={255}\n {...props}\n />\n);\n","/* eslint-disable import/no-cycle */\nimport type { FC } from 'react';\nimport { TextArea } from '../../TextArea/TextArea';\nimport { FormElement, type FormElementProps } from './FormElement';\n\ntype TextAreaElementsProps = Omit<\n FormElementProps<typeof TextArea>,\n 'Element'\n> &\n React.ComponentProps<typeof TextArea> & {\n name: string;\n };\n\nexport const TextAreaElement: FC<TextAreaElementsProps> = (props) => (\n <FormElement\n Element={TextArea}\n id={props.name}\n data-testid={props.name}\n {...props}\n />\n);\n","/* eslint-disable import/no-cycle */\nimport type { ComponentProps, ReactNode } from 'react';\nimport { EditableFieldInput } from '../../EditableField/EditableFieldInput';\nimport { FormElement, type FormElementProps } from './FormElement';\n\ntype EditableFieldInputElementProps = Omit<\n FormElementProps<typeof EditableFieldInput>,\n 'Element'\n> &\n Omit<ComponentProps<typeof EditableFieldInput>, 'onChange'> & {\n name: string;\n description?: ReactNode;\n placeholder?: string;\n className?: string;\n children?: ReactNode;\n };\n\nexport const EditableFieldInputElement = (\n props: EditableFieldInputElementProps\n) => (\n <FormElement\n id={props.name}\n data-testid={props.name}\n Element={EditableFieldInput}\n {...props}\n />\n);\n","/* eslint-disable import/no-cycle */\n\nimport type { ComponentProps, ReactNode } from 'react';\nimport { EditableFieldTextArea } from '../../EditableField/EditableFieldTextArea';\nimport { FormElement, type FormElementProps } from './FormElement';\n\ntype EditableFieldTextAreaElementProps = Omit<\n FormElementProps<typeof EditableFieldTextArea>,\n 'Element'\n> &\n Omit<ComponentProps<typeof EditableFieldTextArea>, 'onChange'> & {\n name: string;\n description?: ReactNode;\n placeholder?: string;\n className?: string;\n children?: ReactNode;\n };\n\nexport const EditableFieldTextAreaElement = (\n props: EditableFieldTextAreaElementProps\n) => (\n <FormElement\n id={props.name}\n data-testid={props.name}\n Element={EditableFieldTextArea}\n {...props}\n />\n);\n","import type { FC } from 'react';\nimport { AutoSizedTextArea } from '../../TextArea/AutoSizeTextArea';\nimport { FormElement, type FormElementProps } from './FormElement';\n\ntype AutoSizedTextAreaElementsProps = Omit<\n FormElementProps<typeof AutoSizedTextArea>,\n 'Element'\n> &\n React.ComponentProps<typeof AutoSizedTextArea> & {\n name: string;\n };\n\nexport const AutoSizedTextAreaElement: FC<AutoSizedTextAreaElementsProps> = (\n props\n) => (\n <FormElement\n Element={AutoSizedTextArea}\n id={props.name}\n data-testid={props.name}\n {...props}\n />\n);\n","/* eslint-disable import/no-cycle */\nimport { forwardRef, type ComponentProps, type FC } from 'react';\nimport { Checkbox } from '../../Input';\nimport { FormElementProps, FormElement } from './FormElement';\n\ntype CheckboxElementProps = Omit<FormElementProps<typeof Checkbox>, 'Element'> &\n ComponentProps<typeof Checkbox> & {\n name: string;\n inputLabel?: string;\n };\n\ntype CheckboxComponentProps = Omit<ComponentProps<typeof Checkbox>, 'label'> & {\n name: string;\n inputLabel?: ComponentProps<typeof Checkbox>['label'];\n};\n\nconst CheckboxComponent = forwardRef<HTMLInputElement, CheckboxComponentProps>(\n ({ inputLabel, ...props }, ref) => (\n <Checkbox ref={ref} {...props} label={inputLabel} />\n )\n);\nCheckboxComponent.displayName = 'CheckboxComponent';\n\nexport const CheckboxElement: FC<CheckboxElementProps> = ({\n autoComplete,\n ...props\n}) => (\n <FormElement\n Element={CheckboxComponent}\n id={props.name}\n data-testid={props.name}\n autoComplete={autoComplete}\n minLength={6}\n maxLength={255}\n {...props}\n />\n);\n","/* eslint-disable import/no-cycle */\nimport type { ComponentProps, ReactNode } from 'react';\nimport { useFormContext } from 'react-hook-form';\nimport { MultiSelect } from '../../Select/Multiselect';\nimport { Form } from '../Form';\nimport { useFormField } from '../FormField';\nimport { FormItemLayout } from '../layout/FormItemLayout';\nimport type { FormElementProps } from './FormElement';\n\ntype SelectElementsProps = Omit<\n FormElementProps<typeof MultiSelect>,\n 'Element'\n> &\n ComponentProps<typeof MultiSelect> & {\n name: string;\n description?: string;\n placeholder?: string;\n className?: string;\n children?: ReactNode;\n };\n\nexport const MultiSelectElement = ({\n name,\n description,\n label,\n isRequired,\n info,\n showErrorMessage,\n children,\n ...props\n}: SelectElementsProps) => {\n const { control } = useFormContext();\n\n return (\n <Form.Field\n control={control}\n name={name}\n render={({ field }) => {\n // eslint-disable-next-line react-hooks/rules-of-hooks, sonarjs/rules-of-hooks\n const { error } = useFormField();\n\n return (\n <FormItemLayout\n htmlFor={name}\n label={label}\n description={description}\n isRequired={isRequired}\n info={info}\n showErrorMessage={showErrorMessage}\n aria-invalid={!!error}\n >\n <MultiSelect\n onValueChange={field.onChange}\n values={field.value}\n {...props}\n >\n {children}\n </MultiSelect>\n </FormItemLayout>\n );\n }}\n />\n );\n};\n","/* eslint-disable react-hooks/rules-of-hooks */\n/* eslint-disable import/no-cycle */\nimport type { ComponentProps, ReactNode } from 'react';\nimport { useFormContext } from 'react-hook-form';\nimport { Select } from '../../Select/Select';\nimport { Form } from '../Form';\nimport { useFormField } from '../FormField';\nimport { FormItemLayout } from '../layout/FormItemLayout';\nimport type { FormElementProps } from './FormElement';\n\ntype SelectElementsProps = Omit<FormElementProps<typeof Select>, 'Element'> &\n ComponentProps<typeof Select> & {\n name: string;\n description?: string;\n placeholder?: string;\n className?: string;\n children?: ReactNode;\n };\n\nexport const SelectElement = ({\n name,\n description,\n label,\n isRequired,\n info,\n showErrorMessage,\n children,\n ...props\n}: SelectElementsProps) => {\n const { control } = useFormContext();\n\n return (\n <Form.Field\n control={control}\n name={name}\n render={({ field }) => {\n const { error } = useFormField();\n\n return (\n <FormItemLayout\n htmlFor={name}\n label={label}\n description={description}\n isRequired={isRequired}\n info={info}\n showErrorMessage={showErrorMessage}\n aria-invalid={!!error}\n >\n <Select\n onValueChange={field.onChange}\n defaultValue={field.value}\n {...props}\n >\n {children}\n </Select>\n </FormItemLayout>\n );\n }}\n />\n );\n};\n","/* eslint-disable import/no-cycle */\nimport type { ComponentProps, ReactNode } from 'react';\nimport { useFormContext } from 'react-hook-form';\nimport { SwitchSelector } from '../../SwitchSelector';\nimport { Form } from '../Form';\nimport { useFormField } from '../FormField';\nimport { FormItemLayout } from '../layout/FormItemLayout';\nimport type { FormElementProps } from './FormElement';\n\ntype SwitchSelectorElementProps = Omit<\n FormElementProps<typeof SwitchSelector>,\n 'Element'\n> &\n ComponentProps<typeof SwitchSelector> & {\n name: string;\n description?: string;\n placeholder?: string;\n className?: string;\n children?: ReactNode;\n };\n\nexport const SwitchSelectorElement = ({\n name,\n description,\n label,\n isRequired,\n info,\n showErrorMessage,\n children,\n ...props\n}: SwitchSelectorElementProps) => {\n const { control } = useFormContext();\n\n return (\n <Form.Field\n control={control}\n name={name}\n render={({ field }) => {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const { error } = useFormField();\n\n return (\n <FormItemLayout\n htmlFor={name}\n label={label}\n description={description}\n isRequired={isRequired}\n info={info}\n showErrorMessage={showErrorMessage}\n aria-invalid={!!error}\n >\n <SwitchSelector {...field} {...props}>\n {children}\n </SwitchSelector>\n </FormItemLayout>\n );\n }}\n />\n );\n};\n","/* eslint-disable import/no-cycle */\nimport { Button } from '../Button';\nimport {\n FormElement,\n InputElement,\n InputPasswordElement,\n TextAreaElement,\n} from './elements';\nimport { AutoSizedTextAreaElement } from './elements/AutoSizeTextAreaElement';\nimport { CheckboxElement } from './elements/CheckboxElement';\nimport { EditableFieldInputElement } from './elements/EditableFieldInputElement';\nimport { EditableFieldTextAreaElement } from './elements/EditableFieldTextAreaElement';\nimport { MultiSelectElement } from './elements/MultiselectElement';\nimport { SelectElement } from './elements/SelectElement';\nimport { SwitchSelectorElement } from './elements/SwitchSelectorElement';\nimport { Form as FormRoot } from './FormBase';\nimport { FormControl } from './FormControl';\nimport { FormDescription } from './FormDescription';\nimport { FormField } from './FormField';\nimport { FormItem } from './FormItem';\nimport { FormMessage } from './FormMessage';\nimport { FormLabelLayout } from './layout';\n\ntype FormType = typeof FormRoot & {\n Description: typeof FormDescription;\n Control: typeof FormControl;\n Field: typeof FormField;\n Item: typeof FormItem;\n Label: typeof FormLabelLayout;\n Message: typeof FormMessage;\n Element: typeof FormElement;\n Button: typeof Button;\n Input: typeof InputElement;\n InputPassword: typeof InputPasswordElement;\n Checkbox: typeof CheckboxElement;\n TextArea: typeof TextAreaElement;\n AutoSizedTextArea: typeof AutoSizedTextAreaElement;\n MultiSelect: typeof MultiSelectElement;\n Select: typeof SelectElement;\n EditableFieldInput: typeof EditableFieldInputElement;\n EditableFieldTextArea: typeof EditableFieldTextAreaElement;\n SwitchSelector: typeof SwitchSelectorElement;\n};\n\n/**\n * Form components\n *\n * Example of usage:\n * ```jsx\n * <Form\n * schema={ZodSchema}\n * onSubmitSuccess={onSubmitSuccess}\n * onSubmitError={onSubmitError}\n * autoComplete\n * >\n * <Form.Input name=\"name\" label=\"Name\" />\n * <Form.Button type=\"submit\" label=\"Click to submit\">\n * Submit\n * </Form.Button>\n * </Form>\n * ```\n */\nexport const Form = FormRoot as FormType;\nForm.Description = FormDescription;\nForm.Control = FormControl;\nForm.Field = FormField;\nForm.Item = FormItem;\nForm.Label = FormLabelLayout;\nForm.Message = FormMessage;\nForm.Element = FormElement;\nForm.Input = InputElement;\nForm.InputPassword = InputPasswordElement;\nForm.Checkbox = CheckboxElement;\nForm.TextArea = TextAreaElement;\nForm.AutoSizedTextArea = AutoSizedTextAreaElement;\nForm.Button = Button;\nForm.Select = SelectElement;\nForm.MultiSelect = MultiSelectElement;\nForm.EditableFieldInput = EditableFieldInputElement;\nForm.EditableFieldTextArea = EditableFieldTextAreaElement;\nForm.SwitchSelector = SwitchSelectorElement;\n"],"names":["jsxs","jsx","FormLabelLayout","useFormField","useFormContext","Input","InputPassword","TextArea","EditableFieldInput","EditableFieldTextArea","AutoSizedTextArea","forwardRef","Checkbox","MultiSelect","Select","SwitchSelector","FormRoot","FormDescription","FormControl","FormField","FormItem","FormMessage","Button"],"mappings":"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"}
|
package/dist/Form-CVD_3nCD.js
DELETED
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { Button } from "./components/Button/Button.mjs";
|
|
3
|
-
import { j as jsxRuntimeExports } from "./jsx-runtime-DaNGiM0W.js";
|
|
4
|
-
import { useFormContext } from "react-hook-form";
|
|
5
|
-
import { Input } from "./components/Input/Input.mjs";
|
|
6
|
-
import { InputPassword } from "./components/Input/InputPassword.mjs";
|
|
7
|
-
import { Checkbox } from "./components/Input/Checkbox.mjs";
|
|
8
|
-
import { TextArea } from "./components/TextArea/TextArea.mjs";
|
|
9
|
-
import { EditableFieldInput } from "./components/EditableField/EditableFieldInput.mjs";
|
|
10
|
-
import { EditableFieldTextArea } from "./components/EditableField/EditableFieldTextArea.mjs";
|
|
11
|
-
import { AutoSizedTextArea } from "./components/TextArea/AutoSizeTextArea.mjs";
|
|
12
|
-
import { forwardRef } from "react";
|
|
13
|
-
import { MultiSelect } from "./components/Select/Multiselect.mjs";
|
|
14
|
-
import { useFormField, FormField } from "./components/Form/FormField.mjs";
|
|
15
|
-
import { FormLabelLayout } from "./components/Form/layout/FormLabelLayout.mjs";
|
|
16
|
-
import { Select } from "./components/Select/Select.mjs";
|
|
17
|
-
import { SwitchSelector } from "./components/SwitchSelector/index.mjs";
|
|
18
|
-
import { Form as Form$1 } from "./components/Form/FormBase.mjs";
|
|
19
|
-
import { FormControl } from "./components/Form/FormControl.mjs";
|
|
20
|
-
import { FormDescription } from "./components/Form/FormDescription.mjs";
|
|
21
|
-
import { FormItem } from "./components/Form/FormItem.mjs";
|
|
22
|
-
import { FormMessage } from "./components/Form/FormMessage.mjs";
|
|
23
|
-
import "clsx";
|
|
24
|
-
import "tailwind-merge";
|
|
25
|
-
import "./components/Form/FormLabel.mjs";
|
|
26
|
-
const FormItemLayout = ({
|
|
27
|
-
label,
|
|
28
|
-
description,
|
|
29
|
-
isRequired,
|
|
30
|
-
info,
|
|
31
|
-
children,
|
|
32
|
-
showErrorMessage = true,
|
|
33
|
-
htmlFor
|
|
34
|
-
}) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Form.Item, { className: "w-full", children: [
|
|
35
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "leading-none", children: [
|
|
36
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(FormLabelLayout, { isRequired, info, htmlFor, children: label }),
|
|
37
|
-
description && /* @__PURE__ */ jsxRuntimeExports.jsx(Form.Description, { children: description })
|
|
38
|
-
] }),
|
|
39
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Form.Control, { children }),
|
|
40
|
-
showErrorMessage && /* @__PURE__ */ jsxRuntimeExports.jsx(Form.Message, { "data-testid": "error-message" })
|
|
41
|
-
] });
|
|
42
|
-
const FormFieldElement = ({
|
|
43
|
-
field,
|
|
44
|
-
name,
|
|
45
|
-
label,
|
|
46
|
-
Element,
|
|
47
|
-
isRequired = false,
|
|
48
|
-
info,
|
|
49
|
-
description,
|
|
50
|
-
showErrorMessage = true,
|
|
51
|
-
...props
|
|
52
|
-
}) => {
|
|
53
|
-
const { error } = useFormField();
|
|
54
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
55
|
-
FormItemLayout,
|
|
56
|
-
{
|
|
57
|
-
htmlFor: name,
|
|
58
|
-
label,
|
|
59
|
-
description,
|
|
60
|
-
isRequired,
|
|
61
|
-
info,
|
|
62
|
-
showErrorMessage,
|
|
63
|
-
"aria-invalid": !!error,
|
|
64
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Element, { "data-testid": "element", id: name, ...field, ...props, children: props.children })
|
|
65
|
-
}
|
|
66
|
-
);
|
|
67
|
-
};
|
|
68
|
-
const FormElement = (props) => {
|
|
69
|
-
const { control } = useFormContext();
|
|
70
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
71
|
-
Form.Field,
|
|
72
|
-
{
|
|
73
|
-
control,
|
|
74
|
-
name: props.name,
|
|
75
|
-
render: ({ field }) => /* @__PURE__ */ jsxRuntimeExports.jsx(FormFieldElement, { ...props, field })
|
|
76
|
-
}
|
|
77
|
-
);
|
|
78
|
-
};
|
|
79
|
-
const InputElement = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
80
|
-
FormElement,
|
|
81
|
-
{
|
|
82
|
-
id: props.name,
|
|
83
|
-
"data-testid": props.name,
|
|
84
|
-
Element: Input,
|
|
85
|
-
...props
|
|
86
|
-
}
|
|
87
|
-
);
|
|
88
|
-
const InputPasswordElement = ({
|
|
89
|
-
autoComplete,
|
|
90
|
-
...props
|
|
91
|
-
}) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
92
|
-
FormElement,
|
|
93
|
-
{
|
|
94
|
-
Element: InputPassword,
|
|
95
|
-
id: props.name,
|
|
96
|
-
"data-testid": props.name,
|
|
97
|
-
autoComplete,
|
|
98
|
-
minLength: 6,
|
|
99
|
-
maxLength: 255,
|
|
100
|
-
...props
|
|
101
|
-
}
|
|
102
|
-
);
|
|
103
|
-
const TextAreaElement = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
104
|
-
FormElement,
|
|
105
|
-
{
|
|
106
|
-
Element: TextArea,
|
|
107
|
-
id: props.name,
|
|
108
|
-
"data-testid": props.name,
|
|
109
|
-
...props
|
|
110
|
-
}
|
|
111
|
-
);
|
|
112
|
-
const EditableFieldInputElement = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
113
|
-
FormElement,
|
|
114
|
-
{
|
|
115
|
-
id: props.name,
|
|
116
|
-
"data-testid": props.name,
|
|
117
|
-
Element: EditableFieldInput,
|
|
118
|
-
...props
|
|
119
|
-
}
|
|
120
|
-
);
|
|
121
|
-
const EditableFieldTextAreaElement = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
122
|
-
FormElement,
|
|
123
|
-
{
|
|
124
|
-
id: props.name,
|
|
125
|
-
"data-testid": props.name,
|
|
126
|
-
Element: EditableFieldTextArea,
|
|
127
|
-
...props
|
|
128
|
-
}
|
|
129
|
-
);
|
|
130
|
-
const AutoSizedTextAreaElement = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
131
|
-
FormElement,
|
|
132
|
-
{
|
|
133
|
-
Element: AutoSizedTextArea,
|
|
134
|
-
id: props.name,
|
|
135
|
-
"data-testid": props.name,
|
|
136
|
-
...props
|
|
137
|
-
}
|
|
138
|
-
);
|
|
139
|
-
const CheckboxComponent = forwardRef(
|
|
140
|
-
({ inputLabel, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, { ref, ...props, label: inputLabel })
|
|
141
|
-
);
|
|
142
|
-
CheckboxComponent.displayName = "CheckboxComponent";
|
|
143
|
-
const CheckboxElement = ({
|
|
144
|
-
autoComplete,
|
|
145
|
-
...props
|
|
146
|
-
}) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
147
|
-
FormElement,
|
|
148
|
-
{
|
|
149
|
-
Element: CheckboxComponent,
|
|
150
|
-
id: props.name,
|
|
151
|
-
"data-testid": props.name,
|
|
152
|
-
autoComplete,
|
|
153
|
-
minLength: 6,
|
|
154
|
-
maxLength: 255,
|
|
155
|
-
...props
|
|
156
|
-
}
|
|
157
|
-
);
|
|
158
|
-
const MultiSelectElement = ({
|
|
159
|
-
name,
|
|
160
|
-
description,
|
|
161
|
-
label,
|
|
162
|
-
isRequired,
|
|
163
|
-
info,
|
|
164
|
-
showErrorMessage,
|
|
165
|
-
children,
|
|
166
|
-
...props
|
|
167
|
-
}) => {
|
|
168
|
-
const { control } = useFormContext();
|
|
169
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
170
|
-
Form.Field,
|
|
171
|
-
{
|
|
172
|
-
control,
|
|
173
|
-
name,
|
|
174
|
-
render: ({ field }) => {
|
|
175
|
-
const { error } = useFormField();
|
|
176
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
177
|
-
FormItemLayout,
|
|
178
|
-
{
|
|
179
|
-
htmlFor: name,
|
|
180
|
-
label,
|
|
181
|
-
description,
|
|
182
|
-
isRequired,
|
|
183
|
-
info,
|
|
184
|
-
showErrorMessage,
|
|
185
|
-
"aria-invalid": !!error,
|
|
186
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
187
|
-
MultiSelect,
|
|
188
|
-
{
|
|
189
|
-
onValueChange: field.onChange,
|
|
190
|
-
values: field.value,
|
|
191
|
-
...props,
|
|
192
|
-
children
|
|
193
|
-
}
|
|
194
|
-
)
|
|
195
|
-
}
|
|
196
|
-
);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
);
|
|
200
|
-
};
|
|
201
|
-
const SelectElement = ({
|
|
202
|
-
name,
|
|
203
|
-
description,
|
|
204
|
-
label,
|
|
205
|
-
isRequired,
|
|
206
|
-
info,
|
|
207
|
-
showErrorMessage,
|
|
208
|
-
children,
|
|
209
|
-
...props
|
|
210
|
-
}) => {
|
|
211
|
-
const { control } = useFormContext();
|
|
212
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
213
|
-
Form.Field,
|
|
214
|
-
{
|
|
215
|
-
control,
|
|
216
|
-
name,
|
|
217
|
-
render: ({ field }) => {
|
|
218
|
-
const { error } = useFormField();
|
|
219
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
220
|
-
FormItemLayout,
|
|
221
|
-
{
|
|
222
|
-
htmlFor: name,
|
|
223
|
-
label,
|
|
224
|
-
description,
|
|
225
|
-
isRequired,
|
|
226
|
-
info,
|
|
227
|
-
showErrorMessage,
|
|
228
|
-
"aria-invalid": !!error,
|
|
229
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
230
|
-
Select,
|
|
231
|
-
{
|
|
232
|
-
onValueChange: field.onChange,
|
|
233
|
-
defaultValue: field.value,
|
|
234
|
-
...props,
|
|
235
|
-
children
|
|
236
|
-
}
|
|
237
|
-
)
|
|
238
|
-
}
|
|
239
|
-
);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
);
|
|
243
|
-
};
|
|
244
|
-
const SwitchSelectorElement = ({
|
|
245
|
-
name,
|
|
246
|
-
description,
|
|
247
|
-
label,
|
|
248
|
-
isRequired,
|
|
249
|
-
info,
|
|
250
|
-
showErrorMessage,
|
|
251
|
-
children,
|
|
252
|
-
...props
|
|
253
|
-
}) => {
|
|
254
|
-
const { control } = useFormContext();
|
|
255
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
256
|
-
Form.Field,
|
|
257
|
-
{
|
|
258
|
-
control,
|
|
259
|
-
name,
|
|
260
|
-
render: ({ field }) => {
|
|
261
|
-
const { error } = useFormField();
|
|
262
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
263
|
-
FormItemLayout,
|
|
264
|
-
{
|
|
265
|
-
htmlFor: name,
|
|
266
|
-
label,
|
|
267
|
-
description,
|
|
268
|
-
isRequired,
|
|
269
|
-
info,
|
|
270
|
-
showErrorMessage,
|
|
271
|
-
"aria-invalid": !!error,
|
|
272
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(SwitchSelector, { ...field, ...props, children })
|
|
273
|
-
}
|
|
274
|
-
);
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
);
|
|
278
|
-
};
|
|
279
|
-
const Form = Form$1;
|
|
280
|
-
Form.Description = FormDescription;
|
|
281
|
-
Form.Control = FormControl;
|
|
282
|
-
Form.Field = FormField;
|
|
283
|
-
Form.Item = FormItem;
|
|
284
|
-
Form.Label = FormLabelLayout;
|
|
285
|
-
Form.Message = FormMessage;
|
|
286
|
-
Form.Element = FormElement;
|
|
287
|
-
Form.Input = InputElement;
|
|
288
|
-
Form.InputPassword = InputPasswordElement;
|
|
289
|
-
Form.Checkbox = CheckboxElement;
|
|
290
|
-
Form.TextArea = TextAreaElement;
|
|
291
|
-
Form.AutoSizedTextArea = AutoSizedTextAreaElement;
|
|
292
|
-
Form.Button = Button;
|
|
293
|
-
Form.Select = SelectElement;
|
|
294
|
-
Form.MultiSelect = MultiSelectElement;
|
|
295
|
-
Form.EditableFieldInput = EditableFieldInputElement;
|
|
296
|
-
Form.EditableFieldTextArea = EditableFieldTextAreaElement;
|
|
297
|
-
Form.SwitchSelector = SwitchSelectorElement;
|
|
298
|
-
export {
|
|
299
|
-
CheckboxElement as C,
|
|
300
|
-
EditableFieldInputElement as E,
|
|
301
|
-
Form as F,
|
|
302
|
-
InputElement as I,
|
|
303
|
-
MultiSelectElement as M,
|
|
304
|
-
SelectElement as S,
|
|
305
|
-
TextAreaElement as T,
|
|
306
|
-
FormElement as a,
|
|
307
|
-
InputPasswordElement as b,
|
|
308
|
-
EditableFieldTextAreaElement as c,
|
|
309
|
-
FormItemLayout as d,
|
|
310
|
-
SwitchSelectorElement as e
|
|
311
|
-
};
|
|
312
|
-
//# sourceMappingURL=Form-CVD_3nCD.js.map
|