@stokr/components-library 2.3.47 → 2.3.49

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.
@@ -106,7 +106,7 @@ var Select = function Select(props) {
106
106
  active: hasFocus,
107
107
  error: error && touched,
108
108
  htmlFor: id
109
- }, label), /*#__PURE__*/_react.default.createElement(_reactSelect.default, _extends({
109
+ }, label), /*#__PURE__*/_react.default.createElement(_reactSelect.default, _extends({}, otherProps, {
110
110
  id: id,
111
111
  name: name,
112
112
  options: options,
@@ -153,7 +153,7 @@ var Select = function Select(props) {
153
153
  IndicatorSeparator: null,
154
154
  MenuList: SelectMenuListWithScroll
155
155
  }
156
- }, otherProps)));
156
+ })));
157
157
  };
158
158
  exports.Select = Select;
159
159
  Select.propTypes = {
@@ -89,6 +89,7 @@ exports.SelectOptionStrings = SelectOptionStrings;
89
89
  SelectOptionStrings.args = {
90
90
  label: 'click LABEL here for options',
91
91
  value: null,
92
+ search: true,
92
93
  //menuHeight: 100,
93
94
  options: [{
94
95
  key: 'other option key',
@@ -13,7 +13,7 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
13
13
  var Text = _styledComponents.default.div.withConfig({
14
14
  displayName: "Textstyles__Text",
15
15
  componentId: "sc-xkpyal-0"
16
- })(["display:block;", " ", " ", " ", " h1{font-family:'Open Sans';font-weight:800;font-size:22px;line-height:1.18;letter-spacing:0.8px;text-transform:uppercase;margin-top:1em;margin-bottom:32px;", "}h2{font-family:'Open Sans';font-weight:300;font-size:34px;line-height:1.18em;letter-spacing:1.5px;margin-top:1em;margin-bottom:0.18em;", " ", "}h4{font-family:'Open Sans';font-weight:300;font-size:17px;line-height:1.27em;letter-spacing:0.8px;margin-top:1em;margin-bottom:0.27em;opacity:0.5;", " ", "}h3{font-family:'Open Sans';font-weight:800;font-size:22px;line-height:1.27em;letter-spacing:0.8px;margin-top:1em;margin-bottom:0.27em;text-transform:uppercase;", " @media screen and (max-width:991px) and (min-width:768px){", "}}h5{font-family:'Open Sans';font-weight:800;font-size:22px;line-height:1.27em;letter-spacing:0.8px;text-transform:uppercase;}p{font-family:'Open Sans';font-weight:300;font-size:16px;line-height:1.5em;letter-spacing:0.6px;margin:1em 0;", " ", " a{text-decoration:underline;transition:color 0.2s;color:", ";&:hover{color:", ";}}", "}ul{margin:16px;li{font-size:14px;font-weight:300;font-style:normal;font-stretch:normal;line-height:2;letter-spacing:0.6px;}@media screen and (max-width:479px){padding-left:15px;}}> *:first-child{margin-top:0;}> *:last-child{margin-bottom:0;}"], function (_ref) {
16
+ })(["display:block;", " ", " ", " ", " h1{font-family:'Open Sans';font-weight:800;font-size:22px;line-height:1.18;letter-spacing:0.8px;text-transform:uppercase;margin-top:1em;margin-bottom:32px;", "}h2{font-family:'Open Sans';font-weight:300;font-size:34px;line-height:1.18em;letter-spacing:1.5px;margin-top:1em;margin-bottom:0.18em;", " ", "}h4{font-family:'Open Sans';font-weight:300;font-size:17px;line-height:1.27em;letter-spacing:0.8px;margin-top:1em;margin-bottom:0.27em;opacity:0.5;", " ", "}h3{font-family:'Open Sans';font-weight:800;font-size:22px;line-height:1.27em;letter-spacing:0.8px;margin-top:1em;margin-bottom:0.27em;text-transform:uppercase;", " @media screen and (max-width:991px) and (min-width:768px){", "}}h5{font-family:'Open Sans';font-weight:800;font-size:22px;line-height:1.27em;letter-spacing:0.8px;text-transform:uppercase;}p{font-family:'Open Sans';font-weight:300;font-size:16px;line-height:1.5em;letter-spacing:0.6px;margin:1em 0;", " ", " a{text-decoration:underline;transition:color 0.2s;color:inherit;&:hover{color:", ";}}", "}ul{margin:16px;li{font-size:14px;font-weight:300;font-style:normal;font-stretch:normal;line-height:2;letter-spacing:0.6px;}@media screen and (max-width:479px){padding-left:15px;}}> *:first-child{margin-top:0;}> *:last-child{margin-bottom:0;}"], function (_ref) {
17
17
  var withMarginBottom = _ref.withMarginBottom;
18
18
  return withMarginBottom && "\n margin-bottom: 32px;\n ";
19
19
  }, function (_ref2) {
@@ -32,8 +32,6 @@ var Text = _styledComponents.default.div.withConfig({
32
32
  }, _rwd.default.XLarge(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n font-size: 20px;\n\n ", "\n\n "])), function (props) {
33
33
  return props.small && "\n font-size:16px;\n ";
34
34
  }), function (props) {
35
- return _theme.default.cPrimary;
36
- }, function (props) {
37
35
  return _theme.default.cText;
38
36
  }, function (props) {
39
37
  return props.success && "\n color: ".concat(_theme.default.cProgressDone, ";\n ");
@@ -18,7 +18,6 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
18
18
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
19
19
  /**
20
20
  * Enhanced timer hook that works with TimerService to avoid context re-renders
21
- * Based on your existing useCooldown hook but with better state management
22
21
  */
23
22
  var useTimer = function useTimer(timerId) {
24
23
  var initialDuration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
@@ -34,11 +33,16 @@ var useTimer = function useTimer(timerId) {
34
33
  _useState6 = _slicedToArray(_useState5, 2),
35
34
  isTimerActive = _useState6[0],
36
35
  setIsTimerActive = _useState6[1];
36
+ var _useState7 = (0, _react.useState)(false),
37
+ _useState8 = _slicedToArray(_useState7, 2),
38
+ wasTimerStarted = _useState8[0],
39
+ setWasTimerStarted = _useState8[1];
37
40
  var timerIdRef = (0, _react.useRef)(timerId);
38
41
  var startTimer = (0, _react.useCallback)(function (duration) {
39
42
  setIsTimerActive(true);
40
43
  setHasTimerFinished(false);
41
44
  setSecondsRemaining(duration);
45
+ setWasTimerStarted(true);
42
46
  _TimerService.default.startTimer(timerIdRef.current, duration, function (remaining, isExpired) {
43
47
  setSecondsRemaining(remaining);
44
48
  if (isExpired) {
@@ -66,15 +70,34 @@ var useTimer = function useTimer(timerId) {
66
70
  }
67
71
  }, [isTimerActive, secondsRemaining, hasTimerFinished, startTimer]);
68
72
 
69
- // Check for existing timer on mount
73
+ // Check for existing timer on mount and sync periodically
70
74
  (0, _react.useEffect)(function () {
71
75
  var existingTimer = _TimerService.default.getTimerInfo(timerIdRef.current);
72
76
  if (existingTimer) {
73
77
  setSecondsRemaining(existingTimer.remaining);
74
78
  setHasTimerFinished(existingTimer.isExpired);
75
79
  setIsTimerActive(existingTimer.isActive);
80
+ setWasTimerStarted(true);
76
81
  }
77
- }, []);
82
+
83
+ // Sync with timer service every second
84
+ var syncInterval = setInterval(function () {
85
+ var timerInfo = _TimerService.default.getTimerInfo(timerIdRef.current);
86
+ if (timerInfo) {
87
+ setSecondsRemaining(timerInfo.remaining);
88
+ setHasTimerFinished(timerInfo.isExpired);
89
+ setIsTimerActive(timerInfo.isActive);
90
+ } else if (wasTimerStarted) {
91
+ // Timer was started but now doesn't exist = it expired
92
+ setHasTimerFinished(true);
93
+ setIsTimerActive(false);
94
+ setSecondsRemaining(0);
95
+ }
96
+ }, 1000);
97
+ return function () {
98
+ return clearInterval(syncInterval);
99
+ };
100
+ }, [wasTimerStarted]);
78
101
 
79
102
  // Cleanup on unmount
80
103
  (0, _react.useEffect)(function () {
package/dist/index.js CHANGED
@@ -1224,6 +1224,17 @@ Object.keys(_scrollUtils).forEach(function (key) {
1224
1224
  }
1225
1225
  });
1226
1226
  });
1227
+ var _moment = require("./utils/moment");
1228
+ Object.keys(_moment).forEach(function (key) {
1229
+ if (key === "default" || key === "__esModule") return;
1230
+ if (key in exports && exports[key] === _moment[key]) return;
1231
+ Object.defineProperty(exports, key, {
1232
+ enumerable: true,
1233
+ get: function get() {
1234
+ return _moment[key];
1235
+ }
1236
+ });
1237
+ });
1227
1238
  var _FA = require("./components/2FA");
1228
1239
  Object.keys(_FA).forEach(function (key) {
1229
1240
  if (key === "default" || key === "__esModule") return;
@@ -28,7 +28,10 @@ var formatCurrencyValue = function formatCurrencyValue(currency, value) {
28
28
  lusdt: ['USDT', 2],
29
29
  'bitcoin-private': ['EUR', 2],
30
30
  'lbtc-private': ['BTC', 8],
31
- bmn1: ['BMN1', 2]
31
+ bmn1: ['BMN1', 2],
32
+ 'btc-fb': ['BTC', 8],
33
+ 'usdc-fb': ['USDC', 2],
34
+ 'usdq-fb': ['USDQ', 2]
32
35
  }[currency] || [currency, tokenDecimals],
33
36
  _ref2 = _slicedToArray(_ref, 2),
34
37
  symbol = _ref2[0],
@@ -49,7 +52,10 @@ var getCurrencySymbol = function getCurrencySymbol(currencySelected) {
49
52
  'lusdt-bfx': 'USDT',
50
53
  'lbtc-bfx': 'LBTC',
51
54
  'btc-bfx': 'BTC',
52
- bmn1: 'BMN1'
55
+ bmn1: 'BMN1',
56
+ 'btc-fb': 'BTC',
57
+ 'usdc-fb': 'USDC',
58
+ 'usdq-fb': 'USDQ'
53
59
  }[currencySelected] || currencySelected;
54
60
  };
55
61
  exports.getCurrencySymbol = getCurrencySymbol;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ Object.defineProperty(exports, "moment", {
8
+ enumerable: true,
9
+ get: function get() {
10
+ return _moment.default;
11
+ }
12
+ });
13
+ Object.defineProperty(exports, "momentTimezone", {
14
+ enumerable: true,
15
+ get: function get() {
16
+ return _momentTimezone.default;
17
+ }
18
+ });
19
+ exports.momentUtils = void 0;
20
+ var _moment = _interopRequireDefault(require("moment"));
21
+ var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
22
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
+ // Re-export moment and moment-timezone for use in other repos
24
+ // Export moment as default for convenience
25
+ var _default = _moment.default; // Common moment utilities that might be useful across projects
26
+ exports.default = _default;
27
+ var momentUtils = {
28
+ /**
29
+ * Format a date to a readable string
30
+ * @param {Date|string|moment} date - The date to format
31
+ * @param {string} format - The format string (default: 'DD MMM YYYY')
32
+ * @returns {string} - Formatted date string
33
+ */
34
+ formatDate: function formatDate(date) {
35
+ var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'DD MMM YYYY';
36
+ return (0, _moment.default)(date).format(format);
37
+ },
38
+ /**
39
+ * Format a date to a readable string with time
40
+ * @param {Date|string|moment} date - The date to format
41
+ * @param {string} format - The format string (default: 'DD MMM YYYY - hh:mm')
42
+ * @returns {string} - Formatted date string
43
+ */
44
+ formatDateTime: function formatDateTime(date) {
45
+ var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'DD MMM YYYY - hh:mm';
46
+ return (0, _moment.default)(date).format(format);
47
+ }
48
+ };
49
+ exports.momentUtils = momentUtils;
@@ -4,8 +4,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.scrollToElement = exports.default = void 0;
7
+ exports.useScrollActions = exports.scrollToElement = exports.default = exports.ScrollToTop = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
+ var _reactRouterDom = require("react-router-dom");
9
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
10
11
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
11
12
  /**
@@ -121,5 +122,20 @@ var useScrollActions = function useScrollActions() {
121
122
  scrollToElementWithOffset: scrollToElementWithOffset
122
123
  };
123
124
  };
125
+ exports.useScrollActions = useScrollActions;
126
+ var ScrollToTop = function ScrollToTop() {
127
+ var _useLocation = (0, _reactRouterDom.useLocation)(),
128
+ pathname = _useLocation.pathname;
129
+ (0, _react.useEffect)(function () {
130
+ // Reset scroll position on route change
131
+ window.scrollTo({
132
+ top: 0,
133
+ left: 0,
134
+ behavior: 'smooth'
135
+ });
136
+ }, [pathname]);
137
+ return null;
138
+ };
139
+ exports.ScrollToTop = ScrollToTop;
124
140
  var _default = useScrollActions;
125
141
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stokr/components-library",
3
- "version": "2.3.47",
3
+ "version": "2.3.49",
4
4
  "description": "STOKR - Components Library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",