mod-arch-shared 1.21.0 → 1.22.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.
|
@@ -14,6 +14,8 @@ type ThemeAwareFormGroupWrapperProps = {
|
|
|
14
14
|
/** Skip wrapping in FormFieldset — use for components like NumberInput */
|
|
15
15
|
skipFieldset?: boolean;
|
|
16
16
|
labelHelp?: React.ReactElement;
|
|
17
|
+
/** Text content for a help popover icon shown next to the label */
|
|
18
|
+
popoverHelpText?: string;
|
|
17
19
|
'data-testid'?: string;
|
|
18
20
|
};
|
|
19
21
|
declare const ThemeAwareFormGroupWrapper: React.FC<ThemeAwareFormGroupWrapperProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeAwareFormGroupWrapper.d.ts","sourceRoot":"","sources":["../../components/ThemeAwareFormGroupWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ThemeAwareFormGroupWrapper.d.ts","sourceRoot":"","sources":["../../components/ThemeAwareFormGroupWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,KAAK,+BAA+B,GAAG;IACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kGAAkG;IAClG,mBAAmB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACtC,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC/B,mEAAmE;IACnE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,QAAA,MAAM,0BAA0B,EAAE,KAAK,CAAC,EAAE,CAAC,+BAA+B,CAmEzE,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { FormGroup } from '@patternfly/react-core';
|
|
3
3
|
import { useThemeContext } from 'mod-arch-kubeflow';
|
|
4
|
+
import FieldGroupHelpLabelIcon from './FieldGroupHelpLabelIcon';
|
|
4
5
|
import FormFieldset from './FormFieldset';
|
|
5
|
-
const ThemeAwareFormGroupWrapper = ({ children, label, fieldId, isRequired, descriptionTextNode, helperTextNode, hasError = false, className, role, isInline, skipFieldset = false, labelHelp, 'data-testid': dataTestId, }) => {
|
|
6
|
+
const ThemeAwareFormGroupWrapper = ({ children, label, fieldId, isRequired, descriptionTextNode, helperTextNode, hasError = false, className, role, isInline, skipFieldset = false, labelHelp, popoverHelpText, 'data-testid': dataTestId, }) => {
|
|
6
7
|
const { isMUITheme } = useThemeContext();
|
|
7
8
|
const errorClass = `${className || ''} ${hasError ? 'pf-m-error' : ''}`.trim();
|
|
9
|
+
const resolvedLabelHelp = labelHelp ??
|
|
10
|
+
(popoverHelpText ? React.createElement(FieldGroupHelpLabelIcon, { content: popoverHelpText }) : undefined);
|
|
8
11
|
const formGroupProps = {
|
|
9
12
|
className: errorClass,
|
|
10
13
|
label,
|
|
@@ -12,13 +15,23 @@ const ThemeAwareFormGroupWrapper = ({ children, label, fieldId, isRequired, desc
|
|
|
12
15
|
fieldId,
|
|
13
16
|
role,
|
|
14
17
|
isInline,
|
|
15
|
-
labelHelp,
|
|
18
|
+
labelHelp: resolvedLabelHelp,
|
|
16
19
|
'data-testid': dataTestId,
|
|
17
20
|
};
|
|
18
21
|
if (isMUITheme) {
|
|
22
|
+
const muiFormGroupProps = {
|
|
23
|
+
className: errorClass,
|
|
24
|
+
label,
|
|
25
|
+
isRequired,
|
|
26
|
+
fieldId,
|
|
27
|
+
role,
|
|
28
|
+
isInline,
|
|
29
|
+
labelHelp: resolvedLabelHelp,
|
|
30
|
+
'data-testid': dataTestId,
|
|
31
|
+
};
|
|
19
32
|
return (React.createElement(React.Fragment, null,
|
|
20
33
|
descriptionTextNode,
|
|
21
|
-
React.createElement(FormGroup, { ...
|
|
34
|
+
React.createElement(FormGroup, { ...muiFormGroupProps }, skipFieldset ? children : React.createElement(FormFieldset, { component: children, field: label })),
|
|
22
35
|
helperTextNode));
|
|
23
36
|
}
|
|
24
37
|
return (React.createElement(React.Fragment, null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeAwareFormGroupWrapper.js","sourceRoot":"","sources":["../../components/ThemeAwareFormGroupWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,YAAY,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"ThemeAwareFormGroupWrapper.js","sourceRoot":"","sources":["../../components/ThemeAwareFormGroupWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAsB1C,MAAM,0BAA0B,GAA8C,CAAC,EAC7E,QAAQ,EACR,KAAK,EACL,OAAO,EACP,UAAU,EACV,mBAAmB,E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;AAEF,eAAe,0BAA0B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mod-arch-shared",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.0",
|
|
4
4
|
"description": "Shared UI components and utilities for modular architecture micro-frontend projects",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"mod-arch-core": ">=1.
|
|
54
|
-
"mod-arch-kubeflow": ">=1.
|
|
53
|
+
"mod-arch-core": ">=1.22.0",
|
|
54
|
+
"mod-arch-kubeflow": ">=1.22.0",
|
|
55
55
|
"react": ">=16.8.0",
|
|
56
56
|
"react-dom": ">=16.8.0",
|
|
57
57
|
"react-router-dom": ">=6.4.0"
|
|
@@ -86,14 +86,14 @@
|
|
|
86
86
|
"ts-jest": "^29.2.6",
|
|
87
87
|
"tsc-alias": "^1.8.15",
|
|
88
88
|
"typescript": "^5.0.4",
|
|
89
|
-
"mod-arch-core": "1.
|
|
90
|
-
"mod-arch-kubeflow": "1.
|
|
89
|
+
"mod-arch-core": "1.22.0",
|
|
90
|
+
"mod-arch-kubeflow": "1.22.0"
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
93
|
"@patternfly/patternfly": "^6.4.0",
|
|
94
94
|
"@patternfly/react-drag-drop": "^6.4.0",
|
|
95
95
|
"classnames": "^2.2.6",
|
|
96
|
-
"dompurify": "^3.4.
|
|
96
|
+
"dompurify": "^3.4.13",
|
|
97
97
|
"lodash-es": "^4.18.1",
|
|
98
98
|
"showdown": "^2.1.0"
|
|
99
99
|
},
|