@elliemae/ds-system 2.2.0-next.2 → 2.2.0-next.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/cjs/th.js +14 -11
- package/esm/th.js +14 -11
- package/package.json +2 -2
- package/types/th.d.ts +12 -12
package/cjs/th.js
CHANGED
|
@@ -6,18 +6,21 @@ require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
|
6
6
|
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
7
|
require('core-js/modules/esnext.iterator.for-each.js');
|
|
8
8
|
|
|
9
|
-
const th = property => (value
|
|
10
|
-
|
|
9
|
+
const th = property => function (value) {
|
|
10
|
+
let dfault = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
11
|
+
return _ref => {
|
|
12
|
+
var _result;
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
let {
|
|
15
|
+
theme
|
|
16
|
+
} = _ref;
|
|
17
|
+
const parts = value.split('-');
|
|
18
|
+
let result = theme[property];
|
|
19
|
+
parts.forEach(part => {
|
|
20
|
+
if (result) result = result[part];
|
|
21
|
+
});
|
|
22
|
+
return (_result = result) !== null && _result !== void 0 ? _result : dfault;
|
|
23
|
+
};
|
|
21
24
|
};
|
|
22
25
|
th.space = th('space');
|
|
23
26
|
th.fontSize = th('fontSizes');
|
package/esm/th.js
CHANGED
|
@@ -2,18 +2,21 @@ import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
|
2
2
|
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
3
|
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
4
4
|
|
|
5
|
-
const th = property => (value
|
|
6
|
-
|
|
5
|
+
const th = property => function (value) {
|
|
6
|
+
let dfault = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
7
|
+
return _ref => {
|
|
8
|
+
var _result;
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
let {
|
|
11
|
+
theme
|
|
12
|
+
} = _ref;
|
|
13
|
+
const parts = value.split('-');
|
|
14
|
+
let result = theme[property];
|
|
15
|
+
parts.forEach(part => {
|
|
16
|
+
if (result) result = result[part];
|
|
17
|
+
});
|
|
18
|
+
return (_result = result) !== null && _result !== void 0 ? _result : dfault;
|
|
19
|
+
};
|
|
17
20
|
};
|
|
18
21
|
th.space = th('space');
|
|
19
22
|
th.fontSize = th('fontSizes');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-system",
|
|
3
|
-
"version": "2.2.0-next.
|
|
3
|
+
"version": "2.2.0-next.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - System",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"generateSubmodules": true
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
|
-
"@elliemae/ds-utilities": "2.2.0-next.
|
|
92
|
+
"@elliemae/ds-utilities": "2.2.0-next.6",
|
|
93
93
|
"polished": "~3.6.7"
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": {
|
package/types/th.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
declare type
|
|
2
|
-
declare type
|
|
3
|
-
space:
|
|
4
|
-
fontSize:
|
|
5
|
-
fontWeight:
|
|
6
|
-
lineHeight:
|
|
7
|
-
letterSpacing:
|
|
8
|
-
font:
|
|
9
|
-
color:
|
|
10
|
-
breakpoint:
|
|
11
|
-
media:
|
|
1
|
+
declare type ThGetter = (value: string, dfault: string) => (theme: any) => string;
|
|
2
|
+
declare type ThConstructor = ((property: string) => ThGetter) & {
|
|
3
|
+
space: ThGetter;
|
|
4
|
+
fontSize: ThGetter;
|
|
5
|
+
fontWeight: ThGetter;
|
|
6
|
+
lineHeight: ThGetter;
|
|
7
|
+
letterSpacing: ThGetter;
|
|
8
|
+
font: ThGetter;
|
|
9
|
+
color: ThGetter;
|
|
10
|
+
breakpoint: ThGetter;
|
|
11
|
+
media: ThGetter;
|
|
12
12
|
};
|
|
13
|
-
export declare const th:
|
|
13
|
+
export declare const th: ThConstructor;
|
|
14
14
|
export {};
|