@elliemae/ds-system 2.2.0 → 2.3.0-alpha.3
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 +42 -30
- package/cjs/arithmetic.js.map +7 -0
- package/cjs/constants.js +43 -15
- package/cjs/constants.js.map +7 -0
- package/cjs/globalStyles.js +44 -22
- package/cjs/globalStyles.js.map +7 -0
- package/cjs/index.js +42 -83
- package/cjs/index.js.map +7 -0
- package/cjs/mobileUtilities.js +57 -26
- package/cjs/mobileUtilities.js.map +7 -0
- package/cjs/spaceUtilities.js +72 -46
- package/cjs/spaceUtilities.js.map +7 -0
- package/cjs/styled/index.d.js +27 -2
- package/cjs/styled/index.d.js.map +7 -0
- package/cjs/styled/index.js +57 -92
- package/cjs/styled/index.js.map +7 -0
- package/cjs/styled/styleGetters.js +42 -30
- package/cjs/styled/styleGetters.js.map +7 -0
- package/cjs/styled/types.js +34 -11
- package/cjs/styled/types.js.map +7 -0
- package/cjs/styled/utils.js +46 -23
- package/cjs/styled/utils.js.map +7 -0
- package/cjs/th.js +57 -31
- package/cjs/th.js.map +7 -0
- package/cjs/theme.js +36 -9
- package/cjs/theme.js.map +7 -0
- package/cjs/themeProviderHOC.js +42 -29
- package/cjs/themeProviderHOC.js.map +7 -0
- package/cjs/utils.js +256 -146
- package/cjs/utils.js.map +7 -0
- package/esm/arithmetic.js +13 -25
- package/esm/arithmetic.js.map +7 -0
- package/esm/constants.js +14 -9
- package/esm/constants.js.map +7 -0
- package/esm/globalStyles.js +16 -15
- package/esm/globalStyles.js.map +7 -0
- package/esm/index.js +14 -11
- package/esm/index.js.map +7 -0
- package/esm/mobileUtilities.js +26 -17
- package/esm/mobileUtilities.js.map +7 -0
- package/esm/spaceUtilities.js +43 -35
- package/esm/spaceUtilities.js.map +7 -0
- package/esm/styled/index.d.js +2 -1
- package/esm/styled/index.d.js.map +7 -0
- package/esm/styled/index.js +23 -78
- package/esm/styled/index.js.map +7 -0
- package/esm/styled/styleGetters.js +12 -23
- package/esm/styled/styleGetters.js.map +7 -0
- package/esm/styled/types.js +6 -1
- package/esm/styled/types.js.map +7 -0
- package/esm/styled/utils.js +16 -16
- package/esm/styled/utils.js.map +7 -0
- package/esm/th.js +28 -27
- package/esm/th.js.map +7 -0
- package/esm/theme.js +6 -4
- package/esm/theme.js.map +7 -0
- package/esm/themeProviderHOC.js +13 -20
- package/esm/themeProviderHOC.js.map +7 -0
- package/esm/utils.js +227 -98
- package/esm/utils.js.map +7 -0
- package/package.json +2 -2
- package/types/th.d.ts +15 -12
- package/types/utils.d.ts +1 -2
package/cjs/arithmetic.js
CHANGED
|
@@ -1,43 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var arithmetic_exports = {};
|
|
29
|
+
__export(arithmetic_exports, {
|
|
30
|
+
getNumberAndUnit: () => getNumberAndUnit,
|
|
31
|
+
op: () => op
|
|
32
|
+
});
|
|
33
|
+
var React = __toESM(require("react"));
|
|
7
34
|
function getNumberAndUnit(numberStrWithUnit) {
|
|
8
35
|
const [number, unit] = String(numberStrWithUnit).match(/[a-z]+|[(/^\-?\d*.\d+|\d+),?]+/gi);
|
|
9
|
-
return {
|
|
10
|
-
number,
|
|
11
|
-
unit
|
|
12
|
-
};
|
|
36
|
+
return { number, unit };
|
|
13
37
|
}
|
|
14
38
|
function op(operator, n1, n2) {
|
|
15
|
-
const {
|
|
16
|
-
|
|
17
|
-
unit
|
|
18
|
-
} = getNumberAndUnit(n1);
|
|
19
|
-
const {
|
|
20
|
-
number: number2,
|
|
21
|
-
unit: unit2
|
|
22
|
-
} = getNumberAndUnit(n2);
|
|
23
|
-
|
|
39
|
+
const { number, unit } = getNumberAndUnit(n1);
|
|
40
|
+
const { number: number2, unit: unit2 } = getNumberAndUnit(n2);
|
|
24
41
|
switch (operator) {
|
|
25
|
-
case
|
|
42
|
+
case "*":
|
|
26
43
|
return Number(number) * Number(number2) + (unit || unit2);
|
|
27
|
-
|
|
28
|
-
case '+':
|
|
44
|
+
case "+":
|
|
29
45
|
return Number(number) + Number(number2) + (unit || unit2);
|
|
30
|
-
|
|
31
|
-
case '-':
|
|
46
|
+
case "-":
|
|
32
47
|
return Number(number) - Number(number2) + (unit || unit2);
|
|
33
|
-
|
|
34
|
-
case '/':
|
|
48
|
+
case "/":
|
|
35
49
|
return Number(number) / Number(number2) + (unit || unit2);
|
|
36
|
-
|
|
37
50
|
default:
|
|
38
51
|
return Number(number) + Number(number2) + (unit || unit2);
|
|
39
52
|
}
|
|
40
53
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
exports.op = op;
|
|
54
|
+
module.exports = __toCommonJS(arithmetic_exports);
|
|
55
|
+
//# sourceMappingURL=arithmetic.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/arithmetic.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export function getNumberAndUnit(\n numberStrWithUnit: string | number,\n): { number: string; unit: string } {\n const [number, unit] = String(numberStrWithUnit).match(\n /[a-z]+|[(/^\\-?\\d*.\\d+|\\d+),?]+/gi,\n );\n return { number, unit };\n}\n\nexport function op(operator: string, n1: string, n2: string | number): string {\n const { number, unit } = getNumberAndUnit(n1);\n const { number: number2, unit: unit2 } = getNumberAndUnit(n2);\n switch (operator) {\n case '*':\n return Number(number) * Number(number2) + (unit || unit2);\n case '+':\n return Number(number) + Number(number2) + (unit || unit2);\n case '-':\n return Number(number) - Number(number2) + (unit || unit2);\n case '/':\n return Number(number) / Number(number2) + (unit || unit2);\n default:\n return Number(number) + Number(number2) + (unit || unit2);\n }\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,0BACL,mBACkC;AAClC,QAAM,CAAC,QAAQ,QAAQ,OAAO,mBAAmB,MAC/C;AAEF,SAAO,EAAE,QAAQ;AAAA;AAGZ,YAAY,UAAkB,IAAY,IAA6B;AAC5E,QAAM,EAAE,QAAQ,SAAS,iBAAiB;AAC1C,QAAM,EAAE,QAAQ,SAAS,MAAM,UAAU,iBAAiB;AAC1D,UAAQ;AAAA,SACD;AACH,aAAO,OAAO,UAAU,OAAO,WAAY,SAAQ;AAAA,SAChD;AACH,aAAO,OAAO,UAAU,OAAO,WAAY,SAAQ;AAAA,SAChD;AACH,aAAO,OAAO,UAAU,OAAO,WAAY,SAAQ;AAAA,SAChD;AACH,aAAO,OAAO,UAAU,OAAO,WAAY,SAAQ;AAAA;AAEnD,aAAO,OAAO,UAAU,OAAO,WAAY,SAAQ;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/cjs/constants.js
CHANGED
|
@@ -1,19 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var constants_exports = {};
|
|
29
|
+
__export(constants_exports, {
|
|
30
|
+
desktopBaseFont: () => desktopBaseFont,
|
|
31
|
+
mobileBaseFont: () => mobileBaseFont,
|
|
32
|
+
translateUnits: () => translateUnits
|
|
33
|
+
});
|
|
34
|
+
var React = __toESM(require("react"));
|
|
5
35
|
const desktopBaseFont = 13;
|
|
6
36
|
const mobileBaseFont = 16;
|
|
7
37
|
const translateUnits = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
38
|
+
"8px": "4px",
|
|
39
|
+
"16px": "8px",
|
|
40
|
+
"32px": "16px",
|
|
41
|
+
"48px": "24px",
|
|
42
|
+
"56px": "32px",
|
|
43
|
+
"64px": "48px",
|
|
44
|
+
"72px": "64px"
|
|
15
45
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
exports.mobileBaseFont = mobileBaseFont;
|
|
19
|
-
exports.translateUnits = translateUnits;
|
|
46
|
+
module.exports = __toCommonJS(constants_exports);
|
|
47
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/constants.ts", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export const desktopBaseFont = 13;\n\nexport const mobileBaseFont = 16;\n\nexport const translateUnits = {\n '8px': '4px',\n '16px': '8px',\n '32px': '16px',\n '48px': '24px',\n '56px': '32px',\n '64px': '48px',\n '72px': '64px',\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,kBAAkB;AAExB,MAAM,iBAAiB;AAEvB,MAAM,iBAAiB;AAAA,EAC5B,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/cjs/globalStyles.js
CHANGED
|
@@ -1,25 +1,47 @@
|
|
|
1
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var globalStyles_exports = {};
|
|
29
|
+
__export(globalStyles_exports, {
|
|
30
|
+
GlobalStyles: () => GlobalStyles
|
|
31
|
+
});
|
|
32
|
+
var React = __toESM(require("react"));
|
|
33
|
+
var import_utils = require("./utils");
|
|
34
|
+
const GlobalStyles = import_utils.createGlobalStyle`
|
|
35
|
+
:root, body {
|
|
36
|
+
overscroll-behavior-y: none;
|
|
2
37
|
|
|
3
|
-
|
|
38
|
+
font-size: ${(props) => props.device === "desktop" ? "13px" : "16px"};
|
|
4
39
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
require('./theme.js');
|
|
9
|
-
require('core-js/modules/web.dom-collections.iterator.js');
|
|
10
|
-
require('react');
|
|
11
|
-
var styled_component = require('styled-components');
|
|
40
|
+
@media(min-width: ${({ theme }) => theme.breakpoints.small}) {
|
|
41
|
+
font-size: ${(props) => props.device === "mobile" ? "16px" : "13px"};
|
|
42
|
+
}
|
|
12
43
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var _templateObject;
|
|
18
|
-
const GlobalStyles = styled_component.createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral__default["default"](["\n :root, body {\n overscroll-behavior-y: none;\n\n font-size: ", ";\n\n @media(min-width: ", ") {\n font-size: ", ";\n }\n\n }\n"])), props => props.device === 'desktop' ? '13px' : '16px', _ref => {
|
|
19
|
-
let {
|
|
20
|
-
theme
|
|
21
|
-
} = _ref;
|
|
22
|
-
return theme.breakpoints.small;
|
|
23
|
-
}, props => props.device === 'mobile' ? '16px' : '13px');
|
|
24
|
-
|
|
25
|
-
exports.GlobalStyles = GlobalStyles;
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
module.exports = __toCommonJS(globalStyles_exports);
|
|
47
|
+
//# sourceMappingURL=globalStyles.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/globalStyles.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { createGlobalStyle } from './utils';\n\nexport const GlobalStyles = createGlobalStyle`\n :root, body {\n overscroll-behavior-y: none;\n\n font-size: ${(props) => (props.device === 'desktop' ? '13px' : '16px')};\n\n @media(min-width: ${({ theme }) => theme.breakpoints.small}) {\n font-size: ${(props) => (props.device === 'mobile' ? '16px' : '13px')};\n }\n\n }\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkC;AAE3B,MAAM,eAAe;AAAA;AAAA;AAAA;AAAA,iBAIX,CAAC,UAAW,MAAM,WAAW,YAAY,SAAS;AAAA;AAAA,wBAE3C,CAAC,EAAE,YAAY,MAAM,YAAY;AAAA,mBACtC,CAAC,UAAW,MAAM,WAAW,WAAW,SAAS;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/cjs/index.js
CHANGED
|
@@ -1,84 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
exports.useIsMobile = mobileUtilities.useIsMobile;
|
|
32
|
-
exports.active = utils.active;
|
|
33
|
-
exports.animation = utils.animation;
|
|
34
|
-
exports.border = utils.border;
|
|
35
|
-
exports.boxShadow = utils.boxShadow;
|
|
36
|
-
exports.buttonLink = utils.buttonLink;
|
|
37
|
-
exports.clearFocus = utils.clearFocus;
|
|
38
|
-
exports.color = utils.color;
|
|
39
|
-
exports.disabled = utils.disabled;
|
|
40
|
-
exports.fakeActive = utils.fakeActive;
|
|
41
|
-
exports.fakeBorder = utils.fakeBorder;
|
|
42
|
-
exports.flexCenter = utils.flexCenter;
|
|
43
|
-
exports.focus = utils.focus;
|
|
44
|
-
exports.focusAfter = utils.focusAfter;
|
|
45
|
-
exports.hover = utils.hover;
|
|
46
|
-
exports.iconColor = utils.iconColor;
|
|
47
|
-
exports.keyframes = utils.keyframes;
|
|
48
|
-
exports.onlyFirefox = utils.onlyFirefox;
|
|
49
|
-
exports.onlySafari = utils.onlySafari;
|
|
50
|
-
exports.onlySafariAndFirefox = utils.onlySafariAndFirefox;
|
|
51
|
-
exports.safariAndFirefoxBold = utils.safariAndFirefoxBold;
|
|
52
|
-
exports.textStyle = utils.textStyle;
|
|
53
|
-
exports.transition = utils.transition;
|
|
54
|
-
exports.truncate = utils.truncate;
|
|
55
|
-
exports.getNumberAndUnit = arithmetic.getNumberAndUnit;
|
|
56
|
-
exports.op = arithmetic.op;
|
|
57
|
-
exports.th = th.th;
|
|
58
|
-
exports.theme = theme.theme;
|
|
59
|
-
exports.styled = index.styled;
|
|
60
|
-
exports.themeProviderHOC = themeProviderHOC.themeProviderHOC;
|
|
61
|
-
Object.defineProperty(exports, 'createGlobalStyle', {
|
|
62
|
-
enumerable: true,
|
|
63
|
-
get: function () { return styled_component.createGlobalStyle; }
|
|
64
|
-
});
|
|
65
|
-
Object.defineProperty(exports, 'css', {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
get: function () { return styled_component.css; }
|
|
68
|
-
});
|
|
69
|
-
Object.defineProperty(exports, 'kfrm', {
|
|
70
|
-
enumerable: true,
|
|
71
|
-
get: function () { return styled_component.keyframes; }
|
|
72
|
-
});
|
|
73
|
-
Object.defineProperty(exports, 'useTheme', {
|
|
74
|
-
enumerable: true,
|
|
75
|
-
get: function () { return styled_component.useTheme; }
|
|
76
|
-
});
|
|
77
|
-
Object.defineProperty(exports, 'withTheme', {
|
|
78
|
-
enumerable: true,
|
|
79
|
-
get: function () { return styled_component.withTheme; }
|
|
80
|
-
});
|
|
81
|
-
Object.defineProperty(exports, 'rgba', {
|
|
82
|
-
enumerable: true,
|
|
83
|
-
get: function () { return polished.rgba; }
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var src_exports = {};
|
|
29
|
+
__export(src_exports, {
|
|
30
|
+
themeProviderHOC: () => import_themeProviderHOC.themeProviderHOC
|
|
84
31
|
});
|
|
32
|
+
var React = __toESM(require("react"));
|
|
33
|
+
__reExport(src_exports, require("./globalStyles"));
|
|
34
|
+
__reExport(src_exports, require("./spaceUtilities"));
|
|
35
|
+
__reExport(src_exports, require("./mobileUtilities"));
|
|
36
|
+
__reExport(src_exports, require("./utils"));
|
|
37
|
+
__reExport(src_exports, require("./arithmetic"));
|
|
38
|
+
__reExport(src_exports, require("./th"));
|
|
39
|
+
__reExport(src_exports, require("./theme"));
|
|
40
|
+
__reExport(src_exports, require("./styled"));
|
|
41
|
+
var import_themeProviderHOC = require("./themeProviderHOC");
|
|
42
|
+
module.exports = __toCommonJS(src_exports);
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
package/cjs/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export * from './globalStyles';\nexport * from './spaceUtilities';\nexport * from './mobileUtilities';\nexport * from './utils';\nexport * from './arithmetic';\nexport * from './th';\nexport * from './theme';\nexport * from './styled';\nexport { themeProviderHOC } from './themeProviderHOC';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc;AACd,wBAAc;AACd,wBAAc;AACd,wBAAc;AACd,wBAAc;AACd,wBAAc;AACd,wBAAc;AACd,wBAAc;AACd,8BAAiC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/cjs/mobileUtilities.js
CHANGED
|
@@ -1,41 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var mobileUtilities_exports = {};
|
|
29
|
+
__export(mobileUtilities_exports, {
|
|
30
|
+
__UNSAFE_SPACE_TO_DIMSUM: () => __UNSAFE_SPACE_TO_DIMSUM,
|
|
31
|
+
isMobile: () => isMobile,
|
|
32
|
+
toMobile: () => toMobile,
|
|
33
|
+
useIsMobile: () => useIsMobile
|
|
34
|
+
});
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_react = require("react");
|
|
37
|
+
var import_theme = require("./theme");
|
|
38
|
+
var import_constants = require("./constants");
|
|
10
39
|
function __UNSAFE_SPACE_TO_DIMSUM(unit) {
|
|
11
|
-
if (
|
|
12
|
-
|
|
40
|
+
if (import_constants.translateUnits[unit])
|
|
41
|
+
return import_constants.translateUnits[unit];
|
|
42
|
+
return `${parseFloat(unit) * (import_constants.mobileBaseFont / import_constants.desktopBaseFont) / 2}px`;
|
|
13
43
|
}
|
|
14
44
|
function toMobile(unit) {
|
|
15
|
-
if (!isMobile())
|
|
16
|
-
|
|
45
|
+
if (!isMobile())
|
|
46
|
+
return unit;
|
|
47
|
+
return `${parseFloat(unit) * (import_constants.desktopBaseFont / import_constants.mobileBaseFont)}rem`;
|
|
17
48
|
}
|
|
18
49
|
const useIsMobile = () => {
|
|
19
|
-
const [mobile, setMobile] =
|
|
20
|
-
|
|
50
|
+
const [mobile, setMobile] = (0, import_react.useState)(isMobile());
|
|
51
|
+
(0, import_react.useEffect)(() => {
|
|
21
52
|
function handleResize() {
|
|
22
53
|
setMobile(isMobile());
|
|
23
54
|
}
|
|
24
|
-
|
|
25
|
-
|
|
55
|
+
if (window)
|
|
56
|
+
window.addEventListener("resize", handleResize);
|
|
26
57
|
return () => {
|
|
27
|
-
if (window)
|
|
58
|
+
if (window)
|
|
59
|
+
window.removeEventListener("resize", handleResize);
|
|
28
60
|
};
|
|
29
61
|
}, []);
|
|
30
|
-
if (!window)
|
|
62
|
+
if (!window)
|
|
63
|
+
return false;
|
|
31
64
|
return mobile;
|
|
32
65
|
};
|
|
33
66
|
const isMobile = () => {
|
|
34
|
-
if (!window)
|
|
35
|
-
|
|
67
|
+
if (!window)
|
|
68
|
+
return false;
|
|
69
|
+
return Number(import_theme.theme.breakpoints.medium.split("px")[0]) - window.innerWidth >= 0;
|
|
36
70
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
exports.isMobile = isMobile;
|
|
40
|
-
exports.toMobile = toMobile;
|
|
41
|
-
exports.useIsMobile = useIsMobile;
|
|
71
|
+
module.exports = __toCommonJS(mobileUtilities_exports);
|
|
72
|
+
//# sourceMappingURL=mobileUtilities.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/mobileUtilities.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { useState, useEffect } from 'react';\nimport { theme } from './theme';\nimport { desktopBaseFont, mobileBaseFont, translateUnits } from './constants';\n\n// eslint-disable-next-line no-underscore-dangle\nexport function __UNSAFE_SPACE_TO_DIMSUM(unit: string): string {\n if (translateUnits[unit]) return translateUnits[unit];\n return `${(parseFloat(unit) * (mobileBaseFont / desktopBaseFont)) / 2}px`;\n}\n\nexport function toMobile(unit: string): string {\n if (!isMobile()) return unit;\n return `${parseFloat(unit) * (desktopBaseFont / mobileBaseFont)}rem`;\n}\n\nexport const useIsMobile = (): boolean => {\n const [mobile, setMobile] = useState<boolean>(isMobile());\n useEffect(() => {\n function handleResize() {\n setMobile(isMobile());\n }\n if (window) window.addEventListener('resize', handleResize);\n return () => {\n if (window) window.removeEventListener('resize', handleResize);\n };\n }, []);\n if (!window) return false;\n return mobile;\n};\n\nexport const isMobile = (): boolean => {\n if (!window) return false;\n return (\n Number(theme.breakpoints.medium.split('px')[0]) - window.innerWidth >= 0\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAoC;AACpC,mBAAsB;AACtB,uBAAgE;AAGzD,kCAAkC,MAAsB;AAC7D,MAAI,gCAAe;AAAO,WAAO,gCAAe;AAChD,SAAO,GAAI,WAAW,QAAS,mCAAiB,oCAAoB;AAAA;AAG/D,kBAAkB,MAAsB;AAC7C,MAAI,CAAC;AAAY,WAAO;AACxB,SAAO,GAAG,WAAW,QAAS,oCAAkB;AAAA;AAG3C,MAAM,cAAc,MAAe;AACxC,QAAM,CAAC,QAAQ,aAAa,2BAAkB;AAC9C,8BAAU,MAAM;AACd,4BAAwB;AACtB,gBAAU;AAAA;AAEZ,QAAI;AAAQ,aAAO,iBAAiB,UAAU;AAC9C,WAAO,MAAM;AACX,UAAI;AAAQ,eAAO,oBAAoB,UAAU;AAAA;AAAA,KAElD;AACH,MAAI,CAAC;AAAQ,WAAO;AACpB,SAAO;AAAA;AAGF,MAAM,WAAW,MAAe;AACrC,MAAI,CAAC;AAAQ,WAAO;AACpB,SACE,OAAO,mBAAM,YAAY,OAAO,MAAM,MAAM,MAAM,OAAO,cAAc;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/cjs/spaceUtilities.js
CHANGED
|
@@ -1,68 +1,94 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var spaceUtilities_exports = {};
|
|
29
|
+
__export(spaceUtilities_exports, {
|
|
30
|
+
fixSpace: () => fixSpace,
|
|
31
|
+
fixSpaceGutter: () => fixSpaceGutter,
|
|
32
|
+
mapGap: () => mapGap,
|
|
33
|
+
mapGrid: () => mapGrid,
|
|
34
|
+
mapGutter: () => mapGutter,
|
|
35
|
+
mapSpace: () => mapSpace,
|
|
36
|
+
mapTemplateGrid: () => mapTemplateGrid,
|
|
37
|
+
numbersToFr: () => numbersToFr
|
|
38
|
+
});
|
|
39
|
+
var React = __toESM(require("react"));
|
|
40
|
+
var import_lodash = require("lodash");
|
|
41
|
+
var import_theme = require("./theme");
|
|
13
42
|
function mapGap(gutter) {
|
|
14
|
-
if (!gutter)
|
|
15
|
-
|
|
16
|
-
|
|
43
|
+
if (!gutter)
|
|
44
|
+
return "0rem";
|
|
45
|
+
if (String(gutter).includes("rem") || String(gutter).includes("px"))
|
|
46
|
+
return gutter;
|
|
47
|
+
return `${import_theme.theme.space[gutter]}`;
|
|
17
48
|
}
|
|
18
49
|
function mapGutter(gutter) {
|
|
19
|
-
if (!gutter)
|
|
20
|
-
|
|
50
|
+
if (!gutter)
|
|
51
|
+
return "0rem";
|
|
52
|
+
return `${import_theme.theme.space[gutter]} * 2`;
|
|
21
53
|
}
|
|
22
54
|
function mapSpace(width) {
|
|
23
|
-
if (typeof width ===
|
|
24
|
-
|
|
55
|
+
if (typeof width === "string")
|
|
56
|
+
return (0, import_lodash.get)(import_theme.theme, width) ? `${(0, import_lodash.get)(import_theme.theme, width)}` : width;
|
|
57
|
+
return `${width * 100}%`;
|
|
25
58
|
}
|
|
26
59
|
function fixSpaceGutter(width, gutter) {
|
|
27
|
-
if (!width)
|
|
28
|
-
|
|
29
|
-
|
|
60
|
+
if (!width)
|
|
61
|
+
return "";
|
|
62
|
+
if (Array.isArray(width))
|
|
63
|
+
return width.map((w) => `calc(${mapSpace(w)} - (${mapGutter(gutter)}))`);
|
|
64
|
+
return `calc(${mapSpace(width)} - (${mapGutter(gutter)}))`;
|
|
30
65
|
}
|
|
31
66
|
function fixSpace(width) {
|
|
32
|
-
if (!width)
|
|
33
|
-
|
|
67
|
+
if (!width)
|
|
68
|
+
return "";
|
|
69
|
+
if (Array.isArray(width))
|
|
70
|
+
return width.map((w) => mapSpace(w));
|
|
34
71
|
return mapSpace(width);
|
|
35
72
|
}
|
|
36
|
-
/**
|
|
37
|
-
* Grid
|
|
38
|
-
*
|
|
39
|
-
* @param grid
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
73
|
function numbersToFr(grid) {
|
|
43
|
-
const den = grid.map(f => f < 1 ? Math.floor(1 / f) : f);
|
|
44
|
-
return den.map(d =>
|
|
74
|
+
const den = grid.map((f) => f < 1 ? Math.floor(1 / f) : f);
|
|
75
|
+
return den.map((d) => `${d}fr`);
|
|
45
76
|
}
|
|
46
77
|
function mapGrid(width) {
|
|
47
|
-
if (
|
|
48
|
-
|
|
78
|
+
if ((0, import_lodash.get)(import_theme.theme, width))
|
|
79
|
+
return `${(0, import_lodash.get)(import_theme.theme, width)}`;
|
|
80
|
+
if (typeof width === "string")
|
|
81
|
+
return width;
|
|
49
82
|
const den = width < 1 ? Math.floor(1 / width) : width;
|
|
50
|
-
return
|
|
83
|
+
return `${den}fr`;
|
|
51
84
|
}
|
|
52
85
|
function mapTemplateGrid(grid) {
|
|
53
86
|
if (Array.isArray(grid)) {
|
|
54
|
-
if (grid.some(w => typeof w ===
|
|
87
|
+
if (grid.some((w) => typeof w === "string"))
|
|
88
|
+
return grid.map((w) => mapGrid(w));
|
|
55
89
|
return numbersToFr(grid);
|
|
56
90
|
}
|
|
57
|
-
|
|
58
91
|
return mapGrid(grid);
|
|
59
92
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
exports.fixSpaceGutter = fixSpaceGutter;
|
|
63
|
-
exports.mapGap = mapGap;
|
|
64
|
-
exports.mapGrid = mapGrid;
|
|
65
|
-
exports.mapGutter = mapGutter;
|
|
66
|
-
exports.mapSpace = mapSpace;
|
|
67
|
-
exports.mapTemplateGrid = mapTemplateGrid;
|
|
68
|
-
exports.numbersToFr = numbersToFr;
|
|
93
|
+
module.exports = __toCommonJS(spaceUtilities_exports);
|
|
94
|
+
//# sourceMappingURL=spaceUtilities.js.map
|