@widergy/energy-ui 3.22.0 → 3.22.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/UTActionCard/README.md +20 -20
- package/dist/components/UTActionCard/components/BottomActions/index.js +1 -2
- package/dist/components/UTActionCard/components/Header/index.js +1 -1
- package/dist/components/UTActionCard/components/Header/styles.module.scss +1 -0
- package/dist/components/UTActionCard/components/HeaderActions/index.js +3 -3
- package/dist/components/UTActionCard/index.js +1 -1
- package/dist/components/UTIcon/theme.js +2 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [3.22.2](https://github.com/widergy/energy-ui/compare/v3.22.1...v3.22.2) (2024-09-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* minor fix ([#499](https://github.com/widergy/energy-ui/issues/499)) ([d09e87a](https://github.com/widergy/energy-ui/commit/d09e87a50f8eac7b99d418764a6ef1b598ee7597))
|
|
7
|
+
|
|
8
|
+
## [3.22.1](https://github.com/widergy/energy-ui/compare/v3.22.0...v3.22.1) (2024-09-25)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* shape prop fixed action card ([#496](https://github.com/widergy/energy-ui/issues/496)) ([10478e0](https://github.com/widergy/energy-ui/commit/10478e0caa4fa88893e5ad161033c90696d8f6a1))
|
|
14
|
+
|
|
1
15
|
# [3.22.0](https://github.com/widergy/energy-ui/compare/v3.21.2...v3.22.0) (2024-09-24)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -3,23 +3,23 @@
|
|
|
3
3
|
## Props
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
| Name | Type
|
|
7
|
-
| :----------------------- |
|
|
8
|
-
| `additionalMessage` | `shape({ Icon: elementType, iconProps: shape({ colorTheme: string, size: string }), labelProps: shape({ colorTheme: string, variant: string }), message: string })`
|
|
9
|
-
| `adornment` | `shape({ alignment: oneOf(['center', 'end', 'start']), position: string, props: object, type: string })`
|
|
10
|
-
| `BackgroundImage` | `elementType`
|
|
11
|
-
| `bottomActions` | `arrayOf(shape({ colorTheme: string, disabled: bool, Icon: elementType, label: string, loading: bool, onClick: func }))`
|
|
12
|
-
| `bottomActionsVariant` | `oneOf(['default', 'redirection'])`
|
|
13
|
-
| `classNames` | `objectOf(string)`
|
|
14
|
-
| `description` | `string`
|
|
15
|
-
| `descriptionProps` | `shape({ colorTheme: string, variant: string })`
|
|
16
|
-
| `headerActions` | `arrayOf(shape({ Icon: oneOfType([elementType, string]), iconProps: string, id: oneOfType([number, string]), label: string, loading: bool, onClick: func }))`
|
|
17
|
-
| `headerActionsProps` | `shape({ alignment: oneOf(['center', 'end', 'start']), buttonGroupProps: shape({ colorTheme: string,
|
|
18
|
-
| `mainAction` | `func`
|
|
19
|
-
| `size` | `oneOf(['medium', 'small'])`
|
|
20
|
-
| `status` | `string`
|
|
21
|
-
| `statusLabel` | `string`
|
|
22
|
-
| `statusAlignment` | `oneOf(['center', 'end', 'start'])`
|
|
23
|
-
| `title` | `string.isRequired`
|
|
24
|
-
| `titleProps` | `shape({ variant: string, weight: string })`
|
|
25
|
-
| `withBodyPadding` | `bool`
|
|
6
|
+
| Name | Type | Default | Description |
|
|
7
|
+
| :----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------------------------------ |
|
|
8
|
+
| `additionalMessage` | `shape({ Icon: elementType, iconProps: shape({ colorTheme: string, size: string }), labelProps: shape({ colorTheme: string, variant: string }), message: string })` | | Additional message information, including icons and labels. |
|
|
9
|
+
| `adornment` | `shape({ alignment: oneOf(['center', 'end', 'start']), position: string, props: object, type: string })` | | Adornment object to customize alignment, position, and type. |
|
|
10
|
+
| `BackgroundImage` | `elementType` | | A React component for the background image. |
|
|
11
|
+
| `bottomActions` | `arrayOf(shape({ colorTheme: string, disabled: bool, Icon: elementType, label: string, loading: bool, onClick: func }))` | | Defines the list of actions to be displayed at the bottom of the card. |
|
|
12
|
+
| `bottomActionsVariant` | `oneOf(['default', 'redirection'])` | | Sets the style variant for bottom actions. |
|
|
13
|
+
| `classNames` | `objectOf(string)` | | Css classes |
|
|
14
|
+
| `description` | `string` | | Description text to be displayed. |
|
|
15
|
+
| `descriptionProps` | `shape({ colorTheme: string, variant: string })` | | Props to customize the description's style. |
|
|
16
|
+
| `headerActions` | `arrayOf(shape({ Icon: oneOfType([elementType, string]), iconProps: string, id: oneOfType([number, string]), label: string, loading: bool, onClick: func }))` | | List of actions available in the header section. |
|
|
17
|
+
| `headerActionsProps` | `shape({ alignment: oneOf(['center', 'end', 'start']), buttonGroupProps: shape({ colorTheme: string, shape: string }), maxNumberOfPrimaryActions: number, variant: oneOf(['default', 'buttonGroup']) })` | | Props to configure header actions alignment, button group, etc. |
|
|
18
|
+
| `mainAction` | `func` | | Main action function for the card. |
|
|
19
|
+
| `size` | `oneOf(['medium', 'small'])` | `'medium'` | Size of the card, either small or medium. |
|
|
20
|
+
| `status` | `string` | | Status text to be displayed. |
|
|
21
|
+
| `statusLabel` | `string` | | Status label for additional status info. |
|
|
22
|
+
| `statusAlignment` | `oneOf(['center', 'end', 'start'])` | | Alignment of the status element. |
|
|
23
|
+
| `title` | `string.isRequired` | | The title of the card, required. |
|
|
24
|
+
| `titleProps` | `shape({ variant: string, weight: string })` | | Props to configure the title style. |
|
|
25
|
+
| `withBodyPadding` | `bool` | `false` | Adds padding to the card body if`true`. |
|
|
@@ -54,8 +54,7 @@ BottomActions.propTypes = {
|
|
|
54
54
|
Icon: (0, _propTypes.oneOfType)([_propTypes.elementType, _propTypes.string]),
|
|
55
55
|
label: _propTypes.string,
|
|
56
56
|
loading: _propTypes.bool,
|
|
57
|
-
onClick: _propTypes.func
|
|
58
|
-
type: (0, _propTypes.oneOf)([_constants.ACTION_TYPES.DEFAULT, _constants.ACTION_TYPES.REDIRECTION])
|
|
57
|
+
onClick: _propTypes.func
|
|
59
58
|
})),
|
|
60
59
|
bottomActionsVariant: _propTypes.string
|
|
61
60
|
};
|
|
@@ -72,7 +72,7 @@ Header.propTypes = {
|
|
|
72
72
|
alignment: (0, _propTypes.oneOf)([_constants.PLACE_SELF_TYPES.CENTER, _constants.PLACE_SELF_TYPES.END, _constants.PLACE_SELF_TYPES.START]),
|
|
73
73
|
buttonGroupProps: (0, _propTypes.shape)({
|
|
74
74
|
colorTheme: _propTypes.string,
|
|
75
|
-
|
|
75
|
+
shape: _propTypes.string
|
|
76
76
|
}),
|
|
77
77
|
maxNumberOfPrimaryActions: _propTypes.number,
|
|
78
78
|
variant: (0, _propTypes.oneOf)([_constants.HEADER_ACTIONS_VARIANTS.DEFAULT, _constants.HEADER_ACTIONS_VARIANTS.BUTTON_GROUP])
|
|
@@ -29,7 +29,7 @@ const HeaderActions = _ref => {
|
|
|
29
29
|
const showButtonGroup = headerActionsProps.variant === _constants.HEADER_ACTIONS_VARIANTS.BUTTON_GROUP;
|
|
30
30
|
const {
|
|
31
31
|
colorTheme: buttonGroupColorTheme = 'secondary',
|
|
32
|
-
|
|
32
|
+
shape: buttonGroupShape
|
|
33
33
|
} = headerActionsProps?.buttonGroupProps || {};
|
|
34
34
|
const maxNumberOfPrimaryActions = headerActionsProps?.maxNumberOfPrimaryActions || _constants2.DEFAULT_MAX_NUMBER_OF_PRIMARY_ACTIONS;
|
|
35
35
|
const handleSetMainActionHoverVisible = () => setMainActionHoverVisible(true);
|
|
@@ -85,7 +85,7 @@ const HeaderActions = _ref => {
|
|
|
85
85
|
})),
|
|
86
86
|
colorTheme: buttonGroupColorTheme,
|
|
87
87
|
selected: selectedAction || secondaryActions[0]?.id,
|
|
88
|
-
|
|
88
|
+
shape: buttonGroupShape
|
|
89
89
|
})));
|
|
90
90
|
};
|
|
91
91
|
HeaderActions.propTypes = {
|
|
@@ -101,7 +101,7 @@ HeaderActions.propTypes = {
|
|
|
101
101
|
alignment: (0, _propTypes.oneOf)([_constants.PLACE_SELF_TYPES.CENTER, _constants.PLACE_SELF_TYPES.END, _constants.PLACE_SELF_TYPES.START]),
|
|
102
102
|
buttonGroupProps: (0, _propTypes.shape)({
|
|
103
103
|
colorTheme: _propTypes.string,
|
|
104
|
-
|
|
104
|
+
shape: _propTypes.string
|
|
105
105
|
}),
|
|
106
106
|
maxNumberOfPrimaryActions: _propTypes.number,
|
|
107
107
|
variant: (0, _propTypes.oneOf)([_constants.HEADER_ACTIONS_VARIANTS.DEFAULT, _constants.HEADER_ACTIONS_VARIANTS.BUTTON_GROUP])
|
|
@@ -125,7 +125,7 @@ UTActionCard.propTypes = {
|
|
|
125
125
|
alignment: (0, _propTypes.oneOf)([_constants.PLACE_SELF_TYPES.CENTER, _constants.PLACE_SELF_TYPES.END, _constants.PLACE_SELF_TYPES.START]),
|
|
126
126
|
buttonGroupProps: (0, _propTypes.shape)({
|
|
127
127
|
colorTheme: _propTypes.string,
|
|
128
|
-
|
|
128
|
+
shape: _propTypes.string
|
|
129
129
|
}),
|
|
130
130
|
maxNumberOfPrimaryActions: _propTypes.number,
|
|
131
131
|
variant: (0, _propTypes.oneOf)([_constants.HEADER_ACTIONS_VARIANTS.DEFAULT, _constants.HEADER_ACTIONS_VARIANTS.BUTTON_GROUP])
|
|
@@ -44,21 +44,16 @@ const getIconProps = _ref2 => {
|
|
|
44
44
|
theme,
|
|
45
45
|
shade: fillShade || _constants.DEFAULT_INTERNAL_SHADE
|
|
46
46
|
});
|
|
47
|
-
const baseIconProps = {
|
|
48
|
-
flexShrink: 0
|
|
49
|
-
};
|
|
50
47
|
const defaultIconProps = {
|
|
51
48
|
color: iconColor,
|
|
52
|
-
size
|
|
53
|
-
...baseIconProps
|
|
49
|
+
size
|
|
54
50
|
};
|
|
55
51
|
const energyIconProps = {
|
|
56
52
|
stroke: iconColor,
|
|
57
53
|
...(size && {
|
|
58
54
|
width: size,
|
|
59
55
|
height: size
|
|
60
|
-
})
|
|
61
|
-
...baseIconProps
|
|
56
|
+
})
|
|
62
57
|
};
|
|
63
58
|
return {
|
|
64
59
|
style: filled ? {
|