@elliemae/ds-system 2.2.0-alpha.3 → 3.0.0-next.0
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 +30 -42
- package/cjs/constants.js +15 -43
- package/cjs/globalStyles.js +22 -44
- package/cjs/index.js +83 -42
- package/cjs/mobileUtilities.js +26 -57
- package/cjs/spaceUtilities.js +46 -72
- package/cjs/styled/index.d.js +2 -27
- package/cjs/styled/index.js +93 -57
- package/cjs/styled/styleGetters.js +30 -42
- package/cjs/styled/types.js +11 -34
- package/cjs/styled/utils.js +23 -46
- package/cjs/th.js +29 -49
- package/cjs/theme.js +9 -36
- package/cjs/themeProviderHOC.js +29 -42
- package/cjs/utils.js +146 -257
- package/esm/arithmetic.js +25 -13
- package/esm/constants.js +9 -14
- package/esm/globalStyles.js +15 -16
- package/esm/index.js +11 -14
- package/esm/mobileUtilities.js +17 -26
- package/esm/spaceUtilities.js +35 -43
- package/esm/styled/index.d.js +1 -2
- package/esm/styled/index.js +79 -23
- package/esm/styled/styleGetters.js +23 -12
- package/esm/styled/types.js +1 -6
- package/esm/styled/utils.js +16 -16
- package/esm/th.js +25 -20
- package/esm/theme.js +4 -6
- package/esm/themeProviderHOC.js +20 -13
- package/esm/utils.js +98 -228
- package/package.json +2 -2
- package/cjs/arithmetic.js.map +0 -7
- package/cjs/constants.js.map +0 -7
- package/cjs/globalStyles.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/mobileUtilities.js.map +0 -7
- package/cjs/spaceUtilities.js.map +0 -7
- package/cjs/styled/index.d.js.map +0 -7
- package/cjs/styled/index.js.map +0 -7
- package/cjs/styled/styleGetters.js.map +0 -7
- package/cjs/styled/types.js.map +0 -7
- package/cjs/styled/utils.js.map +0 -7
- package/cjs/th.js.map +0 -7
- package/cjs/theme.js.map +0 -7
- package/cjs/themeProviderHOC.js.map +0 -7
- package/cjs/utils.js.map +0 -7
- package/esm/arithmetic.js.map +0 -7
- package/esm/constants.js.map +0 -7
- package/esm/globalStyles.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/mobileUtilities.js.map +0 -7
- package/esm/spaceUtilities.js.map +0 -7
- package/esm/styled/index.d.js.map +0 -7
- package/esm/styled/index.js.map +0 -7
- package/esm/styled/styleGetters.js.map +0 -7
- package/esm/styled/types.js.map +0 -7
- package/esm/styled/utils.js.map +0 -7
- package/esm/th.js.map +0 -7
- package/esm/theme.js.map +0 -7
- package/esm/themeProviderHOC.js.map +0 -7
- package/esm/utils.js.map +0 -7
package/cjs/styled/index.js
CHANGED
|
@@ -1,89 +1,125 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
8
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
9
|
+
require('core-js/modules/esnext.async-iterator.reduce.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
11
|
+
require('core-js/modules/esnext.iterator.reduce.js');
|
|
12
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
13
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
14
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
15
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
16
|
+
var styled_component = require('styled-components');
|
|
17
|
+
var styleGetters = require('./styleGetters.js');
|
|
18
|
+
var utils = require('./utils.js');
|
|
19
|
+
|
|
20
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
21
|
+
|
|
22
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
23
|
+
var styled_component__default = /*#__PURE__*/_interopDefaultLegacy(styled_component);
|
|
24
|
+
|
|
25
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
26
|
+
|
|
27
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
28
|
+
|
|
29
|
+
const styledFunction = function (tag) {
|
|
30
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
31
|
+
name: null,
|
|
32
|
+
slot: null
|
|
26
33
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
const {
|
|
35
|
+
name: componentName,
|
|
36
|
+
slot: componentSlot,
|
|
37
|
+
displayName: componentDisplayName = null
|
|
38
|
+
} = options;
|
|
39
|
+
|
|
40
|
+
const func = function (styleArg) {
|
|
41
|
+
for (var _len = arguments.length, expressions = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
42
|
+
expressions[_key - 1] = arguments[_key];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/*
|
|
46
|
+
* These are the internal expression written in dimsum
|
|
47
|
+
* We just coerce with the default theme in case users
|
|
48
|
+
* forget to add the ThemeProvider
|
|
49
|
+
*/
|
|
50
|
+
const expressionsWithDefaultTheme = expressions ? expressions.map(stylesArg => typeof stylesArg === 'function' ? props => stylesArg(_objectSpread(_objectSpread({}, props), {}, {
|
|
51
|
+
theme: utils.coerceWithDefaultTheme(props.theme)
|
|
52
|
+
})) : stylesArg) : [];
|
|
43
53
|
let transformedStyleArg = styleArg;
|
|
54
|
+
/*
|
|
55
|
+
* Here we get the style overrides from the user
|
|
56
|
+
*/
|
|
57
|
+
|
|
44
58
|
if (componentName && componentSlot) {
|
|
45
|
-
expressionsWithDefaultTheme.push(
|
|
46
|
-
const theme =
|
|
47
|
-
const styleOverrides =
|
|
59
|
+
expressionsWithDefaultTheme.push(props => {
|
|
60
|
+
const theme = utils.coerceWithDefaultTheme(props.theme);
|
|
61
|
+
const styleOverrides = styleGetters.getStyleOverrides(componentName, theme);
|
|
62
|
+
|
|
48
63
|
if (styleOverrides) {
|
|
49
64
|
return [styleOverrides[componentSlot]];
|
|
50
65
|
}
|
|
66
|
+
|
|
51
67
|
return null;
|
|
52
68
|
});
|
|
53
69
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
70
|
+
/*
|
|
71
|
+
* Here we get the variant overrides from the user (only for the root)
|
|
72
|
+
*/
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
if (componentName && componentSlot === 'root') {
|
|
76
|
+
expressionsWithDefaultTheme.push(props => {
|
|
77
|
+
const theme = utils.coerceWithDefaultTheme(props.theme);
|
|
78
|
+
return styleGetters.variantsResolver(props, styleGetters.getVariantStyles(componentName, theme), theme, componentName);
|
|
58
79
|
});
|
|
59
80
|
}
|
|
81
|
+
|
|
60
82
|
const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressions.length;
|
|
83
|
+
|
|
61
84
|
if (Array.isArray(styleArg) && numOfCustomFnsApplied > 0) {
|
|
62
|
-
|
|
85
|
+
// Here we are adding placeholders for all the new functions that we are gonna call
|
|
86
|
+
const placeholders = new Array(numOfCustomFnsApplied).fill('');
|
|
63
87
|
transformedStyleArg = Object.assign([...styleArg, ...placeholders], {
|
|
64
88
|
raw: [...styleArg.raw, ...placeholders]
|
|
65
89
|
});
|
|
66
|
-
} else if (typeof styleArg ===
|
|
67
|
-
|
|
90
|
+
} else if (typeof styleArg === 'function') {
|
|
91
|
+
// Here we just coerce with the default theme
|
|
92
|
+
transformedStyleArg = props => styleArg(_objectSpread(_objectSpread({}, props), {}, {
|
|
93
|
+
theme: utils.coerceWithDefaultTheme(props.theme)
|
|
94
|
+
}));
|
|
68
95
|
}
|
|
69
|
-
|
|
70
|
-
|
|
96
|
+
|
|
97
|
+
let Component = /*#__PURE__*/styled_component__default["default"](tag);
|
|
98
|
+
const displayName = componentName !== null && componentSlot !== null ? "".concat(componentName, "-").concat(componentSlot) : componentDisplayName;
|
|
99
|
+
|
|
71
100
|
if (displayName !== null) {
|
|
72
|
-
Component = Component.attrs({
|
|
101
|
+
Component = Component.attrs({
|
|
102
|
+
className: "".concat(componentName, "-").concat(componentSlot)
|
|
103
|
+
});
|
|
73
104
|
}
|
|
105
|
+
|
|
74
106
|
Component = Component(transformedStyleArg, ...expressionsWithDefaultTheme);
|
|
107
|
+
|
|
75
108
|
if (displayName !== null) {
|
|
76
109
|
Component.displayName = displayName;
|
|
77
110
|
}
|
|
111
|
+
|
|
78
112
|
return Component;
|
|
79
113
|
};
|
|
114
|
+
|
|
80
115
|
return func;
|
|
81
116
|
};
|
|
82
|
-
|
|
117
|
+
|
|
118
|
+
const styledObject = Object.keys(styled_component__default["default"]).reduce((obj, key) => {
|
|
83
119
|
const castedKey = key;
|
|
84
120
|
obj[castedKey] = styledFunction(castedKey);
|
|
85
121
|
return obj;
|
|
86
122
|
}, {});
|
|
87
123
|
const styled = Object.assign(styledFunction, styledObject);
|
|
88
|
-
|
|
89
|
-
|
|
124
|
+
|
|
125
|
+
exports.styled = styled;
|
|
@@ -1,56 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.reduce.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.reduce.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.every.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.every.js');
|
|
10
|
+
var utils = require('./utils.js');
|
|
11
|
+
|
|
12
|
+
const getStyleOverrides = (name, theme) => {
|
|
13
|
+
var _theme$components, _theme$components$nam;
|
|
14
|
+
|
|
15
|
+
return ((_theme$components = theme.components) === null || _theme$components === void 0 ? void 0 : (_theme$components$nam = _theme$components[name]) === null || _theme$components$nam === void 0 ? void 0 : _theme$components$nam.styleOverrides) || null;
|
|
11
16
|
};
|
|
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 styleGetters_exports = {};
|
|
29
|
-
__export(styleGetters_exports, {
|
|
30
|
-
getStyleOverrides: () => getStyleOverrides,
|
|
31
|
-
getVariantStyles: () => getVariantStyles,
|
|
32
|
-
variantsResolver: () => variantsResolver
|
|
33
|
-
});
|
|
34
|
-
var React = __toESM(require("react"));
|
|
35
|
-
var import_utils = __toESM(require("./utils"));
|
|
36
|
-
const getStyleOverrides = (name, theme) => theme.components?.[name]?.styleOverrides || null;
|
|
37
17
|
const getVariantStyles = (name, theme) => {
|
|
38
|
-
|
|
18
|
+
var _theme$components2, _theme$components2$na;
|
|
19
|
+
|
|
20
|
+
const variants = ((_theme$components2 = theme.components) === null || _theme$components2 === void 0 ? void 0 : (_theme$components2$na = _theme$components2[name]) === null || _theme$components2$na === void 0 ? void 0 : _theme$components2$na.variants) || [];
|
|
39
21
|
return variants.reduce((styles, definition) => {
|
|
40
|
-
const key =
|
|
22
|
+
const key = utils.propsToClassKey(definition.props);
|
|
41
23
|
styles[key] = definition.style;
|
|
42
24
|
return styles;
|
|
43
25
|
}, {});
|
|
44
26
|
};
|
|
45
27
|
const variantsResolver = (props, styles, theme, name) => {
|
|
46
|
-
|
|
28
|
+
var _theme$components3, _theme$components3$na;
|
|
29
|
+
|
|
30
|
+
const themeVariants = (theme === null || theme === void 0 ? void 0 : (_theme$components3 = theme.components) === null || _theme$components3 === void 0 ? void 0 : (_theme$components3$na = _theme$components3[name]) === null || _theme$components3$na === void 0 ? void 0 : _theme$components3$na.variants) || [];
|
|
47
31
|
return themeVariants.reduce((variantsStyles, themeVariant) => {
|
|
48
|
-
const isMatch = Object.keys(themeVariant.props).every(
|
|
32
|
+
const isMatch = Object.keys(themeVariant.props).every(key => props[key] === themeVariant.props[key]);
|
|
33
|
+
|
|
49
34
|
if (isMatch) {
|
|
50
|
-
variantsStyles.push(styles[
|
|
35
|
+
variantsStyles.push(styles[utils.propsToClassKey(themeVariant.props)]);
|
|
51
36
|
}
|
|
37
|
+
|
|
52
38
|
return variantsStyles;
|
|
53
39
|
}, []);
|
|
54
40
|
};
|
|
55
|
-
|
|
56
|
-
|
|
41
|
+
|
|
42
|
+
exports.getStyleOverrides = getStyleOverrides;
|
|
43
|
+
exports.getVariantStyles = getVariantStyles;
|
|
44
|
+
exports.variantsResolver = variantsResolver;
|
package/cjs/styled/types.js
CHANGED
|
@@ -1,35 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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 types_exports = {};
|
|
29
|
-
__export(types_exports, {
|
|
30
|
-
CSSObject: () => import_styled_components2.CSSObject
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var styled_component = require('styled-components');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, 'CSSObject', {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return styled_component.CSSObject; }
|
|
31
12
|
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
var import_styled_components2 = __toESM(require("styled-components"));
|
|
34
|
-
module.exports = __toCommonJS(types_exports);
|
|
35
|
-
//# sourceMappingURL=types.js.map
|
package/cjs/styled/utils.js
CHANGED
|
@@ -1,47 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.reduce.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.reduce.js');
|
|
8
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
9
|
+
var theme = require('../theme.js');
|
|
10
|
+
|
|
11
|
+
const systemTheme = theme.theme;
|
|
12
|
+
const isEmpty = string => string.length === 0;
|
|
13
|
+
const coerceWithDefaultTheme = themeInput => themeInput !== null && themeInput !== void 0 ? themeInput : systemTheme;
|
|
14
|
+
const propsToClassKey = props => Object.keys(props).sort().reduce((classKey, key) => {
|
|
15
|
+
if (key === 'color') {
|
|
16
|
+
return classKey + isEmpty(String(classKey)) ? String(props[key]) : dsUtilities.capitalize(String(props[key]));
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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 utils_exports = {};
|
|
29
|
-
__export(utils_exports, {
|
|
30
|
-
coerceWithDefaultTheme: () => coerceWithDefaultTheme,
|
|
31
|
-
isEmpty: () => isEmpty,
|
|
32
|
-
propsToClassKey: () => propsToClassKey
|
|
33
|
-
});
|
|
34
|
-
var React = __toESM(require("react"));
|
|
35
|
-
var import_ds_utilities = __toESM(require("@elliemae/ds-utilities"));
|
|
36
|
-
var import_theme = __toESM(require("../theme"));
|
|
37
|
-
const systemTheme = import_theme.theme;
|
|
38
|
-
const isEmpty = (string) => string.length === 0;
|
|
39
|
-
const coerceWithDefaultTheme = (themeInput) => themeInput ?? systemTheme;
|
|
40
|
-
const propsToClassKey = (props) => Object.keys(props).sort().reduce((classKey, key) => {
|
|
41
|
-
if (key === "color") {
|
|
42
|
-
return classKey + isEmpty(String(classKey)) ? String(props[key]) : (0, import_ds_utilities.capitalize)(String(props[key]));
|
|
43
|
-
}
|
|
44
|
-
return `${classKey}${isEmpty(String(classKey)) ? key : (0, import_ds_utilities.capitalize)(key)}${(0, import_ds_utilities.capitalize)(props[key].toString())}`;
|
|
45
|
-
}, "");
|
|
46
|
-
module.exports = __toCommonJS(utils_exports);
|
|
47
|
-
//# sourceMappingURL=utils.js.map
|
|
18
|
+
|
|
19
|
+
return "".concat(classKey).concat(isEmpty(String(classKey)) ? key : dsUtilities.capitalize(key)).concat(dsUtilities.capitalize(props[key].toString()));
|
|
20
|
+
}, '');
|
|
21
|
+
|
|
22
|
+
exports.coerceWithDefaultTheme = coerceWithDefaultTheme;
|
|
23
|
+
exports.isEmpty = isEmpty;
|
|
24
|
+
exports.propsToClassKey = propsToClassKey;
|
package/cjs/th.js
CHANGED
|
@@ -1,52 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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 th_exports = {};
|
|
29
|
-
__export(th_exports, {
|
|
30
|
-
th: () => th
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
const th = (property) => (value, dfault) => ({ theme }) => {
|
|
34
|
-
const parts = value.split("-");
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
8
|
+
|
|
9
|
+
const th = property => (value, dfault) => _ref => {
|
|
10
|
+
var _result;
|
|
11
|
+
|
|
12
|
+
let {
|
|
13
|
+
theme
|
|
14
|
+
} = _ref;
|
|
15
|
+
const parts = value.split('-');
|
|
35
16
|
let result = theme[property];
|
|
36
|
-
parts.forEach(
|
|
37
|
-
if (result)
|
|
38
|
-
result = result[part];
|
|
17
|
+
parts.forEach(part => {
|
|
18
|
+
if (result) result = result[part];
|
|
39
19
|
});
|
|
40
|
-
return result
|
|
20
|
+
return (_result = result) !== null && _result !== void 0 ? _result : dfault;
|
|
41
21
|
};
|
|
42
|
-
th.space = th(
|
|
43
|
-
th.fontSize = th(
|
|
44
|
-
th.fontWeight = th(
|
|
45
|
-
th.lineHeight = th(
|
|
46
|
-
th.letterSpacing = th(
|
|
47
|
-
th.font = th(
|
|
48
|
-
th.color = th(
|
|
49
|
-
th.breakpoint = th(
|
|
50
|
-
th.media = th(
|
|
51
|
-
|
|
52
|
-
|
|
22
|
+
th.space = th('space');
|
|
23
|
+
th.fontSize = th('fontSizes');
|
|
24
|
+
th.fontWeight = th('fontWeights');
|
|
25
|
+
th.lineHeight = th('lineHeights');
|
|
26
|
+
th.letterSpacing = th('letterSpacings');
|
|
27
|
+
th.font = th('fonts');
|
|
28
|
+
th.color = th('colors');
|
|
29
|
+
th.breakpoint = th('breakpoints');
|
|
30
|
+
th.media = th('media');
|
|
31
|
+
|
|
32
|
+
exports.th = th;
|
package/cjs/theme.js
CHANGED
|
@@ -1,36 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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 theme_exports = {};
|
|
29
|
-
__export(theme_exports, {
|
|
30
|
-
theme: () => theme
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
var import_pui_theme = __toESM(require("@elliemae/pui-theme"));
|
|
34
|
-
const theme = (0, import_pui_theme.getDefaultTheme)();
|
|
35
|
-
module.exports = __toCommonJS(theme_exports);
|
|
36
|
-
//# sourceMappingURL=theme.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var puiTheme = require('@elliemae/pui-theme');
|
|
6
|
+
|
|
7
|
+
const theme = puiTheme.getDefaultTheme();
|
|
8
|
+
|
|
9
|
+
exports.theme = theme;
|
package/cjs/themeProviderHOC.js
CHANGED
|
@@ -1,42 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
themeProviderHOC: () => themeProviderHOC
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
var import_react = __toESM(require("react"));
|
|
34
|
-
var import_styled_components = __toESM(require("styled-components"));
|
|
35
|
-
var import_theme = __toESM(require("./theme"));
|
|
36
|
-
const themeProviderHOC = (Component) => (props) => /* @__PURE__ */ import_react.default.createElement(import_styled_components.ThemeProvider, {
|
|
37
|
-
theme: import_theme.theme
|
|
38
|
-
}, /* @__PURE__ */ import_react.default.createElement(Component, {
|
|
39
|
-
...props
|
|
40
|
-
}));
|
|
41
|
-
module.exports = __toCommonJS(themeProviderHOC_exports);
|
|
42
|
-
//# sourceMappingURL=themeProviderHOC.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
10
|
+
var _jsx2 = require('@babel/runtime/helpers/jsx');
|
|
11
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
12
|
+
require('react');
|
|
13
|
+
var styled_component = require('styled-components');
|
|
14
|
+
var theme = require('./theme.js');
|
|
15
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
16
|
+
|
|
17
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
|
+
|
|
19
|
+
var _jsx2__default = /*#__PURE__*/_interopDefaultLegacy(_jsx2);
|
|
20
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
21
|
+
|
|
22
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
23
|
+
|
|
24
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
25
|
+
const themeProviderHOC = Component => props => /*#__PURE__*/_jsx2__default["default"](styled_component.ThemeProvider, {
|
|
26
|
+
theme: theme.theme
|
|
27
|
+
}, void 0, /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread({}, props)));
|
|
28
|
+
|
|
29
|
+
exports.themeProviderHOC = themeProviderHOC;
|