@widergy/energy-ui 3.141.0 → 3.141.2
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/CHANGELOG.md +14 -0
- package/dist/components/UTButton/styles.module.scss +1 -1
- package/dist/components/UTDataCategory/styles.module.scss +1 -1
- package/dist/components/UTDataCategory/theme.js +1 -1
- package/dist/components/UTDataElement/index.js +2 -1
- package/dist/components/UTDataElement/styles.module.scss +9 -8
- package/dist/components/UTLabel/components/Markdown/customPlugins/remarkDeflist.js +74 -15
- package/dist/utils/hooks/useCSSVariables/constants.js +18 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [3.141.2](https://github.com/widergy/energy-ui/compare/v3.141.1...v3.141.2) (2026-04-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* added tokens to data element ([#772](https://github.com/widergy/energy-ui/issues/772)) ([5933975](https://github.com/widergy/energy-ui/commit/5933975f24a216a9338f4f4d61df7b853f1fd01a))
|
|
7
|
+
|
|
8
|
+
## [3.141.1](https://github.com/widergy/energy-ui/compare/v3.141.0...v3.141.1) (2026-03-31)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* markdown fix ([#770](https://github.com/widergy/energy-ui/issues/770)) ([bbb9804](https://github.com/widergy/energy-ui/commit/bbb980470af108f4472b00eb03fdc8c542c2e333))
|
|
14
|
+
|
|
1
15
|
# [3.141.0](https://github.com/widergy/energy-ui/compare/v3.140.0...v3.141.0) (2026-03-18)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -55,7 +55,7 @@ $small-icon: var(--UT-button-icon-size-sm, 1.25rem);
|
|
|
55
55
|
|
|
56
56
|
.paddingLarge {
|
|
57
57
|
padding: var(--UT-button-padding-md, 12px) var(--UT-button-padding-lg, 16px);
|
|
58
|
-
}
|
|
58
|
+
}
|
|
59
59
|
|
|
60
60
|
.paddingMedium {
|
|
61
61
|
padding: var(--UT-button-padding-sm, 8px) var(--UT-button-padding-md, 12px);
|
|
@@ -99,7 +99,8 @@ const UTDataElement = _ref => {
|
|
|
99
99
|
className: contentClasses
|
|
100
100
|
}, IconComponent && /*#__PURE__*/_react.default.createElement(IconComponent, _extends({
|
|
101
101
|
name: Icon,
|
|
102
|
-
colorTheme: "gray"
|
|
102
|
+
colorTheme: "gray",
|
|
103
|
+
size: "var(--UT-dataElement-icon-size, 24px)"
|
|
103
104
|
}, iconProps)), /*#__PURE__*/_react.default.createElement("div", {
|
|
104
105
|
className: infoClasses
|
|
105
106
|
}, (prefix || title || showBadge) && /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
.paddingSmall {
|
|
7
|
-
padding-bottom: 8px;
|
|
8
|
-
padding-top: 8px;
|
|
7
|
+
padding-bottom: var(--UT-dataElement-padding-sm, 8px);
|
|
8
|
+
padding-top: var(--UT-dataElement-padding-sm, 8px);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.paddingMedium {
|
|
12
|
-
padding-bottom: 16px;
|
|
13
|
-
padding-top: 16px;
|
|
12
|
+
padding-bottom: var(--UT-dataElement-padding-md, 16px);
|
|
13
|
+
padding-top: var(--UT-dataElement-padding-md, 16px);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
.content {
|
|
@@ -25,30 +25,31 @@
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.spacingSmall {
|
|
28
|
-
grid-gap: 8px;
|
|
28
|
+
grid-gap: var(--UT-dataElement-gap-sm, 8px);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.spacingMedium {
|
|
32
|
-
grid-gap: 16px;
|
|
32
|
+
grid-gap: var(--UT-dataElement-gap-md, 16px);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
.info {
|
|
36
36
|
display: flex;
|
|
37
37
|
flex: 1;
|
|
38
38
|
flex-direction: row;
|
|
39
|
-
grid-gap: 8px;
|
|
39
|
+
grid-gap: var(--UT-dataElement-content-gap-x, 8px);
|
|
40
40
|
justify-content: space-between;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
.vertical {
|
|
44
44
|
flex-direction: column;
|
|
45
|
+
grid-gap: var(--UT-dataElement-content-gap-y, 8px);
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
.topInfo {
|
|
48
49
|
align-items: center;
|
|
49
50
|
display: flex;
|
|
50
51
|
flex-direction: row;
|
|
51
|
-
grid-gap: 8px;
|
|
52
|
+
grid-gap: var(--UT-dataElement-content-gap-x, 8px);
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
.iconCollapseButton {
|
|
@@ -24,35 +24,94 @@ function remarkDeflist() {
|
|
|
24
24
|
return tree => {
|
|
25
25
|
(0, _unistUtilVisit.visit)(tree, _constants.NODE_TYPES.PARAGRAPH, (node, index, parent) => {
|
|
26
26
|
if (!parent || !Array.isArray(parent.children)) return;
|
|
27
|
+
|
|
28
|
+
// Check if this paragraph contains definition list items
|
|
29
|
+
// A valid definition list has lines that start with ':' at the beginning (after whitespace)
|
|
30
|
+
const hasDefinitionItems = node.children.some(child => {
|
|
31
|
+
if ('value' in child) {
|
|
32
|
+
const lines = child.value.split('\n');
|
|
33
|
+
return lines.some(l => l.trim().startsWith(':'));
|
|
34
|
+
}
|
|
35
|
+
return false;
|
|
36
|
+
});
|
|
37
|
+
if (!hasDefinitionItems) return;
|
|
38
|
+
|
|
39
|
+
// Extract text content to check structure
|
|
27
40
|
const raw = node.children.map(ch => 'value' in ch ? ch.value : '').join('');
|
|
28
41
|
const lines = raw.split('\n');
|
|
29
|
-
|
|
42
|
+
|
|
43
|
+
// Validate that this is a proper definition list structure
|
|
44
|
+
// A valid definition list should have at least one term followed by descriptions
|
|
45
|
+
let hasValidStructure = false;
|
|
46
|
+
let hasTerms = false;
|
|
47
|
+
let hasDescriptions = false;
|
|
48
|
+
for (let i = 0; i < lines.length; i += 1) {
|
|
49
|
+
const trimmed = lines[i].trim();
|
|
50
|
+
if (trimmed && !trimmed.startsWith(':')) {
|
|
51
|
+
hasTerms = true;
|
|
52
|
+
}
|
|
53
|
+
if (trimmed.startsWith(':')) {
|
|
54
|
+
hasDescriptions = true;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
hasValidStructure = hasTerms && hasDescriptions;
|
|
58
|
+
if (!hasValidStructure) return;
|
|
59
|
+
|
|
60
|
+
// Build items while preserving node structure
|
|
30
61
|
const items = [];
|
|
31
62
|
let currentTerm = null;
|
|
32
|
-
|
|
33
|
-
const line = lines[i];
|
|
34
|
-
const trimmed = line.trim();
|
|
63
|
+
const processLine = trimmed => {
|
|
35
64
|
if (trimmed && !trimmed.startsWith(':')) {
|
|
65
|
+
// This is a term
|
|
36
66
|
if (currentTerm) {
|
|
37
|
-
items.push(
|
|
67
|
+
items.push({
|
|
68
|
+
term: currentTerm,
|
|
69
|
+
desc: []
|
|
70
|
+
});
|
|
38
71
|
}
|
|
39
|
-
currentTerm =
|
|
40
|
-
term: trimmed,
|
|
41
|
-
desc: []
|
|
42
|
-
};
|
|
72
|
+
currentTerm = trimmed;
|
|
43
73
|
} else if (trimmed.startsWith(':')) {
|
|
74
|
+
// This is a description
|
|
44
75
|
if (!currentTerm) {
|
|
45
|
-
currentTerm =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
76
|
+
currentTerm = '';
|
|
77
|
+
}
|
|
78
|
+
const itemExists = items.some(item => item.term === currentTerm);
|
|
79
|
+
if (!itemExists) {
|
|
80
|
+
// Only add if we haven't already added this term
|
|
81
|
+
if (currentTerm) {
|
|
82
|
+
items.push({
|
|
83
|
+
term: currentTerm,
|
|
84
|
+
desc: []
|
|
85
|
+
});
|
|
86
|
+
currentTerm = null;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
const descText = trimmed.replace(/^:\s*/, '');
|
|
90
|
+
if (items.length > 0) {
|
|
91
|
+
items[items.length - 1].desc.push(descText);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
for (let i = 0; i < node.children.length; i += 1) {
|
|
96
|
+
const child = node.children[i];
|
|
97
|
+
if ('value' in child) {
|
|
98
|
+
const childLines = child.value.split('\n');
|
|
99
|
+
for (let lineIdx = 0; lineIdx < childLines.length; lineIdx += 1) {
|
|
100
|
+
const line = childLines[lineIdx];
|
|
101
|
+
const trimmed = line.trim();
|
|
102
|
+
processLine(trimmed);
|
|
49
103
|
}
|
|
50
|
-
currentTerm.desc.push(trimmed.replace(/^:\s*/, ''));
|
|
51
104
|
}
|
|
52
105
|
}
|
|
53
106
|
if (currentTerm) {
|
|
54
|
-
items.push(
|
|
107
|
+
items.push({
|
|
108
|
+
term: currentTerm,
|
|
109
|
+
desc: []
|
|
110
|
+
});
|
|
55
111
|
}
|
|
112
|
+
|
|
113
|
+
// Only process if we have valid items
|
|
114
|
+
if (items.length === 0) return;
|
|
56
115
|
const dlNode = {
|
|
57
116
|
type: _constants.COMPONENTS_NAMES.DEFINITION_LIST,
|
|
58
117
|
data: {
|
|
@@ -217,6 +217,23 @@ const baseTokens = exports.baseTokens = {
|
|
|
217
217
|
'UT-shortcutPanel-item-padding': 'padding-xs',
|
|
218
218
|
'UT-shortcutPanel-item-gap': 'gap-sm',
|
|
219
219
|
'UT-shortcutPanel-item-label-size': 'font-body-size-md',
|
|
220
|
-
'UT-shortcutPanel-item-icon-size': 'size-icon-xs'
|
|
220
|
+
'UT-shortcutPanel-item-icon-size': 'size-icon-xs',
|
|
221
|
+
'UT-dataElement-padding-md': 'padding-md',
|
|
222
|
+
'UT-dataElement-padding-sm': 'padding-xs',
|
|
223
|
+
'UT-dataElement-gap-md': 'gap-lg',
|
|
224
|
+
'UT-dataElement-gap-sm': 'gap-sm',
|
|
225
|
+
'UT-dataElement-content-gap-x': 'gap-sm',
|
|
226
|
+
'UT-dataElement-content-gap-y': 'gap-sm',
|
|
227
|
+
'UT-dataElement-icon-size': 'size-icon-md',
|
|
228
|
+
'UT-dataElement-title-size': 'font-body-size-md',
|
|
229
|
+
'UT-dataElement-title-weight': 'font-weight-medium',
|
|
230
|
+
'UT-dataElement-prefix-size': 'font-body-size-md',
|
|
231
|
+
'UT-dataElement-prefix-weight': 'font-weight-medium',
|
|
232
|
+
'UT-dataCategory-padding': 'padding-md',
|
|
233
|
+
'UT-dataCategory-gap': 'gap-lg',
|
|
234
|
+
'UT-dataCategory-title-gap': 'gap-sm',
|
|
235
|
+
'UT-dataCategory-title-size': 'font-body-size-sm',
|
|
236
|
+
'UT-dataCategory-title-weight': 'font-weight-medium',
|
|
237
|
+
'UT-dataCategory-icon-size': 'size-icon-xs'
|
|
221
238
|
}
|
|
222
239
|
};
|