luna-one 3.1.585 → 3.1.587
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/luna/components/FilterSection/FilterSection.js +85 -0
- package/dist/luna/components/FilterSection/FilterSection.scss +141 -0
- package/dist/luna/components/FilterSection/FilterSectionMethods.js +71 -0
- package/dist/luna/featurettes/PullQuote/PullQuote.js +56 -49
- package/dist/luna/featurettes/PullQuote/PullQuote.scss +6 -1
- package/dist/luna/utils/hooks/useClickListener.js +22 -0
- package/package.json +3 -3
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
require("./FilterSection.scss");
|
|
12
|
+
var _useMouse2 = _interopRequireDefault(require("../../utils/hooks/useMouse"));
|
|
13
|
+
var _lodash = require("lodash");
|
|
14
|
+
var _FilterSectionMethods = require("./FilterSectionMethods");
|
|
15
|
+
var _useClickListener = _interopRequireDefault(require("../../utils/hooks/useClickListener"));
|
|
16
|
+
var FilterSection = function FilterSection(_ref) {
|
|
17
|
+
var content = _ref.content;
|
|
18
|
+
var introSection = content.introSection,
|
|
19
|
+
allFilters = content.allFilters,
|
|
20
|
+
filtersTitle = content.filtersTitle,
|
|
21
|
+
filterOptionClickHandler = content.filterOptionClickHandler,
|
|
22
|
+
activeFilters = content.activeFilters,
|
|
23
|
+
clearAllFiltersHandler = content.clearAllFiltersHandler,
|
|
24
|
+
removeActiveFilterHandler = content.removeActiveFilterHandler;
|
|
25
|
+
var _useMouse = (0, _useMouse2["default"])(),
|
|
26
|
+
mouse = _useMouse.mouse;
|
|
27
|
+
var _useState = (0, _react.useState)(null),
|
|
28
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
29
|
+
openFilterDropdown = _useState2[0],
|
|
30
|
+
setOpenFilterDropdown = _useState2[1]; // controls which filter dropdown is open
|
|
31
|
+
var _useState3 = (0, _react.useState)(activeFilters),
|
|
32
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
33
|
+
activeFilterChips = _useState4[0],
|
|
34
|
+
setActiveFilterChips = _useState4[1];
|
|
35
|
+
var filterDropdownClickHandler = function filterDropdownClickHandler(e, filter) {
|
|
36
|
+
var _e$target;
|
|
37
|
+
if (!(e !== null && e !== void 0 && (_e$target = e.target) !== null && _e$target !== void 0 && _e$target.classList.contains('ter-checkbox__label')) && openFilterDropdown === filter) {
|
|
38
|
+
// if clicked dropdown is already open, close it
|
|
39
|
+
setOpenFilterDropdown(null);
|
|
40
|
+
} else {
|
|
41
|
+
setOpenFilterDropdown(filter);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
var handleCloseDropdown = function handleCloseDropdown(e) {
|
|
45
|
+
var classCheck = function classCheck(target) {
|
|
46
|
+
var _target$classList, _target$classList2, _target$classList3, _target$classList4;
|
|
47
|
+
if (target !== null && target !== void 0 && (_target$classList = target.classList) !== null && _target$classList !== void 0 && _target$classList.contains('ter-filter-section__filter-label') || target !== null && target !== void 0 && (_target$classList2 = target.classList) !== null && _target$classList2 !== void 0 && _target$classList2.contains('ter-filter-section__filter-placeholder') || target !== null && target !== void 0 && (_target$classList3 = target.classList) !== null && _target$classList3 !== void 0 && _target$classList3.contains('ter-filter-section__filter-list') || target !== null && target !== void 0 && (_target$classList4 = target.classList) !== null && _target$classList4 !== void 0 && _target$classList4.contains('ter-checkbox__label')) {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
return false;
|
|
51
|
+
};
|
|
52
|
+
if (classCheck(e === null || e === void 0 ? void 0 : e.target) === false) {
|
|
53
|
+
setOpenFilterDropdown(null);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
var query = "";
|
|
57
|
+
if (typeof window !== "undefined" && typeof document !== "undefined") {
|
|
58
|
+
var _document;
|
|
59
|
+
query = ((_document = document) === null || _document === void 0 ? void 0 : _document.querySelectorAll(".ter-filter-section__filter-placeholder").length) > 0;
|
|
60
|
+
}
|
|
61
|
+
(0, _useClickListener["default"])(handleCloseDropdown, query);
|
|
62
|
+
(0, _react.useEffect)(function () {
|
|
63
|
+
setActiveFilterChips(activeFilters);
|
|
64
|
+
}, [activeFilters]);
|
|
65
|
+
return /*#__PURE__*/_react["default"].createElement("section", {
|
|
66
|
+
className: "ter-filter-section"
|
|
67
|
+
}, introSection && /*#__PURE__*/_react["default"].createElement("p", null, introSection), allFilters && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
68
|
+
className: "ter-filter-section__title"
|
|
69
|
+
}, /*#__PURE__*/_react["default"].createElement("h4", null, filtersTitle)), /*#__PURE__*/_react["default"].createElement("div", {
|
|
70
|
+
className: "ter-filter-section__outer "
|
|
71
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
72
|
+
className: "ter-filter-section__filters"
|
|
73
|
+
}, (0, _FilterSectionMethods.renderFiltersSection)(allFilters, filterDropdownClickHandler, filterOptionClickHandler, openFilterDropdown, activeFilters), /*#__PURE__*/_react["default"].createElement("div", {
|
|
74
|
+
className: "ter-filter-section__clear"
|
|
75
|
+
}, activeFilters && /*#__PURE__*/_react["default"].createElement("button", {
|
|
76
|
+
className: "ter-filter-section__clear-button",
|
|
77
|
+
onClick: function onClick(e) {
|
|
78
|
+
return clearAllFiltersHandler(e);
|
|
79
|
+
}
|
|
80
|
+
}, "Clear all filters")))), (activeFilterChips === null || activeFilterChips === void 0 ? void 0 : activeFilterChips.length) > 0 && /*#__PURE__*/_react["default"].createElement("div", {
|
|
81
|
+
className: "ter-filter-section__chips"
|
|
82
|
+
}, (0, _FilterSectionMethods.renderActiveFilters)(activeFilterChips, removeActiveFilterHandler))));
|
|
83
|
+
};
|
|
84
|
+
var _default = FilterSection;
|
|
85
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
@import "../../../global-styles/terra.scss";
|
|
2
|
+
|
|
3
|
+
.ter-filter-section {
|
|
4
|
+
&__title {
|
|
5
|
+
font-size: $body-font-size;
|
|
6
|
+
text-transform: uppercase;
|
|
7
|
+
margin-bottom: 24px;
|
|
8
|
+
}
|
|
9
|
+
&__filters {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-wrap: wrap;
|
|
12
|
+
width: 100%;
|
|
13
|
+
grid-gap: 0 24px;
|
|
14
|
+
align-items: center;
|
|
15
|
+
font-size: $large-body-font-size;
|
|
16
|
+
margin-bottom: 16px;
|
|
17
|
+
}
|
|
18
|
+
&__filter {
|
|
19
|
+
&-placeholder {
|
|
20
|
+
display: block;
|
|
21
|
+
border-radius: 4px;
|
|
22
|
+
border: 1px solid $trimble-dark-gray;
|
|
23
|
+
padding: 16px;
|
|
24
|
+
color: $trimble-blue;
|
|
25
|
+
font-weight: 500;
|
|
26
|
+
line-height: 1.18;
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
&> span,
|
|
29
|
+
&> svg {
|
|
30
|
+
pointer-events: none;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
&-wrapper {
|
|
34
|
+
max-width: 220px;
|
|
35
|
+
width: 100%;
|
|
36
|
+
position: relative;
|
|
37
|
+
margin-bottom: 15px;
|
|
38
|
+
}
|
|
39
|
+
&-title {
|
|
40
|
+
font-weight: 500;
|
|
41
|
+
margin-bottom: 5px;
|
|
42
|
+
display: block;
|
|
43
|
+
}
|
|
44
|
+
&-list {
|
|
45
|
+
height: 0;
|
|
46
|
+
border-radius: 0 0 5px 5px;
|
|
47
|
+
border: 1px solid black;
|
|
48
|
+
background-color: $white;
|
|
49
|
+
max-height: 250px;
|
|
50
|
+
overflow-y: scroll;
|
|
51
|
+
display: block;
|
|
52
|
+
opacity: 0;
|
|
53
|
+
position: absolute;
|
|
54
|
+
left: 0;
|
|
55
|
+
right: 0;
|
|
56
|
+
z-index: 1;
|
|
57
|
+
visibility: hidden;
|
|
58
|
+
&--open {
|
|
59
|
+
height: auto;
|
|
60
|
+
visibility: visible;
|
|
61
|
+
opacity: 1;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
&-option {
|
|
65
|
+
display: flex;
|
|
66
|
+
font-size: $body-font-size;
|
|
67
|
+
padding: 15px;
|
|
68
|
+
align-items: center;
|
|
69
|
+
pointer-events: none;
|
|
70
|
+
cursor: default;
|
|
71
|
+
& > * {
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
pointer-events: auto;
|
|
74
|
+
}
|
|
75
|
+
& + .ter-filter-section__filter-option {
|
|
76
|
+
border-top: 1px solid $concrete-gray;
|
|
77
|
+
}
|
|
78
|
+
& > .ter-checkbox {
|
|
79
|
+
padding: 0;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
&-label {
|
|
83
|
+
flex-grow: 1;
|
|
84
|
+
line-height: 1;
|
|
85
|
+
padding-left: 24px;
|
|
86
|
+
padding-bottom: 0;
|
|
87
|
+
font-size: $body-font-size;
|
|
88
|
+
&:before {
|
|
89
|
+
top: 0;
|
|
90
|
+
}
|
|
91
|
+
&:after {
|
|
92
|
+
top: 3px;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
&__clear {
|
|
97
|
+
@media screen and (max-width: $breakpoint-md) {
|
|
98
|
+
width: 100%;
|
|
99
|
+
}
|
|
100
|
+
&-button {
|
|
101
|
+
font-size: $body-font-size;
|
|
102
|
+
font-weight: 500;
|
|
103
|
+
position: relative;
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
display: block;
|
|
106
|
+
padding: 0;
|
|
107
|
+
&:after {
|
|
108
|
+
content: "";
|
|
109
|
+
display: block;
|
|
110
|
+
position: absolute;
|
|
111
|
+
bottom: 0;
|
|
112
|
+
left: 0;
|
|
113
|
+
right: 0;
|
|
114
|
+
background-color: $trimble-gold;
|
|
115
|
+
height: 2px;
|
|
116
|
+
}
|
|
117
|
+
&:hover:after {
|
|
118
|
+
background-color: $trimble-dark-gray;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
&__filter-wrapper:last-of-type {
|
|
123
|
+
margin-right: 24px;
|
|
124
|
+
}
|
|
125
|
+
&__chevron {
|
|
126
|
+
margin-right: 24px;
|
|
127
|
+
&--open {
|
|
128
|
+
transform: rotate(180deg);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
&__chips {
|
|
132
|
+
display: flex;
|
|
133
|
+
flex-wrap: wrap;
|
|
134
|
+
padding: 15px 0;
|
|
135
|
+
&> .ter-chip {
|
|
136
|
+
margin-right: 24px;
|
|
137
|
+
margin-bottom: 14px;
|
|
138
|
+
font-size: $body-font-size;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.renderFiltersSection = exports.renderActiveFilters = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _terraOne = require("terra-one");
|
|
10
|
+
var renderActiveFilters = function renderActiveFilters(activeFilters, removeActiveFilterHandler) {
|
|
11
|
+
return activeFilters === null || activeFilters === void 0 ? void 0 : activeFilters.map(function (filter, i) {
|
|
12
|
+
return /*#__PURE__*/_react["default"].createElement(_terraOne.Chip, {
|
|
13
|
+
key: i,
|
|
14
|
+
isSelected: false,
|
|
15
|
+
removeChipClickHandler: function removeChipClickHandler(e) {
|
|
16
|
+
return removeActiveFilterHandler(e, filter.id);
|
|
17
|
+
},
|
|
18
|
+
label: filter === null || filter === void 0 ? void 0 : filter.name
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
exports.renderActiveFilters = renderActiveFilters;
|
|
23
|
+
var renderFiltersSection = function renderFiltersSection(allFilters, filterDropdownClickHandler, filterOptionClickHandler, openFilterDropdown, activeFilters) {
|
|
24
|
+
return allFilters === null || allFilters === void 0 ? void 0 : allFilters.map(function (filter, i) {
|
|
25
|
+
var _filter$options;
|
|
26
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
27
|
+
key: i,
|
|
28
|
+
className: "ter-filter-section__filter-wrapper"
|
|
29
|
+
}, /*#__PURE__*/_react["default"].createElement("label", {
|
|
30
|
+
className: "ter-filter-section__filter-title"
|
|
31
|
+
}, filter === null || filter === void 0 ? void 0 : filter.name), /*#__PURE__*/_react["default"].createElement("div", {
|
|
32
|
+
className: "ter-filter-section__filter-placeholder",
|
|
33
|
+
onClick: function onClick(e) {
|
|
34
|
+
return filterDropdownClickHandler(e, filter === null || filter === void 0 ? void 0 : filter.id);
|
|
35
|
+
}
|
|
36
|
+
}, /*#__PURE__*/_react["default"].createElement("svg", {
|
|
37
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
38
|
+
width: "16",
|
|
39
|
+
height: "11",
|
|
40
|
+
fill: "currentColor",
|
|
41
|
+
className: "ter-filter-section__chevron ".concat(openFilterDropdown === (filter === null || filter === void 0 ? void 0 : filter.id) ? 'ter-filter-section__chevron--open' : '')
|
|
42
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
43
|
+
fill: "currentColor",
|
|
44
|
+
d: "M1.88.453 8 6.56 14.12.453 16 2.333l-8 8-8-8L1.88.453Z"
|
|
45
|
+
})), /*#__PURE__*/_react["default"].createElement("span", null, "Select")), /*#__PURE__*/_react["default"].createElement("div", {
|
|
46
|
+
className: "ter-filter-section__filter-list ".concat(openFilterDropdown === (filter === null || filter === void 0 ? void 0 : filter.id) ? 'ter-filter-section__filter-list--open' : '')
|
|
47
|
+
}, filter === null || filter === void 0 ? void 0 : (_filter$options = filter.options) === null || _filter$options === void 0 ? void 0 : _filter$options.map(function (option, i) {
|
|
48
|
+
var isChecked = activeFilters.some(function (filter) {
|
|
49
|
+
return (filter === null || filter === void 0 ? void 0 : filter.id) === (option === null || option === void 0 ? void 0 : option.id);
|
|
50
|
+
});
|
|
51
|
+
var optionAttributes = {
|
|
52
|
+
label: option === null || option === void 0 ? void 0 : option.name,
|
|
53
|
+
name: option === null || option === void 0 ? void 0 : option.name,
|
|
54
|
+
inputClass: "ter-filter-section__filter-checkbox",
|
|
55
|
+
labelClass: "ter-filter-section__filter-label",
|
|
56
|
+
overrideChecked: isChecked
|
|
57
|
+
};
|
|
58
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
59
|
+
className: "ter-filter-section__filter-option",
|
|
60
|
+
key: i,
|
|
61
|
+
"aria-label": option === null || option === void 0 ? void 0 : option.name
|
|
62
|
+
}, /*#__PURE__*/_react["default"].createElement(_terraOne.Checkbox, Object.assign({}, optionAttributes, {
|
|
63
|
+
checked: true,
|
|
64
|
+
handleChange: function handleChange(e) {
|
|
65
|
+
return filterOptionClickHandler(e, option === null || option === void 0 ? void 0 : option.id);
|
|
66
|
+
}
|
|
67
|
+
})));
|
|
68
|
+
})));
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
exports.renderFiltersSection = renderFiltersSection;
|
|
@@ -125,7 +125,7 @@ var imageSizes = {
|
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
127
|
var PullQuote = function PullQuote(props) {
|
|
128
|
-
var _topImage$focalPointI, _sideImage$focalPoint, _backgroundImage$foca
|
|
128
|
+
var _topImage$focalPointI, _sideImage$focalPoint, _backgroundImage$foca;
|
|
129
129
|
var _props$content = props.content,
|
|
130
130
|
content = _props$content === void 0 ? {} : _props$content,
|
|
131
131
|
zIndex = props.zIndex,
|
|
@@ -141,8 +141,8 @@ var PullQuote = function PullQuote(props) {
|
|
|
141
141
|
sideImage = content.sideImage,
|
|
142
142
|
imagePosition = content.imagePosition,
|
|
143
143
|
appearance = content.appearance,
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
backgroundImage = content.backgroundImage,
|
|
145
|
+
imageOptions = content.imageOptions;
|
|
146
146
|
var quoteText = quoteObj.text,
|
|
147
147
|
quoteSource = quoteObj.source,
|
|
148
148
|
quoteSourceTitle = quoteObj.sourceTitle;
|
|
@@ -165,18 +165,21 @@ var PullQuote = function PullQuote(props) {
|
|
|
165
165
|
}
|
|
166
166
|
return null;
|
|
167
167
|
};
|
|
168
|
-
var
|
|
168
|
+
var imageContainerOption = {
|
|
169
169
|
"1/4": "25%",
|
|
170
|
-
"1/2": "50%"
|
|
170
|
+
"1/2": "50%",
|
|
171
|
+
"No Image": "100%"
|
|
171
172
|
};
|
|
172
|
-
var
|
|
173
|
+
var quoteContainerOption = {
|
|
173
174
|
"1/4": "75%",
|
|
174
|
-
"1/2": "50%"
|
|
175
|
+
"1/2": "50%",
|
|
176
|
+
"No Image": "100%"
|
|
175
177
|
};
|
|
176
178
|
var containerWidthClass = {
|
|
177
179
|
"25%": "quarter",
|
|
178
180
|
"50%": "half",
|
|
179
|
-
"75%": "threeQuarter"
|
|
181
|
+
"75%": "threeQuarter",
|
|
182
|
+
"100%": "full"
|
|
180
183
|
};
|
|
181
184
|
var lottieStyles = {
|
|
182
185
|
height: "100%"
|
|
@@ -203,6 +206,46 @@ var PullQuote = function PullQuote(props) {
|
|
|
203
206
|
});
|
|
204
207
|
}
|
|
205
208
|
};
|
|
209
|
+
var renderPullQuoteContent = function renderPullQuoteContent() {
|
|
210
|
+
var _content$cta, _content$cta2, _content$cta3, _content$cta4, _content$cta5, _content$cta6, _content$cta7, _content$cta8, _content$cta9, _content$cta10, _content$cta11, _content$cta12, _content$cta13, _content$cta14, _content$cta15, _content$cta16;
|
|
211
|
+
return /*#__PURE__*/_react["default"].createElement("section", {
|
|
212
|
+
className: "ter-pullQuote__quote-section__quote ter-pullQuote__quote-section__quote--".concat(variant === null || variant === void 0 ? void 0 : variant.toLowerCase(), "--").concat(containerWidthClass[quoteContainerOption[imageOptions]])
|
|
213
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
214
|
+
className: "ter-pullQuote__full-quote-wrapper ter-pullQuote__full-quote-wrapper--".concat(appearance === null || appearance === void 0 ? void 0 : appearance.toLowerCase())
|
|
215
|
+
}, /*#__PURE__*/_react["default"].createElement("aside", {
|
|
216
|
+
className: "ter-pullQuote__full-quote-wrapper--content"
|
|
217
|
+
}, quoteText && !(0, _checkForDangerouslySet["default"])(quoteText) && /*#__PURE__*/_react["default"].createElement("p", {
|
|
218
|
+
className: "ter-pullQuote__quote-text",
|
|
219
|
+
style: {
|
|
220
|
+
color: color
|
|
221
|
+
},
|
|
222
|
+
dangerouslySetInnerHTML: (0, _formatSpecialCharText["default"])(quoteText)
|
|
223
|
+
}), quoteText && (0, _checkForDangerouslySet["default"])(quoteText) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
224
|
+
className: "ter-pullQuote__quote-text-holder dangerously-set-content",
|
|
225
|
+
dangerouslySetInnerHTML: (0, _formatSpecialCharText["default"])(quoteText)
|
|
226
|
+
}), quoteSource && /*#__PURE__*/_react["default"].createElement("p", {
|
|
227
|
+
className: "ter-pullQuote__quote-source",
|
|
228
|
+
style: {
|
|
229
|
+
color: color
|
|
230
|
+
}
|
|
231
|
+
}, quoteSource), quoteSourceTitle && /*#__PURE__*/_react["default"].createElement("p", {
|
|
232
|
+
className: "ter-pullQuote__quote-source-title",
|
|
233
|
+
style: {
|
|
234
|
+
color: color
|
|
235
|
+
}
|
|
236
|
+
}, quoteSourceTitle), ((content === null || content === void 0 ? void 0 : (_content$cta = content.cta) === null || _content$cta === void 0 ? void 0 : _content$cta.url) && (content === null || content === void 0 ? void 0 : (_content$cta2 = content.cta) === null || _content$cta2 === void 0 ? void 0 : _content$cta2.text) || (content === null || content === void 0 ? void 0 : (_content$cta3 = content.cta) === null || _content$cta3 === void 0 ? void 0 : _content$cta3.onClick) && (content === null || content === void 0 ? void 0 : (_content$cta4 = content.cta) === null || _content$cta4 === void 0 ? void 0 : _content$cta4.text) || (content === null || content === void 0 ? void 0 : (_content$cta5 = content.cta) === null || _content$cta5 === void 0 ? void 0 : _content$cta5.text) && (content === null || content === void 0 ? void 0 : (_content$cta6 = content.cta) === null || _content$cta6 === void 0 ? void 0 : _content$cta6.video)) && /*#__PURE__*/_react["default"].createElement(_terraOne.Button, {
|
|
237
|
+
Link: content === null || content === void 0 ? void 0 : content.Link,
|
|
238
|
+
url: content === null || content === void 0 ? void 0 : (_content$cta7 = content.cta) === null || _content$cta7 === void 0 ? void 0 : _content$cta7.url,
|
|
239
|
+
text: content === null || content === void 0 ? void 0 : (_content$cta8 = content.cta) === null || _content$cta8 === void 0 ? void 0 : _content$cta8.text,
|
|
240
|
+
className: "ter-button--".concat(content === null || content === void 0 ? void 0 : (_content$cta9 = content.cta) === null || _content$cta9 === void 0 ? void 0 : _content$cta9.className) || "ter-button--primary--2",
|
|
241
|
+
external: content === null || content === void 0 ? void 0 : content.external,
|
|
242
|
+
VideoComponent: _Video["default"] ? _Video["default"] : null,
|
|
243
|
+
video: content !== null && content !== void 0 && (_content$cta10 = content.cta) !== null && _content$cta10 !== void 0 && _content$cta10.video ? content === null || content === void 0 ? void 0 : (_content$cta11 = content.cta) === null || _content$cta11 === void 0 ? void 0 : _content$cta11.video : null,
|
|
244
|
+
setOverride: content !== null && content !== void 0 && (_content$cta12 = content.cta) !== null && _content$cta12 !== void 0 && _content$cta12.setOverride ? content === null || content === void 0 ? void 0 : (_content$cta13 = content.cta) === null || _content$cta13 === void 0 ? void 0 : _content$cta13.setOverride : null,
|
|
245
|
+
override: content !== null && content !== void 0 && (_content$cta14 = content.cta) !== null && _content$cta14 !== void 0 && _content$cta14.override ? content === null || content === void 0 ? void 0 : (_content$cta15 = content.cta) === null || _content$cta15 === void 0 ? void 0 : _content$cta15.override : null,
|
|
246
|
+
onClick: content === null || content === void 0 ? void 0 : (_content$cta16 = content.cta) === null || _content$cta16 === void 0 ? void 0 : _content$cta16.onClick
|
|
247
|
+
}))));
|
|
248
|
+
};
|
|
206
249
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
207
250
|
className: hasBackgroundImage ? "ter-pullQuote__grid" : ""
|
|
208
251
|
}, hasBackgroundImage && /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -214,7 +257,7 @@ var PullQuote = function PullQuote(props) {
|
|
|
214
257
|
},
|
|
215
258
|
id: (0, _generateID["default"])(id, content.header),
|
|
216
259
|
ref: wrapper
|
|
217
|
-
}, isTopImage && /*#__PURE__*/_react["default"].createElement("section", {
|
|
260
|
+
}, isTopImage && !(imageOptions !== null && imageOptions !== void 0 && imageOptions.includes("No Image")) && /*#__PURE__*/_react["default"].createElement("section", {
|
|
218
261
|
className: "ter-pullQuote ter-pullQuote--top-image"
|
|
219
262
|
}, (0, _renderImageOrLottieAnimation.renderImageOrLottieAnimation)(topImage, pictureStyles(), imageSizes === null || imageSizes === void 0 ? void 0 : imageSizes.variant3, (0, _generateFocusedImageAlt["default"])(topImage), "ter-pullQuote__top-image", lottieStyles, true, {
|
|
220
263
|
width: 14,
|
|
@@ -224,49 +267,13 @@ var PullQuote = function PullQuote(props) {
|
|
|
224
267
|
backgroundColor: backgroundColor,
|
|
225
268
|
color: color
|
|
226
269
|
},
|
|
227
|
-
className: "ter-pullQuote ter-pullQuote__quote-section ter-pullQuote__quote-section--".concat(variant === null || variant === void 0 ? void 0 : variant.toLowerCase(), "--").concat(containerWidthClass[
|
|
270
|
+
className: "ter-pullQuote ter-pullQuote__quote-section ter-pullQuote__quote-section--".concat(variant === null || variant === void 0 ? void 0 : variant.toLowerCase(), "--").concat(containerWidthClass[imageContainerOption[imageOptions]], " ter-pullQuote__quote-section--").concat(appearance === null || appearance === void 0 ? void 0 : appearance.toLowerCase(), " ").concat(!(imageOptions !== null && imageOptions !== void 0 && imageOptions.includes("No Image")) && imagePosition ? "ter-pullQuote__quote-section--".concat(imagePosition === null || imagePosition === void 0 ? void 0 : imagePosition.toLowerCase()) : null, "\n ")
|
|
228
271
|
}, !isTopImage && isSideImage && /*#__PURE__*/_react["default"].createElement("section", {
|
|
229
|
-
className: "ter-pullQuote__quote-section__image ter-pullQuote__quote-section__image--".concat(variant === null || variant === void 0 ? void 0 : variant.toLowerCase(), "--").concat(containerWidthClass[
|
|
230
|
-
}, (0, _renderImageOrLottieAnimation.renderImageOrLottieAnimation)(sideImage, pictureStyles(), imageSizes["".concat(variant, "_").concat(
|
|
272
|
+
className: "ter-pullQuote__quote-section__image ter-pullQuote__quote-section__image--".concat(variant === null || variant === void 0 ? void 0 : variant.toLowerCase(), "--").concat(containerWidthClass[imageContainerOption[imageOptions]], " ter-pullQuote__quote-section__image--").concat(variant === null || variant === void 0 ? void 0 : variant.toLowerCase(), "--").concat(imagePosition === null || imagePosition === void 0 ? void 0 : imagePosition.toLowerCase())
|
|
273
|
+
}, (0, _renderImageOrLottieAnimation.renderImageOrLottieAnimation)(sideImage, pictureStyles(), imageSizes["".concat(variant, "_").concat(imageOptions)], (0, _generateFocusedImageAlt["default"])(sideImage), "ter-pullQuote__side-image", lottieStyles, false, {
|
|
231
274
|
height: 1,
|
|
232
275
|
width: 1
|
|
233
|
-
})),
|
|
234
|
-
className: "ter-pullQuote__quote-section__quote ter-pullQuote__quote-section__quote--".concat(variant.toLowerCase(), "--").concat(containerWidthClass[quoteContainerWidth[imageWidth]])
|
|
235
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
236
|
-
className: "ter-pullQuote__full-quote-wrapper ter-pullQuote__full-quote-wrapper--".concat(appearance === null || appearance === void 0 ? void 0 : appearance.toLowerCase())
|
|
237
|
-
}, /*#__PURE__*/_react["default"].createElement("aside", {
|
|
238
|
-
className: "ter-pullQuote__full-quote-wrapper--content"
|
|
239
|
-
}, quoteText && !(0, _checkForDangerouslySet["default"])(quoteText) && /*#__PURE__*/_react["default"].createElement("p", {
|
|
240
|
-
className: "ter-pullQuote__quote-text",
|
|
241
|
-
style: {
|
|
242
|
-
color: color
|
|
243
|
-
},
|
|
244
|
-
dangerouslySetInnerHTML: (0, _formatSpecialCharText["default"])(quoteText)
|
|
245
|
-
}), quoteText && (0, _checkForDangerouslySet["default"])(quoteText) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
246
|
-
className: "ter-pullQuote__quote-text-holder dangerously-set-content",
|
|
247
|
-
dangerouslySetInnerHTML: (0, _formatSpecialCharText["default"])(quoteText)
|
|
248
|
-
}), quoteSource && /*#__PURE__*/_react["default"].createElement("p", {
|
|
249
|
-
className: "ter-pullQuote__quote-source",
|
|
250
|
-
style: {
|
|
251
|
-
color: color
|
|
252
|
-
}
|
|
253
|
-
}, quoteSource), quoteSourceTitle && /*#__PURE__*/_react["default"].createElement("p", {
|
|
254
|
-
className: "ter-pullQuote__quote-source-title",
|
|
255
|
-
style: {
|
|
256
|
-
color: color
|
|
257
|
-
}
|
|
258
|
-
}, quoteSourceTitle), ((content === null || content === void 0 ? void 0 : (_content$cta = content.cta) === null || _content$cta === void 0 ? void 0 : _content$cta.url) && (content === null || content === void 0 ? void 0 : (_content$cta2 = content.cta) === null || _content$cta2 === void 0 ? void 0 : _content$cta2.text) || (content === null || content === void 0 ? void 0 : (_content$cta3 = content.cta) === null || _content$cta3 === void 0 ? void 0 : _content$cta3.onClick) && (content === null || content === void 0 ? void 0 : (_content$cta4 = content.cta) === null || _content$cta4 === void 0 ? void 0 : _content$cta4.text) || (content === null || content === void 0 ? void 0 : (_content$cta5 = content.cta) === null || _content$cta5 === void 0 ? void 0 : _content$cta5.text) && (content === null || content === void 0 ? void 0 : (_content$cta6 = content.cta) === null || _content$cta6 === void 0 ? void 0 : _content$cta6.video)) && /*#__PURE__*/_react["default"].createElement(_terraOne.Button, {
|
|
259
|
-
Link: content === null || content === void 0 ? void 0 : content.Link,
|
|
260
|
-
url: content === null || content === void 0 ? void 0 : (_content$cta7 = content.cta) === null || _content$cta7 === void 0 ? void 0 : _content$cta7.url,
|
|
261
|
-
text: content === null || content === void 0 ? void 0 : (_content$cta8 = content.cta) === null || _content$cta8 === void 0 ? void 0 : _content$cta8.text,
|
|
262
|
-
className: "ter-button--".concat(content === null || content === void 0 ? void 0 : (_content$cta9 = content.cta) === null || _content$cta9 === void 0 ? void 0 : _content$cta9.className) || "ter-button--primary--2",
|
|
263
|
-
external: content === null || content === void 0 ? void 0 : content.external,
|
|
264
|
-
VideoComponent: _Video["default"] ? _Video["default"] : null,
|
|
265
|
-
video: content !== null && content !== void 0 && (_content$cta10 = content.cta) !== null && _content$cta10 !== void 0 && _content$cta10.video ? content === null || content === void 0 ? void 0 : (_content$cta11 = content.cta) === null || _content$cta11 === void 0 ? void 0 : _content$cta11.video : null,
|
|
266
|
-
setOverride: content !== null && content !== void 0 && (_content$cta12 = content.cta) !== null && _content$cta12 !== void 0 && _content$cta12.setOverride ? content === null || content === void 0 ? void 0 : (_content$cta13 = content.cta) === null || _content$cta13 === void 0 ? void 0 : _content$cta13.setOverride : null,
|
|
267
|
-
override: content !== null && content !== void 0 && (_content$cta14 = content.cta) !== null && _content$cta14 !== void 0 && _content$cta14.override ? content === null || content === void 0 ? void 0 : (_content$cta15 = content.cta) === null || _content$cta15 === void 0 ? void 0 : _content$cta15.override : null,
|
|
268
|
-
onClick: content === null || content === void 0 ? void 0 : (_content$cta16 = content.cta) === null || _content$cta16 === void 0 ? void 0 : _content$cta16.onClick
|
|
269
|
-
})))))));
|
|
276
|
+
})), renderPullQuoteContent())));
|
|
270
277
|
};
|
|
271
278
|
var _default = PullQuote;
|
|
272
279
|
exports["default"] = _default;
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
display: flex;
|
|
68
68
|
flex-direction: row;
|
|
69
69
|
justify-content: space-between;
|
|
70
|
-
|
|
70
|
+
width: 100%;
|
|
71
71
|
|
|
72
72
|
@media (max-width: $breakpoint-xs) {
|
|
73
73
|
flex-direction: column;
|
|
@@ -111,6 +111,8 @@
|
|
|
111
111
|
}
|
|
112
112
|
&__quote {
|
|
113
113
|
padding: 20px;
|
|
114
|
+
width: 100%;
|
|
115
|
+
|
|
114
116
|
&--variant2,
|
|
115
117
|
&--variant1 {
|
|
116
118
|
&--quarter {
|
|
@@ -130,6 +132,9 @@
|
|
|
130
132
|
width: 100%;
|
|
131
133
|
}
|
|
132
134
|
}
|
|
135
|
+
&--full {
|
|
136
|
+
width: 100%
|
|
137
|
+
}
|
|
133
138
|
}
|
|
134
139
|
}
|
|
135
140
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var useClickListener = function useClickListener(handler, selectorCheck) {
|
|
9
|
+
(0, _react.useEffect)(function () {
|
|
10
|
+
// Check if selector is passed to function, and selected element exists in DOM. selectorCheck should be a DOM query, like 'document.querySelectorAll(".nav-entry").length > 0'
|
|
11
|
+
// if the element doesn't exist in the DOM we shouldn't add a listener/handler for it onto the app.
|
|
12
|
+
// hopefully this approach results in better performance by not having blank listeners sitting in memory!
|
|
13
|
+
if (selectorCheck && typeof window !== "undefined" && typeof document !== "undefined") {
|
|
14
|
+
document.addEventListener("click", handler);
|
|
15
|
+
return function () {
|
|
16
|
+
document.removeEventListener("click", handler);
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}, [handler, selectorCheck]);
|
|
20
|
+
};
|
|
21
|
+
var _default = useClickListener;
|
|
22
|
+
exports["default"] = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "luna-one",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.587",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": "^18.2.0",
|
|
6
6
|
"react-dom": "^18.2.0",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"react-player": "^2.11.2",
|
|
50
50
|
"react-scroll": "^1.8.9",
|
|
51
51
|
"smoothscroll-polyfill": "^0.4.4",
|
|
52
|
-
"terra-one": "^3.0.
|
|
52
|
+
"terra-one": "^3.0.194"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"start": "start-storybook -p 9009 -s public",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,md}\"",
|
|
58
58
|
"test": "react-scripts test --transformIgnorePatterns \"node_modules/(?!terra-component-lib)/\"",
|
|
59
59
|
"eject": "react-scripts eject",
|
|
60
|
-
"
|
|
60
|
+
"luna-publish": "git checkout master && git pull && npm install && npm version patch && npm run build && npm publish && git push",
|
|
61
61
|
"update-terra": "npm update terra-component-lib",
|
|
62
62
|
"patch": "git add . && git commit -m 'Bug fix' && npm version patch && npm run build && npm publish afplay /System/Library/Sounds/Pop.aiff ",
|
|
63
63
|
"storybook": "start-storybook -p 9009 -s public",
|