@intlayer/design-system 3.5.6 → 3.5.8
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 +92 -168
- package/dist/Form-0D7KBafQ.cjs +311 -0
- package/dist/Form-0D7KBafQ.cjs.map +1 -0
- package/dist/Form-7BqwvjVI.cjs +320 -0
- package/dist/Form-7BqwvjVI.cjs.map +1 -0
- package/dist/Form-B2UufQRJ.cjs +319 -0
- package/dist/Form-B2UufQRJ.cjs.map +1 -0
- package/dist/Form-BDcoNTLV.cjs.map +1 -1
- package/dist/Form-BTogr-fp.js +312 -0
- package/dist/Form-BTogr-fp.js.map +1 -0
- package/dist/Form-BVkkvSKP.js +312 -0
- package/dist/Form-BVkkvSKP.js.map +1 -0
- package/dist/Form-Be6Uhb5-.js +312 -0
- package/dist/Form-Be6Uhb5-.js.map +1 -0
- package/dist/Form-BmQQnl-6.js +312 -0
- package/dist/Form-BmQQnl-6.js.map +1 -0
- package/dist/Form-Bp_ubH9I.cjs +311 -0
- package/dist/Form-Bp_ubH9I.cjs.map +1 -0
- package/dist/Form-BtqRbgLu.cjs +311 -0
- package/dist/Form-BtqRbgLu.cjs.map +1 -0
- package/dist/Form-COVZyto7.cjs +311 -0
- package/dist/Form-COVZyto7.cjs.map +1 -0
- package/dist/Form-CVD_3nCD.js +312 -0
- package/dist/Form-CVD_3nCD.js.map +1 -0
- package/dist/Form-Cfklj1_H.js +320 -0
- package/dist/Form-Cfklj1_H.js.map +1 -0
- package/dist/Form-ClAAiVNm.cjs +311 -0
- package/dist/Form-ClAAiVNm.cjs.map +1 -0
- package/dist/Form-DhsgC7kB.js.map +1 -1
- package/dist/Form-OK9zfg6E.js +321 -0
- package/dist/Form-OK9zfg6E.js.map +1 -0
- package/dist/components/Accordion/Accordion.cjs +7 -15
- package/dist/components/Accordion/Accordion.cjs.map +1 -1
- package/dist/components/Accordion/Accordion.d.ts +0 -1
- package/dist/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/Accordion/Accordion.mjs +8 -16
- package/dist/components/Accordion/Accordion.mjs.map +1 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs +1 -1
- package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs +1 -1
- package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.d.ts +4 -4
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs +3 -3
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs.map +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs +1 -1
- package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs +1 -1
- package/dist/components/Auth/SignInForm/SignInForm.cjs +1 -1
- package/dist/components/Auth/SignInForm/SignInForm.mjs +1 -1
- package/dist/components/Auth/SignUpForm/SignUpForm.cjs +1 -1
- package/dist/components/Auth/SignUpForm/SignUpForm.mjs +1 -1
- package/dist/components/Auth/useAuth/useCSRF.cjs +2 -2
- package/dist/components/Auth/useAuth/useCSRF.cjs.map +1 -1
- package/dist/components/Auth/useAuth/useCSRF.d.ts +1 -1
- package/dist/components/Auth/useAuth/useCSRF.mjs +1 -1
- package/dist/components/Auth/useAuth/useCSRF.mjs.map +1 -1
- package/dist/components/Auth/useAuth/useOAuth2.cjs +2 -2
- package/dist/components/Auth/useAuth/useOAuth2.cjs.map +1 -1
- package/dist/components/Auth/useAuth/useOAuth2.d.ts +1 -1
- package/dist/components/Auth/useAuth/useOAuth2.mjs +1 -1
- package/dist/components/Auth/useAuth/useOAuth2.mjs.map +1 -1
- package/dist/components/Auth/useAuth/useSession.cjs +2 -2
- package/dist/components/Auth/useAuth/useSession.cjs.map +1 -1
- package/dist/components/Auth/useAuth/useSession.mjs +1 -1
- package/dist/components/Auth/useAuth/useSession.mjs.map +1 -1
- package/dist/components/Button/Button.cjs +47 -25
- package/dist/components/Button/Button.cjs.map +1 -1
- package/dist/components/Button/Button.d.ts +2 -0
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.mjs +47 -25
- package/dist/components/Button/Button.mjs.map +1 -1
- package/dist/components/Container/index.cjs +1 -1
- package/dist/components/Container/index.cjs.map +1 -1
- package/dist/components/Container/index.mjs +1 -1
- package/dist/components/Container/index.mjs.map +1 -1
- package/dist/components/CopyToClipboard/index.cjs +1 -1
- package/dist/components/CopyToClipboard/index.cjs.map +1 -1
- package/dist/components/CopyToClipboard/index.d.ts.map +1 -1
- package/dist/components/CopyToClipboard/index.mjs +1 -1
- package/dist/components/CopyToClipboard/index.mjs.map +1 -1
- package/dist/components/DictionaryEditor/ItemLayout.cjs +0 -1
- package/dist/components/DictionaryEditor/ItemLayout.cjs.map +1 -1
- package/dist/components/DictionaryEditor/ItemLayout.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/ItemLayout.mjs +0 -1
- package/dist/components/DictionaryEditor/ItemLayout.mjs.map +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.cjs +1 -1
- package/dist/components/DictionaryEditor/ValidDictionaryChangeButtons.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/DictionariesSelector/DictionariesSelector.mjs +2 -2
- 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/DictionaryFieldEditor.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/EditorView/EditorView.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs +14 -13
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs +15 -14
- package/dist/components/DictionaryFieldEditor/EditorView/TextEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/JSONEditor.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/JSONEditor.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs +6 -10
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +6 -10
- package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NodeEditor.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/NodeEditor.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/NodeTypeSelector.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs +1 -1
- package/dist/components/Form/Form.cjs +1 -1
- package/dist/components/Form/Form.d.ts +2 -0
- package/dist/components/Form/Form.d.ts.map +1 -1
- package/dist/components/Form/Form.mjs +1 -1
- package/dist/components/Form/elements/AutoSizeTextAreaElement.cjs +7 -0
- package/dist/components/Form/elements/AutoSizeTextAreaElement.cjs.map +1 -0
- package/dist/components/Form/elements/AutoSizeTextAreaElement.d.ts +9 -0
- package/dist/components/Form/elements/AutoSizeTextAreaElement.d.ts.map +1 -0
- package/dist/components/Form/elements/AutoSizeTextAreaElement.mjs +7 -0
- package/dist/components/Form/elements/AutoSizeTextAreaElement.mjs.map +1 -0
- package/dist/components/Form/elements/CheckboxElement.cjs +1 -1
- package/dist/components/Form/elements/CheckboxElement.mjs +1 -1
- package/dist/components/Form/elements/EditableFieldInputElement.cjs +1 -1
- package/dist/components/Form/elements/EditableFieldInputElement.mjs +1 -1
- package/dist/components/Form/elements/EditableFieldTextAreaElement.cjs +1 -1
- package/dist/components/Form/elements/EditableFieldTextAreaElement.mjs +1 -1
- package/dist/components/Form/elements/FormElement.cjs +1 -1
- package/dist/components/Form/elements/FormElement.mjs +1 -1
- package/dist/components/Form/elements/InputElement.cjs +1 -1
- package/dist/components/Form/elements/InputElement.mjs +1 -1
- package/dist/components/Form/elements/InputPasswordElement.cjs +1 -1
- package/dist/components/Form/elements/InputPasswordElement.mjs +1 -1
- package/dist/components/Form/elements/MultiselectElement.cjs +1 -1
- package/dist/components/Form/elements/MultiselectElement.mjs +1 -1
- package/dist/components/Form/elements/SelectElement.cjs +1 -1
- package/dist/components/Form/elements/SelectElement.mjs +1 -1
- package/dist/components/Form/elements/SwitchSelectorElement.cjs +1 -1
- package/dist/components/Form/elements/SwitchSelectorElement.mjs +1 -1
- package/dist/components/Form/elements/TextAreaElement.cjs +1 -1
- package/dist/components/Form/elements/TextAreaElement.mjs +1 -1
- package/dist/components/Form/elements/index.cjs +1 -1
- package/dist/components/Form/elements/index.mjs +1 -1
- package/dist/components/Form/index.cjs +1 -1
- package/dist/components/Form/index.mjs +1 -1
- package/dist/components/Form/layout/FormItemLayout.cjs +1 -1
- package/dist/components/Form/layout/FormItemLayout.d.ts.map +1 -1
- package/dist/components/Form/layout/FormItemLayout.mjs +1 -1
- package/dist/components/Form/layout/index.cjs +1 -1
- package/dist/components/Form/layout/index.mjs +1 -1
- package/dist/components/IDE/Code.cjs +1 -1
- package/dist/components/IDE/Code.cjs.map +1 -1
- package/dist/components/IDE/Code.mjs +1 -1
- package/dist/components/IDE/Code.mjs.map +1 -1
- package/dist/components/IDE/CodeContext.cjs +1 -1
- package/dist/components/IDE/CodeContext.mjs +1 -1
- package/dist/components/Link/Link.cjs +3 -4
- package/dist/components/Link/Link.cjs.map +1 -1
- package/dist/components/Link/Link.d.ts +1 -1
- package/dist/components/Link/Link.d.ts.map +1 -1
- package/dist/components/Link/Link.mjs +3 -4
- package/dist/components/Link/Link.mjs.map +1 -1
- package/dist/components/Loader/index.cjs +6 -1
- package/dist/components/Loader/index.cjs.map +1 -1
- package/dist/components/Loader/index.content.cjs +23 -0
- package/dist/components/Loader/index.content.cjs.map +1 -0
- package/dist/components/Loader/index.content.d.ts +8 -0
- package/dist/components/Loader/index.content.d.ts.map +1 -0
- package/dist/components/Loader/index.content.mjs +23 -0
- package/dist/components/Loader/index.content.mjs.map +1 -0
- package/dist/components/Loader/index.d.ts +2 -2
- package/dist/components/Loader/index.d.ts.map +1 -1
- package/dist/components/Loader/index.mjs +6 -1
- package/dist/components/Loader/index.mjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs +1 -1
- package/dist/components/MarkDownRender/index.cjs +39 -4
- package/dist/components/MarkDownRender/index.cjs.map +1 -1
- package/dist/components/MarkDownRender/index.d.ts.map +1 -1
- package/dist/components/MarkDownRender/index.mjs +40 -5
- package/dist/components/MarkDownRender/index.mjs.map +1 -1
- package/dist/components/Modal/Modal.cjs +19 -11
- package/dist/components/Modal/Modal.cjs.map +1 -1
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/Modal.mjs +20 -12
- package/dist/components/Modal/Modal.mjs.map +1 -1
- package/dist/components/Navbar/MobileNavbar.cjs +1 -1
- package/dist/components/Navbar/MobileNavbar.mjs +1 -1
- package/dist/components/Navbar/index.cjs +1 -1
- package/dist/components/Navbar/index.mjs +1 -1
- package/dist/components/SwitchSelector/index.cjs +1 -1
- package/dist/components/SwitchSelector/index.mjs +1 -1
- package/dist/components/TabSelector/TabSelector.cjs +1 -1
- package/dist/components/TabSelector/TabSelector.mjs +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/hooks/index.cjs +1 -0
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.mjs +2 -1
- package/dist/hooks/intlayerAPIHooks.cjs +2 -0
- package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
- package/dist/hooks/intlayerAPIHooks.d.ts +50 -49
- package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
- package/dist/hooks/intlayerAPIHooks.mjs +2 -0
- package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
- package/dist/hooks/useAsync/useAsync.cjs +81 -78
- package/dist/hooks/useAsync/useAsync.cjs.map +1 -1
- package/dist/hooks/useAsync/useAsync.d.ts +5 -25
- package/dist/hooks/useAsync/useAsync.d.ts.map +1 -1
- package/dist/hooks/useAsync/useAsync.mjs +81 -78
- package/dist/hooks/useAsync/useAsync.mjs.map +1 -1
- package/dist/hooks/useAsync/useAsyncStateStore.cjs +2 -2
- package/dist/hooks/useAsync/useAsyncStateStore.cjs.map +1 -1
- package/dist/hooks/useAsync/useAsyncStateStore.d.ts +1 -1
- package/dist/hooks/useAsync/useAsyncStateStore.mjs +2 -2
- package/dist/hooks/useAsync/useAsyncStateStore.mjs.map +1 -1
- package/dist/hooks/useGetAllDictionaries.cjs +2 -2
- package/dist/hooks/useGetAllDictionaries.cjs.map +1 -1
- package/dist/hooks/useGetAllDictionaries.d.ts +1 -1
- package/dist/hooks/useGetAllDictionaries.d.ts.map +1 -1
- package/dist/hooks/useGetAllDictionaries.mjs +2 -2
- package/dist/hooks/useGetAllDictionaries.mjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.cjs +2 -2
- package/dist/hooks/useIntlayerAPI.cjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.d.ts +59 -58
- package/dist/hooks/useIntlayerAPI.d.ts.map +1 -1
- package/dist/hooks/useIntlayerAPI.mjs +1 -1
- package/dist/hooks/useIntlayerAPI.mjs.map +1 -1
- package/dist/hooks/usePersistedStore.cjs +7 -5
- package/dist/hooks/usePersistedStore.cjs.map +1 -1
- package/dist/hooks/usePersistedStore.d.ts.map +1 -1
- package/dist/hooks/usePersistedStore.mjs +7 -5
- package/dist/hooks/usePersistedStore.mjs.map +1 -1
- package/dist/index-DFc7og1d.cjs +671 -0
- package/dist/index-DFc7og1d.cjs.map +1 -0
- package/dist/index-DcWYZrJW.js +672 -0
- package/dist/index-DcWYZrJW.js.map +1 -0
- package/dist/libs/intlayer-api/ai.cjs +11 -1
- package/dist/libs/intlayer-api/ai.cjs.map +1 -1
- package/dist/libs/intlayer-api/ai.d.ts +3 -1
- package/dist/libs/intlayer-api/ai.d.ts.map +1 -1
- package/dist/libs/intlayer-api/ai.mjs +11 -1
- package/dist/libs/intlayer-api/ai.mjs.map +1 -1
- package/dist/libs/intlayer-api/index.d.ts +2 -0
- package/dist/libs/intlayer-api/index.d.ts.map +1 -1
- package/dist/tailwind.css +1 -1
- package/package.json +18 -16
|
@@ -0,0 +1,321 @@
|
|
|
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 space-y-2", children: [
|
|
35
|
+
(description || label) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-1 leading-none", children: [
|
|
36
|
+
label && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
37
|
+
FormLabelLayout,
|
|
38
|
+
{
|
|
39
|
+
isRequired,
|
|
40
|
+
info,
|
|
41
|
+
htmlFor,
|
|
42
|
+
children: label
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
description && /* @__PURE__ */ jsxRuntimeExports.jsx(Form.Description, { children: description })
|
|
46
|
+
] }),
|
|
47
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Form.Control, { children }),
|
|
48
|
+
showErrorMessage && /* @__PURE__ */ jsxRuntimeExports.jsx(Form.Message, { "data-testid": "error-message" })
|
|
49
|
+
] });
|
|
50
|
+
const FormFieldElement = ({
|
|
51
|
+
field,
|
|
52
|
+
name,
|
|
53
|
+
label,
|
|
54
|
+
Element,
|
|
55
|
+
isRequired = false,
|
|
56
|
+
info,
|
|
57
|
+
description,
|
|
58
|
+
showErrorMessage = true,
|
|
59
|
+
...props
|
|
60
|
+
}) => {
|
|
61
|
+
const { error } = useFormField();
|
|
62
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
63
|
+
FormItemLayout,
|
|
64
|
+
{
|
|
65
|
+
htmlFor: name,
|
|
66
|
+
label,
|
|
67
|
+
description,
|
|
68
|
+
isRequired,
|
|
69
|
+
info,
|
|
70
|
+
showErrorMessage,
|
|
71
|
+
"aria-invalid": !!error,
|
|
72
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Element, { "data-testid": "element", id: name, ...field, ...props, children: props.children })
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
const FormElement = (props) => {
|
|
77
|
+
const { control } = useFormContext();
|
|
78
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
79
|
+
Form.Field,
|
|
80
|
+
{
|
|
81
|
+
control,
|
|
82
|
+
name: props.name,
|
|
83
|
+
render: ({ field }) => /* @__PURE__ */ jsxRuntimeExports.jsx(FormFieldElement, { ...props, field })
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
const InputElement = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88
|
+
FormElement,
|
|
89
|
+
{
|
|
90
|
+
id: props.name,
|
|
91
|
+
"data-testid": props.name,
|
|
92
|
+
Element: Input,
|
|
93
|
+
...props
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
const InputPasswordElement = ({
|
|
97
|
+
autoComplete,
|
|
98
|
+
...props
|
|
99
|
+
}) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
100
|
+
FormElement,
|
|
101
|
+
{
|
|
102
|
+
Element: InputPassword,
|
|
103
|
+
id: props.name,
|
|
104
|
+
"data-testid": props.name,
|
|
105
|
+
autoComplete,
|
|
106
|
+
minLength: 6,
|
|
107
|
+
maxLength: 255,
|
|
108
|
+
...props
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
const TextAreaElement = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
112
|
+
FormElement,
|
|
113
|
+
{
|
|
114
|
+
Element: TextArea,
|
|
115
|
+
id: props.name,
|
|
116
|
+
"data-testid": props.name,
|
|
117
|
+
...props
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
const EditableFieldInputElement = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
121
|
+
FormElement,
|
|
122
|
+
{
|
|
123
|
+
id: props.name,
|
|
124
|
+
"data-testid": props.name,
|
|
125
|
+
Element: EditableFieldInput,
|
|
126
|
+
...props
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
const EditableFieldTextAreaElement = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
130
|
+
FormElement,
|
|
131
|
+
{
|
|
132
|
+
id: props.name,
|
|
133
|
+
"data-testid": props.name,
|
|
134
|
+
Element: EditableFieldTextArea,
|
|
135
|
+
...props
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
const AutoSizedTextAreaElement = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
139
|
+
FormElement,
|
|
140
|
+
{
|
|
141
|
+
Element: AutoSizedTextArea,
|
|
142
|
+
id: props.name,
|
|
143
|
+
"data-testid": props.name,
|
|
144
|
+
...props
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
const CheckboxComponent = forwardRef(
|
|
148
|
+
({ inputLabel, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, { ref, ...props, label: inputLabel })
|
|
149
|
+
);
|
|
150
|
+
CheckboxComponent.displayName = "CheckboxComponent";
|
|
151
|
+
const CheckboxElement = ({
|
|
152
|
+
autoComplete,
|
|
153
|
+
...props
|
|
154
|
+
}) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
155
|
+
FormElement,
|
|
156
|
+
{
|
|
157
|
+
Element: CheckboxComponent,
|
|
158
|
+
id: props.name,
|
|
159
|
+
"data-testid": props.name,
|
|
160
|
+
autoComplete,
|
|
161
|
+
minLength: 6,
|
|
162
|
+
maxLength: 255,
|
|
163
|
+
...props
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
const MultiSelectElement = ({
|
|
167
|
+
name,
|
|
168
|
+
description,
|
|
169
|
+
label,
|
|
170
|
+
isRequired,
|
|
171
|
+
info,
|
|
172
|
+
showErrorMessage,
|
|
173
|
+
children,
|
|
174
|
+
...props
|
|
175
|
+
}) => {
|
|
176
|
+
const { control } = useFormContext();
|
|
177
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
178
|
+
Form.Field,
|
|
179
|
+
{
|
|
180
|
+
control,
|
|
181
|
+
name,
|
|
182
|
+
render: ({ field }) => {
|
|
183
|
+
const { error } = useFormField();
|
|
184
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
185
|
+
FormItemLayout,
|
|
186
|
+
{
|
|
187
|
+
htmlFor: name,
|
|
188
|
+
label,
|
|
189
|
+
description,
|
|
190
|
+
isRequired,
|
|
191
|
+
info,
|
|
192
|
+
showErrorMessage,
|
|
193
|
+
"aria-invalid": !!error,
|
|
194
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
195
|
+
MultiSelect,
|
|
196
|
+
{
|
|
197
|
+
onValueChange: field.onChange,
|
|
198
|
+
values: field.value,
|
|
199
|
+
...props,
|
|
200
|
+
children
|
|
201
|
+
}
|
|
202
|
+
)
|
|
203
|
+
}
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
);
|
|
208
|
+
};
|
|
209
|
+
const SelectElement = ({
|
|
210
|
+
name,
|
|
211
|
+
description,
|
|
212
|
+
label,
|
|
213
|
+
isRequired,
|
|
214
|
+
info,
|
|
215
|
+
showErrorMessage,
|
|
216
|
+
children,
|
|
217
|
+
...props
|
|
218
|
+
}) => {
|
|
219
|
+
const { control } = useFormContext();
|
|
220
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
221
|
+
Form.Field,
|
|
222
|
+
{
|
|
223
|
+
control,
|
|
224
|
+
name,
|
|
225
|
+
render: ({ field }) => {
|
|
226
|
+
const { error } = useFormField();
|
|
227
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
228
|
+
FormItemLayout,
|
|
229
|
+
{
|
|
230
|
+
htmlFor: name,
|
|
231
|
+
label,
|
|
232
|
+
description,
|
|
233
|
+
isRequired,
|
|
234
|
+
info,
|
|
235
|
+
showErrorMessage,
|
|
236
|
+
"aria-invalid": !!error,
|
|
237
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
238
|
+
Select,
|
|
239
|
+
{
|
|
240
|
+
onValueChange: field.onChange,
|
|
241
|
+
defaultValue: field.value,
|
|
242
|
+
...props,
|
|
243
|
+
children
|
|
244
|
+
}
|
|
245
|
+
)
|
|
246
|
+
}
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
);
|
|
251
|
+
};
|
|
252
|
+
const SwitchSelectorElement = ({
|
|
253
|
+
name,
|
|
254
|
+
description,
|
|
255
|
+
label,
|
|
256
|
+
isRequired,
|
|
257
|
+
info,
|
|
258
|
+
showErrorMessage,
|
|
259
|
+
children,
|
|
260
|
+
...props
|
|
261
|
+
}) => {
|
|
262
|
+
const { control } = useFormContext();
|
|
263
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
264
|
+
Form.Field,
|
|
265
|
+
{
|
|
266
|
+
control,
|
|
267
|
+
name,
|
|
268
|
+
render: ({ field }) => {
|
|
269
|
+
const { error } = useFormField();
|
|
270
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
271
|
+
FormItemLayout,
|
|
272
|
+
{
|
|
273
|
+
htmlFor: name,
|
|
274
|
+
label,
|
|
275
|
+
description,
|
|
276
|
+
isRequired,
|
|
277
|
+
info,
|
|
278
|
+
showErrorMessage,
|
|
279
|
+
"aria-invalid": !!error,
|
|
280
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(SwitchSelector, { ...field, ...props, children })
|
|
281
|
+
}
|
|
282
|
+
);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
);
|
|
286
|
+
};
|
|
287
|
+
const Form = Form$1;
|
|
288
|
+
Form.Description = FormDescription;
|
|
289
|
+
Form.Control = FormControl;
|
|
290
|
+
Form.Field = FormField;
|
|
291
|
+
Form.Item = FormItem;
|
|
292
|
+
Form.Label = FormLabelLayout;
|
|
293
|
+
Form.Message = FormMessage;
|
|
294
|
+
Form.Element = FormElement;
|
|
295
|
+
Form.Input = InputElement;
|
|
296
|
+
Form.InputPassword = InputPasswordElement;
|
|
297
|
+
Form.Checkbox = CheckboxElement;
|
|
298
|
+
Form.TextArea = TextAreaElement;
|
|
299
|
+
Form.AutoSizedTextArea = AutoSizedTextAreaElement;
|
|
300
|
+
Form.Button = Button;
|
|
301
|
+
Form.Select = SelectElement;
|
|
302
|
+
Form.MultiSelect = MultiSelectElement;
|
|
303
|
+
Form.EditableFieldInput = EditableFieldInputElement;
|
|
304
|
+
Form.EditableFieldTextArea = EditableFieldTextAreaElement;
|
|
305
|
+
Form.SwitchSelector = SwitchSelectorElement;
|
|
306
|
+
export {
|
|
307
|
+
AutoSizedTextAreaElement as A,
|
|
308
|
+
CheckboxElement as C,
|
|
309
|
+
EditableFieldInputElement as E,
|
|
310
|
+
Form as F,
|
|
311
|
+
InputElement as I,
|
|
312
|
+
MultiSelectElement as M,
|
|
313
|
+
SelectElement as S,
|
|
314
|
+
TextAreaElement as T,
|
|
315
|
+
FormElement as a,
|
|
316
|
+
InputPasswordElement as b,
|
|
317
|
+
EditableFieldTextAreaElement as c,
|
|
318
|
+
FormItemLayout as d,
|
|
319
|
+
SwitchSelectorElement as e
|
|
320
|
+
};
|
|
321
|
+
//# sourceMappingURL=Form-OK9zfg6E.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Form-OK9zfg6E.js","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 {(description || label) && (\n <div className=\"space-y-1 leading-none\">\n {label && (\n <FormLabelLayout\n isRequired={isRequired}\n info={info}\n htmlFor={htmlFor}\n >\n {label}\n </FormLabelLayout>\n )}\n {description && <Form.Description>{description}</Form.Description>}\n </div>\n )}\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","FormRoot"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAYO,MAAM,iBAA0C,CAAC;AAAA,EACtD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,mBAAmB;AAAA,EACnB;AACF,MACGA,kCAAAA,KAAA,KAAK,MAAL,EAAU,WAAU,oBACjB,UAAA;AAAA,GAAA,eAAe,UACfA,kCAAA,KAAC,OAAI,EAAA,WAAU,0BACZ,UAAA;AAAA,IACC,SAAAC,kCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QAEC,UAAA;AAAA,MAAA;AAAA,IACH;AAAA,IAED,eAAeA,kCAAA,IAAC,KAAK,aAAL,EAAkB,UAAY,YAAA,CAAA;AAAA,EAAA,GACjD;AAAA,EAEDA,kCAAAA,IAAA,KAAK,SAAL,EAAc,SAAS,CAAA;AAAA,EAEvB,oBAAqBA,kCAAA,IAAA,KAAK,SAAL,EAAa,eAAY,gBAAgB,CAAA;AAAA,EACjE,CAAA;ACXF,MAAM,mBAAmB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G;AACL,MAAkC;AAC1B,QAAA,EAAE,QAAQ,IAAI,eAAe;AAGjC,SAAAA,kCAAA;AAAA,IAAC,KAAK;AAAA,IAAL;AAAA,MACC;AAAA,MACA;AAAA,MACA,QAAQ,CAAC,EAAE,YAAY;AAEf,cAAA,EAAE,MAAM,IAAI,aAAa;AAG7B,eAAAA,kCAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,SAAS;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,gBAAc,CAAC,CAAC;AAAA,YAEhB,gDAAC,gBAAgB,EAAA,GAAG,OAAQ,GAAG,OAC5B,SACH,CAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAEJ;AAAA,EACF;AAEJ;ACGO,MAAM,OAAOC;AACpB,KAAK,cAAc;AACnB,KAAK,UAAU;AACf,KAAK,QAAQ;AACb,KAAK,OAAO;AACZ,KAAK,QAAQ;AACb,KAAK,UAAU;AACf,KAAK,UAAU;AACf,KAAK,QAAQ;AACb,KAAK,gBAAgB;AACrB,KAAK,WAAW;AAChB,KAAK,WAAW;AAChB,KAAK,oBAAoB;AACzB,KAAK,SAAS;AACd,KAAK,SAAS;AACd,KAAK,cAAc;AACnB,KAAK,qBAAqB;AAC1B,KAAK,wBAAwB;AAC7B,KAAK,iBAAiB;"}
|
|
@@ -21,20 +21,7 @@ const Accordion = ({
|
|
|
21
21
|
setIsOpen(isOpenDefault);
|
|
22
22
|
}
|
|
23
23
|
}, [isOpenDefault]);
|
|
24
|
-
|
|
25
|
-
() => /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
26
|
-
lucideReact.ChevronDown,
|
|
27
|
-
{
|
|
28
|
-
size: 16,
|
|
29
|
-
className: utils_cn.cn(
|
|
30
|
-
"transform transition-transform duration-500 ease-in-out",
|
|
31
|
-
isOpen ? "rotate-0" : "rotate-180"
|
|
32
|
-
)
|
|
33
|
-
}
|
|
34
|
-
),
|
|
35
|
-
[isOpen]
|
|
36
|
-
);
|
|
37
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment, { children: [
|
|
24
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("div", { children: [
|
|
38
25
|
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
39
26
|
components_Button_Button.Button,
|
|
40
27
|
{
|
|
@@ -45,7 +32,12 @@ const Accordion = ({
|
|
|
45
32
|
onClick?.(e);
|
|
46
33
|
},
|
|
47
34
|
isFullWidth: true,
|
|
48
|
-
|
|
35
|
+
className: "flex items-center justify-between gap-2 bg-red-300",
|
|
36
|
+
IconRight: lucideReact.ChevronDown,
|
|
37
|
+
iconClassName: utils_cn.cn(
|
|
38
|
+
"transform transition-transform duration-500 ease-in-out",
|
|
39
|
+
isOpen ? "rotate-0" : "-rotate-180"
|
|
40
|
+
),
|
|
49
41
|
...props,
|
|
50
42
|
children: header
|
|
51
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.cjs","sources":["../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["'use client';\n\nimport { ChevronDown } from 'lucide-react';\nimport {
|
|
1
|
+
{"version":3,"file":"Accordion.cjs","sources":["../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["'use client';\n\nimport { ChevronDown } from 'lucide-react';\nimport { useEffect, useState, type FC, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { Button, ButtonProps } from '../Button';\nimport { MaxHeightSmoother } from '../MaxHeightSmoother';\n\ntype AccordionProps = {\n header: ReactNode;\n children: ReactNode;\n isOpen?: boolean;\n} & ButtonProps;\n\n/**\n * Accordion component that allows the user to expand and collapse content.\n * It provides a header with a chevron icon that controls the visibility of the content.\n *\n * @param header - The content of the header.\n * @param children - The content to be expanded and collapsed.\n * @param isOpen - Whether the content is expanded or collapsed by default.\n *\n * @example\n * <Accordion header=\"Accordion Header\" isOpen={true}>\n * <p>Accordion content</p>\n * </Accordion>\n *\n */\nexport const Accordion: FC<AccordionProps> = ({\n children,\n header,\n isOpen: isOpenDefault = false,\n onClick,\n ...props\n}) => {\n const [isOpen, setIsOpen] = useState(isOpenDefault);\n const isHidden = isOpen == undefined ? undefined : !isOpen;\n\n useEffect(() => {\n if (isOpenDefault != undefined) {\n setIsOpen(isOpenDefault);\n }\n }, [isOpenDefault]);\n\n return (\n <div>\n <Button\n variant=\"hoverable\"\n color=\"text\"\n onClick={(e) => {\n setIsOpen((prevIsOpen) => !prevIsOpen);\n onClick?.(e);\n }}\n isFullWidth\n className=\"flex items-center justify-between gap-2 bg-red-300\"\n IconRight={ChevronDown}\n iconClassName={cn(\n 'transform transition-transform duration-500 ease-in-out',\n isOpen ? 'rotate-0' : '-rotate-180'\n )}\n {...props}\n >\n {header}\n </Button>\n\n <MaxHeightSmoother\n tabIndex={isHidden !== false ? undefined : -1}\n isHidden={isHidden}\n >\n {children}\n </MaxHeightSmoother>\n </div>\n );\n};\n"],"names":["useState","useEffect","jsx","Button","ChevronDown","cn","MaxHeightSmoother"],"mappings":";;;;;;;;;AA4BO,MAAM,YAAgC,CAAC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA,QAAQ,gBAAgB;AAAA,EACxB;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,CAAC,QAAQ,SAAS,IAAIA,WAAAA,SAAS,aAAa;AAClD,QAAM,WAAW,UAAU,SAAY,SAAY,CAAC;AAEpDC,aAAAA,UAAU,MAAM;AACd,QAAI,iBAAiB,QAAW;AAC9B,gBAAU,aAAa;AAAA,IAAA;AAAA,EACzB,GACC,CAAC,aAAa,CAAC;AAElB,2DACG,OACC,EAAA,UAAA;AAAA,IAAAC,2BAAA,kBAAA;AAAA,MAACC,yBAAA;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,OAAM;AAAA,QACN,SAAS,CAAC,MAAM;AACJ,oBAAA,CAAC,eAAe,CAAC,UAAU;AACrC,oBAAU,CAAC;AAAA,QACb;AAAA,QACA,aAAW;AAAA,QACX,WAAU;AAAA,QACV,WAAWC,YAAA;AAAA,QACX,eAAeC,SAAA;AAAA,UACb;AAAA,UACA,SAAS,aAAa;AAAA,QACxB;AAAA,QACC,GAAG;AAAA,QAEH,UAAA;AAAA,MAAA;AAAA,IACH;AAAA,IAEAH,2BAAA,kBAAA;AAAA,MAACI,mCAAA;AAAA,MAAA;AAAA,QACC,UAAU,aAAa,QAAQ,SAAY;AAAA,QAC3C;AAAA,QAEC;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,GACF;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/Accordion.tsx"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/Accordion.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAuB,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAErE,OAAO,EAAU,WAAW,EAAE,MAAM,WAAW,CAAC;AAGhD,KAAK,cAAc,GAAG;IACpB,MAAM,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GAAG,WAAW,CAAC;AAEhB;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA6CxC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { j as jsxRuntimeExports } from "../../jsx-runtime-DaNGiM0W.js";
|
|
3
3
|
import { ChevronDown } from "lucide-react";
|
|
4
|
-
import { useState, useEffect
|
|
4
|
+
import { useState, useEffect } from "react";
|
|
5
5
|
import { cn } from "../../utils/cn.mjs";
|
|
6
6
|
import { Button } from "../Button/Button.mjs";
|
|
7
7
|
import { MaxHeightSmoother } from "../MaxHeightSmoother/index.mjs";
|
|
@@ -19,20 +19,7 @@ const Accordion = ({
|
|
|
19
19
|
setIsOpen(isOpenDefault);
|
|
20
20
|
}
|
|
21
21
|
}, [isOpenDefault]);
|
|
22
|
-
|
|
23
|
-
() => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24
|
-
ChevronDown,
|
|
25
|
-
{
|
|
26
|
-
size: 16,
|
|
27
|
-
className: cn(
|
|
28
|
-
"transform transition-transform duration-500 ease-in-out",
|
|
29
|
-
isOpen ? "rotate-0" : "rotate-180"
|
|
30
|
-
)
|
|
31
|
-
}
|
|
32
|
-
),
|
|
33
|
-
[isOpen]
|
|
34
|
-
);
|
|
35
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
22
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
36
23
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
37
24
|
Button,
|
|
38
25
|
{
|
|
@@ -43,7 +30,12 @@ const Accordion = ({
|
|
|
43
30
|
onClick?.(e);
|
|
44
31
|
},
|
|
45
32
|
isFullWidth: true,
|
|
46
|
-
|
|
33
|
+
className: "flex items-center justify-between gap-2 bg-red-300",
|
|
34
|
+
IconRight: ChevronDown,
|
|
35
|
+
iconClassName: cn(
|
|
36
|
+
"transform transition-transform duration-500 ease-in-out",
|
|
37
|
+
isOpen ? "rotate-0" : "-rotate-180"
|
|
38
|
+
),
|
|
47
39
|
...props,
|
|
48
40
|
children: header
|
|
49
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.mjs","sources":["../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["'use client';\n\nimport { ChevronDown } from 'lucide-react';\nimport {
|
|
1
|
+
{"version":3,"file":"Accordion.mjs","sources":["../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["'use client';\n\nimport { ChevronDown } from 'lucide-react';\nimport { useEffect, useState, type FC, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { Button, ButtonProps } from '../Button';\nimport { MaxHeightSmoother } from '../MaxHeightSmoother';\n\ntype AccordionProps = {\n header: ReactNode;\n children: ReactNode;\n isOpen?: boolean;\n} & ButtonProps;\n\n/**\n * Accordion component that allows the user to expand and collapse content.\n * It provides a header with a chevron icon that controls the visibility of the content.\n *\n * @param header - The content of the header.\n * @param children - The content to be expanded and collapsed.\n * @param isOpen - Whether the content is expanded or collapsed by default.\n *\n * @example\n * <Accordion header=\"Accordion Header\" isOpen={true}>\n * <p>Accordion content</p>\n * </Accordion>\n *\n */\nexport const Accordion: FC<AccordionProps> = ({\n children,\n header,\n isOpen: isOpenDefault = false,\n onClick,\n ...props\n}) => {\n const [isOpen, setIsOpen] = useState(isOpenDefault);\n const isHidden = isOpen == undefined ? undefined : !isOpen;\n\n useEffect(() => {\n if (isOpenDefault != undefined) {\n setIsOpen(isOpenDefault);\n }\n }, [isOpenDefault]);\n\n return (\n <div>\n <Button\n variant=\"hoverable\"\n color=\"text\"\n onClick={(e) => {\n setIsOpen((prevIsOpen) => !prevIsOpen);\n onClick?.(e);\n }}\n isFullWidth\n className=\"flex items-center justify-between gap-2 bg-red-300\"\n IconRight={ChevronDown}\n iconClassName={cn(\n 'transform transition-transform duration-500 ease-in-out',\n isOpen ? 'rotate-0' : '-rotate-180'\n )}\n {...props}\n >\n {header}\n </Button>\n\n <MaxHeightSmoother\n tabIndex={isHidden !== false ? undefined : -1}\n isHidden={isHidden}\n >\n {children}\n </MaxHeightSmoother>\n </div>\n );\n};\n"],"names":["jsx"],"mappings":";;;;;;;AA4BO,MAAM,YAAgC,CAAC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA,QAAQ,gBAAgB;AAAA,EACxB;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,aAAa;AAClD,QAAM,WAAW,UAAU,SAAY,SAAY,CAAC;AAEpD,YAAU,MAAM;AACd,QAAI,iBAAiB,QAAW;AAC9B,gBAAU,aAAa;AAAA,IAAA;AAAA,EACzB,GACC,CAAC,aAAa,CAAC;AAElB,gDACG,OACC,EAAA,UAAA;AAAA,IAAAA,kCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,OAAM;AAAA,QACN,SAAS,CAAC,MAAM;AACJ,oBAAA,CAAC,eAAe,CAAC,UAAU;AACrC,oBAAU,CAAC;AAAA,QACb;AAAA,QACA,aAAW;AAAA,QACX,WAAU;AAAA,QACV,WAAW;AAAA,QACX,eAAe;AAAA,UACb;AAAA,UACA,SAAS,aAAa;AAAA,QACxB;AAAA,QACC,GAAG;AAAA,QAEH,UAAA;AAAA,MAAA;AAAA,IACH;AAAA,IAEAA,kCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,UAAU,aAAa,QAAQ,SAAY;AAAA,QAC3C;AAAA,QAEC;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,GACF;AAEJ;"}
|
|
@@ -4,7 +4,7 @@ const jsxRuntime = require("../../../jsx-runtime-XHKiWCTo.cjs");
|
|
|
4
4
|
const reactIntlayer = require("react-intlayer");
|
|
5
5
|
const components_Form_FormBase = require("../../Form/FormBase.cjs");
|
|
6
6
|
require("../../Form/FormField.cjs");
|
|
7
|
-
const components_Form_layout_FormItemLayout = require("../../../Form-
|
|
7
|
+
const components_Form_layout_FormItemLayout = require("../../../Form-7BqwvjVI.cjs");
|
|
8
8
|
const components_Auth_useUser_index = require("../useUser/index.cjs");
|
|
9
9
|
const components_Auth_ChangePasswordForm_changePasswordForm_content = require("./changePasswordForm.content.cjs");
|
|
10
10
|
const components_Auth_ChangePasswordForm_useChangePasswordSchema = require("./useChangePasswordSchema.cjs");
|
|
@@ -2,7 +2,7 @@ import { j as jsxRuntimeExports } from "../../../jsx-runtime-DaNGiM0W.js";
|
|
|
2
2
|
import { useDictionary } from "react-intlayer";
|
|
3
3
|
import { useForm } from "../../Form/FormBase.mjs";
|
|
4
4
|
import "../../Form/FormField.mjs";
|
|
5
|
-
import { F as Form } from "../../../Form-
|
|
5
|
+
import { F as Form } from "../../../Form-OK9zfg6E.js";
|
|
6
6
|
import { useUser } from "../useUser/index.mjs";
|
|
7
7
|
import { changePasswordContent } from "./changePasswordForm.content.mjs";
|
|
8
8
|
import { useChangePasswordSchema } from "./useChangePasswordSchema.mjs";
|
|
@@ -4,20 +4,20 @@ export declare const useChangePasswordSchema: () => z.ZodEffects<z.ZodObject<{
|
|
|
4
4
|
newPassword: z.ZodString;
|
|
5
5
|
newPasswordConfirmation: z.ZodString;
|
|
6
6
|
}, "strip", z.ZodTypeAny, {
|
|
7
|
-
newPassword: string;
|
|
8
7
|
currentPassword: string;
|
|
8
|
+
newPassword: string;
|
|
9
9
|
newPasswordConfirmation: string;
|
|
10
10
|
}, {
|
|
11
|
-
newPassword: string;
|
|
12
11
|
currentPassword: string;
|
|
12
|
+
newPassword: string;
|
|
13
13
|
newPasswordConfirmation: string;
|
|
14
14
|
}>, {
|
|
15
|
-
newPassword: string;
|
|
16
15
|
currentPassword: string;
|
|
16
|
+
newPassword: string;
|
|
17
17
|
newPasswordConfirmation: string;
|
|
18
18
|
}, {
|
|
19
|
-
newPassword: string;
|
|
20
19
|
currentPassword: string;
|
|
20
|
+
newPassword: string;
|
|
21
21
|
newPasswordConfirmation: string;
|
|
22
22
|
}>;
|
|
23
23
|
export type ChangePassword = z.infer<ReturnType<typeof useChangePasswordSchema>>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
const jsxRuntime = require("../../../jsx-runtime-XHKiWCTo.cjs");
|
|
5
5
|
const reactIntlayer = require("react-intlayer");
|
|
6
|
-
const
|
|
6
|
+
const index = require("../../../index-DFc7og1d.cjs");
|
|
7
7
|
const components_Button_Button = require("../../Button/Button.cjs");
|
|
8
8
|
const components_Auth_ExternalsLoginButtons_assets_GithubLogo = require("./assets/GithubLogo.cjs");
|
|
9
9
|
const components_Auth_ExternalsLoginButtons_assets_GoogleLogo = require("./assets/GoogleLogo.cjs");
|
|
@@ -12,7 +12,7 @@ const GitHubLoginButton = () => {
|
|
|
12
12
|
const externalsLoginButtons = reactIntlayer.useDictionary(components_Auth_ExternalsLoginButtons_externalsLoginButtons_content.externalsLoginButtonsContent);
|
|
13
13
|
const loginWithGitHub = () => {
|
|
14
14
|
const origin = window.location.href;
|
|
15
|
-
const authURL =
|
|
15
|
+
const authURL = index.intlayerAPI.auth.getLoginWithGitHubURL({ origin });
|
|
16
16
|
window.location.href = authURL;
|
|
17
17
|
};
|
|
18
18
|
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
@@ -30,7 +30,7 @@ const GoogleLoginButton = () => {
|
|
|
30
30
|
const externalsLoginButtons = reactIntlayer.useDictionary(components_Auth_ExternalsLoginButtons_externalsLoginButtons_content.externalsLoginButtonsContent);
|
|
31
31
|
const loginWithGoogle = () => {
|
|
32
32
|
const origin = window.location.href;
|
|
33
|
-
const authURL =
|
|
33
|
+
const authURL = index.intlayerAPI.auth.getLoginWithGoogleURL({ origin });
|
|
34
34
|
window.location.href = authURL;
|
|
35
35
|
};
|
|
36
36
|
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExternalsLoginButtons.cjs","sources":["../../../../src/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.tsx"],"sourcesContent":["'use client';\n\nimport type { FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { intlayerAPI } from '
|
|
1
|
+
{"version":3,"file":"ExternalsLoginButtons.cjs","sources":["../../../../src/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.tsx"],"sourcesContent":["'use client';\n\nimport type { FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { intlayerAPI } from '../../../../../api/src';\nimport { Button } from '../../Button';\nimport { GithubLogo } from './assets/GithubLogo';\nimport { GoogleLogo } from './assets/GoogleLogo';\nimport { externalsLoginButtonsContent } from './externalsLoginButtons.content';\n\nexport const GitHubLoginButton: FC = () => {\n const externalsLoginButtons = useDictionary(externalsLoginButtonsContent);\n const loginWithGitHub = () => {\n const origin = window.location.href;\n\n const authURL = intlayerAPI.auth.getLoginWithGitHubURL({ origin });\n\n window.location.href = authURL;\n };\n\n return (\n <Button\n label={externalsLoginButtons.github.label}\n Icon={GithubLogo}\n onClick={loginWithGitHub}\n color=\"text\"\n >\n {externalsLoginButtons.github.label}\n </Button>\n );\n};\n\nexport const GoogleLoginButton: FC = () => {\n const externalsLoginButtons = useDictionary(externalsLoginButtonsContent);\n const loginWithGoogle = () => {\n const origin = window.location.href;\n\n const authURL = intlayerAPI.auth.getLoginWithGoogleURL({ origin });\n\n window.location.href = authURL;\n };\n\n return (\n <Button\n className=\"bg-red-400 hover:bg-red-500 dark:hover:bg-red-300\"\n label={externalsLoginButtons.google.label}\n Icon={GoogleLogo}\n onClick={loginWithGoogle}\n color=\"custom\"\n >\n {externalsLoginButtons.google.label}\n </Button>\n );\n};\n\nexport const ExternalsLoginButtons: FC = () => {\n const externalsLoginButtons = useDictionary(externalsLoginButtonsContent);\n\n return (\n <div className=\"relative flex flex-col justify-center gap-y-3\">\n <div className=\"mb-3 flex w-full items-center gap-3 text-center text-base\">\n <div className=\"bg-neutral dark:bg-neutral-dark h-px w-full\" />\n <div className=\"text-neutral dark:text-neutral-dark\">\n {externalsLoginButtons.span}\n </div>\n <div className=\"bg-neutral dark:bg-neutral-dark h-px w-full\" />\n </div>\n <GoogleLoginButton />\n <GitHubLoginButton />\n </div>\n );\n};\n"],"names":["useDictionary","externalsLoginButtonsContent","intlayerAPI","jsx","Button","GithubLogo","GoogleLogo","jsxs"],"mappings":";;;;;;;;;;AAWO,MAAM,oB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AAI,EAAA,WAAU,8CAA8C,CAAA;AAAA,IAAA,GAC/D;AAAA,qDACC,mBAAkB,EAAA;AAAA,qDAClB,mBAAkB,CAAA,CAAA;AAAA,EAAA,GACrB;AAEJ;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { j as jsxRuntimeExports } from "../../../jsx-runtime-DaNGiM0W.js";
|
|
3
3
|
import { useDictionary } from "react-intlayer";
|
|
4
|
-
import { intlayerAPI } from "../../../
|
|
4
|
+
import { i as intlayerAPI } from "../../../index-DcWYZrJW.js";
|
|
5
5
|
import { Button } from "../../Button/Button.mjs";
|
|
6
6
|
import { GithubLogo } from "./assets/GithubLogo.mjs";
|
|
7
7
|
import { GoogleLogo } from "./assets/GoogleLogo.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExternalsLoginButtons.mjs","sources":["../../../../src/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.tsx"],"sourcesContent":["'use client';\n\nimport type { FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { intlayerAPI } from '
|
|
1
|
+
{"version":3,"file":"ExternalsLoginButtons.mjs","sources":["../../../../src/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.tsx"],"sourcesContent":["'use client';\n\nimport type { FC } from 'react';\n// @ts-ignore react-intlayer not build yet\nimport { useDictionary } from 'react-intlayer';\nimport { intlayerAPI } from '../../../../../api/src';\nimport { Button } from '../../Button';\nimport { GithubLogo } from './assets/GithubLogo';\nimport { GoogleLogo } from './assets/GoogleLogo';\nimport { externalsLoginButtonsContent } from './externalsLoginButtons.content';\n\nexport const GitHubLoginButton: FC = () => {\n const externalsLoginButtons = useDictionary(externalsLoginButtonsContent);\n const loginWithGitHub = () => {\n const origin = window.location.href;\n\n const authURL = intlayerAPI.auth.getLoginWithGitHubURL({ origin });\n\n window.location.href = authURL;\n };\n\n return (\n <Button\n label={externalsLoginButtons.github.label}\n Icon={GithubLogo}\n onClick={loginWithGitHub}\n color=\"text\"\n >\n {externalsLoginButtons.github.label}\n </Button>\n );\n};\n\nexport const GoogleLoginButton: FC = () => {\n const externalsLoginButtons = useDictionary(externalsLoginButtonsContent);\n const loginWithGoogle = () => {\n const origin = window.location.href;\n\n const authURL = intlayerAPI.auth.getLoginWithGoogleURL({ origin });\n\n window.location.href = authURL;\n };\n\n return (\n <Button\n className=\"bg-red-400 hover:bg-red-500 dark:hover:bg-red-300\"\n label={externalsLoginButtons.google.label}\n Icon={GoogleLogo}\n onClick={loginWithGoogle}\n color=\"custom\"\n >\n {externalsLoginButtons.google.label}\n </Button>\n );\n};\n\nexport const ExternalsLoginButtons: FC = () => {\n const externalsLoginButtons = useDictionary(externalsLoginButtonsContent);\n\n return (\n <div className=\"relative flex flex-col justify-center gap-y-3\">\n <div className=\"mb-3 flex w-full items-center gap-3 text-center text-base\">\n <div className=\"bg-neutral dark:bg-neutral-dark h-px w-full\" />\n <div className=\"text-neutral dark:text-neutral-dark\">\n {externalsLoginButtons.span}\n </div>\n <div className=\"bg-neutral dark:bg-neutral-dark h-px w-full\" />\n </div>\n <GoogleLoginButton />\n <GitHubLoginButton />\n </div>\n );\n};\n"],"names":["jsx","jsxs"],"mappings":";;;;;;;;AAWO,MAAM,oBAAwB,MAAM;AACnC,QAAA,wBAAwB,cAAc,4BAA4B;AACxE,QAAM,kBAAkB,MAAM;AACtB,UAAA,SAAS,OAAO,SAAS;AAE/B,UAAM,UAAU,YAAY,KAAK,sBAAsB,EAAE,QAAQ;AAEjE,WAAO,SAAS,OAAO;AAAA,EACzB;AAGE,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAO,sBAAsB,OAAO;AAAA,MACpC,MAAM;AAAA,MACN,SAAS;AAAA,MACT,OAAM;AAAA,MAEL,gCAAsB,OAAO;AAAA,IAAA;AAAA,EAChC;AAEJ;AAEO,MAAM,oBAAwB,MAAM;AACnC,QAAA,wBAAwB,cAAc,4BAA4B;AACxE,QAAM,kBAAkB,MAAM;AACtB,UAAA,SAAS,OAAO,SAAS;AAE/B,UAAM,UAAU,YAAY,KAAK,sBAAsB,EAAE,QAAQ;AAEjE,WAAO,SAAS,OAAO;AAAA,EACzB;AAGE,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,OAAO,sBAAsB,OAAO;AAAA,MACpC,MAAM;AAAA,MACN,SAAS;AAAA,MACT,OAAM;AAAA,MAEL,gCAAsB,OAAO;AAAA,IAAA;AAAA,EAChC;AAEJ;AAEO,MAAM,wBAA4B,MAAM;AACvC,QAAA,wBAAwB,cAAc,4BAA4B;AAGtE,SAAAC,kCAAA,KAAC,OAAI,EAAA,WAAU,iDACb,UAAA;AAAA,IAACA,kCAAAA,KAAA,OAAA,EAAI,WAAU,6DACb,UAAA;AAAA,MAACD,kCAAAA,IAAA,OAAA,EAAI,WAAU,8CAA8C,CAAA;AAAA,MAC5DA,kCAAA,IAAA,OAAA,EAAI,WAAU,uCACZ,gCAAsB,MACzB;AAAA,MACAA,kCAAAA,IAAC,OAAI,EAAA,WAAU,8CAA8C,CAAA;AAAA,IAAA,GAC/D;AAAA,0CACC,mBAAkB,EAAA;AAAA,0CAClB,mBAAkB,CAAA,CAAA;AAAA,EAAA,GACrB;AAEJ;"}
|
|
@@ -6,7 +6,7 @@ const require$$0 = require("react");
|
|
|
6
6
|
const reactIntlayer = require("react-intlayer");
|
|
7
7
|
const components_Form_FormBase = require("../../Form/FormBase.cjs");
|
|
8
8
|
require("../../Form/FormField.cjs");
|
|
9
|
-
const components_Form_layout_FormItemLayout = require("../../../Form-
|
|
9
|
+
const components_Form_layout_FormItemLayout = require("../../../Form-7BqwvjVI.cjs");
|
|
10
10
|
const components_Auth_ResetPasswordForm_resetPasswordContent_content = require("./resetPasswordContent.content.cjs");
|
|
11
11
|
const components_Auth_ResetPasswordForm_useResetPasswordSchema = require("./useResetPasswordSchema.cjs");
|
|
12
12
|
const ResetPasswordForm = ({
|