@elliemae/ds-system 2.0.0-next.7 → 2.0.0-rc.10

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.
@@ -8,15 +8,18 @@ require('lodash');
8
8
  require('./theme.js');
9
9
  require('core-js/modules/web.dom-collections.iterator.js');
10
10
  require('react');
11
- var styledComponents = require('styled-components');
11
+ var styled_component = require('styled-components');
12
12
 
13
13
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
14
 
15
15
  var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefaultLegacy(_taggedTemplateLiteral);
16
16
 
17
17
  var _templateObject;
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);
18
+ const GlobalStyles = styled_component.createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral__default["default"](["\n :root, body {\n overscroll-behavior-y: none;\n\n ", "\n\n font-size: ", ";\n\n @media(min-width: ", ") {\n font-size: ", ";\n }\n\n }\n"])), props => void 0, 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');
21
24
 
22
25
  exports.GlobalStyles = GlobalStyles;
package/cjs/index.js CHANGED
@@ -7,9 +7,11 @@ var spaceUtilities = require('./spaceUtilities.js');
7
7
  var mobileUtilities = require('./mobileUtilities.js');
8
8
  var utils = require('./utils.js');
9
9
  var arithmetic = require('./arithmetic.js');
10
+ var th = require('./th.js');
10
11
  var theme = require('./theme.js');
12
+ var index = require('./styled/index.js');
11
13
  var themeProviderHOC = require('./themeProviderHOC.js');
12
- var styledComponents = require('styled-components');
14
+ var styled_component = require('styled-components');
13
15
  var polished = require('polished');
14
16
 
15
17
 
@@ -52,27 +54,29 @@ exports.transition = utils.transition;
52
54
  exports.truncate = utils.truncate;
53
55
  exports.getNumberAndUnit = arithmetic.getNumberAndUnit;
54
56
  exports.op = arithmetic.op;
57
+ exports.th = th.th;
55
58
  exports.theme = theme.theme;
59
+ exports.styled = index.styled;
56
60
  exports.themeProviderHOC = themeProviderHOC.themeProviderHOC;
57
61
  Object.defineProperty(exports, 'createGlobalStyle', {
58
62
  enumerable: true,
59
- get: function () { return styledComponents.createGlobalStyle; }
63
+ get: function () { return styled_component.createGlobalStyle; }
60
64
  });
61
65
  Object.defineProperty(exports, 'css', {
62
66
  enumerable: true,
63
- get: function () { return styledComponents.css; }
67
+ get: function () { return styled_component.css; }
64
68
  });
65
69
  Object.defineProperty(exports, 'kfrm', {
66
70
  enumerable: true,
67
- get: function () { return styledComponents.keyframes; }
71
+ get: function () { return styled_component.keyframes; }
68
72
  });
69
73
  Object.defineProperty(exports, 'useTheme', {
70
74
  enumerable: true,
71
- get: function () { return styledComponents.useTheme; }
75
+ get: function () { return styled_component.useTheme; }
72
76
  });
73
77
  Object.defineProperty(exports, 'withTheme', {
74
78
  enumerable: true,
75
- get: function () { return styledComponents.withTheme; }
79
+ get: function () { return styled_component.withTheme; }
76
80
  });
