@trackunit/react-form-components 0.0.148 → 0.0.150
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/index.cjs.js +2 -2
- package/index.esm.js +2 -2
- package/package.json +2 -2
- package/src/components/FormGroup/FormGroup.d.ts +6 -2
package/index.cjs.js
CHANGED
|
@@ -2964,8 +2964,8 @@ const cvaHelpAddon = cssClassVarianceUtilities.cvaMerge(["ml-auto"]);
|
|
|
2964
2964
|
* @param {FormGroupProps} props - The props for the FormGroup component
|
|
2965
2965
|
* @returns {JSX.Element} FormGroup component
|
|
2966
2966
|
*/
|
|
2967
|
-
const FormGroup = ({ isInvalid, helpText, helpAddon, tip, className, dataTestId, label, htmlFor, children, disabled = false, }) => {
|
|
2968
|
-
return (jsxRuntime.jsxs("div", { className: cvaFormGroup({ disabled, className }), "data-testid": dataTestId, children: [jsxRuntime.jsxs("div", { className: cvaFormGroupContainerBefore({ className }), children: [jsxRuntime.jsx(Label, { className: "component-formGroup-font", dataTestId: dataTestId && `${dataTestId}-label`, htmlFor: htmlFor, id: htmlFor + "-label", children: label }), tip && jsxRuntime.jsx(reactComponents.Tip, { dataTestId: dataTestId && `${dataTestId}-tip`, children: tip })] }), children, jsxRuntime.jsxs("div", { className: cvaFormGroupContainerAfter({ invalid: isInvalid }), children: [helpText && jsxRuntime.jsx("span", { "data-testid": dataTestId && `${dataTestId}-helpText`, children: helpText }), helpAddon && (jsxRuntime.jsx("span", { className: cvaHelpAddon(), "data-testid": dataTestId && `${dataTestId}-helpAddon`, children: helpAddon }))] })] }));
|
|
2967
|
+
const FormGroup = ({ isInvalid, helpText, helpAddon, tip, className, dataTestId, label, htmlFor, children, tipIconProps, disabled = false, }) => {
|
|
2968
|
+
return (jsxRuntime.jsxs("div", { className: cvaFormGroup({ disabled, className }), "data-testid": dataTestId, children: [jsxRuntime.jsxs("div", { className: cvaFormGroupContainerBefore({ className }), children: [jsxRuntime.jsx(Label, { className: "component-formGroup-font", dataTestId: dataTestId && `${dataTestId}-label`, htmlFor: htmlFor, id: htmlFor + "-label", children: label }), tip && (jsxRuntime.jsx(reactComponents.Tip, { dataTestId: dataTestId && `${dataTestId}-tip`, iconProps: tipIconProps, children: tip }))] }), children, jsxRuntime.jsxs("div", { className: cvaFormGroupContainerAfter({ invalid: isInvalid }), children: [helpText && jsxRuntime.jsx("span", { "data-testid": dataTestId && `${dataTestId}-helpText`, children: helpText }), helpAddon && (jsxRuntime.jsx("span", { className: cvaHelpAddon(), "data-testid": dataTestId && `${dataTestId}-helpAddon`, children: helpAddon }))] })] }));
|
|
2969
2969
|
};
|
|
2970
2970
|
|
|
2971
2971
|
/**
|
package/index.esm.js
CHANGED
|
@@ -2938,8 +2938,8 @@ const cvaHelpAddon = cvaMerge(["ml-auto"]);
|
|
|
2938
2938
|
* @param {FormGroupProps} props - The props for the FormGroup component
|
|
2939
2939
|
* @returns {JSX.Element} FormGroup component
|
|
2940
2940
|
*/
|
|
2941
|
-
const FormGroup = ({ isInvalid, helpText, helpAddon, tip, className, dataTestId, label, htmlFor, children, disabled = false, }) => {
|
|
2942
|
-
return (jsxs("div", { className: cvaFormGroup({ disabled, className }), "data-testid": dataTestId, children: [jsxs("div", { className: cvaFormGroupContainerBefore({ className }), children: [jsx$1(Label, { className: "component-formGroup-font", dataTestId: dataTestId && `${dataTestId}-label`, htmlFor: htmlFor, id: htmlFor + "-label", children: label }), tip && jsx$1(Tip, { dataTestId: dataTestId && `${dataTestId}-tip`, children: tip })] }), children, jsxs("div", { className: cvaFormGroupContainerAfter({ invalid: isInvalid }), children: [helpText && jsx$1("span", { "data-testid": dataTestId && `${dataTestId}-helpText`, children: helpText }), helpAddon && (jsx$1("span", { className: cvaHelpAddon(), "data-testid": dataTestId && `${dataTestId}-helpAddon`, children: helpAddon }))] })] }));
|
|
2941
|
+
const FormGroup = ({ isInvalid, helpText, helpAddon, tip, className, dataTestId, label, htmlFor, children, tipIconProps, disabled = false, }) => {
|
|
2942
|
+
return (jsxs("div", { className: cvaFormGroup({ disabled, className }), "data-testid": dataTestId, children: [jsxs("div", { className: cvaFormGroupContainerBefore({ className }), children: [jsx$1(Label, { className: "component-formGroup-font", dataTestId: dataTestId && `${dataTestId}-label`, htmlFor: htmlFor, id: htmlFor + "-label", children: label }), tip && (jsx$1(Tip, { dataTestId: dataTestId && `${dataTestId}-tip`, iconProps: tipIconProps, children: tip }))] }), children, jsxs("div", { className: cvaFormGroupContainerAfter({ invalid: isInvalid }), children: [helpText && jsx$1("span", { "data-testid": dataTestId && `${dataTestId}-helpText`, children: helpText }), helpAddon && (jsx$1("span", { className: cvaHelpAddon(), "data-testid": dataTestId && `${dataTestId}-helpAddon`, children: helpAddon }))] })] }));
|
|
2943
2943
|
};
|
|
2944
2944
|
|
|
2945
2945
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-form-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.150",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@trackunit/css-class-variance-utilities": "0.0.14",
|
|
11
11
|
"@trackunit/i18n-library-translation": "0.0.79",
|
|
12
|
-
"@trackunit/react-components": "0.1.
|
|
12
|
+
"@trackunit/react-components": "0.1.163",
|
|
13
13
|
"@trackunit/shared-utils": "0.0.8",
|
|
14
14
|
"@trackunit/ui-icons": "0.0.76",
|
|
15
15
|
"date-fns": "2.29.3",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
1
|
+
import { CommonProps, IconProps } from "@trackunit/react-components";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
export interface FormGroupProps extends CommonProps {
|
|
4
4
|
/**
|
|
@@ -28,6 +28,10 @@ export interface FormGroupProps extends CommonProps {
|
|
|
28
28
|
*/
|
|
29
29
|
disabled?: boolean;
|
|
30
30
|
children?: React.ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* The props for setting the icon on tip.
|
|
33
|
+
*/
|
|
34
|
+
tipIconProps?: Partial<IconProps>;
|
|
31
35
|
}
|
|
32
36
|
/**
|
|
33
37
|
* The FormGroup component should be used to wrap any Input element that needs a label.
|
|
@@ -36,4 +40,4 @@ export interface FormGroupProps extends CommonProps {
|
|
|
36
40
|
* @param {FormGroupProps} props - The props for the FormGroup component
|
|
37
41
|
* @returns {JSX.Element} FormGroup component
|
|
38
42
|
*/
|
|
39
|
-
export declare const FormGroup: ({ isInvalid, helpText, helpAddon, tip, className, dataTestId, label, htmlFor, children, disabled, }: FormGroupProps) => JSX.Element;
|
|
43
|
+
export declare const FormGroup: ({ isInvalid, helpText, helpAddon, tip, className, dataTestId, label, htmlFor, children, tipIconProps, disabled, }: FormGroupProps) => JSX.Element;
|