mod-arch-shared 1.17.0 → 1.19.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/dist/components/ThemeAwareFormGroupWrapper.d.ts +2 -0
- package/dist/components/ThemeAwareFormGroupWrapper.d.ts.map +1 -1
- package/dist/components/ThemeAwareFormGroupWrapper.js +3 -1
- package/dist/components/ThemeAwareFormGroupWrapper.js.map +1 -1
- package/dist/components/TruncatedText.d.ts +2 -0
- package/dist/components/TruncatedText.d.ts.map +1 -1
- package/dist/components/TruncatedText.js +2 -2
- package/dist/components/TruncatedText.js.map +1 -1
- package/package.json +6 -6
|
@@ -4,6 +4,8 @@ type ThemeAwareFormGroupWrapperProps = {
|
|
|
4
4
|
label?: string;
|
|
5
5
|
fieldId: string;
|
|
6
6
|
isRequired?: boolean;
|
|
7
|
+
/** Always-visible description text rendered outside the fieldset (MUI) or before children (PF) */
|
|
8
|
+
descriptionTextNode?: React.ReactNode;
|
|
7
9
|
helperTextNode?: React.ReactNode;
|
|
8
10
|
hasError?: boolean;
|
|
9
11
|
className?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeAwareFormGroupWrapper.d.ts","sourceRoot":"","sources":["../../components/ThemeAwareFormGroupWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/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,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,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,QAAA,MAAM,0BAA0B,EAAE,KAAK,CAAC,EAAE,CAAC,+BAA+B,
|
|
1
|
+
{"version":3,"file":"ThemeAwareFormGroupWrapper.d.ts","sourceRoot":"","sources":["../../components/ThemeAwareFormGroupWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/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,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,QAAA,MAAM,0BAA0B,EAAE,KAAK,CAAC,EAAE,CAAC,+BAA+B,CAmDzE,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { FormGroup } from '@patternfly/react-core';
|
|
3
3
|
import { useThemeContext } from 'mod-arch-kubeflow';
|
|
4
4
|
import FormFieldset from './FormFieldset';
|
|
5
|
-
const ThemeAwareFormGroupWrapper = ({ children, label, fieldId, isRequired, helperTextNode, hasError = false, className, role, isInline, skipFieldset = false, labelHelp, 'data-testid': dataTestId, }) => {
|
|
5
|
+
const ThemeAwareFormGroupWrapper = ({ children, label, fieldId, isRequired, descriptionTextNode, helperTextNode, hasError = false, className, role, isInline, skipFieldset = false, labelHelp, 'data-testid': dataTestId, }) => {
|
|
6
6
|
const { isMUITheme } = useThemeContext();
|
|
7
7
|
const errorClass = `${className || ''} ${hasError ? 'pf-m-error' : ''}`.trim();
|
|
8
8
|
const formGroupProps = {
|
|
@@ -17,11 +17,13 @@ const ThemeAwareFormGroupWrapper = ({ children, label, fieldId, isRequired, help
|
|
|
17
17
|
};
|
|
18
18
|
if (isMUITheme) {
|
|
19
19
|
return (React.createElement(React.Fragment, null,
|
|
20
|
+
descriptionTextNode,
|
|
20
21
|
React.createElement(FormGroup, { ...formGroupProps }, skipFieldset ? children : React.createElement(FormFieldset, { component: children, field: label })),
|
|
21
22
|
helperTextNode));
|
|
22
23
|
}
|
|
23
24
|
return (React.createElement(React.Fragment, null,
|
|
24
25
|
React.createElement(FormGroup, { ...formGroupProps },
|
|
26
|
+
descriptionTextNode,
|
|
25
27
|
children,
|
|
26
28
|
helperTextNode)));
|
|
27
29
|
};
|
|
@@ -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,C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fly/react-core';
|
|
2
3
|
type TruncatedTextProps = {
|
|
3
4
|
maxLines: number;
|
|
4
5
|
content: React.ReactNode;
|
|
6
|
+
tooltipPosition?: TooltipProps['position'];
|
|
5
7
|
} & Omit<React.HTMLProps<HTMLSpanElement>, 'content'>;
|
|
6
8
|
declare const TruncatedText: React.FC<TruncatedTextProps>;
|
|
7
9
|
export default TruncatedText;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TruncatedText.d.ts","sourceRoot":"","sources":["../../components/TruncatedText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TruncatedText.d.ts","sourceRoot":"","sources":["../../components/TruncatedText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEpE,KAAK,kBAAkB,GAAG;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,eAAe,CAAC,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;CAC5C,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC,EAAE,SAAS,CAAC,CAAC;AAEtD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA8C/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Tooltip } from '@patternfly/react-core';
|
|
3
|
-
const TruncatedText = ({ maxLines, content, ...props }) => {
|
|
3
|
+
const TruncatedText = ({ maxLines, content, tooltipPosition, ...props }) => {
|
|
4
4
|
const outerElementRef = React.useRef(null);
|
|
5
5
|
const textElementRef = React.useRef(null);
|
|
6
6
|
const [isTruncated, setIsTruncated] = React.useState(false);
|
|
@@ -24,7 +24,7 @@ const TruncatedText = ({ maxLines, content, ...props }) => {
|
|
|
24
24
|
updateTruncation();
|
|
25
25
|
} },
|
|
26
26
|
React.createElement("span", { ref: textElementRef }, content)));
|
|
27
|
-
return (React.createElement(Tooltip, { hidden: !isTruncated ? true : undefined, content: content }, truncateBody));
|
|
27
|
+
return (React.createElement(Tooltip, { hidden: !isTruncated ? true : undefined, content: content, position: tooltipPosition }, truncateBody));
|
|
28
28
|
};
|
|
29
29
|
export default TruncatedText;
|
|
30
30
|
//# sourceMappingURL=TruncatedText.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TruncatedText.js","sourceRoot":"","sources":["../../components/TruncatedText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"TruncatedText.js","sourceRoot":"","sources":["../../components/TruncatedText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAqB,MAAM,wBAAwB,CAAC;AAQpE,MAAM,aAAa,GAAiC,CAAC,EACnD,QAAQ,EACR,OAAO,EACP,eAAe,EACf,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAAc,IAAI,CAAC,CAAC;IACxD,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,CAAc,IAAI,CAAC,CAAC;IACvD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAU,KAAK,CAAC,CAAC;IAErE,MAAM,gBAAgB,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QAC9C,IAAI,cAAc,CAAC,OAAO,IAAI,eAAe,CAAC,OAAO,EAAE,CAAC;YACtD,cAAc,CAAC,cAAc,CAAC,OAAO,CAAC,YAAY,GAAG,eAAe,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QAC7F,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,YAAY,GAAG,CACnB,iCACM,KAAK,EACT,KAAK,EAAE;YACL,OAAO,EAAE,aAAa;YACtB,eAAe,EAAE,UAAU;YAC3B,YAAY,EAAE,UAAU;YACxB,QAAQ,EAAE,QAAQ;YAClB,eAAe,EAAE,QAAQ;YACzB,GAAG,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;SACvB,EACD,GAAG,EAAE,eAAe,EACpB,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE;YAClB,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC;YACxB,gBAAgB,EAAE,CAAC;QACrB,CAAC,EACD,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;YACnB,gBAAgB,EAAE,CAAC;QACrB,CAAC;QAED,8BAAM,GAAG,EAAE,cAAc,IAAG,OAAO,CAAQ,CACtC,CACR,CAAC;IAEF,OAAO,CACL,oBAAC,OAAO,IAAC,MAAM,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,IAC1F,YAAY,CACL,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mod-arch-shared",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.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.19.0",
|
|
54
|
+
"mod-arch-kubeflow": ">=1.19.0",
|
|
55
55
|
"react": ">=16.8.0",
|
|
56
56
|
"react-dom": ">=16.8.0",
|
|
57
57
|
"react-router-dom": ">=6.4.0"
|
|
@@ -81,13 +81,13 @@
|
|
|
81
81
|
"npm-run-all2": "^7.0.1",
|
|
82
82
|
"react": "^18.3.1",
|
|
83
83
|
"react-dom": "^18.3.1",
|
|
84
|
-
"react-router-dom": "^6.
|
|
84
|
+
"react-router-dom": "^6.30.4",
|
|
85
85
|
"sass": "^1.83.0",
|
|
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.19.0",
|
|
90
|
+
"mod-arch-kubeflow": "1.19.0"
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
93
|
"@patternfly/patternfly": "^6.4.0",
|