@elliemae/ds-system 1.57.1-rc.0 → 2.0.0-alpha.11
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/cjs/arithmetic.js +12 -20
- package/cjs/constants.js +3 -4
- package/cjs/globalStyles.js +5 -10
- package/cjs/index.js +22 -16
- package/cjs/mobileUtilities.js +7 -17
- package/cjs/spaceUtilities.js +6 -20
- package/cjs/theme.js +1 -2
- package/cjs/themeProviderHOC.js +12 -11
- package/cjs/utils.js +48 -83
- package/esm/arithmetic.js +12 -16
- package/esm/constants.js +3 -4
- package/esm/globalStyles.js +5 -10
- package/esm/index.js +2 -9
- package/esm/mobileUtilities.js +6 -12
- package/esm/spaceUtilities.js +6 -20
- package/esm/theme.js +1 -2
- package/esm/themeProviderHOC.js +10 -10
- package/esm/utils.js +24 -67
- package/package.json +63 -12
- package/types/arithmetic.d.ts +5 -0
- package/types/constants.d.ts +11 -0
- package/types/globalStyles.d.ts +1 -0
- package/types/index.d.ts +7 -0
- package/types/mobileUtilities.d.ts +4 -0
- package/types/spaceUtilities.d.ts +13 -0
- package/types/tests/arithmetic.test.d.ts +1 -0
- package/types/theme.d.ts +2 -0
- package/types/themeProviderHOC.d.ts +2 -0
- package/types/utils.d.ts +27 -0
- package/arithmetic/package.json +0 -10
- package/cjs/arithmetic.js.map +0 -1
- package/cjs/constants.js.map +0 -1
- package/cjs/globalStyles.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/mobileUtilities.js.map +0 -1
- package/cjs/spaceUtilities.js.map +0 -1
- package/cjs/theme.js.map +0 -1
- package/cjs/themeProviderHOC.js.map +0 -1
- package/cjs/utils.js.map +0 -1
- package/constants/package.json +0 -10
- package/esm/arithmetic.js.map +0 -1
- package/esm/constants.js.map +0 -1
- package/esm/globalStyles.js.map +0 -1
- package/esm/index.js.map +0 -1
- package/esm/mobileUtilities.js.map +0 -1
- package/esm/spaceUtilities.js.map +0 -1
- package/esm/theme.js.map +0 -1
- package/esm/themeProviderHOC.js.map +0 -1
- package/esm/utils.js.map +0 -1
- package/globalStyles/package.json +0 -10
- package/mobileUtilities/package.json +0 -10
- package/spaceUtilities/package.json +0 -10
- package/theme/package.json +0 -10
- package/themeProviderHOC/package.json +0 -10
- package/utils/package.json +0 -10
package/cjs/arithmetic.js
CHANGED
|
@@ -2,31 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
-
|
|
9
|
-
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
5
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
10
6
|
|
|
11
7
|
function getNumberAndUnit(numberStrWithUnit) {
|
|
12
|
-
|
|
13
|
-
_String$match2 = _slicedToArray__default['default'](_String$match, 2),
|
|
14
|
-
number = _String$match2[0],
|
|
15
|
-
unit = _String$match2[1];
|
|
16
|
-
|
|
8
|
+
const [number, unit] = String(numberStrWithUnit).match(/[a-z]+|[(/^\-?\d*.\d+|\d+),?]+/gi);
|
|
17
9
|
return {
|
|
18
|
-
number
|
|
19
|
-
unit
|
|
10
|
+
number,
|
|
11
|
+
unit
|
|
20
12
|
};
|
|
21
13
|
}
|
|
22
14
|
function op(operator, n1, n2) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
15
|
+
const {
|
|
16
|
+
number,
|
|
17
|
+
unit
|
|
18
|
+
} = getNumberAndUnit(n1);
|
|
19
|
+
const {
|
|
20
|
+
number: number2,
|
|
21
|
+
unit: unit2
|
|
22
|
+
} = getNumberAndUnit(n2);
|
|
30
23
|
|
|
31
24
|
switch (operator) {
|
|
32
25
|
case '*':
|
|
@@ -48,4 +41,3 @@ function op(operator, n1, n2) {
|
|
|
48
41
|
|
|
49
42
|
exports.getNumberAndUnit = getNumberAndUnit;
|
|
50
43
|
exports.op = op;
|
|
51
|
-
//# sourceMappingURL=arithmetic.js.map
|
package/cjs/constants.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const desktopBaseFont = 13;
|
|
6
|
+
const mobileBaseFont = 16;
|
|
7
|
+
const translateUnits = {
|
|
8
8
|
'8px': '4px',
|
|
9
9
|
'16px': '8px',
|
|
10
10
|
'32px': '16px',
|
|
@@ -17,4 +17,3 @@ var translateUnits = {
|
|
|
17
17
|
exports.desktopBaseFont = desktopBaseFont;
|
|
18
18
|
exports.mobileBaseFont = mobileBaseFont;
|
|
19
19
|
exports.translateUnits = translateUnits;
|
|
20
|
-
//# sourceMappingURL=constants.js.map
|
package/cjs/globalStyles.js
CHANGED
|
@@ -3,25 +3,20 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
|
|
6
|
-
var utils = require('./utils.js');
|
|
7
6
|
require('polished');
|
|
8
7
|
require('lodash');
|
|
9
8
|
require('./theme.js');
|
|
10
|
-
require('
|
|
11
|
-
require('./mobileUtilities.js');
|
|
12
|
-
require('@babel/runtime/helpers/slicedToArray');
|
|
9
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
13
10
|
require('react');
|
|
14
|
-
require('
|
|
11
|
+
var styledComponents = require('styled-components');
|
|
15
12
|
|
|
16
13
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
14
|
|
|
18
15
|
var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefaultLegacy(_taggedTemplateLiteral);
|
|
19
16
|
|
|
20
17
|
var _templateObject;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
});
|
|
18
|
+
const GlobalStyles = styledComponents.createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral__default["default"](["\n :root, body {\n overscroll-behavior-y: none;\n font-size: 16px;\n @media (min-width: ", ") { \n font-size: 13px;\n }\n }\n"])), ({
|
|
19
|
+
theme
|
|
20
|
+
}) => theme.breakpoints.small);
|
|
25
21
|
|
|
26
22
|
exports.GlobalStyles = GlobalStyles;
|
|
27
|
-
//# sourceMappingURL=globalStyles.js.map
|
package/cjs/index.js
CHANGED
|
@@ -9,14 +9,8 @@ var utils = require('./utils.js');
|
|
|
9
9
|
var arithmetic = require('./arithmetic.js');
|
|
10
10
|
var theme = require('./theme.js');
|
|
11
11
|
var themeProviderHOC = require('./themeProviderHOC.js');
|
|
12
|
+
var styledComponents = require('styled-components');
|
|
12
13
|
var polished = require('polished');
|
|
13
|
-
require('@babel/runtime/helpers/taggedTemplateLiteral');
|
|
14
|
-
require('lodash');
|
|
15
|
-
require('@elliemae/pui-theme');
|
|
16
|
-
require('@babel/runtime/helpers/slicedToArray');
|
|
17
|
-
require('react');
|
|
18
|
-
require('./constants.js');
|
|
19
|
-
require('styled-components');
|
|
20
14
|
|
|
21
15
|
|
|
22
16
|
|
|
@@ -40,8 +34,6 @@ exports.boxShadow = utils.boxShadow;
|
|
|
40
34
|
exports.buttonLink = utils.buttonLink;
|
|
41
35
|
exports.clearFocus = utils.clearFocus;
|
|
42
36
|
exports.color = utils.color;
|
|
43
|
-
exports.createGlobalStyle = utils.createGlobalStyle;
|
|
44
|
-
exports.css = utils.css;
|
|
45
37
|
exports.disabled = utils.disabled;
|
|
46
38
|
exports.fakeActive = utils.fakeActive;
|
|
47
39
|
exports.fakeBorder = utils.fakeBorder;
|
|
@@ -51,7 +43,6 @@ exports.focusAfter = utils.focusAfter;
|
|
|
51
43
|
exports.hover = utils.hover;
|
|
52
44
|
exports.iconColor = utils.iconColor;
|
|
53
45
|
exports.keyframes = utils.keyframes;
|
|
54
|
-
exports.kfrm = utils.kfrm;
|
|
55
46
|
exports.onlyFirefox = utils.onlyFirefox;
|
|
56
47
|
exports.onlySafari = utils.onlySafari;
|
|
57
48
|
exports.onlySafariAndFiredox = utils.onlySafariAndFiredox;
|
|
@@ -59,16 +50,31 @@ exports.safariAndFirefoxBold = utils.safariAndFirefoxBold;
|
|
|
59
50
|
exports.textStyle = utils.textStyle;
|
|
60
51
|
exports.transition = utils.transition;
|
|
61
52
|
exports.truncate = utils.truncate;
|
|
62
|
-
exports.useTheme = utils.useTheme;
|
|
63
|
-
exports.withTheme = utils.withTheme;
|
|
64
53
|
exports.getNumberAndUnit = arithmetic.getNumberAndUnit;
|
|
65
54
|
exports.op = arithmetic.op;
|
|
66
55
|
exports.theme = theme.theme;
|
|
67
56
|
exports.themeProviderHOC = themeProviderHOC.themeProviderHOC;
|
|
57
|
+
Object.defineProperty(exports, 'createGlobalStyle', {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
get: function () { return styledComponents.createGlobalStyle; }
|
|
60
|
+
});
|
|
61
|
+
Object.defineProperty(exports, 'css', {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function () { return styledComponents.css; }
|
|
64
|
+
});
|
|
65
|
+
Object.defineProperty(exports, 'kfrm', {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function () { return styledComponents.keyframes; }
|
|
68
|
+
});
|
|
69
|
+
Object.defineProperty(exports, 'useTheme', {
|
|
70
|
+
enumerable: true,
|
|
71
|
+
get: function () { return styledComponents.useTheme; }
|
|
72
|
+
});
|
|
73
|
+
Object.defineProperty(exports, 'withTheme', {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
get: function () { return styledComponents.withTheme; }
|
|
76
|
+
});
|
|
68
77
|
Object.defineProperty(exports, 'rgba', {
|
|
69
78
|
enumerable: true,
|
|
70
|
-
get: function () {
|
|
71
|
-
return polished.rgba;
|
|
72
|
-
}
|
|
79
|
+
get: function () { return polished.rgba; }
|
|
73
80
|
});
|
|
74
|
-
//# sourceMappingURL=index.js.map
|
package/cjs/mobileUtilities.js
CHANGED
|
@@ -2,15 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
var
|
|
5
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
6
|
+
var react = require('react');
|
|
7
7
|
var theme = require('./theme.js');
|
|
8
8
|
var constants = require('./constants.js');
|
|
9
|
-
require('@elliemae/pui-theme');
|
|
10
|
-
|
|
11
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
|
-
|
|
13
|
-
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
14
9
|
|
|
15
10
|
function __UNSAFE_SPACE_TO_DIMSUM(unit) {
|
|
16
11
|
if (constants.translateUnits[unit]) return constants.translateUnits[unit];
|
|
@@ -20,26 +15,22 @@ function toMobile(unit) {
|
|
|
20
15
|
if (!isMobile()) return unit;
|
|
21
16
|
return "".concat(parseFloat(unit) * (constants.desktopBaseFont / constants.mobileBaseFont), "rem");
|
|
22
17
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
mobile = _useState2[0],
|
|
27
|
-
setMobile = _useState2[1];
|
|
28
|
-
|
|
29
|
-
React.useEffect(function () {
|
|
18
|
+
const useIsMobile = () => {
|
|
19
|
+
const [mobile, setMobile] = react.useState(isMobile());
|
|
20
|
+
react.useEffect(() => {
|
|
30
21
|
function handleResize() {
|
|
31
22
|
setMobile(isMobile());
|
|
32
23
|
}
|
|
33
24
|
|
|
34
25
|
if (window) window.addEventListener('resize', handleResize);
|
|
35
|
-
return
|
|
26
|
+
return () => {
|
|
36
27
|
if (window) window.removeEventListener('resize', handleResize);
|
|
37
28
|
};
|
|
38
29
|
}, []);
|
|
39
30
|
if (!window) return false;
|
|
40
31
|
return mobile;
|
|
41
32
|
};
|
|
42
|
-
|
|
33
|
+
const isMobile = () => {
|
|
43
34
|
if (!window) return false;
|
|
44
35
|
return Number(theme.theme.breakpoints.medium.split('px')[0]) - window.innerWidth >= 0;
|
|
45
36
|
};
|
|
@@ -48,4 +39,3 @@ exports.__UNSAFE_SPACE_TO_DIMSUM = __UNSAFE_SPACE_TO_DIMSUM;
|
|
|
48
39
|
exports.isMobile = isMobile;
|
|
49
40
|
exports.toMobile = toMobile;
|
|
50
41
|
exports.useIsMobile = useIsMobile;
|
|
51
|
-
//# sourceMappingURL=mobileUtilities.js.map
|
package/cjs/spaceUtilities.js
CHANGED
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var lodash = require('lodash');
|
|
6
6
|
var theme = require('./theme.js');
|
|
7
|
-
require('@elliemae/pui-theme');
|
|
8
7
|
|
|
9
8
|
function mapGap(gutter) {
|
|
10
9
|
if (!gutter) return '0rem';
|
|
@@ -21,16 +20,12 @@ function mapSpace(width) {
|
|
|
21
20
|
}
|
|
22
21
|
function fixSpaceGutter(width, gutter) {
|
|
23
22
|
if (!width) return '';
|
|
24
|
-
if (Array.isArray(width)) return width.map(
|
|
25
|
-
return "calc(".concat(mapSpace(w), " - (").concat(mapGutter(gutter), "))");
|
|
26
|
-
});
|
|
23
|
+
if (Array.isArray(width)) return width.map(w => "calc(".concat(mapSpace(w), " - (").concat(mapGutter(gutter), "))"));
|
|
27
24
|
return "calc(".concat(mapSpace(width), " - (").concat(mapGutter(gutter), "))");
|
|
28
25
|
}
|
|
29
26
|
function fixSpace(width) {
|
|
30
27
|
if (!width) return '';
|
|
31
|
-
if (Array.isArray(width)) return width.map(
|
|
32
|
-
return mapSpace(w);
|
|
33
|
-
});
|
|
28
|
+
if (Array.isArray(width)) return width.map(w => mapSpace(w));
|
|
34
29
|
return mapSpace(width);
|
|
35
30
|
}
|
|
36
31
|
/**
|
|
@@ -40,26 +35,18 @@ function fixSpace(width) {
|
|
|
40
35
|
*/
|
|
41
36
|
|
|
42
37
|
function numbersToFr(grid) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
});
|
|
46
|
-
return den.map(function (d) {
|
|
47
|
-
return "".concat(d, "fr");
|
|
48
|
-
});
|
|
38
|
+
const den = grid.map(f => f < 1 ? Math.floor(1 / f) : f);
|
|
39
|
+
return den.map(d => "".concat(d, "fr"));
|
|
49
40
|
}
|
|
50
41
|
function mapGrid(width) {
|
|
51
42
|
if (lodash.get(theme.theme, width)) return "".concat(lodash.get(theme.theme, width));
|
|
52
43
|
if (typeof width === 'string') return width;
|
|
53
|
-
|
|
44
|
+
const den = width < 1 ? Math.floor(1 / width) : width;
|
|
54
45
|
return "".concat(den, "fr");
|
|
55
46
|
}
|
|
56
47
|
function mapTemplateGrid(grid) {
|
|
57
48
|
if (Array.isArray(grid)) {
|
|
58
|
-
if (grid.some(
|
|
59
|
-
return typeof w === 'string';
|
|
60
|
-
})) return grid.map(function (w) {
|
|
61
|
-
return mapGrid(w);
|
|
62
|
-
});
|
|
49
|
+
if (grid.some(w => typeof w === 'string')) return grid.map(w => mapGrid(w));
|
|
63
50
|
return numbersToFr(grid);
|
|
64
51
|
}
|
|
65
52
|
|
|
@@ -74,4 +61,3 @@ exports.mapGutter = mapGutter;
|
|
|
74
61
|
exports.mapSpace = mapSpace;
|
|
75
62
|
exports.mapTemplateGrid = mapTemplateGrid;
|
|
76
63
|
exports.numbersToFr = numbersToFr;
|
|
77
|
-
//# sourceMappingURL=spaceUtilities.js.map
|
package/cjs/theme.js
CHANGED
package/cjs/themeProviderHOC.js
CHANGED
|
@@ -2,22 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _jsx2 = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
|
+
require('react');
|
|
6
8
|
var styledComponents = require('styled-components');
|
|
7
9
|
var theme = require('./theme.js');
|
|
8
|
-
require('
|
|
10
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
9
11
|
|
|
10
12
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
13
|
|
|
12
|
-
var
|
|
14
|
+
var _jsx2__default = /*#__PURE__*/_interopDefaultLegacy(_jsx2);
|
|
15
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
13
16
|
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
17
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
18
|
+
|
|
19
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
20
|
+
const themeProviderHOC = Component => props => /*#__PURE__*/_jsx2__default["default"](styledComponents.ThemeProvider, {
|
|
21
|
+
theme: theme.theme
|
|
22
|
+
}, void 0, /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread({}, props)));
|
|
21
23
|
|
|
22
24
|
exports.themeProviderHOC = themeProviderHOC;
|
|
23
|
-
//# sourceMappingURL=themeProviderHOC.js.map
|
package/cjs/utils.js
CHANGED
|
@@ -2,33 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
|
|
6
5
|
var polished = require('polished');
|
|
7
6
|
var lodash = require('lodash');
|
|
8
7
|
var theme = require('./theme.js');
|
|
9
8
|
var mobileUtilities = require('./mobileUtilities.js');
|
|
10
|
-
require('
|
|
11
|
-
require('@babel/runtime/helpers/slicedToArray');
|
|
12
|
-
require('react');
|
|
13
|
-
require('./constants.js');
|
|
9
|
+
var styledComponents = require('styled-components');
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefaultLegacy(_taggedTemplateLiteral);
|
|
18
|
-
|
|
19
|
-
var _templateObject;
|
|
20
|
-
|
|
21
|
-
var styled = require('styled-components');
|
|
22
|
-
|
|
23
|
-
var css = styled.css;
|
|
24
|
-
var kfrm = styled.keyframes;
|
|
25
|
-
var withTheme = styled.withTheme;
|
|
26
|
-
var useTheme = styled.useTheme;
|
|
27
|
-
var createGlobalStyle = styled.createGlobalStyle;
|
|
11
|
+
/* eslint-disable no-shadow */
|
|
28
12
|
function truncate(width) {
|
|
29
|
-
return
|
|
30
|
-
return css(["", " white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"], !!width || props.width ? "width: ".concat(props.width || width, ";") : '');
|
|
31
|
-
};
|
|
13
|
+
return props => styledComponents.css(["", " white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"], !!width || props.width ? "width: ".concat(props.width || width, ";") : '');
|
|
32
14
|
}
|
|
33
15
|
function flexCenter() {
|
|
34
16
|
return "\n display: flex;\n justify-content: center;\n align-items: center;\n ";
|
|
@@ -37,58 +19,38 @@ function disabled() {
|
|
|
37
19
|
return "\n cursor: not-allowed;\n pointer-events: none;\n ";
|
|
38
20
|
}
|
|
39
21
|
function keyframes(obj) {
|
|
40
|
-
return
|
|
41
|
-
return "\n ".concat(result, "\n ").concat(key, "% {\n ").concat(value, "\n }\n ");
|
|
42
|
-
}, ''));
|
|
22
|
+
return styledComponents.keyframes(["", ""], lodash.reduce(obj, (result, value, key) => "\n ".concat(result, "\n ").concat(key, "% {\n ").concat(value, "\n }\n "), ''));
|
|
43
23
|
} // eslint-disable-next-line max-params
|
|
44
24
|
|
|
45
|
-
function boxShadow(top, left, blur, color) {
|
|
46
|
-
var inset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
25
|
+
function boxShadow(top, left, blur, color, inset = false) {
|
|
47
26
|
return "box-shadow: ".concat(inset ? 'inset' : '', " ").concat(top, " ").concat(left, " ").concat(blur, " ").concat(color, ";");
|
|
48
27
|
}
|
|
49
|
-
function color() {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return props.theme.colors[variant][type];
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
function border() {
|
|
57
|
-
var color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : theme.theme.colors.brand[600];
|
|
58
|
-
var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '1px';
|
|
59
|
-
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'solid';
|
|
28
|
+
function color(variant = 'neutral', type = 400) {
|
|
29
|
+
return styledComponents.css(["color:", ";"], props => props.theme.colors[variant][type]);
|
|
30
|
+
}
|
|
31
|
+
function border(color = theme.theme.colors.brand[600], size = '1px', type = 'solid') {
|
|
60
32
|
return "".concat(size, " ").concat(type, " ").concat(color);
|
|
61
33
|
}
|
|
62
34
|
function animation(animationKeyframes, animationLength, animationTimingFn) {
|
|
63
|
-
return
|
|
64
|
-
return css(["animation:", " ", " ", ";"], props.animationKeyframes || animationKeyframes, props.animationLength || animationLength, props.animationTimingFn || animationTimingFn);
|
|
65
|
-
};
|
|
35
|
+
return props => styledComponents.css(["animation:", " ", " ", ";"], props.animationKeyframes || animationKeyframes, props.animationLength || animationLength, props.animationTimingFn || animationTimingFn);
|
|
66
36
|
} // 0.0769
|
|
67
37
|
|
|
68
|
-
function focus() {
|
|
69
|
-
|
|
70
|
-
return function () {
|
|
71
|
-
return css(["outline:none;border:1px solid ", ";box-shadow:inset 0 0 0 1px ", ";border-radius:2px;"], color, polished.lighten(0.3, color));
|
|
72
|
-
};
|
|
38
|
+
function focus(color = theme.theme.colors.brand[600]) {
|
|
39
|
+
return () => styledComponents.css(["outline:none;border:1px solid ", ";box-shadow:inset 0 0 0 1px ", ";border-radius:2px;"], color, polished.lighten(0.3, color));
|
|
73
40
|
}
|
|
74
41
|
function focusAfter(color) {
|
|
75
|
-
return css(["outline:none;position:relative;&:after{content:'';z-index:10;position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;", "}"], focus(color));
|
|
42
|
+
return styledComponents.css(["outline:none;position:relative;&:after{content:'';z-index:10;position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;", "}"], focus(color));
|
|
76
43
|
}
|
|
77
44
|
function active() {
|
|
78
|
-
return
|
|
79
|
-
return css(["outline:none;border:1px solid ", ";border-radius:2px;"], props.theme.colors.brand[700]);
|
|
80
|
-
};
|
|
45
|
+
return props => styledComponents.css(["outline:none;border:1px solid ", ";border-radius:2px;"], props.theme.colors.brand[700]);
|
|
81
46
|
}
|
|
82
47
|
function hover() {
|
|
83
|
-
return
|
|
84
|
-
return css(["outline:1px solid ", ";outline-offset:-1px;"], props.theme.colors.brand[600]);
|
|
85
|
-
};
|
|
48
|
+
return props => styledComponents.css(["outline:1px solid ", ";outline-offset:-1px;"], props.theme.colors.brand[600]);
|
|
86
49
|
}
|
|
87
|
-
function textStyle(type) {
|
|
88
|
-
var weight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'regular';
|
|
50
|
+
function textStyle(type, weight = 'regular') {
|
|
89
51
|
// eslint-disable-next-line complexity
|
|
90
|
-
return
|
|
91
|
-
|
|
52
|
+
return props => {
|
|
53
|
+
let cssVar = "font-weight: ".concat(props.theme.fontWeights[weight], ";"); // eslint-disable-next-line default-case
|
|
92
54
|
|
|
93
55
|
switch (type) {
|
|
94
56
|
case 'h1':
|
|
@@ -139,22 +101,14 @@ function textStyle(type) {
|
|
|
139
101
|
return cssVar;
|
|
140
102
|
};
|
|
141
103
|
}
|
|
142
|
-
function iconColor() {
|
|
143
|
-
|
|
144
|
-
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 400;
|
|
145
|
-
return css(["fill:", ";"], function (props) {
|
|
146
|
-
return props.theme.colors[variant][type];
|
|
147
|
-
});
|
|
104
|
+
function iconColor(variant = 'neutral', type = 400) {
|
|
105
|
+
return styledComponents.css(["fill:", ";"], props => props.theme.colors[variant][type]);
|
|
148
106
|
}
|
|
149
107
|
function fakeBorder() {
|
|
150
|
-
return css(["box-shadow:inset 0 0 0 1px ", ";border-radius:2px;"],
|
|
151
|
-
return props.theme.colors.neutral[200];
|
|
152
|
-
});
|
|
108
|
+
return styledComponents.css(["box-shadow:inset 0 0 0 1px ", ";border-radius:2px;"], props => props.theme.colors.neutral[200]);
|
|
153
109
|
}
|
|
154
110
|
function fakeActive() {
|
|
155
|
-
return css(["outline:none;box-shadow:inset 0 0 0 1px ", ";border-radius:2px;"],
|
|
156
|
-
return props.theme.colors.brand[700];
|
|
157
|
-
});
|
|
111
|
+
return styledComponents.css(["outline:none;box-shadow:inset 0 0 0 1px ", ";border-radius:2px;"], props => props.theme.colors.brand[700]);
|
|
158
112
|
}
|
|
159
113
|
function clearFocus() {
|
|
160
114
|
return "\n border: none;\n box-shadow: none;\n ";
|
|
@@ -162,28 +116,45 @@ function clearFocus() {
|
|
|
162
116
|
function buttonLink() {
|
|
163
117
|
return "\n background-color: transparent;\n border: 1px solid transparent;\n cursor: pointer;\n ";
|
|
164
118
|
}
|
|
165
|
-
function transition() {
|
|
166
|
-
var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'all 1s ease';
|
|
119
|
+
function transition(t = 'all 1s ease') {
|
|
167
120
|
return "\n transition: ".concat(t, ";\n ");
|
|
168
121
|
}
|
|
169
122
|
function onlySafariAndFiredox(styles) {
|
|
170
|
-
return css(["@media not all and (min-resolution:0.001dpcm){", "}@media screen and (min--moz-device-pixel-ratio:0){", "}"], styles, styles);
|
|
123
|
+
return styledComponents.css(["@media not all and (min-resolution:0.001dpcm){", "}@media screen and (min--moz-device-pixel-ratio:0){", "}"], styles, styles);
|
|
171
124
|
}
|
|
172
125
|
function onlySafari(styles) {
|
|
173
|
-
return css(["@media not all and (min-resolution:0.001dpcm){", "}"], styles);
|
|
126
|
+
return styledComponents.css(["@media not all and (min-resolution:0.001dpcm){", "}"], styles);
|
|
174
127
|
}
|
|
175
128
|
function onlyFirefox(styles) {
|
|
176
|
-
return css(["@media screen and (min--moz-device-pixel-ratio:0){", "}"], styles);
|
|
129
|
+
return styledComponents.css(["@media screen and (min--moz-device-pixel-ratio:0){", "}"], styles);
|
|
177
130
|
}
|
|
178
131
|
function safariAndFirefoxBold(color) {
|
|
179
|
-
return css(["@media not all and (min-resolution:0.001dpcm){font-weight:400;-webkit-font-smoothing:subpixel-antialiased;-webkit-text-stroke:0.4px ", ";}@media screen and (min--moz-device-pixel-ratio:0){font-weight:400;-webkit-font-smoothing:subpixel-antialiased;-webkit-text-stroke:0.4px ", ";}"], color, color);
|
|
132
|
+
return styledComponents.css(["@media not all and (min-resolution:0.001dpcm){font-weight:400;-webkit-font-smoothing:subpixel-antialiased;-webkit-text-stroke:0.4px ", ";}@media screen and (min--moz-device-pixel-ratio:0){font-weight:400;-webkit-font-smoothing:subpixel-antialiased;-webkit-text-stroke:0.4px ", ";}"], color, color);
|
|
180
133
|
}
|
|
181
134
|
|
|
182
135
|
Object.defineProperty(exports, 'rgba', {
|
|
183
136
|
enumerable: true,
|
|
184
|
-
get: function () {
|
|
185
|
-
|
|
186
|
-
|
|
137
|
+
get: function () { return polished.rgba; }
|
|
138
|
+
});
|
|
139
|
+
Object.defineProperty(exports, 'createGlobalStyle', {
|
|
140
|
+
enumerable: true,
|
|
141
|
+
get: function () { return styledComponents.createGlobalStyle; }
|
|
142
|
+
});
|
|
143
|
+
Object.defineProperty(exports, 'css', {
|
|
144
|
+
enumerable: true,
|
|
145
|
+
get: function () { return styledComponents.css; }
|
|
146
|
+
});
|
|
147
|
+
Object.defineProperty(exports, 'kfrm', {
|
|
148
|
+
enumerable: true,
|
|
149
|
+
get: function () { return styledComponents.keyframes; }
|
|
150
|
+
});
|
|
151
|
+
Object.defineProperty(exports, 'useTheme', {
|
|
152
|
+
enumerable: true,
|
|
153
|
+
get: function () { return styledComponents.useTheme; }
|
|
154
|
+
});
|
|
155
|
+
Object.defineProperty(exports, 'withTheme', {
|
|
156
|
+
enumerable: true,
|
|
157
|
+
get: function () { return styledComponents.withTheme; }
|
|
187
158
|
});
|
|
188
159
|
exports.active = active;
|
|
189
160
|
exports.animation = animation;
|
|
@@ -192,8 +163,6 @@ exports.boxShadow = boxShadow;
|
|
|
192
163
|
exports.buttonLink = buttonLink;
|
|
193
164
|
exports.clearFocus = clearFocus;
|
|
194
165
|
exports.color = color;
|
|
195
|
-
exports.createGlobalStyle = createGlobalStyle;
|
|
196
|
-
exports.css = css;
|
|
197
166
|
exports.disabled = disabled;
|
|
198
167
|
exports.fakeActive = fakeActive;
|
|
199
168
|
exports.fakeBorder = fakeBorder;
|
|
@@ -203,7 +172,6 @@ exports.focusAfter = focusAfter;
|
|
|
203
172
|
exports.hover = hover;
|
|
204
173
|
exports.iconColor = iconColor;
|
|
205
174
|
exports.keyframes = keyframes;
|
|
206
|
-
exports.kfrm = kfrm;
|
|
207
175
|
exports.onlyFirefox = onlyFirefox;
|
|
208
176
|
exports.onlySafari = onlySafari;
|
|
209
177
|
exports.onlySafariAndFiredox = onlySafariAndFiredox;
|
|
@@ -211,6 +179,3 @@ exports.safariAndFirefoxBold = safariAndFirefoxBold;
|
|
|
211
179
|
exports.textStyle = textStyle;
|
|
212
180
|
exports.transition = transition;
|
|
213
181
|
exports.truncate = truncate;
|
|
214
|
-
exports.useTheme = useTheme;
|
|
215
|
-
exports.withTheme = withTheme;
|
|
216
|
-
//# sourceMappingURL=utils.js.map
|
package/esm/arithmetic.js
CHANGED
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
2
2
|
|
|
3
3
|
function getNumberAndUnit(numberStrWithUnit) {
|
|
4
|
-
|
|
5
|
-
_String$match2 = _slicedToArray(_String$match, 2),
|
|
6
|
-
number = _String$match2[0],
|
|
7
|
-
unit = _String$match2[1];
|
|
8
|
-
|
|
4
|
+
const [number, unit] = String(numberStrWithUnit).match(/[a-z]+|[(/^\-?\d*.\d+|\d+),?]+/gi);
|
|
9
5
|
return {
|
|
10
|
-
number
|
|
11
|
-
unit
|
|
6
|
+
number,
|
|
7
|
+
unit
|
|
12
8
|
};
|
|
13
9
|
}
|
|
14
10
|
function op(operator, n1, n2) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
const {
|
|
12
|
+
number,
|
|
13
|
+
unit
|
|
14
|
+
} = getNumberAndUnit(n1);
|
|
15
|
+
const {
|
|
16
|
+
number: number2,
|
|
17
|
+
unit: unit2
|
|
18
|
+
} = getNumberAndUnit(n2);
|
|
22
19
|
|
|
23
20
|
switch (operator) {
|
|
24
21
|
case '*':
|
|
@@ -39,4 +36,3 @@ function op(operator, n1, n2) {
|
|
|
39
36
|
}
|
|
40
37
|
|
|
41
38
|
export { getNumberAndUnit, op };
|
|
42
|
-
//# sourceMappingURL=arithmetic.js.map
|
package/esm/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const desktopBaseFont = 13;
|
|
2
|
+
const mobileBaseFont = 16;
|
|
3
|
+
const translateUnits = {
|
|
4
4
|
'8px': '4px',
|
|
5
5
|
'16px': '8px',
|
|
6
6
|
'32px': '16px',
|
|
@@ -11,4 +11,3 @@ var translateUnits = {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export { desktopBaseFont, mobileBaseFont, translateUnits };
|
|
14
|
-
//# sourceMappingURL=constants.js.map
|
package/esm/globalStyles.js
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from '@babel/runtime/helpers/esm/taggedTemplateLiteral';
|
|
2
|
-
import { createGlobalStyle } from './utils.js';
|
|
3
2
|
import 'polished';
|
|
4
3
|
import 'lodash';
|
|
5
4
|
import './theme.js';
|
|
6
|
-
import '
|
|
7
|
-
import './mobileUtilities.js';
|
|
8
|
-
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
5
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
9
6
|
import 'react';
|
|
10
|
-
import '
|
|
7
|
+
import { createGlobalStyle } from 'styled-components';
|
|
11
8
|
|
|
12
9
|
var _templateObject;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
});
|
|
10
|
+
const GlobalStyles = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n :root, body {\n overscroll-behavior-y: none;\n font-size: 16px;\n @media (min-width: ", ") { \n font-size: 13px;\n }\n }\n"])), ({
|
|
11
|
+
theme
|
|
12
|
+
}) => theme.breakpoints.small);
|
|
17
13
|
|
|
18
14
|
export { GlobalStyles };
|
|
19
|
-
//# sourceMappingURL=globalStyles.js.map
|
package/esm/index.js
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
export { GlobalStyles } from './globalStyles.js';
|
|
2
2
|
export { fixSpace, fixSpaceGutter, mapGap, mapGrid, mapGutter, mapSpace, mapTemplateGrid, numbersToFr } from './spaceUtilities.js';
|
|
3
3
|
export { __UNSAFE_SPACE_TO_DIMSUM, isMobile, toMobile, useIsMobile } from './mobileUtilities.js';
|
|
4
|
-
export { active, animation, border, boxShadow, buttonLink, clearFocus, color,
|
|
4
|
+
export { active, animation, border, boxShadow, buttonLink, clearFocus, color, disabled, fakeActive, fakeBorder, flexCenter, focus, focusAfter, hover, iconColor, keyframes, onlyFirefox, onlySafari, onlySafariAndFiredox, safariAndFirefoxBold, textStyle, transition, truncate } from './utils.js';
|
|
5
5
|
export { getNumberAndUnit, op } from './arithmetic.js';
|
|
6
6
|
export { theme } from './theme.js';
|
|
7
7
|
export { themeProviderHOC } from './themeProviderHOC.js';
|
|
8
|
+
export { createGlobalStyle, css, keyframes as kfrm, useTheme, withTheme } from 'styled-components';
|
|
8
9
|
export { rgba } from 'polished';
|
|
9
|
-
import '@babel/runtime/helpers/esm/taggedTemplateLiteral';
|
|
10
|
-
import 'lodash';
|
|
11
|
-
import '@elliemae/pui-theme';
|
|
12
|
-
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
13
|
-
import 'react';
|
|
14
|
-
import './constants.js';
|
|
15
|
-
import 'styled-components';
|
|
16
|
-
//# sourceMappingURL=index.js.map
|