77
81
  Object.defineProperty(exports, 'rgba', {
78
82
  enumerable: true,
@@ -2,6 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ require('core-js/modules/esnext.async-iterator.map.js');
6
+ require('core-js/modules/esnext.iterator.map.js');
7
+ require('core-js/modules/esnext.async-iterator.some.js');
8
+ require('core-js/modules/esnext.iterator.constructor.js');
9
+ require('core-js/modules/esnext.iterator.some.js');
5
10
  var lodash = require('lodash');
6
11
  var theme = require('./theme.js');
7
12
 
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+
@@ -0,0 +1,123 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
6
+ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
7
+ require('core-js/modules/esnext.async-iterator.map.js');
8
+ require('core-js/modules/esnext.iterator.map.js');
9
+ require('core-js/modules/web.dom-collections.iterator.js');
10
+ require('core-js/modules/esnext.async-iterator.for-each.js');
11
+ require('core-js/modules/esnext.iterator.constructor.js');
12
+ require('core-js/modules/esnext.iterator.for-each.js');
13
+ require('core-js/modules/esnext.async-iterator.filter.js');
14
+ require('core-js/modules/esnext.iterator.filter.js');
15
+ var styled_component = require('styled-components');
16
+ var styleGetters = require('./styleGetters.js');
17
+ var utils = require('./utils.js');
18
+
19
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
20
+
21
+ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
22
+ var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
23
+ var styled_component__default = /*#__PURE__*/_interopDefaultLegacy(styled_component);
24
+
25
+ const _excluded = ["theme"],
26
+ _excluded2 = ["theme"];
27
+
28
+ 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; }
29
+
30
+ 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; }
31
+ const styled = function (tag) {
32
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
33
+ name: null,
34
+ slot: null
35
+ };
36
+ const {
37
+ name: componentName,
38
+ slot: componentSlot
39
+ } = options;
40
+ return 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' ? _ref => {
51
+ let {
52
+ theme: themeInput
53
+ } = _ref,
54
+ other = _objectWithoutProperties__default["default"](_ref, _excluded);
55
+
56
+ return stylesArg(_objectSpread({
57
+ theme: utils.coerceWithDefaultTheme(themeInput)
58
+ }, other));
59
+ } : stylesArg) : [];
60
+ let transformedStyleArg = styleArg;
61
+ /*
62
+ * Here we get the style overrides from the user
63
+ */
64
+
65
+ if (componentName && componentSlot) {
66
+ expressionsWithDefaultTheme.push(props => {
67
+ const theme = utils.coerceWithDefaultTheme(props.theme);
68
+ const styleOverrides = styleGetters.getStyleOverrides(componentName, theme);
69
+
70
+ if (styleOverrides) {
71
+ return [styleOverrides[componentSlot]];
72
+ }
73
+
74
+ return null;
75
+ });
76
+ }
77
+ /*
78
+ * Here we get the variant overrides from the user (only for the root)
79
+ */
80
+
81
+
82
+ if (componentName && componentSlot === 'root') {
83
+ expressionsWithDefaultTheme.push(props => {
84
+ const theme = utils.coerceWithDefaultTheme(props.theme);
85
+ return styleGetters.variantsResolver(props, styleGetters.getVariantStyles(componentName, theme), theme, componentName);
86
+ });
87
+ }
88
+
89
+ const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressions.length;
90
+
91
+ if (Array.isArray(styleArg) && numOfCustomFnsApplied > 0) {
92
+ // Here we are adding placeholders for all the new functions that we are gonna call
93
+ const placeholders = new Array(numOfCustomFnsApplied).fill('');
94
+ transformedStyleArg = [...styleArg, ...placeholders];
95
+ transformedStyleArg.raw = [...styleArg.raw, ...placeholders];
96
+ } else if (typeof styleArg === 'function') {
97
+ // Here we just coerce with the default theme
98
+ transformedStyleArg = _ref2 => {
99
+ let {
100
+ theme: themeInput
101
+ } = _ref2,
102
+ other = _objectWithoutProperties__default["default"](_ref2, _excluded2);
103
+
104
+ return styleArg(_objectSpread({
105
+ theme: utils.coerceWithDefaultTheme(themeInput)
106
+ }, other));
107
+ };
108
+ }
109
+
110
+ const Component = /*#__PURE__*/styled_component__default["default"](tag).attrs({
111
+ className: "".concat(componentName, "-").concat(componentSlot)
112
+ }).withConfig({
113
+ componentId: "sc-rjg4in-0"
114
+ })(transformedStyleArg, ...expressionsWithDefaultTheme);
115
+ return Component;
116
+ };
117
+ }; // Here we setup the necessary keys so we can continue using styled.button, styled.span, etc.
118
+
119
+ Object.keys(styled_component__default["default"]).forEach(key => {
120
+ styled[key] = styled(key);
121
+ });
122
+
123
+ exports.styled = styled;
@@ -0,0 +1,44 @@
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;
16
+ };
17
+ const getVariantStyles = (name, theme) => {
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) || [];
21
+ return variants.reduce((styles, definition) => {
22
+ const key = utils.propsToClassKey(definition.props);
23
+ styles[key] = definition.style;
24
+ return styles;
25
+ }, {});
26
+ };
27
+ const variantsResolver = (props, styles, theme, name) => {
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) || [];
31
+ return themeVariants.reduce((variantsStyles, themeVariant) => {
32
+ const isMatch = Object.keys(themeVariant.props).every(key => props[key] === themeVariant.props[key]);
33
+
34
+ if (isMatch) {
35
+ variantsStyles.push(styles[utils.propsToClassKey(themeVariant.props)]);
36
+ }
37
+
38
+ return variantsStyles;
39
+ }, []);
40
+ };
41
+
42
+ exports.getStyleOverrides = getStyleOverrides;
43
+ exports.getVariantStyles = getVariantStyles;
44
+ exports.variantsResolver = variantsResolver;
@@ -0,0 +1,24 @@
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
+ }
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 ADDED
@@ -0,0 +1,32 @@
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('-');
16
+ let result = theme[property];
17
+ parts.forEach(part => {
18
+ if (result) result = result[part];
19
+ });
20
+ return (_result = result) !== null && _result !== void 0 ? _result : dfault;
21
+ };
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;
@@ -2,10 +2,15 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
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');
5
10
  var _jsx2 = require('@babel/runtime/helpers/jsx');
