aefis-core-ui 2.3.0-rc49 → 2.3.0-rc50

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.
@@ -1938,11 +1938,17 @@ const useTag = color => {
1938
1938
  const useStyles$F = makeStyles(theme => ({
1939
1939
  sectionHeader: {
1940
1940
  paddingTop: theme.spacing(2),
1941
- paddingBottom: theme.spacing(2)
1941
+ paddingBottom: theme.spacing(2),
1942
+ display: "flex",
1943
+ width: "100%"
1942
1944
  },
1943
1945
  sectionHeaderTop: {
1944
1946
  paddingBottom: theme.spacing(2)
1945
1947
  },
1948
+ sectionHeaderAction: {
1949
+ justifyContent: "center",
1950
+ alignItems: "flex-end"
1951
+ },
1946
1952
  cardContent: {
1947
1953
  paddingTop: 0,
1948
1954
  paddingBottom: 0
@@ -2121,13 +2127,32 @@ const ContentBox = props => {
2121
2127
  return /*#__PURE__*/jsxs(Box$2, {
2122
2128
  sx: props.sx,
2123
2129
  style: props.containerStyle,
2124
- children: [props.header && /*#__PURE__*/jsx(Box$2, {
2130
+ children: [props.header && /*#__PURE__*/jsxs(Box$2, {
2125
2131
  className: classes.sectionHeader,
2126
- children: /*#__PURE__*/jsx(Typography, {
2132
+ children: [/*#__PURE__*/jsx(Typography, {
2127
2133
  variant: "h6",
2128
2134
  component: "h2",
2135
+ sx: {
2136
+ display: "flex",
2137
+ alignItems: "center"
2138
+ },
2129
2139
  children: props.header
2130
- })
2140
+ }), props.headerAction && /*#__PURE__*/jsx(Button, {
2141
+ name: props.headerAction.name,
2142
+ variant: "contained",
2143
+ color: "primary",
2144
+ size: props.headerAction.size || "small",
2145
+ sx: {
2146
+ display: "flex",
2147
+ alignItems: "center",
2148
+ marginLeft: "auto"
2149
+ },
2150
+ onClick: props.headerAction.action || props.headerAction.onClick,
2151
+ style: props.headerAction.style || undefined,
2152
+ disabled: props.headerAction.disabled || false,
2153
+ startIcon: props.headerAction.icon || undefined,
2154
+ children: props.headerAction.name
2155
+ })]
2131
2156
  }), /*#__PURE__*/jsxs(Card, {
2132
2157
  style: cardStyle,
2133
2158
  className: tag.tag,
@@ -2203,6 +2228,15 @@ ContentBox.propTypes = {
2203
2228
  formatContent: PropTypes.bool,
2204
2229
  /** Header for the content box. */
2205
2230
  header: PropTypes.any,
2231
+ /** Action for the header. Should be considered an action related to the content box contents. */
2232
+ headerAction: PropTypes.shape({
2233
+ size: PropTypes.oneOf(["small", "medium"]),
2234
+ icon: PropTypes.any,
2235
+ name: PropTypes.any.isRequired,
2236
+ style: PropTypes.any,
2237
+ action: PropTypes.func.isRequired,
2238
+ disabled: PropTypes.any
2239
+ }),
2206
2240
  /** Sub-title of the content box. Can be a string or any component. */
2207
2241
  subtitle: PropTypes.any,
2208
2242
  /** Main title of the content box. Can be a string or any component. */