@bigbinary/neeto-molecules 1.0.4 → 1.0.6

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/README.md CHANGED
@@ -10,7 +10,9 @@ A package of reusable molecular components for neeto products.
10
10
  - [BrowserSupport](./docs/components.md#browsersupport)
11
11
  - [Columns](./docs/components.md#columns)
12
12
  - [CustomDomain](./docs/components.md#customdomain)
13
+ - [DateFormat/TimeFormat](./docs/components.md#dateformattimeformat)
13
14
  - [DateRangeFilter](./docs/components.md#daterangefilter)
15
+ - [DynamicVariables](./docs/components.md#dynamicvariables)
14
16
  - [EmailPreview](./docs/components.md#emailpreview)
15
17
  - [ErrorPage](./docs/components.md#errorpage)
16
18
  - [IpRestriction](./docs/components.md#iprestriction)
@@ -0,0 +1,46 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var pure = require('@bigbinary/neeto-commons-frontend/pure');
5
+ var utils = require('@bigbinary/neeto-commons-frontend/utils');
6
+ var neetoui = require('@bigbinary/neetoui');
7
+ var ramda = require('ramda');
8
+
9
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
+
11
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
12
+
13
+ function _extends() {
14
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
15
+ for (var i = 1; i < arguments.length; i++) {
16
+ var source = arguments[i];
17
+ for (var key in source) {
18
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
19
+ target[key] = source[key];
20
+ }
21
+ }
22
+ }
23
+ return target;
24
+ };
25
+ return _extends.apply(this, arguments);
26
+ }
27
+
28
+ var DateFormat = ramda.fromPairs(ramda.keys(utils.timeFormat).map(function (key) {
29
+ return [pure.capitalize(key), function (_ref) {
30
+ var date = _ref.date,
31
+ _ref$tooltipProps = _ref.tooltipProps,
32
+ tooltipProps = _ref$tooltipProps === void 0 ? {} : _ref$tooltipProps,
33
+ _ref$typographyProps = _ref.typographyProps,
34
+ typographyProps = _ref$typographyProps === void 0 ? {} : _ref$typographyProps;
35
+ var dateDisplay = /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, _extends({
36
+ component: "span",
37
+ style: "body2"
38
+ }, typographyProps), utils.timeFormat[key](date));
39
+ return key === "extended" ? dateDisplay : /*#__PURE__*/React__default["default"].createElement(neetoui.Tooltip, _extends({
40
+ content: utils.timeFormat.extended(date),
41
+ position: "top"
42
+ }, tooltipProps), dateDisplay);
43
+ }];
44
+ }));
45
+
46
+ module.exports = DateFormat;
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ import { capitalize } from '@bigbinary/neeto-commons-frontend/pure';
3
+ import { timeFormat } from '@bigbinary/neeto-commons-frontend/utils';
4
+ import { Typography, Tooltip } from '@bigbinary/neetoui';
5
+ import { fromPairs, keys } from 'ramda';
6
+
7
+ function _extends() {
8
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
9
+ for (var i = 1; i < arguments.length; i++) {
10
+ var source = arguments[i];
11
+ for (var key in source) {
12
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
13
+ target[key] = source[key];
14
+ }
15
+ }
16
+ }
17
+ return target;
18
+ };
19
+ return _extends.apply(this, arguments);
20
+ }
21
+
22
+ var DateFormat = fromPairs(keys(timeFormat).map(function (key) {
23
+ return [capitalize(key), function (_ref) {
24
+ var date = _ref.date,
25
+ _ref$tooltipProps = _ref.tooltipProps,
26
+ tooltipProps = _ref$tooltipProps === void 0 ? {} : _ref$tooltipProps,
27
+ _ref$typographyProps = _ref.typographyProps,
28
+ typographyProps = _ref$typographyProps === void 0 ? {} : _ref$typographyProps;
29
+ var dateDisplay = /*#__PURE__*/React.createElement(Typography, _extends({
30
+ component: "span",
31
+ style: "body2"
32
+ }, typographyProps), timeFormat[key](date));
33
+ return key === "extended" ? dateDisplay : /*#__PURE__*/React.createElement(Tooltip, _extends({
34
+ content: timeFormat.extended(date),
35
+ position: "top"
36
+ }, tooltipProps), dateDisplay);
37
+ }];
38
+ }));
39
+
40
+ export { DateFormat as default };
@@ -211,9 +211,9 @@ var DateRangeFilter = function DateRangeFilter(_ref) {
211
211
  autoFocus: true,
212
212
  className: "ml-3 w-full",
213
213
  dateFormat: initializers.globalProps === null || initializers.globalProps === void 0 ? void 0 : (_globalProps$user = initializers.globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.dateFormat,
214
- defaultValue: [dayjs__default["default"](startDate), dayjs__default["default"](endDate)],
215
214
  picker: "date",
216
215
  type: "range",
216
+ defaultValue: [startDate ? dayjs__default["default"](startDate) : null, endDate ? dayjs__default["default"](endDate) : null],
217
217
  onChange: function onChange(_, _ref2) {
218
218
  var _ref3 = _slicedToArray(_ref2, 2),
219
219
  startDate = _ref3[0],
@@ -204,9 +204,9 @@ var DateRangeFilter = function DateRangeFilter(_ref) {
204
204
  autoFocus: true,
205
205
  className: "ml-3 w-full",
206
206
  dateFormat: globalProps === null || globalProps === void 0 ? void 0 : (_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.dateFormat,
207
- defaultValue: [dayjs(startDate), dayjs(endDate)],
208
207
  picker: "date",
209
208
  type: "range",
209
+ defaultValue: [startDate ? dayjs(startDate) : null, endDate ? dayjs(endDate) : null],
210
210
  onChange: function onChange(_, _ref2) {
211
211
  var _ref3 = _slicedToArray(_ref2, 2),
212
212
  startDate = _ref3[0],
@@ -0,0 +1,112 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var pure = require('@bigbinary/neeto-commons-frontend/pure');
5
+ var neetoIcons = require('@bigbinary/neeto-icons');
6
+ var neetoui = require('@bigbinary/neetoui');
7
+ var ramda = require('ramda');
8
+
9
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
+
11
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
12
+
13
+ function _extends() {
14
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
15
+ for (var i = 1; i < arguments.length; i++) {
16
+ var source = arguments[i];
17
+ for (var key in source) {
18
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
19
+ target[key] = source[key];
20
+ }
21
+ }
22
+ }
23
+ return target;
24
+ };
25
+ return _extends.apply(this, arguments);
26
+ }
27
+
28
+ 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}}
29
+
30
+ var css = ".neeto-molecules-dynamic-variables{max-width:360px;min-width:184px}.neeto-molecules-dynamic-variables button{border:1px solid rgb(var(--neeto-ui-gray-300));border-radius:var(--neeto-ui-rounded-md);color:rgb(var(--neeto-ui-black));padding:6px;transition:var(--neeto-ui-transition);-webkit-user-select:none;-moz-user-select:none;user-select:none}.neeto-molecules-dynamic-variables button:focus,.neeto-molecules-dynamic-variables button:focus-visible,.neeto-molecules-dynamic-variables button:hover{border-color:rgb(var(--neeto-ui-primary-800));box-shadow:none;color:rgb(var(--neeto-ui-primary-800));outline:none}";
31
+ n(css,{});
32
+
33
+ var parseVariables = function parseVariables() {
34
+ var variableArr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
35
+ var uncategorized = [];
36
+ var groupedVariables = [];
37
+ var categorySet = new Set();
38
+ variableArr.forEach(function (variable) {
39
+ var category = variable.category,
40
+ label = variable.label,
41
+ variables = variable.variables;
42
+ if (category && variables) {
43
+ var parsedVariables = variables.map(ramda.assoc("category", category));
44
+ if (!categorySet.has(category)) {
45
+ categorySet.add(category);
46
+ groupedVariables.push({
47
+ label: label,
48
+ variables: parsedVariables
49
+ });
50
+ } else {
51
+ var existingGroup = pure.findBy({
52
+ label: label
53
+ }, groupedVariables);
54
+ existingGroup.variables = ramda.uniqBy(ramda.prop("key"), existingGroup.variables.concat(parsedVariables));
55
+ }
56
+ } else {
57
+ uncategorized.push(variable);
58
+ }
59
+ });
60
+ if (!ramda.isEmpty(uncategorized)) {
61
+ groupedVariables.push({
62
+ label: !ramda.isEmpty(groupedVariables) ? "Others" : null,
63
+ variables: uncategorized
64
+ });
65
+ }
66
+ return groupedVariables;
67
+ };
68
+
69
+ var Menu = neetoui.Dropdown.Menu;
70
+ var DynamicVariables = function DynamicVariables(_ref) {
71
+ var _ref$onVariableClick = _ref.onVariableClick,
72
+ onVariableClick = _ref$onVariableClick === void 0 ? pure.noop : _ref$onVariableClick,
73
+ _ref$variables = _ref.variables,
74
+ variables = _ref$variables === void 0 ? [] : _ref$variables,
75
+ _ref$dropdownProps = _ref.dropdownProps,
76
+ dropdownProps = _ref$dropdownProps === void 0 ? {} : _ref$dropdownProps;
77
+ if (ramda.isEmpty(variables)) {
78
+ return null;
79
+ }
80
+ var parsedVariables = parseVariables(variables);
81
+ return /*#__PURE__*/React__default["default"].createElement(neetoui.Dropdown, _extends({
82
+ buttonProps: {
83
+ "data-testid": "variables-dropdown"
84
+ },
85
+ buttonStyle: "secondary",
86
+ icon: neetoIcons.Braces,
87
+ strategy: "fixed"
88
+ }, dropdownProps), /*#__PURE__*/React__default["default"].createElement(Menu, null, /*#__PURE__*/React__default["default"].createElement("div", {
89
+ className: "space-y-3 p-2 neeto-molecules-dynamic-variables",
90
+ "data-testid": "variables-list"
91
+ }, parsedVariables.map(function (_ref2) {
92
+ var label = _ref2.label,
93
+ variables = _ref2.variables;
94
+ return /*#__PURE__*/React__default["default"].createElement(React.Fragment, {
95
+ key: label
96
+ }, label && /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
97
+ className: "",
98
+ style: "h6"
99
+ }, label), /*#__PURE__*/React__default["default"].createElement("div", {
100
+ className: "flex flex-wrap items-center gap-2"
101
+ }, variables.map(function (item) {
102
+ return /*#__PURE__*/React__default["default"].createElement("button", {
103
+ key: item.label,
104
+ onClick: function onClick() {
105
+ return onVariableClick(item);
106
+ }
107
+ }, item.label);
108
+ })));
109
+ }))));
110
+ };
111
+
112
+ module.exports = DynamicVariables;
@@ -0,0 +1,106 @@
1
+ import React, { Fragment } from 'react';
2
+ import { findBy, noop } from '@bigbinary/neeto-commons-frontend/pure';
3
+ import { Braces } from '@bigbinary/neeto-icons';
4
+ import { Dropdown, Typography } from '@bigbinary/neetoui';
5
+ import { assoc, uniqBy, prop, isEmpty } from 'ramda';
6
+
7
+ function _extends() {
8
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
9
+ for (var i = 1; i < arguments.length; i++) {
10
+ var source = arguments[i];
11
+ for (var key in source) {
12
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
13
+ target[key] = source[key];
14
+ }
15
+ }
16
+ }
17
+ return target;
18
+ };
19
+ return _extends.apply(this, arguments);
20
+ }
21
+
22
+ 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}}
23
+
24
+ var css = ".neeto-molecules-dynamic-variables{max-width:360px;min-width:184px}.neeto-molecules-dynamic-variables button{border:1px solid rgb(var(--neeto-ui-gray-300));border-radius:var(--neeto-ui-rounded-md);color:rgb(var(--neeto-ui-black));padding:6px;transition:var(--neeto-ui-transition);-webkit-user-select:none;-moz-user-select:none;user-select:none}.neeto-molecules-dynamic-variables button:focus,.neeto-molecules-dynamic-variables button:focus-visible,.neeto-molecules-dynamic-variables button:hover{border-color:rgb(var(--neeto-ui-primary-800));box-shadow:none;color:rgb(var(--neeto-ui-primary-800));outline:none}";
25
+ n(css,{});
26
+
27
+ var parseVariables = function parseVariables() {
28
+ var variableArr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
29
+ var uncategorized = [];
30
+ var groupedVariables = [];
31
+ var categorySet = new Set();
32
+ variableArr.forEach(function (variable) {
33
+ var category = variable.category,
34
+ label = variable.label,
35
+ variables = variable.variables;
36
+ if (category && variables) {
37
+ var parsedVariables = variables.map(assoc("category", category));
38
+ if (!categorySet.has(category)) {
39
+ categorySet.add(category);
40
+ groupedVariables.push({
41
+ label: label,
42
+ variables: parsedVariables
43
+ });
44
+ } else {
45
+ var existingGroup = findBy({
46
+ label: label
47
+ }, groupedVariables);
48
+ existingGroup.variables = uniqBy(prop("key"), existingGroup.variables.concat(parsedVariables));
49
+ }
50
+ } else {
51
+ uncategorized.push(variable);
52
+ }
53
+ });
54
+ if (!isEmpty(uncategorized)) {
55
+ groupedVariables.push({
56
+ label: !isEmpty(groupedVariables) ? "Others" : null,
57
+ variables: uncategorized
58
+ });
59
+ }
60
+ return groupedVariables;
61
+ };
62
+
63
+ var Menu = Dropdown.Menu;
64
+ var DynamicVariables = function DynamicVariables(_ref) {
65
+ var _ref$onVariableClick = _ref.onVariableClick,
66
+ onVariableClick = _ref$onVariableClick === void 0 ? noop : _ref$onVariableClick,
67
+ _ref$variables = _ref.variables,
68
+ variables = _ref$variables === void 0 ? [] : _ref$variables,
69
+ _ref$dropdownProps = _ref.dropdownProps,
70
+ dropdownProps = _ref$dropdownProps === void 0 ? {} : _ref$dropdownProps;
71
+ if (isEmpty(variables)) {
72
+ return null;
73
+ }
74
+ var parsedVariables = parseVariables(variables);
75
+ return /*#__PURE__*/React.createElement(Dropdown, _extends({
76
+ buttonProps: {
77
+ "data-testid": "variables-dropdown"
78
+ },
79
+ buttonStyle: "secondary",
80
+ icon: Braces,
81
+ strategy: "fixed"
82
+ }, dropdownProps), /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement("div", {
83
+ className: "space-y-3 p-2 neeto-molecules-dynamic-variables",
84
+ "data-testid": "variables-list"
85
+ }, parsedVariables.map(function (_ref2) {
86
+ var label = _ref2.label,
87
+ variables = _ref2.variables;
88
+ return /*#__PURE__*/React.createElement(Fragment, {
89
+ key: label
90
+ }, label && /*#__PURE__*/React.createElement(Typography, {
91
+ className: "",
92
+ style: "h6"
93
+ }, label), /*#__PURE__*/React.createElement("div", {
94
+ className: "flex flex-wrap items-center gap-2"
95
+ }, variables.map(function (item) {
96
+ return /*#__PURE__*/React.createElement("button", {
97
+ key: item.label,
98
+ onClick: function onClick() {
99
+ return onVariableClick(item);
100
+ }
101
+ }, item.label);
102
+ })));
103
+ }))));
104
+ };
105
+
106
+ export { DynamicVariables as default };
@@ -2161,6 +2161,7 @@ var HotKeyList = function HotKeyList(_ref) {
2161
2161
  className: "pl-4 mb-3",
2162
2162
  href: fullShortcutsLink,
2163
2163
  style: "link",
2164
+ target: "_blank",
2164
2165
  label: t("neetoMolecules.keyboardShortcuts.viewFullListOfShortcuts")
2165
2166
  }));
