@lunit/oui 2.2.26 → 2.2.27
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.
|
@@ -10,6 +10,8 @@ const Score = ({ componentType = 'score', title, size = 'medium', metrics }) =>
|
|
|
10
10
|
throw new Error("The 'title' prop is required.");
|
|
11
11
|
if (!metrics)
|
|
12
12
|
throw new Error("The 'metrics' prop is required.");
|
|
13
|
+
if (metrics && !metrics.value)
|
|
14
|
+
throw new Error("The 'value' prop in 'metrics' is required.");
|
|
13
15
|
return (_jsxs(PresentationTypography, { size: size, style: { color: metrics.isFullColored ? metrics.color : 'inherit' }, children: [title, ": ", metrics.value, metrics.scoreType && (_jsx("span", { style: { color: metrics.color, marginLeft: 4 }, children: capitalize(metrics.scoreType) }))] }));
|
|
14
16
|
};
|
|
15
17
|
export default Score;
|
|
@@ -17,6 +17,8 @@ const ToggleControl = ({ componentType = 'toggle', title, size = 'medium', symbo
|
|
|
17
17
|
throw new Error("The 'title' prop is required.");
|
|
18
18
|
if (checked === undefined)
|
|
19
19
|
throw new Error("The 'checked' prop is required.");
|
|
20
|
+
if (typeof checked !== 'boolean')
|
|
21
|
+
throw new Error("The 'checked' prop must be a boolean.");
|
|
20
22
|
return (_jsxs(ToggleControlOuter, { "data-toggle-name": `toggle-control-${title?.replace(/\s/g, '-')}`, hasBar: !!bar || !!content.length, style: { marginBottom: isParent ? '4px' : '0' }, children: [_jsxs(ToggleControlContainer, { className: "toggle-inner-container", size: size, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: '6px' }, className: "toggle-label", children: [!!tooltip.length && (_jsx(Tooltip, { arrow: true, size: "large", title: _jsx(Box, { sx: { display: 'flex', flexDirection: 'column', gap: '8px' }, children: tooltip.map((item) => (_jsxs(Box, { children: [item.componentType === 'freeText' && (_jsx(FreeText, { componentType: item.componentType, size: item.size, content: item.content })), item.componentType === 'statistic' && (_jsx(Statistic, { componentType: item.componentType, title: item.title, size: item.size, layout: item.layout, symbol: item.symbol, color: item.color }))] }, uuidV4()))) }), children: _jsx(Box, { sx: {
|
|
21
23
|
display: 'flex',
|
|
22
24
|
alignItems: 'center',
|
|
@@ -9,6 +9,8 @@ const ToggleControlGroup = ({ componentType = 'toggleGroup', size = 'medium', ti
|
|
|
9
9
|
throw new Error("The 'title' prop is required.");
|
|
10
10
|
if (checked === undefined)
|
|
11
11
|
throw new Error("The 'checked' prop is required.");
|
|
12
|
+
if (typeof checked !== 'boolean')
|
|
13
|
+
throw new Error("The 'checked' prop must be a boolean.");
|
|
12
14
|
if (!childToggles.length)
|
|
13
15
|
throw new Error("The 'childToggles' prop must contain at least one child toggle.");
|
|
14
16
|
return (_jsxs(ToggleControlGroupContainer, { children: [_jsx(ToggleControl, { isParent: true, componentType: "toggle", bar: bar, disabled: disabled, size: size, title: title, tooltip: tooltip, checked: checked, isDimmed: isDimmed, onChange: onChange }), childToggles?.map((child, index) => {
|
|
@@ -22,6 +22,7 @@ export const PresentationTypography = (props) => {
|
|
|
22
22
|
return (_jsx(Typography, { variant: "body5", ...rest, sx: { color: isDimmed ? theme.palette.neutralGrey[40] : 'inherit' } }));
|
|
23
23
|
};
|
|
24
24
|
export const PresentationSymbolIcon = ({ symbol, color = 'black', isDimmed = false, }) => {
|
|
25
|
+
const symbolColor = color?.length ? color : 'black';
|
|
25
26
|
if (symbol === 'circle') {
|
|
26
27
|
return (_jsx("div", { style: {
|
|
27
28
|
height: '100%',
|
|
@@ -31,7 +32,7 @@ export const PresentationSymbolIcon = ({ symbol, color = 'black', isDimmed = fal
|
|
|
31
32
|
}, children: _jsx("span", { style: {
|
|
32
33
|
height: '6px',
|
|
33
34
|
width: '6px',
|
|
34
|
-
backgroundColor:
|
|
35
|
+
backgroundColor: symbolColor,
|
|
35
36
|
borderRadius: '50%',
|
|
36
37
|
border: '1px solid black',
|
|
37
38
|
} }) }));
|
|
@@ -45,7 +46,7 @@ export const PresentationSymbolIcon = ({ symbol, color = 'black', isDimmed = fal
|
|
|
45
46
|
}, children: _jsx("span", { style: {
|
|
46
47
|
height: '10px',
|
|
47
48
|
width: '10px',
|
|
48
|
-
backgroundColor:
|
|
49
|
+
backgroundColor: symbolColor,
|
|
49
50
|
} }) }));
|
|
50
51
|
}
|
|
51
52
|
if (symbol === 'border-circle') {
|
|
@@ -57,7 +58,7 @@ export const PresentationSymbolIcon = ({ symbol, color = 'black', isDimmed = fal
|
|
|
57
58
|
}, children: _jsx("span", { style: {
|
|
58
59
|
height: '10px',
|
|
59
60
|
width: '10px',
|
|
60
|
-
backgroundColor:
|
|
61
|
+
backgroundColor: symbolColor,
|
|
61
62
|
borderRadius: '50%',
|
|
62
63
|
border: '1px solid black',
|
|
63
64
|
} }) }));
|
|
@@ -71,7 +72,7 @@ export const PresentationSymbolIcon = ({ symbol, color = 'black', isDimmed = fal
|
|
|
71
72
|
}, children: _jsx("span", { style: {
|
|
72
73
|
height: '10px',
|
|
73
74
|
width: '10px',
|
|
74
|
-
backgroundColor:
|
|
75
|
+
backgroundColor: symbolColor,
|
|
75
76
|
border: '1px solid black',
|
|
76
77
|
} }) }));
|
|
77
78
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunit/oui",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.27",
|
|
4
4
|
"validate-branch-name": {
|
|
5
5
|
"pattern": "^(main|develop)|(feature|fix|release|hotfix|qe)/.+$",
|
|
6
6
|
"errorMsg": "The branch name is not correct. Please check the pattern. (ex. feature/add-something)"
|