@asante-org/atlascopco-vt-litesitegenerator 3.0.20 → 3.0.23

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/dist/index.esm.js CHANGED
@@ -11,9 +11,10 @@ function _extends() {
11
11
  }
12
12
 
13
13
  var LsgButton = function (_a) {
14
- var children = _a.children;
15
- _a.variant;
16
- var _c = _a.disabled,
14
+ var children = _a.children,
15
+ _b = _a.variant,
16
+ variant = _b === void 0 ? "primary" : _b,
17
+ _c = _a.disabled,
17
18
  disabled = _c === void 0 ? false : _c,
18
19
  href = _a.href,
19
20
  onClick = _a.onClick,
@@ -23,7 +24,7 @@ var LsgButton = function (_a) {
23
24
  className = _e === void 0 ? "" : _e,
24
25
  _f = _a.external,
25
26
  external = _f === void 0 ? false : _f;
26
- var classNames = ["lsg-button", disabled ? "lsg-button--disabled" : "", className].filter(Boolean).join(" ");
27
+ var classNames = ["lsg-button", "lsg-button--".concat(variant), disabled ? "lsg-button--disabled" : "", className].filter(Boolean).join(" ");
27
28
  if (href) {
28
29
  return /*#__PURE__*/React.createElement("a", _extends({
29
30
  href: disabled ? undefined : href,
@@ -45,36 +46,94 @@ var LsgButton = function (_a) {
45
46
  }, children);
46
47
  };
47
48
 
49
+ function bannerClassName(layout, mobileMediaPosition, className) {
50
+ return ["lsg-banner", "lsg-banner--".concat(layout), "lsg-banner--mobile-media-".concat(mobileMediaPosition), className].filter(Boolean).join(" ");
51
+ }
48
52
  var LsgBanner = function (_a) {
49
53
  var heading = _a.heading,
54
+ preTitle = _a.preTitle,
50
55
  eyebrow = _a.eyebrow,
56
+ body = _a.body,
51
57
  copy = _a.copy,
58
+ ctas = _a.ctas,
52
59
  cta = _a.cta,
60
+ mediaType = _a.mediaType,
53
61
  imageUrl = _a.imageUrl,
54
62
  _b = _a.imageAlt,
55
- imageAlt = _b === void 0 ? "" : _b;
63
+ imageAlt = _b === void 0 ? "" : _b,
64
+ videoUrl = _a.videoUrl,
65
+ videoPoster = _a.videoPoster,
66
+ _c = _a.videoControls,
67
+ videoControls = _c === void 0 ? true : _c,
68
+ _d = _a.videoAutoPlay,
69
+ videoAutoPlay = _d === void 0 ? false : _d,
70
+ _e = _a.videoMuted,
71
+ videoMuted = _e === void 0 ? true : _e,
72
+ _f = _a.videoLoop,
73
+ videoLoop = _f === void 0 ? false : _f,
74
+ _g = _a.layout,
75
+ layout = _g === void 0 ? "media-left" : _g,
76
+ _h = _a.mobileMediaPosition,
77
+ mobileMediaPosition = _h === void 0 ? "top" : _h,
78
+ _j = _a.headingTag,
79
+ headingTag = _j === void 0 ? "h1" : _j,
80
+ className = _a.className;
81
+ var resolvedPreTitle = preTitle !== null && preTitle !== void 0 ? preTitle : eyebrow;
82
+ var resolvedBody = body !== null && body !== void 0 ? body : copy;
83
+ var actions = ((ctas === null || ctas === void 0 ? void 0 : ctas.length) ? ctas : cta ? [cta] : []).slice(0, 3);
84
+ var resolvedMediaType = mediaType !== null && mediaType !== void 0 ? mediaType : videoUrl ? "video" : "image";
85
+ var hasMedia = layout !== "text-only" && (resolvedMediaType === "video" ? Boolean(videoUrl) : Boolean(imageUrl));
86
+ var HeadingTag = headingTag;
56
87
  return /*#__PURE__*/React.createElement("section", {
57
- className: "lsg-banner"
58
- }, imageUrl && /*#__PURE__*/React.createElement("div", {
59
- className: "lsg-banner__background",
60
- "aria-hidden": "true"
61
- }, /*#__PURE__*/React.createElement("img", {
88
+ className: bannerClassName(layout, mobileMediaPosition, className),
89
+ "data-lsg-is": "banner",
90
+ "data-lsg-banner-layout": layout,
91
+ "data-lsg-banner-mobile-media": mobileMediaPosition,
92
+ "data-lsg-banner-media": hasMedia ? resolvedMediaType : "none"
93
+ }, /*#__PURE__*/React.createElement("div", {
94
+ className: "lsg-banner__shell"
95
+ }, hasMedia && /*#__PURE__*/React.createElement("div", {
96
+ className: "lsg-banner__media"
97
+ }, resolvedMediaType === "video" && videoUrl ? /*#__PURE__*/React.createElement("video", {
98
+ className: "lsg-banner__video",
99
+ src: videoUrl,
100
+ poster: videoPoster,
101
+ controls: videoControls,
102
+ autoPlay: videoAutoPlay,
103
+ muted: videoMuted,
104
+ loop: videoLoop,
105
+ playsInline: true,
106
+ "aria-label": imageAlt || heading
107
+ }) : imageUrl ? /*#__PURE__*/React.createElement("img", {
108
+ className: "lsg-banner__image",
62
109
  src: imageUrl,
63
110
  alt: imageAlt
64
- })), /*#__PURE__*/React.createElement("div", {
65
- className: "lsg-banner__inner"
66
- }, eyebrow && /*#__PURE__*/React.createElement("span", {
67
- className: "lsg-banner__eyebrow"
68
- }, eyebrow), /*#__PURE__*/React.createElement("h1", {
111
+ }) : null), /*#__PURE__*/React.createElement("div", {
112
+ className: "lsg-banner__content"
113
+ }, resolvedPreTitle && /*#__PURE__*/React.createElement("div", {
114
+ className: "lsg-banner__pre-title"
115
+ }, /*#__PURE__*/React.createElement("span", {
116
+ className: "lsg-banner__pre-title-marker",
117
+ "aria-hidden": "true"
118
+ }), /*#__PURE__*/React.createElement("span", {
119
+ className: "lsg-banner__pre-title-text"
120
+ }, resolvedPreTitle)), /*#__PURE__*/React.createElement(HeadingTag, {
69
121
  className: "lsg-banner__heading"
70
- }, heading), copy && /*#__PURE__*/React.createElement("p", {
71
- className: "lsg-banner__copy"
72
- }, copy), cta && /*#__PURE__*/React.createElement(LsgButton, {
73
- href: cta.href,
74
- external: cta.external,
75
- variant: "primary",
76
- className: "lsg-banner__cta"
77
- }, cta.label)));
122
+ }, heading), resolvedBody && /*#__PURE__*/React.createElement("div", {
123
+ className: "lsg-banner__body"
124
+ }, /*#__PURE__*/React.createElement("p", null, resolvedBody)), actions.length > 0 && /*#__PURE__*/React.createElement("div", {
125
+ className: "lsg-banner__actions"
126
+ }, actions.map(function (action, index) {
127
+ var _a, _b;
128
+ return /*#__PURE__*/React.createElement(LsgButton, {
129
+ key: "".concat(action.label, "-").concat((_a = action.href) !== null && _a !== void 0 ? _a : "button", "-").concat(index),
130
+ href: action.href,
131
+ external: action.external,
132
+ variant: (_b = action.variant) !== null && _b !== void 0 ? _b : "primary",
133
+ onClick: action.onClick,
134
+ className: "lsg-banner__cta"
135
+ }, action.label);
136
+ })))));
78
137
  };
79
138
 
80
139
  function cardVariantClass(variant) {