2166
2167
  });
@@ -2168,7 +2169,7 @@ var HotKeyList = function HotKeyList(_ref) {
2168
2169
 
2169
2170
  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}}
2170
2171
 
2171
- var css = ".neeto-commons-keyboard-shortcuts-pane{flex-grow:0;flex-shrink:0;z-index:calc(var(--neeto-ui-modal-z-index) + 1)}";
2172
+ var css = ".neeto-molecules-keyboard-shortcuts-pane{flex-grow:0;flex-shrink:0;z-index:calc(var(--neeto-ui-modal-z-index) + 1)}";
2172
2173
  n(css,{});
2173
2174
 
2174
2175
  var KeyboardShortcutsPane = function KeyboardShortcutsPane(_ref) {
@@ -2192,7 +2193,7 @@ var KeyboardShortcutsPane = function KeyboardShortcutsPane(_ref) {
2192
2193
  return setIsOpen(false);
2193
2194
  });
2194
2195
  return /*#__PURE__*/React__default["default"].createElement("div", {
2195
- className: classnames("neeto-commons-keyboard-shortcuts-pane neeto-ui-border-gray-300 transition-width ml-auto min-h-screen border-l bg-white duration-300 ease-in-out overflow-y-scroll", {
2196
+ className: classnames("neeto-molecules-keyboard-shortcuts-pane neeto-ui-border-gray-300 transition-width ml-auto min-h-screen border-l bg-white duration-300 ease-in-out overflow-y-scroll", {
2196
2197
  "w-80": isOpen,
2197
2198
  "w-0": !isOpen,
2198
2199
  absolute: hasOverlays,
@@ -2154,6 +2154,7 @@ var HotKeyList = function HotKeyList(_ref) {
2154
2154
  className: "pl-4 mb-3",
2155
2155
  href: fullShortcutsLink,
2156
2156
  style: "link",
2157
+ target: "_blank",
2157
2158
  label: t("neetoMolecules.keyboardShortcuts.viewFullListOfShortcuts")
2158
2159
  }));
2159
2160
  });
@@ -2161,7 +2162,7 @@ var HotKeyList = function HotKeyList(_ref) {
2161
2162
 
2162
2163
  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}}
2163
2164
 
2164
- var css = ".neeto-commons-keyboard-shortcuts-pane{flex-grow:0;flex-shrink:0;z-index:calc(var(--neeto-ui-modal-z-index) + 1)}";
2165
+ var css = ".neeto-molecules-keyboard-shortcuts-pane{flex-grow:0;flex-shrink:0;z-index:calc(var(--neeto-ui-modal-z-index) + 1)}";
2165
2166
  n(css,{});
2166
2167
 
2167
2168
  var KeyboardShortcutsPane = function KeyboardShortcutsPane(_ref) {
@@ -2185,7 +2186,7 @@ var KeyboardShortcutsPane = function KeyboardShortcutsPane(_ref) {
2185
2186
  return setIsOpen(false);
2186
2187
  });
2187
2188
  return /*#__PURE__*/React.createElement("div", {
2188
- className: classnames("neeto-commons-keyboard-shortcuts-pane neeto-ui-border-gray-300 transition-width ml-auto min-h-screen border-l bg-white duration-300 ease-in-out overflow-y-scroll", {
2189
+ className: classnames("neeto-molecules-keyboard-shortcuts-pane neeto-ui-border-gray-300 transition-width ml-auto min-h-screen border-l bg-white duration-300 ease-in-out overflow-y-scroll", {
2189
2190
  "w-80": isOpen,
2190
2191
  "w-0": !isOpen,
2191
2192
  absolute: hasOverlays,
@@ -97,7 +97,7 @@ var AlertBlock = function AlertBlock(props) {
97
97
 
98
98
  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}}
99
99
 
100
- var css = ".neeto-commons-publish-block{align-items:center;display:flex;gap:12px;justify-content:flex-end}.neeto-commons-publish-block__action-btn{align-items:center;display:inline-flex;flex-direction:row;gap:1px;justify-content:center}.neeto-commons-publish-block__action-btn>.neeto-ui-btn:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.neeto-commons-publish-block__action-btn>.neeto-ui-btn:last-child{border-bottom-left-radius:0;border-top-left-radius:0}";
100
+ var css = ".neeto-molecules-publish-block{align-items:center;display:flex;gap:12px;justify-content:flex-end}.neeto-molecules-publish-block__action-btn{align-items:center;display:inline-flex;flex-direction:row;gap:1px;justify-content:center}.neeto-molecules-publish-block__action-btn>.neeto-ui-btn:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.neeto-molecules-publish-block__action-btn>.neeto-ui-btn:last-child{border-bottom-left-radius:0;border-top-left-radius:0}";
101
101
  n(css,{});
102
102
 
103
103
  var ViewDraftButton = function ViewDraftButton(props) {
@@ -165,7 +165,7 @@ var PublishBlock = function PublishBlock(_ref) {
165
165
  ResetDraftButton: ResetDraftButton
166
166
  });
167
167
  return /*#__PURE__*/React__default["default"].createElement("div", {
168
- className: "neeto-commons-publish-block"
168
+ className: "neeto-molecules-publish-block"
169
169
  }, draftBlockButtons && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
170
170
  className: "flex items-center gap-2"
171
171
  }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
@@ -177,7 +177,7 @@ var PublishBlock = function PublishBlock(_ref) {
177
177
  }, draftBlockButtons)), /*#__PURE__*/React__default["default"].createElement("div", {
178
178
  className: "neeto-ui-bg-gray-300 h-full w-px"
179
179
  })), /*#__PURE__*/React__default["default"].createElement("div", {
180
- className: "neeto-commons-publish-block__action-btn"
180
+ className: "neeto-molecules-publish-block__action-btn"
181
181
  }, renderPublishButtons({
182
182
  PublishButton: PublishButton,
183
183
  PublishPreviewButton: PublishPreviewButton
@@ -91,7 +91,7 @@ var AlertBlock = function AlertBlock(props) {
91
91
 
92
92
  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}}
93
93
 
94
- var css = ".neeto-commons-publish-block{align-items:center;display:flex;gap:12px;justify-content:flex-end}.neeto-commons-publish-block__action-btn{align-items:center;display:inline-flex;flex-direction:row;gap:1px;justify-content:center}.neeto-commons-publish-block__action-btn>.neeto-ui-btn:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.neeto-commons-publish-block__action-btn>.neeto-ui-btn:last-child{border-bottom-left-radius:0;border-top-left-radius:0}";
94
+ var css = ".neeto-molecules-publish-block{align-items:center;display:flex;gap:12px;justify-content:flex-end}.neeto-molecules-publish-block__action-btn{align-items:center;display:inline-flex;flex-direction:row;gap:1px;justify-content:center}.neeto-molecules-publish-block__action-btn>.neeto-ui-btn:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.neeto-molecules-publish-block__action-btn>.neeto-ui-btn:last-child{border-bottom-left-radius:0;border-top-left-radius:0}";
95
95
  n(css,{});
96
96
 
97
97
  var ViewDraftButton = function ViewDraftButton(props) {
@@ -159,7 +159,7 @@ var PublishBlock = function PublishBlock(_ref) {
159
159
  ResetDraftButton: ResetDraftButton
160
160
  });
161
161
  return /*#__PURE__*/React.createElement("div", {
162
- className: "neeto-commons-publish-block"
162
+ className: "neeto-molecules-publish-block"
163
163
  }, draftBlockButtons && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
164
164
  className: "flex items-center gap-2"
165
165
  }, /*#__PURE__*/React.createElement(Typography, {
@@ -171,7 +171,7 @@ var PublishBlock = function PublishBlock(_ref) {
171
171
  }, draftBlockButtons)), /*#__PURE__*/React.createElement("div", {
172
172
  className: "neeto-ui-bg-gray-300 h-full w-px"
173
173
  })), /*#__PURE__*/React.createElement("div", {
174
- className: "neeto-commons-publish-block__action-btn"
174
+ className: "neeto-molecules-publish-block__action-btn"
175
175
  }, renderPublishButtons({
176
176
  PublishButton: PublishButton,
177
177
  PublishPreviewButton: PublishPreviewButton
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ var DateFormat = require('@bigbinary/neeto-molecules/DateFormat');
4
+
5
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
6
+
7
+ var DateFormat__default = /*#__PURE__*/_interopDefaultLegacy(DateFormat);
8
+
9
+ var TimeFormat = DateFormat__default["default"];
10
+
11
+ module.exports = TimeFormat;
@@ -0,0 +1,5 @@
1
+ import DateFormat from '@bigbinary/neeto-molecules/DateFormat';
2
+
3
+ var TimeFormat = DateFormat;
4
+
5
+ export { TimeFormat as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-molecules",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "A package of reusable molecular components for neeto products.",
5
5
  "repository": "git@github.com:bigbinary/neeto-molecules.git",
6
6
  "author": "Amaljith K <amaljith.k@bigbinary.com>",
@@ -38,6 +38,7 @@
38
38
  "@bigbinary/neeto-commons-frontend": "^2.0.39",
39
39
  "@bigbinary/neeto-editor": "^1.23.3",
40
40
  "@bigbinary/neeto-icons": "^1.9.15",
41
+ "@bigbinary/neeto-molecules": "^1.0.5",
41
42
  "@bigbinary/neetoui": "4.4.3",
42
43
  "@honeybadger-io/react": "2.0.1",
43
44
  "@rollup/plugin-alias": "^3.1.9",
@@ -118,7 +119,7 @@
118
119
  "peerDependencies": {
119
120
  "@bigbinary/neeto-commons-frontend": "^2.0.39",
120
121
  "@bigbinary/neeto-icons": "^1.9.15",
121
- "@bigbinary/neeto-molecules": "^1.0.0",
122
+ "@bigbinary/neeto-molecules": "^1.0.5",
122
123
  "@bigbinary/neetoui": "^4.4.3",
123
124
  "@honeybadger-io/react": "2.0.1",
124
125
  "@svgr/webpack": "^6.5.1",
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+
3
+ import { TooltipProps, TypographyProps } from "@bigbinary/neetoui";
4
+ import {
5
+ timeFormat,
6
+ DateTimeType,
7
+ } from "@bigbinary/neeto-commons-frontend/utils";
8
+
9
+ const DateFormat: {
10
+ [key in Capitalize<keyof typeof timeFormat>]: React.FC<{
11
+ date: DateTimeType;
12
+ typographyProps?: Partial<TypographyProps>;
13
+ tooltipProps?: Partial<TooltipProps>;
14
+ }>;
15
+ };
16
+
17
+ export default DateFormat;
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ import { DropdownProps } from "@bigbinary/neetoui";
3
+
4
+ interface Variable {
5
+ label?: string;
6
+ key?: string;
7
+ value?: string;
8
+ category?: string;
9
+ variables?: Omit<Variable, "variables">[]
10
+ }
11
+
12
+ const DynamicVariables: React.FC<{
13
+ onVariableClick?: (variable: Variable) => void;
14
+ variables: Variable[];
15
+ dropdownProps?: DropdownProps;
16
+ }>;
17
+
18
+ export default DynamicVariables;
@@ -0,0 +1,5 @@
1
+ import DateFormat from "@bigbinary/neeto-molecules/DateFormat";
2
+
3
+ const TimeFormat = DateFormat;
4
+
5
+ export default TimeFormat;