6
11
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
7
12
  require('react');
8
- var styledComponents = require('styled-components');
13
+ var styled_component = require('styled-components');
9
14
  var theme = require('./theme.js');
10
15
  var jsxRuntime = require('react/jsx-runtime');
11
16
 
@@ -17,7 +22,7 @@ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_definePropert
17
22
  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
23
 
19
24
  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, {
25
+ const themeProviderHOC = Component => props => /*#__PURE__*/_jsx2__default["default"](styled_component.ThemeProvider, {
21
26
  theme: theme.theme
22
27
  }, void 0, /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread({}, props)));
23
28
 
package/cjs/utils.js CHANGED
@@ -6,11 +6,11 @@ var polished = require('polished');
6
6
  var lodash = require('lodash');
7
7
  var theme = require('./theme.js');
8
8
  var mobileUtilities = require('./mobileUtilities.js');
9
- var styledComponents = require('styled-components');
9
+ var styled_component = require('styled-components');
10
10
 
11
11
  /* eslint-disable no-shadow */
12
12
  function truncate(width) {
13
- return props => styledComponents.css(["", " white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"], !!width || props.width ? "width: ".concat(props.width || width, ";") : '');
13
+ return props => styled_component.css(["", " white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"], !!width || props.width ? "width: ".concat(props.width || width, ";") : '');
14
14
  }
15
15
  function flexCenter() {
16
16
  return "\n display: flex;\n justify-content: center;\n align-items: center;\n ";
@@ -19,35 +19,43 @@ function disabled() {
19
19
  return "\n cursor: not-allowed;\n pointer-events: none;\n ";
20
20
  }
21
21
  function keyframes(obj) {
22
- return styledComponents.keyframes(["", ""], lodash.reduce(obj, (result, value, key) => "\n ".concat(result, "\n ").concat(key, "% {\n ").concat(value, "\n }\n "), ''));
22
+ return styled_component.keyframes(["", ""], lodash.reduce(obj, (result, value, key) => "\n ".concat(result, "\n ").concat(key, "% {\n ").concat(value, "\n }\n "), ''));
23
23
  } // eslint-disable-next-line max-params
24
24
 
25
- function boxShadow(top, left, blur, color, inset = false) {
25
+ function boxShadow(top, left, blur, color) {
26
+ let inset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
26
27
  return "box-shadow: ".concat(inset ? 'inset' : '', " ").concat(top, " ").concat(left, " ").concat(blur, " ").concat(color, ";");
27
28
  }
28
- function color(variant = 'neutral', type = 400) {
29
- return styledComponents.css(["color:", ";"], props => props.theme.colors[variant][type]);
29
+ function color() {
30
+ let variant = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'neutral';
31
+ let type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 400;
32
+ return styled_component.css(["color:", ";"], props => props.theme.colors[variant][type]);
30
33
  }
31
- function border(color = theme.theme.colors.brand[600], size = '1px', type = 'solid') {
34
+ function border() {
35
+ let color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : theme.theme.colors.brand[600];
36
+ let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '1px';
37
+ let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'solid';
32
38
  return "".concat(size, " ").concat(type, " ").concat(color);
33
39
  }
34
40
  function animation(animationKeyframes, animationLength, animationTimingFn) {
35
- return props => styledComponents.css(["animation:", " ", " ", ";"], props.animationKeyframes || animationKeyframes, props.animationLength || animationLength, props.animationTimingFn || animationTimingFn);
41
+ return props => styled_component.css(["animation:", " ", " ", ";"], props.animationKeyframes || animationKeyframes, props.animationLength || animationLength, props.animationTimingFn || animationTimingFn);
36
42
  } // 0.0769
37
43
 
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));
44
+ function focus() {
45
+ let color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : theme.theme.colors.brand[600];
46
+ return () => styled_component.css(["outline:none;border:1px solid ", ";box-shadow:inset 0 0 0 1px ", ";border-radius:2px;"], color, polished.lighten(0.3, color));
40
47
  }
41
48
  function focusAfter(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));
49
+ return styled_component.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));
43
50
  }
44
51
  function active() {
45
- return props => styledComponents.css(["outline:none;border:1px solid ", ";border-radius:2px;"], props.theme.colors.brand[700]);
52
+ return props => styled_component.css(["outline:none;border:1px solid ", ";border-radius:2px;"], props.theme.colors.brand[700]);
46
53
  }
47
54
  function hover() {
48
- return props => styledComponents.css(["outline:1px solid ", ";outline-offset:-1px;"], props.theme.colors.brand[600]);
55
+ return props => styled_component.css(["outline:1px solid ", ";outline-offset:-1px;"], props.theme.colors.brand[600]);
49
56
  }
