@kbgarcia8/react-dynamic-form 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +2 -0
- package/dist/components/atoms/Button/Button.d.ts +4 -0
- package/dist/components/atoms/Button/Button.d.ts.map +1 -0
- package/dist/components/atoms/Button/Button.styles.d.ts +5 -0
- package/dist/components/atoms/Button/Button.styles.d.ts.map +1 -0
- package/dist/components/atoms/Button/index.d.ts +3 -0
- package/dist/components/atoms/Button/index.d.ts.map +1 -0
- package/dist/components/atoms/Input/Input.d.ts +5 -0
- package/dist/components/atoms/Input/Input.d.ts.map +1 -0
- package/dist/components/atoms/Input/Inputs.styles.d.ts +3 -0
- package/dist/components/atoms/Input/Inputs.styles.d.ts.map +1 -0
- package/dist/components/atoms/Input/index.d.ts +3 -0
- package/dist/components/atoms/Input/index.d.ts.map +1 -0
- package/dist/components/atoms/Label/Label.d.ts +5 -0
- package/dist/components/atoms/Label/Label.d.ts.map +1 -0
- package/dist/components/atoms/Label/Label.styles.d.ts +6 -0
- package/dist/components/atoms/Label/Label.styles.d.ts.map +1 -0
- package/dist/components/atoms/Label/index.d.ts +3 -0
- package/dist/components/atoms/Label/index.d.ts.map +1 -0
- package/dist/components/molecules/FormActionButtons/FormActionButtons.d.ts +4 -0
- package/dist/components/molecules/FormActionButtons/FormActionButtons.d.ts.map +1 -0
- package/dist/components/molecules/FormActionButtons/FormActionButtons.styles.d.ts +2 -0
- package/dist/components/molecules/FormActionButtons/FormActionButtons.styles.d.ts.map +1 -0
- package/dist/components/molecules/FormActionButtons/index.d.ts +3 -0
- package/dist/components/molecules/FormActionButtons/index.d.ts.map +1 -0
- package/dist/components/molecules/LabeledInput/LabeledInput.d.ts +5 -0
- package/dist/components/molecules/LabeledInput/LabeledInput.d.ts.map +1 -0
- package/dist/components/molecules/LabeledInput/LabeledInput.styles.d.ts +3 -0
- package/dist/components/molecules/LabeledInput/LabeledInput.styles.d.ts.map +1 -0
- package/dist/components/molecules/LabeledInput/index.d.ts +3 -0
- package/dist/components/molecules/LabeledInput/index.d.ts.map +1 -0
- package/dist/components/molecules/NestedEditableOption/NestedEditableOption.d.ts +4 -0
- package/dist/components/molecules/NestedEditableOption/NestedEditableOption.d.ts.map +1 -0
- package/dist/components/molecules/NestedEditableOption/NestedEditableOption.styles.d.ts +5 -0
- package/dist/components/molecules/NestedEditableOption/NestedEditableOption.styles.d.ts.map +1 -0
- package/dist/components/molecules/NestedEditableOption/index.d.ts +3 -0
- package/dist/components/molecules/NestedEditableOption/index.d.ts.map +1 -0
- package/dist/components/organisms/DynamicForm/DynamicForm.d.ts +5 -0
- package/dist/components/organisms/DynamicForm/DynamicForm.d.ts.map +1 -0
- package/dist/components/organisms/DynamicForm/DynamicForm.styles.d.ts +8 -0
- package/dist/components/organisms/DynamicForm/DynamicForm.styles.d.ts.map +1 -0
- package/dist/components/organisms/DynamicForm/index.d.ts +3 -0
- package/dist/components/organisms/DynamicForm/index.d.ts.map +1 -0
- package/dist/context/ThemeContext.d.ts +4 -0
- package/dist/context/ThemeContext.d.ts.map +1 -0
- package/dist/context/ThemeContextWrapper.d.ts +3 -0
- package/dist/context/ThemeContextWrapper.d.ts.map +1 -0
- package/dist/hooks/useTheme.d.ts +3 -0
- package/dist/hooks/useTheme.d.ts.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/react-dynamic-form.cjs.js +171 -0
- package/dist/react-dynamic-form.es.js +654 -0
- package/dist/styles/theme.d.ts +5 -0
- package/dist/styles/theme.d.ts.map +1 -0
- package/dist/styles/variables.d.ts +3 -0
- package/dist/styles/variables.d.ts.map +1 -0
- package/dist/type/constantTypes.d.ts +30 -0
- package/dist/type/constantTypes.d.ts.map +1 -0
- package/dist/type/propTypes.d.ts +144 -0
- package/dist/type/propTypes.d.ts.map +1 -0
- package/dist/utils/utils.d.ts +6 -0
- package/dist/utils/utils.d.ts.map +1 -0
- package/package.json +57 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Karl Garcia
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ButtonProps } from "../../../type/propTypes";
|
|
2
|
+
declare const Button: ({ onClick, id, buttonType, source, svg, alt, text, className, dataAttributes }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default Button;
|
|
4
|
+
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Button/Button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,QAAA,MAAM,MAAM,GAAI,gFAUd,WAAW,4CAgBZ,CAAA;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const DefaultButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
2
|
+
export declare const ButtonTextAndIconSpace: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
|
+
export declare const ButtonIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never>> & string;
|
|
4
|
+
export declare const ButtonText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
5
|
+
//# sourceMappingURL=Button.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Button/Button.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,yOA0BzB,CAAC;AAEF,eAAO,MAAM,sBAAsB,6NAMlC,CAAC;AAEF,eAAO,MAAM,UAAU,oOAEtB,CAAC;AAEF,eAAO,MAAM,UAAU,+NAOtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { InputProps } from "../../../type/propTypes";
|
|
3
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement | HTMLTextAreaElement>>;
|
|
4
|
+
export default Input;
|
|
5
|
+
//# sourceMappingURL=Input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,UAAU,EAAgB,MAAM,yBAAyB,CAAC;AAExE,QAAA,MAAM,KAAK,2GAsDT,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const DefaultInput: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, never>> & string;
|
|
2
|
+
export declare const TextArea: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, never>> & string;
|
|
3
|
+
//# sourceMappingURL=Inputs.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Inputs.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Input/Inputs.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,sOAiBxB,CAAC;AAEF,eAAO,MAAM,QAAQ,+OAapB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Input/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { LabelProps } from "../../../type/propTypes";
|
|
3
|
+
declare const Label: ({ htmlFor, textLabel, additionalInfo, $labelFlexDirection, source, svg, className, children }: React.PropsWithChildren<LabelProps>) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export default Label;
|
|
5
|
+
//# sourceMappingURL=Label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Label/Label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,QAAA,MAAM,KAAK,GAAI,+FASZ,KAAK,CAAC,iBAAiB,CAAC,UAAU,CAAC,4CAWrC,CAAA;AAED,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { LabelProps } from "../../../type/propTypes";
|
|
2
|
+
export declare const DefaultLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, Pick<LabelProps, "$labelFlexDirection">>> & string;
|
|
3
|
+
export declare const MainLabelText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
4
|
+
export declare const LabelIconContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
5
|
+
export declare const LabelAdditionalInfo: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
6
|
+
//# sourceMappingURL=Label.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Label.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Label/Label.styles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,eAAO,MAAM,YAAY,qRAiBxB,CAAC;AAEF,eAAO,MAAM,aAAa,+NAEzB,CAAC;AAEF,eAAO,MAAM,kBAAkB,6NAI9B,CAAC;AAEF,eAAO,MAAM,mBAAmB,+NAE/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Label/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { FormActionButtonsProps } from "../../../type/propTypes";
|
|
2
|
+
declare const FormActionButtons: ({ id, hasSubmit, submitText, handleSubmit, hasEdit, editText, handleEdit, hasCancel, cancelText, handleCancel, hasDelete, deleteText, handleDelete, }: FormActionButtonsProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default FormActionButtons;
|
|
4
|
+
//# sourceMappingURL=FormActionButtons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormActionButtons.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/FormActionButtons/FormActionButtons.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEtE,QAAA,MAAM,iBAAiB,GAAI,uJAczB,sBAAsB,4CASvB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const ButtonContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
2
|
+
//# sourceMappingURL=FormActionButtons.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormActionButtons.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/FormActionButtons/FormActionButtons.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,6NAI3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/FormActionButtons/index.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { LabeledInputProps } from "../../../type/propTypes";
|
|
3
|
+
declare const LabeledInput: (props: React.PropsWithChildren<LabeledInputProps>) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export default LabeledInput;
|
|
5
|
+
//# sourceMappingURL=LabeledInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LabeledInput.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/LabeledInput/LabeledInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,iBAAiB,EAAgB,MAAM,yBAAyB,CAAC;AAE/E,QAAA,MAAM,YAAY,GAAI,OAAM,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,4CA8FrE,CAAA;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const LabelAndInputContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
2
|
+
export declare const EditableInputButtonContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
|
+
//# sourceMappingURL=LabeledInput.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LabeledInput.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/LabeledInput/LabeledInput.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB,6NAMlC,CAAC;AAEF,eAAO,MAAM,4BAA4B,6NAKxC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/LabeledInput/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NestedEditableOptionProps } from "../../../type/propTypes";
|
|
2
|
+
declare const NestedEditableOption: ({ legend, idx, editableInformation, onChangeOfEditableOption, onClickSaveEdit, onClickCancelEdit, onClickDeleteEntry }: NestedEditableOptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default NestedEditableOption;
|
|
4
|
+
//# sourceMappingURL=NestedEditableOption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NestedEditableOption.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/NestedEditableOption/NestedEditableOption.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAGzE,QAAA,MAAM,oBAAoB,GAAI,wHAQ5B,yBAAyB,4CA6B1B,CAAA;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const FormFieldset: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>, never>> & string;
|
|
2
|
+
export declare const FormLegend: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>, never>> & string;
|
|
3
|
+
export declare const LabelAndInputContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
|
+
export declare const ButtonContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
5
|
+
//# sourceMappingURL=NestedEditableOption.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NestedEditableOption.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/NestedEditableOption/NestedEditableOption.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,+OAIxB,CAAC;AAEF,eAAO,MAAM,UAAU,mOAMtB,CAAC;AAEF,eAAO,MAAM,sBAAsB,6NAMlC,CAAC;AAEF,eAAO,MAAM,eAAe,6NAI3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/NestedEditableOption/index.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { DynamicFormProps } from "../../../type/propTypes";
|
|
3
|
+
declare const DynamicForm: ({ fieldsets, legendText, isExpandable, id, formInputs, labelAndInputContainerClass, labelClass, inputClass, handleEditableInputEntryChange, handleAddingInputEntry, hasSubmit, hasCancel, hasDelete, hasEdit, submitText, handleSubmitForm, handleSubmit, cancelText, handleCancel, deleteText, handleDelete, editText, handleEdit, className, children }: React.PropsWithChildren<DynamicFormProps>) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export default DynamicForm;
|
|
5
|
+
//# sourceMappingURL=DynamicForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DynamicForm.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/DynamicForm/DynamicForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,KAAK,EAAgB,gBAAgB,EAAgD,MAAM,yBAAyB,CAAC;AAE5H,QAAA,MAAM,WAAW,GAAI,2VA0BnB,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,4CA6I1C,CAAA;AAGD,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const FormLegend: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>, never>> & string;
|
|
2
|
+
export declare const FormFieldset: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>, never>> & string;
|
|
3
|
+
export declare const FieldsetWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
|
+
export declare const FieldsetNoEntryMessage: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
5
|
+
export declare const Form: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, never>> & string;
|
|
6
|
+
export declare const ButtonContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
7
|
+
export declare const ChildrenContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
8
|
+
//# sourceMappingURL=DynamicForm.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DynamicForm.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/DynamicForm/DynamicForm.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,mOAOtB,CAAC;AAEF,eAAO,MAAM,YAAY,+OAIxB,CAAC;AAEF,eAAO,MAAM,eAAe,6NAI3B,CAAC;AAEF,eAAO,MAAM,sBAAsB,6NASlC,CAAA;AAED,eAAO,MAAM,IAAI,mOAKhB,CAAC;AACF,eAAO,MAAM,eAAe,6NAI3B,CAAC;AACF,eAAO,MAAM,iBAAiB,6NAM7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/DynamicForm/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../src/context/ThemeContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAI3D,QAAA,MAAM,YAAY,wDAA0D,CAAC;AAE7E,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeContextWrapper.d.ts","sourceRoot":"","sources":["../../src/context/ThemeContextWrapper.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAUtD,eAAO,MAAM,oBAAoB,GAAI,cAAW,YAAY,4CAY3D,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../src/hooks/useTheme.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,QAAQ,iEAAyC,CAAC;AAExD,eAAe,QAAQ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as DynamicForm } from "./components/organisms/DynamicForm";
|
|
2
|
+
export { ThemeContextProvider } from "./context/ThemeContextWrapper";
|
|
3
|
+
export { default as ThemeContext } from "./context/ThemeContext";
|
|
4
|
+
export { default as useTheme } from "./hooks/useTheme";
|
|
5
|
+
export * from "./styles/theme";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),v=require("react"),c=require("styled-components"),t={fonts:{secondary:"Raleway",tertiary:"Lato",fallback:"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif"},fontWeight:{light:300,medium:500,bold:700,bolder:900},fontSize:{xsmall:"0.75rem"},spacing:{xxxsmall:"0.25rem",xxsmall:"0.375rem",xsmall:"0.5rem",small:"0.75rem",medium:"1.25rem"},borderRadius:{xsmall:"0.125rem",small:"0.25rem",xlarge:"2rem"},borderThickness:{thin:"0.0625rem",light:"0.125rem"}},Q=c.button`
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
background-color: ${({theme:n})=>n.colors.blue||"blue"};
|
|
6
|
+
color: ${({theme:n})=>n.colors.bg||"white"};
|
|
7
|
+
border: ${t.borderThickness.light} solid ${({theme:n})=>n.colors.text||"black"};
|
|
8
|
+
border-radius: ${t.borderRadius.xlarge};
|
|
9
|
+
padding: ${t.spacing.xxxsmall} ${t.spacing.small};
|
|
10
|
+
margin: 0.125rem;
|
|
11
|
+
width: auto;
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
transition: background-color 0.2s ease, border-color 0.2s ease;
|
|
14
|
+
|
|
15
|
+
&:hover {
|
|
16
|
+
background-color: lightblue;
|
|
17
|
+
border: ${t.borderThickness.light} solid gray;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
& .button-icon-text-space {
|
|
21
|
+
max-width: 100%;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
& .button-icon-text-space svg {
|
|
25
|
+
max-width: 100%;
|
|
26
|
+
}
|
|
27
|
+
`,V=c.div`
|
|
28
|
+
width: 100%;
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: row;
|
|
31
|
+
align-items: center;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
`,X=c.img`
|
|
34
|
+
maxwidth: 100%;
|
|
35
|
+
`,Y=c.span`
|
|
36
|
+
font-size: ${t.fontSize.xsmall};
|
|
37
|
+
font-weight: ${t.fontWeight.medium};
|
|
38
|
+
font-family: ${t.fonts.tertiary}, ${t.fonts.fallback};
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
`,f=({onClick:n,id:o,buttonType:l,source:s,svg:r,alt:h="alt-button-icon",text:d="",className:i="",dataAttributes:b={}})=>e.jsx(Q,{onClick:n,id:o,type:l,className:i,...b,children:e.jsxs(V,{className:"button-icon-text-space",children:[s?e.jsx(X,{src:s,alt:h}):r||"",d&&e.jsx(Y,{id:o,children:d})]})}),Z=c.div`
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
align-items: left;
|
|
46
|
+
width: 100%;
|
|
47
|
+
margin-bottom: ${t.spacing.small};
|
|
48
|
+
`,_=c.div`
|
|
49
|
+
display: flex;
|
|
50
|
+
gap: ${t.spacing.xsmall};
|
|
51
|
+
width: auto;
|
|
52
|
+
height: auto;
|
|
53
|
+
`,ee=c.label`
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
justify-content:center;
|
|
57
|
+
height: auto;
|
|
58
|
+
flex-direction: ${n=>n.$labelFlexDirection||"column"};
|
|
59
|
+
font-family: ${t.fonts.secondary}, ${t.fonts.fallback};
|
|
60
|
+
font-size: ${t.fontSize.xsmall};
|
|
61
|
+
font-weight: ${t.fontWeight.bold};
|
|
62
|
+
gap: ${t.spacing.xxsmall};
|
|
63
|
+
|
|
64
|
+
& .label-icon-container img,
|
|
65
|
+
& .label-icon-container svg {
|
|
66
|
+
max-width: 100%;
|
|
67
|
+
height: auto;
|
|
68
|
+
object-fit: contain;
|
|
69
|
+
}
|
|
70
|
+
`,te=c.span`
|
|
71
|
+
font-weight: ${t.fontWeight.bolder};
|
|
72
|
+
`,ne=c.div`
|
|
73
|
+
max-width: 100%;
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
`,ae=c.span`
|
|
77
|
+
font-weight: ${t.fontWeight.light};
|
|
78
|
+
`,P=({htmlFor:n,textLabel:o,additionalInfo:l,$labelFlexDirection:s,source:r,svg:h,className:d,children:i})=>e.jsxs(ee,{htmlFor:n,className:d,$labelFlexDirection:s,children:[(r||h)&&e.jsx(ne,{className:"label-icon-container",children:r?e.jsx("img",{src:r,alt:`${n}-label-icon`}):h||""}),e.jsx(te,{className:"main-label",children:o}),l&&e.jsx(ae,{className:"additional-info",children:l}),i]}),W=c.input`
|
|
79
|
+
display: flex;
|
|
80
|
+
place-content: center;
|
|
81
|
+
font-family: ${t.fonts.secondary}, ${t.fonts.fallback};
|
|
82
|
+
font-size: ${t.fontSize.xsmall};
|
|
83
|
+
line-height: 1.75;
|
|
84
|
+
padding: ${t.spacing.xxxsmall} ${t.spacing.xsmall};
|
|
85
|
+
max-width: 100%;
|
|
86
|
+
height: auto;
|
|
87
|
+
background-color: #FFFFFF;
|
|
88
|
+
outline: none;
|
|
89
|
+
border: ${t.borderThickness.thin} solid #000000;
|
|
90
|
+
border-radius: ${t.borderRadius.xsmall};
|
|
91
|
+
|
|
92
|
+
&:focus{
|
|
93
|
+
border: ${t.borderThickness.thin} solid ${({theme:n})=>n.colors.teal};
|
|
94
|
+
}
|
|
95
|
+
`,oe=c.textarea`
|
|
96
|
+
display: flex;
|
|
97
|
+
place-content: center;
|
|
98
|
+
border: ${t.borderThickness.light} solid ${({theme:n})=>n.colors.text};
|
|
99
|
+
border-radius: ${t.borderRadius.small};
|
|
100
|
+
outline: none;
|
|
101
|
+
line-height: ${t.spacing.small};
|
|
102
|
+
padding: ${t.spacing.xxxsmall};
|
|
103
|
+
font-family: ${t.fonts.secondary}, ${t.fonts.fallback};
|
|
104
|
+
font-size: ${t.fontSize.xsmall};
|
|
105
|
+
max-width: 100%;
|
|
106
|
+
resize: none;
|
|
107
|
+
overflow-y: auto;
|
|
108
|
+
`,z=v.forwardRef((n,o)=>{const{type:l,id:s,onChange:r,isRequired:h,dataAttributes:d,disabled:i,className:b}=n;if(l==="textarea"){const{rows:j=5,cols:w=30,value:T,...D}=n;return e.jsx(oe,{id:s,onChange:r,value:T,rows:j,cols:w,...d,className:b,ref:o,disabled:i,required:h})}if(l==="radio"||l==="checkbox"){const{checked:j,...w}=n;return e.jsx(W,{ref:o,type:"checkbox",id:s,checked:j,onChange:r,disabled:i,className:b,...d})}const g=n,{value:y,pattern:u,placeholderText:p,...C}=g;return e.jsx(W,{id:s,name:s,placeholder:p,onChange:r,value:y,type:l,required:h,...d,className:b,ref:o,disabled:i,pattern:u})}),E=n=>{const{className:o,type:l,id:s,textLabel:r,additionalInfo:h,$labelFlexDirection:d,svg:i,labelClass:b,onChange:g,isRequired:y,dataAttributes:u,inputClass:p,ref:C,disabled:j,isEditable:w,editIcon:T,onClickEdit:D,deleteIcon:L,onClickDelete:B,idx:S,children:q}=n;return e.jsxs(Z,{className:`${o} ${s.replace("#","")}-label-input-container`,children:[l!=="radio"&&l!=="checkbox"&&e.jsx(P,{htmlFor:s,textLabel:r,additionalInfo:h,$labelFlexDirection:d,svg:i,className:b}),l!=="radio"&&l!=="checkbox"&&l==="textarea"&&(()=>{const{rows:k=5,cols:F=30,value:A,...a}=n;return e.jsx(z,{id:s,name:s,type:"textarea",isRequired:y,onChange:g,value:A,rows:k,cols:F,...u,className:p,ref:C,disabled:j})})(),l!=="radio"&&l!=="checkbox"&&l!=="textarea"&&(()=>{const k=n,{value:F,pattern:A,placeholderText:a,...$}=k;return e.jsx(z,{id:s,name:s,placeholderText:a,onChange:g,value:F,type:l,isRequired:y,...u,className:p,ref:C,disabled:j,pattern:A})})(),(l==="radio"||l==="checkbox")&&(()=>{const{checked:k,...F}=n;return e.jsxs(e.Fragment,{children:[e.jsx(z,{ref:C,type:"checkbox",name:s,id:s,isRequired:y,checked:k,onChange:g,disabled:j,className:p,...u}),e.jsx(P,{htmlFor:s,textLabel:r,additionalInfo:h,$labelFlexDirection:d,svg:i,className:b})]})})(),"// * Radio inputs usually have labels next to them",w&&e.jsxs(_,{className:"input-edit-buttons",children:[e.jsx(f,{id:`editable-${s}-edit-btn`,svg:T,buttonType:"button",onClick:D,className:`edit-radio-${S}`,dataAttributes:u}),e.jsx(f,{id:`editable-${s}-delete-btn`,svg:L,buttonType:"button",onClick:B,className:`delete-radio-${S}`,dataAttributes:u})]}),q]})},se=c.fieldset`
|
|
109
|
+
padding: 0;
|
|
110
|
+
height: auto;
|
|
111
|
+
width: 100%;
|
|
112
|
+
`,le=c.legend`
|
|
113
|
+
font-size: ${t.spacing.medium};
|
|
114
|
+
font-weight: 500;
|
|
115
|
+
margin: 0 auto ${t.spacing.small} auto;
|
|
116
|
+
text-align: center;
|
|
117
|
+
font-family: ${t.fonts.secondary}, ${t.fonts.fallback};
|
|
118
|
+
`,ie=c.div`
|
|
119
|
+
display: flex;
|
|
120
|
+
flex-direction: column;
|
|
121
|
+
align-items: flex-start;
|
|
122
|
+
width: 100%;
|
|
123
|
+
margin-bottom: ${t.spacing.small};
|
|
124
|
+
`,ce=c.div`
|
|
125
|
+
display: flex;
|
|
126
|
+
justify-content: space-between;
|
|
127
|
+
width: 100%;
|
|
128
|
+
`,I=({legend:n,idx:o,editableInformation:l,onChangeOfEditableOption:s,onClickSaveEdit:r,onClickCancelEdit:h,onClickDeleteEntry:d})=>e.jsxs(se,{className:"editable-selection-fieldset",children:[e.jsx(le,{children:`${n} ${o+1}`}),l.map((i,b)=>e.jsx(ie,{className:"editable-selection-container",children:e.jsx(z,{id:`editable-selection-${b}`,name:`editable-selection-${b}`,placeholderText:i.name.charAt(0).toUpperCase()+i.name.slice(1),onChange:s,value:i.info,type:i.type,isRequired:!0,className:"editable-selection",dataAttributes:{"data-index":b,"data-key":i.info}})},`${i.name}-${b}`)),e.jsxs(ce,{className:"editable-selection-button-space",children:[e.jsx(f,{id:`editable-selection-${o}-submit`,buttonType:"submit",text:"Save",onClick:r,className:"editable-selection-btn",dataAttributes:{"data-index":o}}),e.jsx(f,{id:`editable-selection-${o}-cancel`,buttonType:"button",text:"Cancel",onClick:h,className:"editable-selection-btn",dataAttributes:{"data-index":o}}),e.jsx(f,{id:`editable-selection-${o}-delete`,buttonType:"button",text:"Delete",onClick:d,className:"editable-selection-btn",dataAttributes:{"data-index":o}})]})]}),re=c.div`
|
|
129
|
+
display: flex;
|
|
130
|
+
justify-content: space-between;
|
|
131
|
+
max-width: 100%;
|
|
132
|
+
`,de=({id:n,hasSubmit:o,submitText:l,handleSubmit:s,hasEdit:r,editText:h,handleEdit:d,hasCancel:i,cancelText:b,handleCancel:g,hasDelete:y,deleteText:u,handleDelete:p})=>e.jsxs(re,{className:"form-main-button-container",children:[o&&e.jsx(f,{id:`form-${n}-submit`,buttonType:"submit",text:l??"Submit",onClick:s,className:"submit-form-btn"}),r&&e.jsx(f,{id:`form-${n}-edit`,buttonType:"button",text:h??"Edit",onClick:d,className:"edit-form-btn"}),i&&e.jsx(f,{id:`form-${n}-cancel`,buttonType:"button",text:b??"Cancel",onClick:g,className:"cancel-form-btn"}),y&&e.jsx(f,{id:`form-${n}-delete`,buttonType:"button",text:u??"Delete",onClick:p,className:"delete-form-btn"})]}),M=c.legend`
|
|
133
|
+
font-size: ${t.spacing.medium};
|
|
134
|
+
font-weight: 500;
|
|
135
|
+
margin-bottom: ${t.spacing.small};
|
|
136
|
+
width: auto;
|
|
137
|
+
text-align: center;
|
|
138
|
+
font-family: ${t.fonts.secondary}, ${t.fonts.fallback};
|
|
139
|
+
`,U=c.fieldset`
|
|
140
|
+
padding: 0;
|
|
141
|
+
height: auto;
|
|
142
|
+
width: 100%;
|
|
143
|
+
`,H=c.div`
|
|
144
|
+
padding: ${t.spacing.small};
|
|
145
|
+
height: auto;
|
|
146
|
+
width: 100%;
|
|
147
|
+
`,G=c.div`
|
|
148
|
+
display: flex;
|
|
149
|
+
justify-content: center;
|
|
150
|
+
align-items: center;
|
|
151
|
+
width: 100%;
|
|
152
|
+
height: auto;
|
|
153
|
+
font-family: ${t.fonts.tertiary}, ${t.fonts.fallback};
|
|
154
|
+
font-size: ${t.fontSize.xsmall};
|
|
155
|
+
font-weight: ${t.fontWeight.bold};
|
|
156
|
+
`,me=c.form`
|
|
157
|
+
display: flex;
|
|
158
|
+
flex-direction: column;
|
|
159
|
+
align-items: center;
|
|
160
|
+
width: 100%;
|
|
161
|
+
`,J=c.div`
|
|
162
|
+
display: flex;
|
|
163
|
+
justify-content: space-between;
|
|
164
|
+
width: 100%;
|
|
165
|
+
`,be=c.div`
|
|
166
|
+
width: 100%;
|
|
167
|
+
display: flex;
|
|
168
|
+
flex-direction: column;
|
|
169
|
+
align-items: center;
|
|
170
|
+
justify-content: center;
|
|
171
|
+
`,xe=({fieldsets:n=null,legendText:o,isExpandable:l=!1,id:s,formInputs:r,labelAndInputContainerClass:h,labelClass:d,inputClass:i,handleEditableInputEntryChange:b,handleAddingInputEntry:g,hasSubmit:y=!1,hasCancel:u=!1,hasDelete:p=!1,hasEdit:C=!1,submitText:j,handleSubmitForm:w,handleSubmit:T,cancelText:D,handleCancel:L,deleteText:B,handleDelete:S,editText:q,handleEdit:k,className:F,children:A})=>e.jsxs(me,{id:`${s}-form`,className:F,onSubmit:w,children:[n?n.map((a,$)=>e.jsxs(H,{children:[e.jsxs(U,{id:`${s}-form-fieldset-${$}`,className:"form-fieldset",children:[a.legend&&e.jsx(M,{children:a.legend}),a.inputs.length!==0?a.inputs.map((x,N)=>e.jsxs(v.Fragment,{children:[x.type==="textarea"&&e.jsx(E,{...x,id:x.id??`${a.legend}-input`,labelClass:d,inputClass:i,idx:N}),(x.type==="radio"||x.type==="checkbox")&&e.jsx(E,{...x,id:x.id??`${a.legend}-input`,labelClass:d,inputClass:i,idx:N}),x.type!=="textarea"&&x.type!=="radio"&&x.type!=="checkbox"&&e.jsx(E,{...x,id:x.id??`${a.legend}-input`,labelClass:d,inputClass:i,idx:N}),"//* For editable data e.g. address entry, education entry",x.editable&&x.editing&&e.jsx(I,{legend:`${a.legend} ${N+1}`,idx:N,editableInformation:x?.editableInformation,onChangeOfEditableOption:b,onClickSaveEdit:x?.onClickSave,onClickCancelEdit:x?.onClickCancel,onClickDeleteEntry:x?.onClickDelete})]},`form-${s}-${N}`)):a.expandable?e.jsx(G,{children:`No entry yet on ${a.legend}. Click "+" button to add entry.`}):""]}),a.expandable&&e.jsx(J,{className:"add-input-button-space",children:e.jsx(f,{id:`expand-${a.legend}-inputs`,buttonType:"button",text:"+",onClick:g,className:"add-input-entry"})})]},`${a.legend}-${$}`)):e.jsxs(H,{children:[e.jsxs(U,{id:`${s}-form-fieldset`,className:"form-fieldset",children:[o&&e.jsx(M,{children:o}),r.length!==0?r.map((a,$)=>e.jsxs(v.Fragment,{children:[a.type==="textarea"&&e.jsx(E,{...a,id:a.id??`${o}-input`,labelClass:d,inputClass:i,idx:$}),(a.type==="radio"||a.type==="checkbox")&&e.jsx(E,{...a,id:a.id??`${o}-input`,labelClass:d,inputClass:i,idx:$}),a.type!=="textarea"&&a.type!=="radio"&&a.type!=="checkbox"&&e.jsx(E,{...a,id:a.id??`${o}-input`,labelClass:d,inputClass:i,idx:$}),"//*For editable data e.g. address entry, education entry",a.editable&&a.editing&&e.jsx(I,{legend:`${o} ${$+1}`,idx:$,editableInformation:a?.editableInformation,onChangeOfEditableOption:b,onClickSaveEdit:a?.onClickSave,onClickCancelEdit:a?.onClickEdit,onClickDeleteEntry:a?.onClickDelete})]},`form-${s}-${$}`)):l?e.jsx(G,{children:`No entry yet on ${o}. Please click "+" button to add`}):""]}),l&&e.jsx(J,{className:"add-input-button-space",children:e.jsx(f,{id:`expand-${o}-inputs`,buttonType:"button",text:"+",onClick:g,className:"add-input-entry"})})]}),e.jsx(de,{id:s,hasSubmit:y,submitText:j,handleSubmit:T,hasEdit:C,editText:q,handleEdit:k,hasCancel:u,cancelText:D,handleCancel:L,hasDelete:p,deleteText:B,handleDelete:S}),e.jsx(be,{className:"children-container",children:A})]}),he=n=>{const o=/^#([0-9A-Fa-f]{3}){1,2}$/,l=/^rgb(a)?\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}(?:\s*,\s*(0|1|0?\.\d+))?\s*\)$/;return o.test(n)||l.test(n)||CSS.supports("color",n)},m=n=>{if(!he(n))throw new Error(`Invalid color: ${n}`);return n},ue={mobile:"320px",tablet:"768px",desktop:"992px",largeDesktop:"1200px",largerDesktop:"1400px"},R={name:"light",colors:{text:m("#333446"),bg:m("#EEEEEE"),blue:m("#7F8CAA"),blue2:m("#80A6FF"),teal:m("#5b8280ff"),teal2:m("#AEEAE7"),gray:m("#AEAEAE"),information:m("#202234"),success:m("#123524"),warning:m("#F2C265"),error:m("#990000")}},K={name:"dark",colors:{bg:m("#333446"),text:m("#EEEEEE"),blue:m("#80A6FF"),blue2:m("#7F8CAA"),teal:m("#AEEAE7"),teal2:m("#5b8280ff"),gray:m("#D0D0DD"),information:m("#C9E6F0"),success:m("#9EDF9C"),warning:m("#FCFFC1"),error:m("#FAD4D4")}},O=v.createContext(void 0),fe=({children:n})=>{const[o,l]=v.useState(R),s=()=>{l(r=>r===R?K:R)};return e.jsx(O.Provider,{value:{currentTheme:o,toggleTheme:s},children:e.jsx(c.ThemeProvider,{theme:o,children:n})})},ge=()=>v.useContext(O);exports.DynamicForm=xe;exports.ThemeContext=O;exports.ThemeContextProvider=fe;exports.breakpoints=ue;exports.darkTheme=K;exports.lightTheme=R;exports.useTheme=ge;
|