@trackunit/react-form-components 0.0.271 → 0.0.272
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 +3 -3
- package/package.json +1 -1
- package/src/components/FormGroup/FormGroup.d.ts +1 -1
package/index.cjs.js
CHANGED
|
@@ -553,13 +553,13 @@ const cvaHelpAddon = cssClassVarianceUtilities.cvaMerge(["ml-auto"]);
|
|
|
553
553
|
|
|
554
554
|
/**
|
|
555
555
|
* The FormGroup component should be used to wrap any Input element that needs a label.
|
|
556
|
-
* Besides a label the component supplies an optional
|
|
556
|
+
* Besides a label the component supplies an optional Tooltip, HelpText and HelpAddon support.
|
|
557
557
|
*
|
|
558
558
|
* @param {FormGroupProps} props - The props for the FormGroup component
|
|
559
559
|
* @returns {JSX.Element} FormGroup component
|
|
560
560
|
*/
|
|
561
561
|
const FormGroup = ({ isInvalid, helpText, helpAddon, tip, className, dataTestId, label, htmlFor, children, tipIconProps, disabled = false, }) => {
|
|
562
|
-
return (jsxRuntime.jsxs("div", { className: cvaFormGroup({ disabled, className }), "data-testid": dataTestId, children: [jsxRuntime.jsxs("div", { className: cvaFormGroupContainerBefore(), children: [jsxRuntime.jsx(Label, { className: "component-formGroup-font", dataTestId: dataTestId && `${dataTestId}-label`, htmlFor: htmlFor, id: htmlFor + "-label", children: label }), tip && (jsxRuntime.jsx(reactComponents.
|
|
562
|
+
return (jsxRuntime.jsxs("div", { className: cvaFormGroup({ disabled, className }), "data-testid": dataTestId, children: [jsxRuntime.jsxs("div", { className: cvaFormGroupContainerBefore(), children: [jsxRuntime.jsx(Label, { className: "component-formGroup-font", dataTestId: dataTestId && `${dataTestId}-label`, htmlFor: htmlFor, id: htmlFor + "-label", children: label }), tip && (jsxRuntime.jsx(reactComponents.Tooltip, { dataTestId: dataTestId && `${dataTestId}-tooltip`, iconProps: tipIconProps, label: tip, placement: "bottom" }))] }), 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 }))] })] }));
|
|
563
563
|
};
|
|
564
564
|
|
|
565
565
|
/**
|
package/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { useNamespaceTranslation, registerTranslations } from '@trackunit/i18n-library-translation';
|
|
3
|
-
import { IconButton, Icon,
|
|
3
|
+
import { IconButton, Icon, Tooltip, Heading, Text, MenuItem, Tag, Spinner } from '@trackunit/react-components';
|
|
4
4
|
import { cvaMerge } from '@trackunit/css-class-variance-utilities';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import React__default, { useMemo, forwardRef, useCallback, cloneElement, useState, useEffect, useRef } from 'react';
|
|
@@ -523,13 +523,13 @@ const cvaHelpAddon = cvaMerge(["ml-auto"]);
|
|
|
523
523
|
|
|
524
524
|
/**
|
|
525
525
|
* The FormGroup component should be used to wrap any Input element that needs a label.
|
|
526
|
-
* Besides a label the component supplies an optional
|
|
526
|
+
* Besides a label the component supplies an optional Tooltip, HelpText and HelpAddon support.
|
|
527
527
|
*
|
|
528
528
|
* @param {FormGroupProps} props - The props for the FormGroup component
|
|
529
529
|
* @returns {JSX.Element} FormGroup component
|
|
530
530
|
*/
|
|
531
531
|
const FormGroup = ({ isInvalid, helpText, helpAddon, tip, className, dataTestId, label, htmlFor, children, tipIconProps, disabled = false, }) => {
|
|
532
|
-
return (jsxs("div", { className: cvaFormGroup({ disabled, className }), "data-testid": dataTestId, children: [jsxs("div", { className: cvaFormGroupContainerBefore(), children: [jsx(Label, { className: "component-formGroup-font", dataTestId: dataTestId && `${dataTestId}-label`, htmlFor: htmlFor, id: htmlFor + "-label", children: label }), tip && (jsx(
|
|
532
|
+
return (jsxs("div", { className: cvaFormGroup({ disabled, className }), "data-testid": dataTestId, children: [jsxs("div", { className: cvaFormGroupContainerBefore(), children: [jsx(Label, { className: "component-formGroup-font", dataTestId: dataTestId && `${dataTestId}-label`, htmlFor: htmlFor, id: htmlFor + "-label", children: label }), tip && (jsx(Tooltip, { dataTestId: dataTestId && `${dataTestId}-tooltip`, iconProps: tipIconProps, label: tip, placement: "bottom" }))] }), children, jsxs("div", { className: cvaFormGroupContainerAfter({ invalid: isInvalid }), children: [helpText && jsx("span", { "data-testid": dataTestId && `${dataTestId}-helpText`, children: helpText }), helpAddon && (jsx("span", { className: cvaHelpAddon(), "data-testid": dataTestId && `${dataTestId}-helpAddon`, children: helpAddon }))] })] }));
|
|
533
533
|
};
|
|
534
534
|
|
|
535
535
|
/**
|
package/package.json
CHANGED
|
@@ -35,7 +35,7 @@ export interface FormGroupProps extends CommonProps {
|
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
37
|
* The FormGroup component should be used to wrap any Input element that needs a label.
|
|
38
|
-
* Besides a label the component supplies an optional
|
|
38
|
+
* Besides a label the component supplies an optional Tooltip, HelpText and HelpAddon support.
|
|
39
39
|
*
|
|
40
40
|
* @param {FormGroupProps} props - The props for the FormGroup component
|
|
41
41
|
* @returns {JSX.Element} FormGroup component
|