50
- function textStyle(type, weight = 'regular') {
57
+ function textStyle(type) {
58
+ let weight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'regular';
51
59
  // eslint-disable-next-line complexity
52
60
  return props => {
53
61
  let cssVar = "font-weight: ".concat(props.theme.fontWeights[weight], ";"); // eslint-disable-next-line default-case
@@ -101,14 +109,16 @@ function textStyle(type, weight = 'regular') {
101
109
  return cssVar;
102
110
  };
103
111
  }
104
- function iconColor(variant = 'neutral', type = 400) {
105
- return styledComponents.css(["fill:", ";"], props => props.theme.colors[variant][type]);
112
+ function iconColor() {
113
+ let variant = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'neutral';
114
+ let type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 400;
115
+ return styled_component.css(["fill:", ";"], props => props.theme.colors[variant][type]);
106
116
  }
107
117
  function fakeBorder() {
108
- return styledComponents.css(["box-shadow:inset 0 0 0 1px ", ";border-radius:2px;"], props => props.theme.colors.neutral[200]);
118
+ return styled_component.css(["box-shadow:inset 0 0 0 1px ", ";border-radius:2px;"], props => props.theme.colors.neutral[200]);
109
119
  }
110
120
  function fakeActive() {
111
- return styledComponents.css(["outline:none;box-shadow:inset 0 0 0 1px ", ";border-radius:2px;"], props => props.theme.colors.brand[700]);
121
+ return styled_component.css(["outline:none;box-shadow:inset 0 0 0 1px ", ";border-radius:2px;"], props => props.theme.colors.brand[700]);
112
122
  }
113
123
  function clearFocus() {
114
124
  return "\n border: none;\n box-shadow: none;\n ";
@@ -116,20 +126,21 @@ function clearFocus() {
116
126
  function buttonLink() {
117
127
  return "\n background-color: transparent;\n border: 1px solid transparent;\n cursor: pointer;\n ";
118
128
  }
119
- function transition(t = 'all 1s ease') {
129
+ function transition() {
130
+ let t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'all 1s ease';
120
131
  return "\n transition: ".concat(t, ";\n ");
121
132
  }
122
133
  function onlySafariAndFiredox(styles) {
123
- return styledComponents.css(["@media not all and (min-resolution:0.001dpcm){", "}@media screen and (min--moz-device-pixel-ratio:0){", "}"], styles, styles);
134
+ return styled_component.css(["@media not all and (min-resolution:0.001dpcm){", "}@media screen and (min--moz-device-pixel-ratio:0){", "}"], styles, styles);
124
135
  }
125
136
  function onlySafari(styles) {
126
- return styledComponents.css(["@media not all and (min-resolution:0.001dpcm){", "}"], styles);
137
+ return styled_component.css(["@media not all and (min-resolution:0.001dpcm){", "}"], styles);
127
138
  }
128
139
  function onlyFirefox(styles) {
129
- return styledComponents.css(["@media screen and (min--moz-device-pixel-ratio:0){", "}"], styles);
140
+ return styled_component.css(["@media screen and (min--moz-device-pixel-ratio:0){", "}"], styles);
130
141
  }
131
142
  function safariAndFirefoxBold(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);
143
+ return styled_component.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);
133
144
  }
134
145
 
135
146
  Object.defineProperty(exports, 'rgba', {
@@ -138,23 +149,23 @@ Object.defineProperty(exports, 'rgba', {
138
149
  });
139
150
  Object.defineProperty(exports, 'createGlobalStyle', {
140
151
  enumerable: true,
141
- get: function () { return styledComponents.createGlobalStyle; }
152
+ get: function () { return styled_component.createGlobalStyle; }
142
153
  });
143
154
  Object.defineProperty(exports, 'css', {
144
155
  enumerable: true,
145
- get: function () { return styledComponents.css; }
156
+ get: function () { return styled_component.css; }
146
157
  });
147
158
  Object.defineProperty(exports, 'kfrm', {
148
159
  enumerable: true,
149
- get: function () { return styledComponents.keyframes; }
160
+ get: function () { return styled_component.keyframes; }
150
161
  });
151
162
  Object.defineProperty(exports, 'useTheme', {
152
163
  enumerable: true,
153
- get: function () { return styledComponents.useTheme; }
164
+ get: function () { return styled_component.useTheme; }
154
165
  });
155
166
  Object.defineProperty(exports, 'withTheme', {
156
167
  enumerable: true,
157
- get: function () { return styledComponents.withTheme; }
168
+ get: function () { return styled_component.withTheme; }
158
169
  });
159
170
  exports.active = active;
160
171
  exports.animation = animation;
@@ -7,8 +7,11 @@ import 'react';
7
7
  import { createGlobalStyle } from 'styled-components';
8
8
 
9
9
  var _templateObject;
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);
10
+ const GlobalStyles = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n :root, body {\n overscroll-behavior-y: none;\n\n ", "\n\n font-size: ", ";\n\n @media(min-width: ", ") {\n font-size: ", ";\n }\n\n }\n"])), props => void 0, props => props.device === 'desktop' ? '13px' : '16px', _ref => {
11
+ let {
12
+ theme
13
+ } = _ref;
14
+ return theme.breakpoints.small;
15
+ }, props => props.device === 'mobile' ? '16px' : '13px');
13
16
 
14
17
  export { GlobalStyles };
package/esm/index.js CHANGED
@@ -3,7 +3,9 @@ export { fixSpace, fixSpaceGutter, mapGap, mapGrid, mapGutter, mapSpace, mapTemp
3
3
  export { __UNSAFE_SPACE_TO_DIMSUM, isMobile, toMobile, useIsMobile } from './mobileUtilities.js';
4
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
+ export { th } from './th.js';
6
7
  export { theme } from './theme.js';
8
+ export { styled } from './styled/index.js';
7
9
  export { themeProviderHOC } from './themeProviderHOC.js';
8
10
  export { createGlobalStyle, css, keyframes as kfrm, useTheme, withTheme } from 'styled-components';
9
11
  export { rgba } from 'polished';
@@ -1,3 +1,8 @@
1
+ import 'core-js/modules/esnext.async-iterator.map.js';
2
+ import 'core-js/modules/esnext.iterator.map.js';
3
+ import 'core-js/modules/esnext.async-iterator.some.js';
4
+ import 'core-js/modules/esnext.iterator.constructor.js';
5
+ import 'core-js/modules/esnext.iterator.some.js';
1
6
  import { get } from 'lodash';
2
7
  import { theme } from './theme.js';
3
8
 
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,113 @@
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.filter.js';
3
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
4
+ import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
5
+ import 'core-js/modules/esnext.async-iterator.map.js';
6
+ import 'core-js/modules/esnext.iterator.map.js';
7
+ import 'core-js/modules/web.dom-collections.iterator.js';
8
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
9
+ import 'core-js/modules/esnext.iterator.constructor.js';
10
+ import 'core-js/modules/esnext.iterator.for-each.js';
11
+ import styled_component from 'styled-components';
12
+ import { getStyleOverrides, variantsResolver, getVariantStyles } from './styleGetters.js';
13
+ import { coerceWithDefaultTheme } from './utils.js';
14
+
15
+ const _excluded = ["theme"],
16
+ _excluded2 = ["theme"];
17
+
18
+ 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; }
19
+
20
+ 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(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; }
21
+ const styled = function (tag) {
22
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
23
+ name: null,
24
+ slot: null
25
+ };
26
+ const {
27
+ name: componentName,
28
+ slot: componentSlot
29
+ } = options;
30
+ return function (styleArg) {
31
+ for (var _len = arguments.length, expressions = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
32
+ expressions[_key - 1] = arguments[_key];
33
+ }
34
+
35
+ /*
36
+ * These are the internal expression written in dimsum
37
+ * We just coerce with the default theme in case users
38
+ * forget to add the ThemeProvider
39
+ */
40
+ const expressionsWithDefaultTheme = expressions ? expressions.map(stylesArg => typeof stylesArg === 'function' ? _ref => {
41
+ let {
42
+ theme: themeInput
43
+ } = _ref,
44
+ other = _objectWithoutProperties(_ref, _excluded);
45
+
46
+ return stylesArg(_objectSpread({
47
+ theme: coerceWithDefaultTheme(themeInput)
48
+ }, other));
49
+ } : stylesArg) : [];
50
+ let transformedStyleArg = styleArg;
51
+ /*
52
+ * Here we get the style overrides from the user
53
+ */
54
+
55
+ if (componentName && componentSlot) {
56
+ expressionsWithDefaultTheme.push(props => {
57
+ const theme = coerceWithDefaultTheme(props.theme);
58
+ const styleOverrides = getStyleOverrides(componentName, theme);
59
+
60
+ if (styleOverrides) {
61
+ return [styleOverrides[componentSlot]];
62
+ }
63
+
64
+ return null;
65
+ });
66
+ }
67
+ /*
68
+ * Here we get the variant overrides from the user (only for the root)
69
+ */
70
+
71
+
72
+ if (componentName && componentSlot === 'root') {
73
+ expressionsWithDefaultTheme.push(props => {
74
+ const theme = coerceWithDefaultTheme(props.theme);
75
+ return variantsResolver(props, getVariantStyles(componentName, theme), theme, componentName);
76
+ });
77
+ }
78
+
79
+ const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressions.length;
80
+
81
+ if (Array.isArray(styleArg) && numOfCustomFnsApplied > 0) {
82
+ // Here we are adding placeholders for all the new functions that we are gonna call
83
+ const placeholders = new Array(numOfCustomFnsApplied).fill('');
84
+ transformedStyleArg = [...styleArg, ...placeholders];
85
+ transformedStyleArg.raw = [...styleArg.raw, ...placeholders];
86
+ } else if (typeof styleArg === 'function') {
87
+ // Here we just coerce with the default theme
88
+ transformedStyleArg = _ref2 => {
89
+ let {
90
+ theme: themeInput
91
+ } = _ref2,
92
+ other = _objectWithoutProperties(_ref2, _excluded2);
93
+
94
+ return styleArg(_objectSpread({
95
+ theme: coerceWithDefaultTheme(themeInput)
96
+ }, other));
97
+ };
98
+ }
99
+
100
+ const Component = /*#__PURE__*/styled_component(tag).attrs({
101
+ className: "".concat(componentName, "-").concat(componentSlot)
102
+ }).withConfig({
103
+ componentId: "sc-rjg4in-0"
104
+ })(transformedStyleArg, ...expressionsWithDefaultTheme);
105
+ return Component;
106
+ };
107
+ }; // Here we setup the necessary keys so we can continue using styled.button, styled.span, etc.
108
+
109
+ Object.keys(styled_component).forEach(key => {
110
+ styled[key] = styled(key);
111
+ });
112
+
113
+ export { styled };
@@ -0,0 +1,38 @@
1
+ import 'core-js/modules/esnext.async-iterator.reduce.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.reduce.js';
4
+ import 'core-js/modules/esnext.async-iterator.every.js';
5
+ import 'core-js/modules/esnext.iterator.every.js';
6
+ import { propsToClassKey } from './utils.js';
7
+
8
+ const getStyleOverrides = (name, theme) => {
9
+ var _theme$components, _theme$components$nam;
10
+
11
+ 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;
12
+ };
13
+ const getVariantStyles = (name, theme) => {
14
+ var _theme$components2, _theme$components2$na;
15
+
16
+ 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) || [];
17
+ return variants.reduce((styles, definition) => {
18
+ const key = propsToClassKey(definition.props);
19
+ styles[key] = definition.style;
20
+ return styles;
21
+ }, {});
22
+ };
23
+ const variantsResolver = (props, styles, theme, name) => {
24
+ var _theme$components3, _theme$components3$na;
25
+
26
+ 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) || [];
27
+ return themeVariants.reduce((variantsStyles, themeVariant) => {
28
+ const isMatch = Object.keys(themeVariant.props).every(key => props[key] === themeVariant.props[key]);
29
+
30
+ if (isMatch) {
31
+ variantsStyles.push(styles[propsToClassKey(themeVariant.props)]);
32
+ }
33
+
34
+ return variantsStyles;
35
+ }, []);
36
+ };
37
+
38
+ export { getStyleOverrides, getVariantStyles, variantsResolver };
@@ -0,0 +1,18 @@
1
+ import 'core-js/modules/esnext.async-iterator.reduce.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.reduce.js';
4
+ import { capitalize } from '@elliemae/ds-utilities';
5
+ import { theme } from '../theme.js';
6
+
7
+ const systemTheme = theme;
8
+ const isEmpty = string => string.length === 0;
9
+ const coerceWithDefaultTheme = themeInput => themeInput !== null && themeInput !== void 0 ? themeInput : systemTheme;
10
+ const propsToClassKey = props => Object.keys(props).sort().reduce((classKey, key) => {
11
+ if (key === 'color') {
12
+ return classKey + isEmpty(String(classKey)) ? String(props[key]) : capitalize(String(props[key]));
13
+ }
14
+
15
+ return "".concat(classKey).concat(isEmpty(String(classKey)) ? key : capitalize(key)).concat(capitalize(props[key].toString()));
16
+ }, '');
17
+
18
+ export { coerceWithDefaultTheme, isEmpty, propsToClassKey };
package/esm/th.js ADDED
@@ -0,0 +1,28 @@
1
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.for-each.js';
4
+
5
+ const th = property => (value, dfault) => _ref => {
6
+ var _result;
7
+
8
+ let {
9
+ theme
10
+ } = _ref;
11
+ const parts = value.split('-');
12
+ let result = theme[property];
13
+ parts.forEach(part => {
14
+ if (result) result = result[part];
15
+ });
16
+ return (_result = result) !== null && _result !== void 0 ? _result : dfault;
17
+ };
18
+ th.space = th('space');
19
+ th.fontSize = th('fontSizes');
20
+ th.fontWeight = th('fontWeights');
21
+ th.lineHeight = th('lineHeights');
22
+ th.letterSpacing = th('letterSpacings');
23
+ th.font = th('fonts');
24
+ th.color = th('colors');
25
+ th.breakpoint = th('breakpoints');
26
+ th.media = th('media');
27
+
28
+ export { th };
@@ -1,3 +1,8 @@
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
1
6
  import _jsx2 from '@babel/runtime/helpers/esm/jsx';
