@bolttech/atoms-section-header 0.16.0 → 0.17.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/index.cjs
CHANGED
|
@@ -1148,13 +1148,21 @@ const Background = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
|
1148
1148
|
displayName: "atoms-section-headerstyle__Background",
|
|
1149
1149
|
componentId: "sc-xtf6u-2"
|
|
1150
1150
|
})(["display:flex;align-items:flex-end;z-index:0;"]);
|
|
1151
|
+
const BackgroundImage = /*#__PURE__*/styled__default["default"].img.withConfig({
|
|
1152
|
+
displayName: "atoms-section-headerstyle__BackgroundImage",
|
|
1153
|
+
componentId: "sc-xtf6u-3"
|
|
1154
|
+
})(["display:flex;align-items:flex-end;z-index:0;max-height:150px;"]);
|
|
1151
1155
|
const Icon = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
1152
1156
|
displayName: "atoms-section-headerstyle__Icon",
|
|
1153
|
-
componentId: "sc-xtf6u-
|
|
1157
|
+
componentId: "sc-xtf6u-4"
|
|
1154
1158
|
})(["position:absolute;display:flex;bottom:0;z-index:1;transform:translate(-50%);"]);
|
|
1159
|
+
const IconImage = /*#__PURE__*/styled__default["default"].img.withConfig({
|
|
1160
|
+
displayName: "atoms-section-headerstyle__IconImage",
|
|
1161
|
+
componentId: "sc-xtf6u-5"
|
|
1162
|
+
})(["position:absolute;display:flex;bottom:0;z-index:1;transform:translate(-50%);max-height:150px;width:auto;"]);
|
|
1155
1163
|
const IlustrationContainer = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
1156
1164
|
displayName: "atoms-section-headerstyle__IlustrationContainer",
|
|
1157
|
-
componentId: "sc-xtf6u-
|
|
1165
|
+
componentId: "sc-xtf6u-6"
|
|
1158
1166
|
})(["display:flex;position:relative;justify-content:flex-end;align-items:flex-end;@media only screen and (max-width:1431px){width:60%;height:100%;svg{max-width:100%;max-height:100%;height:100%;}}"]);
|
|
1159
1167
|
|
|
1160
1168
|
const SectionHeader = /*#__PURE__*/react.forwardRef((_a, ref) => {
|
|
@@ -1165,6 +1173,28 @@ const SectionHeader = /*#__PURE__*/react.forwardRef((_a, ref) => {
|
|
|
1165
1173
|
background
|
|
1166
1174
|
} = _a,
|
|
1167
1175
|
props = __rest(_a, ["dataTestId", "title", "icon", "background"]);
|
|
1176
|
+
const renderIcon = () => {
|
|
1177
|
+
if (icon && typeof icon === 'string') return jsxRuntime.jsx(IconImage, {
|
|
1178
|
+
"data-testid": `${dataTestId}-iconimg`,
|
|
1179
|
+
src: icon
|
|
1180
|
+
});
|
|
1181
|
+
if (icon && typeof icon !== 'string') return jsxRuntime.jsx(Icon, {
|
|
1182
|
+
"data-testid": `${dataTestId}-icon`,
|
|
1183
|
+
children: icon
|
|
1184
|
+
});
|
|
1185
|
+
return null;
|
|
1186
|
+
};
|
|
1187
|
+
const renderBackground = () => {
|
|
1188
|
+
if (background && typeof background === 'string') return jsxRuntime.jsx(BackgroundImage, {
|
|
1189
|
+
"data-testid": `${dataTestId}-backgroundimg`,
|
|
1190
|
+
src: background
|
|
1191
|
+
});
|
|
1192
|
+
if (background && typeof background !== 'string') return jsxRuntime.jsx(Background, {
|
|
1193
|
+
"data-testid": `${dataTestId}-background`,
|
|
1194
|
+
children: background
|
|
1195
|
+
});
|
|
1196
|
+
return null;
|
|
1197
|
+
};
|
|
1168
1198
|
return jsxRuntime.jsxs(SectionHeaderContainer, Object.assign({
|
|
1169
1199
|
fullWidth: true,
|
|
1170
1200
|
"data-testid": dataTestId,
|
|
@@ -1177,11 +1207,7 @@ const SectionHeader = /*#__PURE__*/react.forwardRef((_a, ref) => {
|
|
|
1177
1207
|
}, uiUtils.applyDataAttributes(props, 'title'), {
|
|
1178
1208
|
children: title
|
|
1179
1209
|
})), jsxRuntime.jsxs(IlustrationContainer, {
|
|
1180
|
-
children: [
|
|
1181
|
-
children: icon
|
|
1182
|
-
}), background && jsxRuntime.jsx(Background, {
|
|
1183
|
-
children: background
|
|
1184
|
-
})]
|
|
1210
|
+
children: [renderIcon(), renderBackground()]
|
|
1185
1211
|
})]
|
|
1186
1212
|
}));
|
|
1187
1213
|
});
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
export declare const SectionHeader: React.ForwardRefExoticComponent<import("@bolttech/ui-utils").DefaultProps & {
|
|
3
3
|
dataTestId?: string | undefined;
|
|
4
4
|
title: string;
|
|
5
|
-
icon?: React.ReactElement<SVGElement, string | React.JSXElementConstructor<any>> | undefined;
|
|
6
|
-
background?: React.ReactElement<SVGElement, string | React.JSXElementConstructor<any>> | undefined;
|
|
5
|
+
icon?: string | React.ReactElement<SVGElement, string | React.JSXElementConstructor<any>> | undefined;
|
|
6
|
+
background?: string | React.ReactElement<SVGElement, string | React.JSXElementConstructor<any>> | undefined;
|
|
7
7
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
export default SectionHeader;
|
|
@@ -2,5 +2,7 @@
|
|
|
2
2
|
export declare const SectionHeaderContainer: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@edirect/frontend-foundations/dist/src/shared/types/row.type").RowPropsType & import("react").RefAttributes<HTMLDivElement>>, any, {}, never>;
|
|
3
3
|
export declare const SectionHeaderLabel: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@edirect/frontend-foundations/dist/src/shared/types/typography.type").TypographyPropsType & import("react").RefAttributes<HTMLElement>>, any, {}, never>;
|
|
4
4
|
export declare const Background: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
+
export declare const BackgroundImage: import("styled-components").StyledComponent<"img", any, {}, never>;
|
|
5
6
|
export declare const Icon: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
|
+
export declare const IconImage: import("styled-components").StyledComponent<"img", any, {}, never>;
|
|
6
8
|
export declare const IlustrationContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -13,7 +13,7 @@ export type SectionHeaderProps = DefaultProps & {
|
|
|
13
13
|
/** Main text that will be displayed on the section header */
|
|
14
14
|
title: string;
|
|
15
15
|
/** SVG that will be displayed on top */
|
|
16
|
-
icon?: React.ReactElement<SVGElement>;
|
|
16
|
+
icon?: string | React.ReactElement<SVGElement>;
|
|
17
17
|
/** SVG that will be displayed as the background of the icon */
|
|
18
|
-
background?: React.ReactElement<SVGElement>;
|
|
18
|
+
background?: string | React.ReactElement<SVGElement>;
|
|
19
19
|
};
|