@bigbinary/neeto-molecules 1.0.87-beta → 1.0.88

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.
@@ -249,7 +249,7 @@ var RightBlock = function RightBlock(_ref) {
249
249
 
250
250
  var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
251
251
 
252
- var css = ":root{--neeto-molecules-sub-header-height:37px;--neeto-molecules-sub-header-bottom-margin:20px}.neeto-molecules-subheader{align-items:center;background-color:rgb(var(--neeto-ui-white));display:flex;flex-direction:row;justify-content:space-between;margin-bottom:20px;margin-bottom:var(--neeto-molecules-sub-header-bottom-margin);min-height:37px;min-height:var(--neeto-molecules-sub-header-height);width:100%}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper{display:flex;flex-grow:1}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper .neeto-molecules-subheader__left{align-items:center;display:flex;flex-direction:row;justify-content:flex-start}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper .neeto-molecules-subheader__left .neeto-molecules-input__prefix{color:rgb(var(--neeto-ui-gray-400))}.neeto-molecules-subheader .neeto-molecules-subheader__right{align-items:center;display:flex;flex-direction:row;gap:12px;justify-content:flex-end}.neeto-molecules-subheader .neeto-molecules-subheader__right-actions{align-items:center;display:flex;flex-direction:row;gap:8px;justify-content:flex-end}.neeto-molecules-subheader .neeto-molecules-subheader__right-actions>:not([hidden])~:not([hidden]){border-left:thin solid rgb(var(--neeto-ui-gray-300));padding-left:8px}.neeto-molecules-subheader__download{position:relative}.neeto-molecules-subheader__download-count{align-items:center;background-color:rgb(var(--neeto-ui-primary-500));border-radius:var(--neeto-ui-rounded-full);color:rgb(var(--neeto-ui-white));display:inline-flex;font-size:10px;justify-content:center;min-height:16px;min-width:16px;position:absolute;right:-2px;text-align:center;top:-2px;z-index:1}";
252
+ var css = ".neeto-molecules-subheader{align-items:center;background-color:rgb(var(--neeto-ui-white));display:flex;flex-direction:row;justify-content:space-between;margin-bottom:var(--neeto-ui-sub-header-bottom-margin);min-height:var(--neeto-ui-sub-header-height);width:100%}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper{display:flex;flex-grow:1}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper .neeto-molecules-subheader__left{align-items:center;display:flex;flex-direction:row;justify-content:flex-start}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper .neeto-molecules-subheader__left .neeto-molecules-input__prefix{color:rgb(var(--neeto-ui-gray-400))}.neeto-molecules-subheader .neeto-molecules-subheader__right{align-items:center;display:flex;flex-direction:row;gap:12px;justify-content:flex-end}.neeto-molecules-subheader .neeto-molecules-subheader__right-actions{align-items:center;display:flex;flex-direction:row;gap:8px;justify-content:flex-end}.neeto-molecules-subheader .neeto-molecules-subheader__right-actions>:not([hidden])~:not([hidden]){border-left:thin solid rgb(var(--neeto-ui-gray-300));padding-left:8px}.neeto-molecules-subheader__download{position:relative}.neeto-molecules-subheader__download-count{align-items:center;background-color:rgb(var(--neeto-ui-primary-500));border-radius:var(--neeto-ui-rounded-full);color:rgb(var(--neeto-ui-white));display:inline-flex;font-size:10px;justify-content:center;min-height:16px;min-width:16px;position:absolute;right:-2px;text-align:center;top:-2px;z-index:1}";
253
253
  n(css,{});
254
254
 
255
255
  var SubHeader = function SubHeader(_ref) {
package/dist/SubHeader.js CHANGED
@@ -242,7 +242,7 @@ var RightBlock = function RightBlock(_ref) {
242
242
 
243
243
  var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
244
244
 
245
- var css = ":root{--neeto-molecules-sub-header-height:37px;--neeto-molecules-sub-header-bottom-margin:20px}.neeto-molecules-subheader{align-items:center;background-color:rgb(var(--neeto-ui-white));display:flex;flex-direction:row;justify-content:space-between;margin-bottom:20px;margin-bottom:var(--neeto-molecules-sub-header-bottom-margin);min-height:37px;min-height:var(--neeto-molecules-sub-header-height);width:100%}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper{display:flex;flex-grow:1}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper .neeto-molecules-subheader__left{align-items:center;display:flex;flex-direction:row;justify-content:flex-start}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper .neeto-molecules-subheader__left .neeto-molecules-input__prefix{color:rgb(var(--neeto-ui-gray-400))}.neeto-molecules-subheader .neeto-molecules-subheader__right{align-items:center;display:flex;flex-direction:row;gap:12px;justify-content:flex-end}.neeto-molecules-subheader .neeto-molecules-subheader__right-actions{align-items:center;display:flex;flex-direction:row;gap:8px;justify-content:flex-end}.neeto-molecules-subheader .neeto-molecules-subheader__right-actions>:not([hidden])~:not([hidden]){border-left:thin solid rgb(var(--neeto-ui-gray-300));padding-left:8px}.neeto-molecules-subheader__download{position:relative}.neeto-molecules-subheader__download-count{align-items:center;background-color:rgb(var(--neeto-ui-primary-500));border-radius:var(--neeto-ui-rounded-full);color:rgb(var(--neeto-ui-white));display:inline-flex;font-size:10px;justify-content:center;min-height:16px;min-width:16px;position:absolute;right:-2px;text-align:center;top:-2px;z-index:1}";
245
+ var css = ".neeto-molecules-subheader{align-items:center;background-color:rgb(var(--neeto-ui-white));display:flex;flex-direction:row;justify-content:space-between;margin-bottom:var(--neeto-ui-sub-header-bottom-margin);min-height:var(--neeto-ui-sub-header-height);width:100%}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper{display:flex;flex-grow:1}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper .neeto-molecules-subheader__left{align-items:center;display:flex;flex-direction:row;justify-content:flex-start}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper .neeto-molecules-subheader__left .neeto-molecules-input__prefix{color:rgb(var(--neeto-ui-gray-400))}.neeto-molecules-subheader .neeto-molecules-subheader__right{align-items:center;display:flex;flex-direction:row;gap:12px;justify-content:flex-end}.neeto-molecules-subheader .neeto-molecules-subheader__right-actions{align-items:center;display:flex;flex-direction:row;gap:8px;justify-content:flex-end}.neeto-molecules-subheader .neeto-molecules-subheader__right-actions>:not([hidden])~:not([hidden]){border-left:thin solid rgb(var(--neeto-ui-gray-300));padding-left:8px}.neeto-molecules-subheader__download{position:relative}.neeto-molecules-subheader__download-count{align-items:center;background-color:rgb(var(--neeto-ui-primary-500));border-radius:var(--neeto-ui-rounded-full);color:rgb(var(--neeto-ui-white));display:inline-flex;font-size:10px;justify-content:center;min-height:16px;min-width:16px;position:absolute;right:-2px;text-align:center;top:-2px;z-index:1}";
246
246
  n(css,{});
247
247
 
248
248
  var SubHeader = function SubHeader(_ref) {
@@ -0,0 +1,304 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var formik$1 = require('formik');
5
+ var pure = require('@bigbinary/neeto-commons-frontend/pure');
6
+ var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
7
+ var neetoIcons = require('@bigbinary/neeto-icons');
8
+ var neetoui = require('@bigbinary/neetoui');
9
+ var formik = require('@bigbinary/neetoui/formik');
10
+ var ramda = require('ramda');
11
+ var reactI18next = require('react-i18next');
12
+
13
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
+
15
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
16
+
17
+ function _arrayWithHoles(arr) {
18
+ if (Array.isArray(arr)) return arr;
19
+ }
20
+
21
+ function _iterableToArrayLimit(arr, i) {
22
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
23
+ if (null != _i) {
24
+ var _s,
25
+ _e,
26
+ _x,
27
+ _r,
28
+ _arr = [],
29
+ _n = !0,
30
+ _d = !1;
31
+ try {
32
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
33
+ if (Object(_i) !== _i) return;
34
+ _n = !1;
35
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
36
+ } catch (err) {
37
+ _d = !0, _e = err;
38
+ } finally {
39
+ try {
40
+ if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
41
+ } finally {
42
+ if (_d) throw _e;
43
+ }
44
+ }
45
+ return _arr;
46
+ }
47
+ }
48
+
49
+ function _arrayLikeToArray(arr, len) {
50
+ if (len == null || len > arr.length) len = arr.length;
51
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
52
+ return arr2;
53
+ }
54
+
55
+ function _unsupportedIterableToArray(o, minLen) {
56
+ if (!o) return;
57
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
58
+ var n = Object.prototype.toString.call(o).slice(8, -1);
59
+ if (n === "Object" && o.constructor) n = o.constructor.name;
60
+ if (n === "Map" || n === "Set") return Array.from(o);
61
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
62
+ }
63
+
64
+ function _nonIterableRest() {
65
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
66
+ }
67
+
68
+ function _slicedToArray(arr, i) {
69
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
70
+ }
71
+
72
+ var classnames$1 = {exports: {}};
73
+
74
+ /*!
75
+ Copyright (c) 2018 Jed Watson.
76
+ Licensed under the MIT License (MIT), see
77
+ http://jedwatson.github.io/classnames
78
+ */
79
+
80
+ (function (module) {
81
+ /* global define */
82
+
83
+ (function () {
84
+
85
+ var hasOwn = {}.hasOwnProperty;
86
+
87
+ function classNames() {
88
+ var classes = [];
89
+
90
+ for (var i = 0; i < arguments.length; i++) {
91
+ var arg = arguments[i];
92
+ if (!arg) continue;
93
+
94
+ var argType = typeof arg;
95
+
96
+ if (argType === 'string' || argType === 'number') {
97
+ classes.push(arg);
98
+ } else if (Array.isArray(arg)) {
99
+ if (arg.length) {
100
+ var inner = classNames.apply(null, arg);
101
+ if (inner) {
102
+ classes.push(inner);
103
+ }
104
+ }
105
+ } else if (argType === 'object') {
106
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
107
+ classes.push(arg.toString());
108
+ continue;
109
+ }
110
+
111
+ for (var key in arg) {
112
+ if (hasOwn.call(arg, key) && arg[key]) {
113
+ classes.push(key);
114
+ }
115
+ }
116
+ }
117
+ }
118
+
119
+ return classes.join(' ');
120
+ }
121
+
122
+ if (module.exports) {
123
+ classNames.default = classNames;
124
+ module.exports = classNames;
125
+ } else {
126
+ window.classNames = classNames;
127
+ }
128
+ }());
129
+ } (classnames$1));
130
+
131
+ var classnames = classnames$1.exports;
132
+
133
+ var useScrollIntoView = function useScrollIntoView(_ref) {
134
+ var elementId = _ref.elementId,
135
+ trigger = _ref.trigger;
136
+ React.useEffect(function () {
137
+ var _document$getElementB;
138
+ if (!trigger) return;
139
+ (_document$getElementB = document.getElementById(elementId)) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.scrollIntoView();
140
+ }, [trigger]);
141
+ };
142
+
143
+ var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
144
+
145
+ var css = ".toggle-feature-card--highlighted{border-color:rgb(var(--neeto-ui-primary-800))!important;box-shadow:0 0 0 1px rgb(var(--neeto-ui-primary-800))}";
146
+ n(css,{});
147
+
148
+ var TooltipSwitch = reactUtils.withT(function (_ref) {
149
+ var t = _ref.t,
150
+ enabledCondition = _ref.enabledCondition,
151
+ _ref$name = _ref.name,
152
+ name = _ref$name === void 0 ? "" : _ref$name,
153
+ _ref$isDisabled = _ref.isDisabled,
154
+ isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
155
+ switchDataCy = _ref.switchDataCy;
156
+ return /*#__PURE__*/React__default["default"].createElement(neetoui.Tooltip, {
157
+ position: "top",
158
+ content: enabledCondition ? t("neetoMolecules.toggleFeatureCard.switchTooltip.enabled") : t("neetoMolecules.toggleFeatureCard.switchTooltip.disabled")
159
+ }, /*#__PURE__*/React__default["default"].createElement("span", null, /*#__PURE__*/React__default["default"].createElement(formik.Switch, {
160
+ "data-cy": switchDataCy,
161
+ "data-testid": "toggle-feature-card-switch",
162
+ disabled: isDisabled,
163
+ name: name
164
+ })));
165
+ });
166
+
167
+ var ToggleFeatureCard = function ToggleFeatureCard(_ref) {
168
+ var _ref$title = _ref.title,
169
+ title = _ref$title === void 0 ? "" : _ref$title,
170
+ _ref$description = _ref.description,
171
+ description = _ref$description === void 0 ? null : _ref$description,
172
+ _ref$switchName = _ref.switchName,
173
+ switchName = _ref$switchName === void 0 ? "switch" : _ref$switchName,
174
+ _ref$titleDataCy = _ref.titleDataCy,
175
+ titleDataCy = _ref$titleDataCy === void 0 ? "" : _ref$titleDataCy,
176
+ _ref$switchDataCy = _ref.switchDataCy,
177
+ switchDataCy = _ref$switchDataCy === void 0 ? "" : _ref$switchDataCy,
178
+ _ref$descriptionDataC = _ref.descriptionDataCy,
179
+ descriptionDataCy = _ref$descriptionDataC === void 0 ? "" : _ref$descriptionDataC,
180
+ _ref$isDisabled = _ref.isDisabled,
181
+ isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
182
+ _ref$children = _ref.children,
183
+ children = _ref$children === void 0 ? null : _ref$children,
184
+ _ref$inputProps = _ref.inputProps,
185
+ inputProps = _ref$inputProps === void 0 ? {
186
+ name: null,
187
+ display: null,
188
+ label: null,
189
+ editButtonTooltip: null,
190
+ editButtonDataCy: "",
191
+ placeholder: null,
192
+ dataCy: ""
193
+ } : _ref$inputProps;
194
+ var _useTranslation = reactI18next.useTranslation(),
195
+ t = _useTranslation.t;
196
+ var cardRef = React.useRef();
197
+ var id = pure.slugify(title);
198
+ var _useState = React.useState(false),
199
+ _useState2 = _slicedToArray(_useState, 2),
200
+ isEditing = _useState2[0],
201
+ setIsEditing = _useState2[1];
202
+ var _useFormikContext = formik$1.useFormikContext(),
203
+ setFieldValue = _useFormikContext.setFieldValue,
204
+ values = _useFormikContext.values,
205
+ submitCount = _useFormikContext.submitCount,
206
+ errors = _useFormikContext.errors,
207
+ initialValues = _useFormikContext.initialValues;
208
+ React.useEffect(function () {
209
+ if (submitCount >= 1 && ramda.isEmpty(errors)) {
210
+ setIsEditing(false);
211
+ }
212
+ }, [submitCount]);
213
+ React.useEffect(function () {
214
+ if (!ramda.isEmpty(errors)) {
215
+ setIsEditing(true);
216
+ }
217
+ }, [values, errors]);
218
+ var _useState3 = React.useState(location.hash.split("#")[1] === id),
219
+ _useState4 = _slicedToArray(_useState3, 2),
220
+ shouldHighlight = _useState4[0],
221
+ setShouldHighlight = _useState4[1];
222
+ var hasInput = (values === null || values === void 0 ? void 0 : values[switchName]) && (inputProps === null || inputProps === void 0 ? void 0 : inputProps.name);
223
+ var enabledCondition = values === null || values === void 0 ? void 0 : values[switchName];
224
+ var handleInputReset = function handleInputReset() {
225
+ setIsEditing(false);
226
+ hasInput && setFieldValue(inputProps === null || inputProps === void 0 ? void 0 : inputProps.name, initialValues === null || initialValues === void 0 ? void 0 : initialValues[inputProps === null || inputProps === void 0 ? void 0 : inputProps.name]);
227
+ };
228
+ reactUtils.useOnClickOutside(cardRef, function () {
229
+ return setShouldHighlight(false);
230
+ });
231
+ useScrollIntoView({
232
+ elementId: id,
233
+ trigger: shouldHighlight
234
+ });
235
+ var inputRef = reactUtils.useHotKeys("enter", function () {
236
+ return setIsEditing(false);
237
+ }, {
238
+ mode: "scoped"
239
+ });
240
+ return /*#__PURE__*/React__default["default"].createElement("div", {
241
+ "data-testid": "toggle-feature-card",
242
+ id: id,
243
+ ref: cardRef,
244
+ className: classnames("neeto-ui-bg-white neeto-ui-rounded-lg flex flex-col space-y-2 border p-4", {
245
+ "neeto-ui-border-gray-300": !shouldHighlight
246
+ }, {
247
+ "toggle-feature-card--highlighted": shouldHighlight
248
+ })
249
+ }, /*#__PURE__*/React__default["default"].createElement(neetoui.Label, {
250
+ className: "flex flex-row items-center gap-2"
251
+ }, /*#__PURE__*/React__default["default"].createElement(TooltipSwitch, {
252
+ enabledCondition: enabledCondition,
253
+ isDisabled: isDisabled,
254
+ switchDataCy: switchDataCy,
255
+ name: switchName
256
+ }), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
257
+ component: "span",
258
+ "data-cy": titleDataCy,
259
+ "data-testid": "toggle-feature-card-title",
260
+ style: "h4",
261
+ weight: "semibold"
262
+ }, title)), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
263
+ className: "mb-4 whitespace-pre-line",
264
+ "data-cy": descriptionDataCy,
265
+ "data-testid": "toggle-feature-card-description",
266
+ style: "body2"
267
+ }, description), hasInput && !isEditing && /*#__PURE__*/React__default["default"].createElement("div", {
268
+ className: "m-0 flex flex-row items-center space-x-2"
269
+ }, inputProps === null || inputProps === void 0 ? void 0 : inputProps.display, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
270
+ "data-cy": inputProps === null || inputProps === void 0 ? void 0 : inputProps.editButtonDataCy,
271
+ "data-testid": "toggle-feature-card-input-display-edit",
272
+ icon: neetoIcons.Edit,
273
+ size: "small",
274
+ style: "text",
275
+ type: "button",
276
+ tooltipProps: {
277
+ content: (inputProps === null || inputProps === void 0 ? void 0 : inputProps.editButtonTooltip) || t("neetoMolecules.toggleFeatureCard.input.editButtonDefaultTooltip"),
278
+ position: "right"
279
+ },
280
+ onClick: function onClick() {
281
+ return setIsEditing(true);
282
+ }
283
+ })), hasInput && isEditing && /*#__PURE__*/React__default["default"].createElement(formik.Input, {
284
+ autoFocus: true,
285
+ "data-cy": inputProps === null || inputProps === void 0 ? void 0 : inputProps.dataCy,
286
+ "data-testid": "toggle-feature-card-input-field",
287
+ label: inputProps === null || inputProps === void 0 ? void 0 : inputProps.label,
288
+ name: inputProps === null || inputProps === void 0 ? void 0 : inputProps.name,
289
+ placeholder: inputProps === null || inputProps === void 0 ? void 0 : inputProps.placeholder,
290
+ ref: inputRef,
291
+ size: "medium",
292
+ suffix: /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
293
+ "data-testid": "toggle-feature-card-input-reset",
294
+ icon: neetoIcons.Close,
295
+ size: "small",
296
+ style: "text",
297
+ type: "button",
298
+ onClick: handleInputReset
299
+ })
300
+ }), children);
301
+ };
302
+
303
+ module.exports = ToggleFeatureCard;
304
+ //# sourceMappingURL=ToggleFeatureCard.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToggleFeatureCard.cjs.js","sources":["../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../node_modules/classnames/index.js","../src/components/ToggleFeatureCard/hooks/useScrollIntoView.js","../node_modules/rollup-plugin-styles/dist/runtime/inject-css.js","../src/components/ToggleFeatureCard/ToolTipSwitch.jsx","../src/components/ToggleFeatureCard/index.jsx"],"sourcesContent":["export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _iterableToArrayLimit(arr, i) {\n var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"];\n if (null != _i) {\n var _s,\n _e,\n _x,\n _r,\n _arr = [],\n _n = !0,\n _d = !1;\n try {\n if (_x = (_i = _i.call(arr)).next, 0 === i) {\n if (Object(_i) !== _i) return;\n _n = !1;\n } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);\n } catch (err) {\n _d = !0, _e = err;\n } finally {\n try {\n if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return;\n } finally {\n if (_d) throw _e;\n }\n }\n return _arr;\n }\n}","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\tvar nativeCodeString = '[native code]';\n\n\tfunction classNames() {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tif (arg.length) {\n\t\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\t\tif (inner) {\n\t\t\t\t\t\tclasses.push(inner);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import { useEffect } from \"react\";\n\nconst useScrollIntoView = ({ elementId, trigger }) => {\n useEffect(() => {\n if (!trigger) return;\n document.getElementById(elementId)?.scrollIntoView();\n }, [trigger]);\n};\n\nexport default useScrollIntoView;\n","var e=[],t=[];function n(n,r){if(n&&\"undefined\"!=typeof document){var a,s=!0===r.prepend?\"prepend\":\"append\",d=!0===r.singleTag,i=\"string\"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName(\"head\")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c()}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n))}function c(){var e=document.createElement(\"style\");if(e.setAttribute(\"type\",\"text/css\"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a=\"prepend\"===s?\"afterbegin\":\"beforeend\";return i.insertAdjacentElement(a,e),e}}export{n as default};\n","import React from \"react\";\n\nimport { withT } from \"neetocommons/react-utils\";\nimport { Tooltip } from \"neetoui\";\nimport { Switch as FormikSwitch } from \"neetoui/formik\";\n\nconst TooltipSwitch = withT(\n ({ t, enabledCondition, name = \"\", isDisabled = false, switchDataCy }) => (\n <Tooltip\n position=\"top\"\n content={\n enabledCondition\n ? t(\"neetoMolecules.toggleFeatureCard.switchTooltip.enabled\")\n : t(\"neetoMolecules.toggleFeatureCard.switchTooltip.disabled\")\n }\n >\n <span>\n <FormikSwitch\n data-cy={switchDataCy}\n data-testid=\"toggle-feature-card-switch\"\n disabled={isDisabled}\n {...{ name }}\n />\n </span>\n </Tooltip>\n )\n);\n\nexport default TooltipSwitch;\n","import React, { useRef, useState, useEffect } from \"react\";\n\nimport classnames from \"classnames\";\nimport { useFormikContext } from \"formik\";\nimport { slugify } from \"neetocommons/pure\";\nimport { useHotKeys, useOnClickOutside } from \"neetocommons/react-utils\";\nimport { Edit, Close } from \"neetoicons\";\nimport { Typography, Label, Button } from \"neetoui\";\nimport { Input } from \"neetoui/formik\";\nimport PropTypes from \"prop-types\";\nimport { isEmpty } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport useScrollIntoView from \"./hooks/useScrollIntoView\";\nimport \"./toggleFeatureCard.scss\";\nimport TooltipSwitch from \"./ToolTipSwitch\";\n\nconst ToggleFeatureCard = ({\n title = \"\",\n description = null,\n switchName = \"switch\",\n titleDataCy = \"\",\n switchDataCy = \"\",\n descriptionDataCy = \"\",\n isDisabled = false,\n children = null,\n inputProps = {\n name: null,\n display: null,\n label: null,\n editButtonTooltip: null,\n editButtonDataCy: \"\",\n placeholder: null,\n dataCy: \"\",\n },\n}) => {\n const { t } = useTranslation();\n const cardRef = useRef();\n const id = slugify(title);\n\n const [isEditing, setIsEditing] = useState(false);\n\n const { setFieldValue, values, submitCount, errors, initialValues } =\n useFormikContext();\n\n useEffect(() => {\n if (submitCount >= 1 && isEmpty(errors)) {\n setIsEditing(false);\n }\n }, [submitCount]);\n\n useEffect(() => {\n if (!isEmpty(errors)) {\n setIsEditing(true);\n }\n }, [values, errors]);\n\n const [shouldHighlight, setShouldHighlight] = useState(\n location.hash.split(\"#\")[1] === id\n );\n\n const hasInput = values?.[switchName] && inputProps?.name;\n const enabledCondition = values?.[switchName];\n\n const handleInputReset = () => {\n setIsEditing(false);\n hasInput &&\n setFieldValue(inputProps?.name, initialValues?.[inputProps?.name]);\n };\n\n useOnClickOutside(cardRef, () => setShouldHighlight(false));\n\n useScrollIntoView({ elementId: id, trigger: shouldHighlight });\n\n const inputRef = useHotKeys(\"enter\", () => setIsEditing(false), {\n mode: \"scoped\",\n });\n\n return (\n <div\n data-testid=\"toggle-feature-card\"\n {...{ id }}\n ref={cardRef}\n className={classnames(\n \"neeto-ui-bg-white neeto-ui-rounded-lg flex flex-col space-y-2 border p-4\",\n { \"neeto-ui-border-gray-300\": !shouldHighlight },\n { \"toggle-feature-card--highlighted\": shouldHighlight }\n )}\n >\n <Label className=\"flex flex-row items-center gap-2\">\n <TooltipSwitch\n {...{ enabledCondition, isDisabled, switchDataCy }}\n name={switchName}\n />\n <Typography\n component=\"span\"\n data-cy={titleDataCy}\n data-testid=\"toggle-feature-card-title\"\n style=\"h4\"\n weight=\"semibold\"\n >\n {title}\n </Typography>\n </Label>\n <Typography\n className=\"mb-4 whitespace-pre-line\"\n data-cy={descriptionDataCy}\n data-testid=\"toggle-feature-card-description\"\n style=\"body2\"\n >\n {description}\n </Typography>\n {hasInput && !isEditing && (\n <div className=\"m-0 flex flex-row items-center space-x-2\">\n {inputProps?.display}\n <Button\n data-cy={inputProps?.editButtonDataCy}\n data-testid=\"toggle-feature-card-input-display-edit\"\n icon={Edit}\n size=\"small\"\n style=\"text\"\n type=\"button\"\n tooltipProps={{\n content:\n inputProps?.editButtonTooltip ||\n t(\n \"neetoMolecules.toggleFeatureCard.input.editButtonDefaultTooltip\"\n ),\n position: \"right\",\n }}\n onClick={() => setIsEditing(true)}\n />\n </div>\n )}\n {hasInput && isEditing && (\n <Input\n autoFocus\n data-cy={inputProps?.dataCy}\n data-testid=\"toggle-feature-card-input-field\"\n label={inputProps?.label}\n name={inputProps?.name}\n placeholder={inputProps?.placeholder}\n ref={inputRef}\n size=\"medium\"\n suffix={\n <Button\n data-testid=\"toggle-feature-card-input-reset\"\n icon={Close}\n size=\"small\"\n style=\"text\"\n type=\"button\"\n onClick={handleInputReset}\n />\n }\n />\n )}\n {children}\n </div>\n );\n};\n\nToggleFeatureCard.propTypes = {\n /**\n * The title that will be displayed for the card.\n */\n title: PropTypes.string,\n /**\n * The descripton text for the particular feature or setting.\n */\n description: PropTypes.string,\n /**\n * The formik name of the feature or setting to be toggled. eg:\n {switchName: \"enableEmails\"}.\n */\n switchName: PropTypes.string,\n /**\n * Can be used to disable the toggle switch conditionally.\n */\n isDisabled: PropTypes.bool,\n /**\n * Custom child components to be displayed in the card.\n */\n children: PropTypes.node,\n /**\n * Can be used to add an input field for a setting or a feature.\n For example, `Enable email notifications` card can have an email input field.\n */\n inputProps: PropTypes.shape({\n name: PropTypes.string,\n display: PropTypes.node,\n label: PropTypes.string,\n editButtonTooltip: PropTypes.string,\n editButtonDataCy: PropTypes.string,\n placeholder: PropTypes.string,\n dataCy: PropTypes.string,\n }),\n};\n\nexport default ToggleFeatureCard;\n"],"names":["arrayLikeToArray","arrayWithHoles","iterableToArrayLimit","unsupportedIterableToArray","nonIterableRest","useScrollIntoView","_ref","elementId","trigger","useEffect","_document$getElementB","document","getElementById","scrollIntoView","TooltipSwitch","withT","t","enabledCondition","_ref$name","name","_ref$isDisabled","isDisabled","switchDataCy","React","createElement","Tooltip","position","content","FormikSwitch","disabled","ToggleFeatureCard","_ref$title","title","_ref$description","description","_ref$switchName","switchName","_ref$titleDataCy","titleDataCy","_ref$switchDataCy","_ref$descriptionDataC","descriptionDataCy","_ref$children","children","_ref$inputProps","inputProps","display","label","editButtonTooltip","editButtonDataCy","placeholder","dataCy","_useTranslation","useTranslation","cardRef","useRef","id","slugify","_useState","useState","_useState2","_slicedToArray","isEditing","setIsEditing","_useFormikContext","useFormikContext","setFieldValue","values","submitCount","errors","initialValues","isEmpty","_useState3","location","hash","split","_useState4","shouldHighlight","setShouldHighlight","hasInput","handleInputReset","useOnClickOutside","inputRef","useHotKeys","mode","ref","className","classnames","Label","Typography","component","style","weight","Button","icon","Edit","size","type","tooltipProps","onClick","Input","autoFocus","suffix","Close"],"mappings":";;;;;;;;;;;;;;;;AAAe,SAAS,eAAe,CAAC,GAAG,EAAE;AAC7C,EAAE,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,OAAO,GAAG,CAAC;AACrC;;ACFe,SAAS,qBAAqB,CAAC,GAAG,EAAE,CAAC,EAAE;AACtD,EAAE,IAAI,EAAE,GAAG,IAAI,IAAI,GAAG,GAAG,IAAI,GAAG,WAAW,IAAI,OAAO,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,YAAY,CAAC,CAAC;AAC1G,EAAE,IAAI,IAAI,IAAI,EAAE,EAAE;AAClB,IAAI,IAAI,EAAE;AACV,MAAM,EAAE;AACR,MAAM,EAAE;AACR,MAAM,EAAE;AACR,MAAM,IAAI,GAAG,EAAE;AACf,MAAM,EAAE,GAAG,CAAC,CAAC;AACb,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;AACd,IAAI,IAAI;AACR,MAAM,IAAI,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE;AAClD,QAAQ,IAAI,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,OAAO;AACtC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC;AAChB,OAAO,MAAM,OAAO,EAAE,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE,E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