@thecb/components 6.2.8 → 6.2.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "6.2.8",
3
+ "version": "6.2.9",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -1,19 +1,6 @@
1
1
  import React, { useState, useLayoutEffect, useRef } from "react";
2
2
  import { ThemeProvider } from "styled-components";
3
-
4
- const MOBILE_WIDTH = 768;
5
-
6
- const throttle = (delay, fn) => {
7
- let lastCall = 0;
8
- return (...args) => {
9
- const now = new Date().getTime();
10
- if (now - lastCall < delay) {
11
- return;
12
- }
13
- lastCall = now;
14
- return fn(...args);
15
- };
16
- };
3
+ import { MOBILE_WIDTH, throttle } from "../util/general";
17
4
 
18
5
  const withWindowSize = Child => ({ ...props }) => {
19
6
  const [state, setState] = useState({
@@ -130,3 +130,17 @@ export const inputDisabledStyle = `
130
130
  background-color: #f7f7f7;
131
131
  pointer-events: none;
132
132
  `;
133
+
134
+ export const MOBILE_WIDTH = 768;
135
+
136
+ export const throttle = (delay, fn) => {
137
+ let lastCall = 0;
138
+ return (...args) => {
139
+ const now = new Date().getTime();
140
+ if (now - lastCall < delay) {
141
+ return;
142
+ }
143
+ lastCall = now;
144
+ return fn(...args);
145
+ };
146
+ };