2
7
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
8
  import 'react';
package/esm/utils.js CHANGED
@@ -20,20 +20,27 @@ function keyframes(obj) {
20
20
  return keyframes$1(["", ""], reduce(obj, (result, value, key) => "\n ".concat(result, "\n ").concat(key, "% {\n ").concat(value, "\n }\n "), ''));
21
21
  } // eslint-disable-next-line max-params
22
22
 
23
- function boxShadow(top, left, blur, color, inset = false) {
23
+ function boxShadow(top, left, blur, color) {
24
+ let inset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
24
25
  return "box-shadow: ".concat(inset ? 'inset' : '', " ").concat(top, " ").concat(left, " ").concat(blur, " ").concat(color, ";");
25
26
  }
26
- function color(variant = 'neutral', type = 400) {
27
+ function color() {
28
+ let variant = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'neutral';
29
+ let type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 400;
27
30
  return css(["color:", ";"], props => props.theme.colors[variant][type]);
28
31
  }
29
- function border(color = theme.colors.brand[600], size = '1px', type = 'solid') {
32
+ function border() {
33
+ let color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : theme.colors.brand[600];
34
+ let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '1px';
35
+ let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'solid';
30
36
  return "".concat(size, " ").concat(type, " ").concat(color);
31
37
  }
32
38
  function animation(animationKeyframes, animationLength, animationTimingFn) {
33
39
  return props => css(["animation:", " ", " ", ";"], props.animationKeyframes || animationKeyframes, props.animationLength || animationLength, props.animationTimingFn || animationTimingFn);
34
40
  } // 0.0769
35
41
 
36
- function focus(color = theme.colors.brand[600]) {
42
+ function focus() {
43
+ let color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : theme.colors.brand[600];
37
44
  return () => css(["outline:none;border:1px solid ", ";box-shadow:inset 0 0 0 1px ", ";border-radius:2px;"], color, lighten(0.3, color));
38
45
  }
39
46
  function focusAfter(color) {
@@ -45,7 +52,8 @@ function active() {
45
52
  function hover() {
46
53
  return props => css(["outline:1px solid ", ";outline-offset:-1px;"], props.theme.colors.brand[600]);
47
54
  }
48
- function textStyle(type, weight = 'regular') {
55
+ function textStyle(type) {
56
+ let weight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'regular';
49
57
  // eslint-disable-next-line complexity
50
58
  return props => {
51
59
  let cssVar = "font-weight: ".concat(props.theme.fontWeights[weight], ";"); // eslint-disable-next-line default-case
@@ -99,7 +107,9 @@ function textStyle(type, weight = 'regular') {
99
107
  return cssVar;
100
108
  };
101
109
  }
102
- function iconColor(variant = 'neutral', type = 400) {
110
+ function iconColor() {
111
+ let variant = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'neutral';
112
+ let type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 400;
103
113
  return css(["fill:", ";"], props => props.theme.colors[variant][type]);
104
114
  }
105
115
  function fakeBorder() {
@@ -114,7 +124,8 @@ function clearFocus() {
114
124
  function buttonLink() {
115
125
  return "\n background-color: transparent;\n border: 1px solid transparent;\n cursor: pointer;\n ";
116
126
  }
117
- function transition(t = 'all 1s ease') {
127
+ function transition() {
128
+ let t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'all 1s ease';
118
129
  return "\n transition: ".concat(t, ";\n ");
119
130
  }
120
131
  function onlySafariAndFiredox(styles) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-system",
3
- "version": "2.0.0-next.7",
3
+ "version": "2.0.0-rc.10",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - System",
6
6
  "module": "./esm/index.js",
@@ -23,6 +23,22 @@
23
23
  "import": "./esm/theme.js",
24
24
  "require": "./cjs/theme.js"
25
25
  },
26
+ "./th": {
27
+ "import": "./esm/th.js",
28
+ "require": "./cjs/th.js"
29
+ },
30
+ "./styled/utils": {
31
+ "import": "./esm/styled/utils.js",
32
+ "require": "./cjs/styled/utils.js"
33
+ },
34
+ "./styled/styleGetters": {
35
+ "import": "./esm/styled/styleGetters.js",
36
+ "require": "./cjs/styled/styleGetters.js"
37
+ },
38
+ "./styled": {
39
+ "import": "./esm/styled/index.js",
40
+ "require": "./cjs/styled/index.js"
41
+ },
26
42
  "./spaceUtilities": {
27
43
  "import": "./esm/spaceUtilities.js",
28
44
  "require": "./cjs/spaceUtilities.js"
@@ -72,16 +88,15 @@
72
88
  "polished": "~3.6.7"
73
89
  },
74
90
  "devDependencies": {
75
- "@elliemae/pui-theme": "~2.2.4",
76
- "styled-components": "~5.3.1",
77
- "styled-system": "~5.1.5"
91
+ "@elliemae/pui-theme": "~2.2.5",
92
+ "@testing-library/jest-dom": "~5.15.0",
93
+ "styled-components": "~5.3.3"
78
94
  },
79
95
  "peerDependencies": {
80
- "@elliemae/pui-theme": "^2.2.4",
96
+ "@elliemae/pui-theme": "^2.2.5",
81
97
  "lodash": "^4.17.21",
82
98
  "react": "~17.0.2",
83
99
  "react-dom": "^17.0.2",
84
- "styled-components": "^5.3.1",
85
- "styled-system": "^5.1.5"
100
+ "styled-components": "^5.3.3"
86
101
  }
87
102
  }
package/types/index.d.ts CHANGED
@@ -3,5 +3,7 @@ export * from './spaceUtilities';
3
3
  export * from './mobileUtilities';
4
4
  export * from './utils';
5
5
  export * from './arithmetic';
6
+ export * from './th';
6
7
  export * from './theme';
8
+ export * from './styled';
7
9
  export { themeProviderHOC } from './themeProviderHOC';
@@ -0,0 +1,2 @@
1
+ import { Styled } from './index.d';
2
+ export declare const styled: Styled;
@@ -0,0 +1,4 @@
1
+ import type { StyleObject, Theme } from './index.d';
2
+ export declare const getStyleOverrides: (name: string, theme: Theme) => StyleObject;
3
+ export declare const getVariantStyles: (name: string, theme: Theme) => Record<string, string>;
4
+ export declare const variantsResolver: (props: Record<string, unknown>, styles: StyleObject, theme: Theme, name: string) => StyleObject[keyof StyleObject][];
@@ -0,0 +1,4 @@
1
+ import type { Theme } from '@elliemae/pui-theme';
2
+ export declare const isEmpty: (string: string) => boolean;
3
+ export declare const coerceWithDefaultTheme: (themeInput: Theme) => Theme;
4
+ export declare const propsToClassKey: (props: Record<string, unknown>) => string;
package/types/th.d.ts ADDED
@@ -0,0 +1,14 @@
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
+ };
13
+ export declare const th: thConstructor;
14
+ export {};
package/types/utils.d.ts CHANGED
@@ -7,17 +7,17 @@ export declare function flexCenter(): string;
7
7
  export declare function disabled(): string;
8
8
  export declare function keyframes(obj: Record<string, unknown>): Keyframes;
9
9
  export declare function boxShadow(top: string, left: string, blur: string, color: string, inset?: boolean): string;
10
- export declare function color(variant?: string, type?: number): import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<any>>;
10
+ export declare function color(variant?: string, type?: number): import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<import("styled-components").DefaultTheme>>;
11
11
  export declare function border(color?: string, size?: string, type?: string): string;
12
12
  export declare function animation(animationKeyframes: string, animationLength: string, animationTimingFn: string): (props: any) => import("styled-components").FlattenSimpleInterpolation;
13
13
  export declare function focus(color?: string): () => import("styled-components").FlattenSimpleInterpolation;
14
- export declare function focusAfter(color: string): import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<any>>;
14
+ export declare function focusAfter(color: string): import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<import("styled-components").DefaultTheme>>;
15
15
  export declare function active(): (props: any) => import("styled-components").FlattenSimpleInterpolation;
16
16
  export declare function hover(): (props: any) => import("styled-components").FlattenSimpleInterpolation;
17
17
  export declare function textStyle(type: string, weight?: string): (props: any) => string;
18
- export declare function iconColor(variant?: string, type?: number): import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<any>>;
19
- export declare function fakeBorder(): import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<any>>;
20
- export declare function fakeActive(): import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<any>>;
18
+ export declare function iconColor(variant?: string, type?: number): import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<import("styled-components").DefaultTheme>>;
19
+ export declare function fakeBorder(): import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<import("styled-components").DefaultTheme>>;
20
+ export declare function fakeActive(): import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<import("styled-components").DefaultTheme>>;
21
21
  export declare function clearFocus(): string;
22
22
  export declare function buttonLink(): string;
23
23
  export declare function transition(t?: string): string;