@elliemae/ds-system 2.0.0-rc.10 → 2.0.0-rc.14

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/index.js CHANGED
@@ -47,7 +47,7 @@ exports.iconColor = utils.iconColor;
47
47
  exports.keyframes = utils.keyframes;
48
48
  exports.onlyFirefox = utils.onlyFirefox;
49
49
  exports.onlySafari = utils.onlySafari;
50
- exports.onlySafariAndFiredox = utils.onlySafariAndFiredox;
50
+ exports.onlySafariAndFirefox = utils.onlySafariAndFirefox;
51
51
  exports.safariAndFirefoxBold = utils.safariAndFirefoxBold;
52
52
  exports.textStyle = utils.textStyle;
53
53
  exports.transition = utils.transition;
@@ -3,15 +3,16 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
6
- var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
7
6
  require('core-js/modules/esnext.async-iterator.map.js');
8
7
  require('core-js/modules/esnext.iterator.map.js');
9
8
  require('core-js/modules/web.dom-collections.iterator.js');
10
- require('core-js/modules/esnext.async-iterator.for-each.js');
9
+ require('core-js/modules/esnext.async-iterator.reduce.js');
11
10
  require('core-js/modules/esnext.iterator.constructor.js');
12
- require('core-js/modules/esnext.iterator.for-each.js');
11
+ require('core-js/modules/esnext.iterator.reduce.js');
13
12
  require('core-js/modules/esnext.async-iterator.filter.js');
14
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');
15
16
  var styled_component = require('styled-components');
16
17
  var styleGetters = require('./styleGetters.js');
17
18
  var utils = require('./utils.js');
@@ -19,16 +20,13 @@ var utils = require('./utils.js');
19
20
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
20
21
 
21
22
  var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
22
- var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
23
23
  var styled_component__default = /*#__PURE__*/_interopDefaultLegacy(styled_component);
24
24
 
25
- const _excluded = ["theme"],
26
- _excluded2 = ["theme"];
27
-
28
25
  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
26
 
30
27
  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) {
28
+
29
+ const styledFunction = function (tag) {
32
30
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
33
31
  name: null,
34
32
  slot: null
@@ -37,7 +35,8 @@ const styled = function (tag) {
37
35
  name: componentName,
38
36
  slot: componentSlot
39
37
  } = options;
40
- return function (styleArg) {
38
+
39
+ const func = function (styleArg) {
41
40
  for (var _len = arguments.length, expressions = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
42
41
  expressions[_key - 1] = arguments[_key];
43
42
  }
@@ -47,16 +46,9 @@ const styled = function (tag) {
47
46
  * We just coerce with the default theme in case users
48
47
  * forget to add the ThemeProvider
49
48
  */
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) : [];
49
+ const expressionsWithDefaultTheme = expressions ? expressions.map(stylesArg => typeof stylesArg === 'function' ? props => stylesArg(_objectSpread(_objectSpread({}, props), {}, {
50
+ theme: utils.coerceWithDefaultTheme(props.theme)
51
+ })) : stylesArg) : [];
60
52
  let transformedStyleArg = styleArg;
61
53
  /*
62
54
  * Here we get the style overrides from the user
@@ -91,33 +83,42 @@ const styled = function (tag) {
91
83
  if (Array.isArray(styleArg) && numOfCustomFnsApplied > 0) {
92
84
  // Here we are adding placeholders for all the new functions that we are gonna call
93
85
  const placeholders = new Array(numOfCustomFnsApplied).fill('');
94
- transformedStyleArg = [...styleArg, ...placeholders];
95
- transformedStyleArg.raw = [...styleArg.raw, ...placeholders];
86
+ transformedStyleArg = Object.assign([...styleArg, ...placeholders], {
87
+ raw: [...styleArg.raw, ...placeholders]
88
+ });
96
89
  } else if (typeof styleArg === 'function') {
97
90
  // 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
- };
91
+ transformedStyleArg = props => styleArg(_objectSpread(_objectSpread({}, props), {}, {
92
+ theme: utils.coerceWithDefaultTheme(props.theme)
93
+ }));
94
+ }
95
+
96
+ let Component = /*#__PURE__*/styled_component__default["default"](tag);
97
+ const displayName = componentName !== null && componentSlot !== null ? "".concat(componentName).concat(componentSlot) : null;
98
+
99
+ if (displayName !== null) {
100
+ Component = Component.attrs({
101
+ className: "".concat(componentName).concat(componentSlot)
102
+ });
103
+ }
104
+
105
+ Component = Component(transformedStyleArg, ...expressionsWithDefaultTheme);
106
+
107
+ if (displayName !== null) {
108
+ Component.displayName = displayName;
108
109
  }
109
110
 
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
111
  return Component;
116
112
  };
117
- }; // Here we setup the necessary keys so we can continue using styled.button, styled.span, etc.
118
113
 
119
- Object.keys(styled_component__default["default"]).forEach(key => {
120
- styled[key] = styled(key);
121
- });
114
+ return func;
115
+ };
116
+
117
+ const styledObject = Object.keys(styled_component__default["default"]).reduce((obj, key) => {
118
+ const castedKey = key;
119
+ obj[castedKey] = styledFunction(castedKey);
120
+ return obj;
121
+ }, {});
122
+ const styled = Object.assign(styledFunction, styledObject);
122
123
 
123
124
  exports.styled = styled;
@@ -0,0 +1,12 @@
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; }
12
+ });
package/cjs/utils.js CHANGED
@@ -130,18 +130,10 @@ function transition() {
130
130
  let t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'all 1s ease';
131
131
  return "\n transition: ".concat(t, ";\n ");
132
132
  }
133
- function onlySafariAndFiredox(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);
135
- }
136
- function onlySafari(styles) {
137
- return styled_component.css(["@media not all and (min-resolution:0.001dpcm){", "}"], styles);
138
- }
139
- function onlyFirefox(styles) {
140
- return styled_component.css(["@media screen and (min--moz-device-pixel-ratio:0){", "}"], styles);
141
- }
142
- function safariAndFirefoxBold(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);
144
- }
133
+ const onlySafariAndFirefox = styles => styled_component.css(["@media not all and (min-resolution:0.001dpcm){", "}@media screen and (min--moz-device-pixel-ratio:0){", "}"], styles, styles);
134
+ const onlySafari = styles => "\n @media not all and (min-resolution: 0.001dpcm) {\n ".concat(styles, "\n }\n ");
135
+ const onlyFirefox = styles => "\n @media screen and (min--moz-device-pixel-ratio: 0) {\n ".concat(styles, "\n }\n ");
136
+ const safariAndFirefoxBold = color => "\n @media not all and (min-resolution: 0.001dpcm) {\n font-weight: 400;\n -webkit-font-smoothing: subpixel-antialiased;\n -webkit-text-stroke: 0.4px ".concat(color, ";\n }\n @media screen and (min--moz-device-pixel-ratio: 0) {\n font-weight: 400;\n -webkit-font-smoothing: subpixel-antialiased;\n -webkit-text-stroke: 0.4px ").concat(color, ";\n }\n");
145
137
 
146
138
  Object.defineProperty(exports, 'rgba', {
147
139
  enumerable: true,
@@ -185,7 +177,7 @@ exports.iconColor = iconColor;
185
177
  exports.keyframes = keyframes;
186
178
  exports.onlyFirefox = onlyFirefox;
187
179
  exports.onlySafari = onlySafari;
188
- exports.onlySafariAndFiredox = onlySafariAndFiredox;
180
+ exports.onlySafariAndFirefox = onlySafariAndFirefox;
189
181
  exports.safariAndFirefoxBold = safariAndFirefoxBold;
190
182
  exports.textStyle = textStyle;
191
183
  exports.transition = transition;
package/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export { GlobalStyles } from './globalStyles.js';
2
2
  export { fixSpace, fixSpaceGutter, mapGap, mapGrid, mapGutter, mapSpace, mapTemplateGrid, numbersToFr } from './spaceUtilities.js';
3
3
  export { __UNSAFE_SPACE_TO_DIMSUM, isMobile, toMobile, useIsMobile } from './mobileUtilities.js';
4
- export { active, animation, border, boxShadow, buttonLink, clearFocus, color, disabled, fakeActive, fakeBorder, flexCenter, focus, focusAfter, hover, iconColor, keyframes, onlyFirefox, onlySafari, onlySafariAndFiredox, safariAndFirefoxBold, textStyle, transition, truncate } from './utils.js';
4
+ export { active, animation, border, boxShadow, buttonLink, clearFocus, color, disabled, fakeActive, fakeBorder, flexCenter, focus, focusAfter, hover, iconColor, keyframes, onlyFirefox, onlySafari, onlySafariAndFirefox, safariAndFirefoxBold, textStyle, transition, truncate } from './utils.js';
5
5
  export { getNumberAndUnit, op } from './arithmetic.js';
6
6
  export { th } from './th.js';
7
7
  export { theme } from './theme.js';
@@ -1,24 +1,23 @@
1
1
  import 'core-js/modules/esnext.async-iterator.filter.js';
2
2
  import 'core-js/modules/esnext.iterator.filter.js';
3
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
4
+ import 'core-js/modules/esnext.iterator.for-each.js';
3
5
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
4
- import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
5
6
  import 'core-js/modules/esnext.async-iterator.map.js';
6
7
  import 'core-js/modules/esnext.iterator.map.js';
7
8
  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.async-iterator.reduce.js';
9
10
  import 'core-js/modules/esnext.iterator.constructor.js';
10
- import 'core-js/modules/esnext.iterator.for-each.js';
11
+ import 'core-js/modules/esnext.iterator.reduce.js';
11
12
  import styled_component from 'styled-components';
12
13
  import { getStyleOverrides, variantsResolver, getVariantStyles } from './styleGetters.js';
13
14
  import { coerceWithDefaultTheme } from './utils.js';
14
15
 
15
- const _excluded = ["theme"],
16
- _excluded2 = ["theme"];
17
-
18
16
  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
17
 
20
18
  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) {
19
+
20
+ const styledFunction = function (tag) {
22
21
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
23
22
  name: null,
24
23
  slot: null
@@ -27,7 +26,8 @@ const styled = function (tag) {
27
26
  name: componentName,
28
27
  slot: componentSlot
29
28
  } = options;
30
- return function (styleArg) {
29
+
30
+ const func = function (styleArg) {
31
31
  for (var _len = arguments.length, expressions = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
32
32
  expressions[_key - 1] = arguments[_key];
33
33
  }
@@ -37,16 +37,9 @@ const styled = function (tag) {
37
37
  * We just coerce with the default theme in case users
38
38
  * forget to add the ThemeProvider
39
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) : [];
40
+ const expressionsWithDefaultTheme = expressions ? expressions.map(stylesArg => typeof stylesArg === 'function' ? props => stylesArg(_objectSpread(_objectSpread({}, props), {}, {
41
+ theme: coerceWithDefaultTheme(props.theme)
42
+ })) : stylesArg) : [];
50
43
  let transformedStyleArg = styleArg;
51
44
  /*
52
45
  * Here we get the style overrides from the user
@@ -81,33 +74,42 @@ const styled = function (tag) {
81
74
  if (Array.isArray(styleArg) && numOfCustomFnsApplied > 0) {
82
75
  // Here we are adding placeholders for all the new functions that we are gonna call
83
76
  const placeholders = new Array(numOfCustomFnsApplied).fill('');
84
- transformedStyleArg = [...styleArg, ...placeholders];
85
- transformedStyleArg.raw = [...styleArg.raw, ...placeholders];
77
+ transformedStyleArg = Object.assign([...styleArg, ...placeholders], {
78
+ raw: [...styleArg.raw, ...placeholders]
79
+ });
86
80
  } else if (typeof styleArg === 'function') {
87
81
  // 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
- };
82
+ transformedStyleArg = props => styleArg(_objectSpread(_objectSpread({}, props), {}, {
83
+ theme: coerceWithDefaultTheme(props.theme)
84
+ }));
85
+ }
86
+
87
+ let Component = /*#__PURE__*/styled_component(tag);
88
+ const displayName = componentName !== null && componentSlot !== null ? "".concat(componentName).concat(componentSlot) : null;
89
+
90
+ if (displayName !== null) {
91
+ Component = Component.attrs({
92
+ className: "".concat(componentName).concat(componentSlot)
93
+ });
94
+ }
95
+
96
+ Component = Component(transformedStyleArg, ...expressionsWithDefaultTheme);
97
+
98
+ if (displayName !== null) {
99
+ Component.displayName = displayName;
98
100
  }
99
101
 
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
102
  return Component;
106
103
  };
107
- }; // Here we setup the necessary keys so we can continue using styled.button, styled.span, etc.
108
104
 
109
- Object.keys(styled_component).forEach(key => {
110
- styled[key] = styled(key);
111
- });
105
+ return func;
106
+ };
107
+
108
+ const styledObject = Object.keys(styled_component).reduce((obj, key) => {
109
+ const castedKey = key;
110
+ obj[castedKey] = styledFunction(castedKey);
111
+ return obj;
112
+ }, {});
113
+ const styled = Object.assign(styledFunction, styledObject);
112
114
 
113
115
  export { styled };
@@ -0,0 +1 @@
1
+ export { CSSObject } from 'styled-components';
package/esm/utils.js CHANGED
@@ -128,17 +128,9 @@ function transition() {
128
128
  let t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'all 1s ease';
129
129
  return "\n transition: ".concat(t, ";\n ");
130
130
  }
131
- function onlySafariAndFiredox(styles) {
132
- return css(["@media not all and (min-resolution:0.001dpcm){", "}@media screen and (min--moz-device-pixel-ratio:0){", "}"], styles, styles);
133
- }
134
- function onlySafari(styles) {
135
- return css(["@media not all and (min-resolution:0.001dpcm){", "}"], styles);
136
- }
137
- function onlyFirefox(styles) {
138
- return css(["@media screen and (min--moz-device-pixel-ratio:0){", "}"], styles);
139
- }
140
- function safariAndFirefoxBold(color) {
141
- return css(["@media not all and (min-resolution:0.001dpcm){font-weight:400;-webkit-font-smoothing:subpixel-antialiased;-webkit-text-stroke:0.4px ", ";}@media screen and (min--moz-device-pixel-ratio:0){font-weight:400;-webkit-font-smoothing:subpixel-antialiased;-webkit-text-stroke:0.4px ", ";}"], color, color);
142
- }
131
+ const onlySafariAndFirefox = styles => css(["@media not all and (min-resolution:0.001dpcm){", "}@media screen and (min--moz-device-pixel-ratio:0){", "}"], styles, styles);
132
+ const onlySafari = styles => "\n @media not all and (min-resolution: 0.001dpcm) {\n ".concat(styles, "\n }\n ");
133
+ const onlyFirefox = styles => "\n @media screen and (min--moz-device-pixel-ratio: 0) {\n ".concat(styles, "\n }\n ");
134
+ const safariAndFirefoxBold = color => "\n @media not all and (min-resolution: 0.001dpcm) {\n font-weight: 400;\n -webkit-font-smoothing: subpixel-antialiased;\n -webkit-text-stroke: 0.4px ".concat(color, ";\n }\n @media screen and (min--moz-device-pixel-ratio: 0) {\n font-weight: 400;\n -webkit-font-smoothing: subpixel-antialiased;\n -webkit-text-stroke: 0.4px ").concat(color, ";\n }\n");
143
135
 
144
- export { active, animation, border, boxShadow, buttonLink, clearFocus, color, disabled, fakeActive, fakeBorder, flexCenter, focus, focusAfter, hover, iconColor, keyframes, onlyFirefox, onlySafari, onlySafariAndFiredox, safariAndFirefoxBold, textStyle, transition, truncate };
136
+ export { active, animation, border, boxShadow, buttonLink, clearFocus, color, disabled, fakeActive, fakeBorder, flexCenter, focus, focusAfter, hover, iconColor, keyframes, onlyFirefox, onlySafari, onlySafariAndFirefox, safariAndFirefoxBold, textStyle, transition, truncate };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-system",
3
- "version": "2.0.0-rc.10",
3
+ "version": "2.0.0-rc.14",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - System",
6
6
  "module": "./esm/index.js",
@@ -31,6 +31,10 @@
31
31
  "import": "./esm/styled/utils.js",
32
32
  "require": "./cjs/styled/utils.js"
33
33
  },
34
+ "./styled/types": {
35
+ "import": "./esm/styled/types.js",
36
+ "require": "./cjs/styled/types.js"
37
+ },
34
38
  "./styled/styleGetters": {
35
39
  "import": "./esm/styled/styleGetters.js",
36
40
  "require": "./cjs/styled/styleGetters.js"
@@ -85,6 +89,7 @@
85
89
  "generateSubmodules": true
86
90
  },
87
91
  "dependencies": {
92
+ "@elliemae/ds-utilities": "2.0.0-rc.14",
88
93
  "polished": "~3.6.7"
89
94
  },
90
95
  "devDependencies": {
@@ -1,5 +1,5 @@
1
- export declare function getNumberAndUnit(numberStrWithUnit: string): {
1
+ export declare function getNumberAndUnit(numberStrWithUnit: string | number): {
2
2
  number: string;
3
3
  unit: string;
4
4
  };
5
- export declare function op(operator: string, n1: string, n2: string): string;
5
+ export declare function op(operator: string, n1: string, n2: string | number): string;
@@ -1,2 +1,2 @@
1
- import { Styled } from './index.d';
1
+ import { Styled } from './types';
2
2
  export declare const styled: Styled;
@@ -1,4 +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][];
1
+ import type { Theme, CSSObject } from './types';
2
+ export declare const getStyleOverrides: (name: string, theme: Theme) => CSSObject | null;
3
+ export declare const getVariantStyles: (name: string, theme: Theme) => Record<string, CSSObject>;
4
+ export declare const variantsResolver: (props: Record<string, unknown>, styles: CSSObject, theme: Theme, name: string) => CSSObject[keyof CSSObject][];
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import type { Theme as PuiTheme } from '@elliemae/pui-theme';
3
+ import { AnyStyledComponent, CSSObject, Interpolation, InterpolationFunction, StyledComponent, StyledComponentInnerAttrs, StyledComponentInnerComponent, StyledComponentInnerOtherProps, StyledComponentPropsWithRef, ThemedStyledProps } from 'styled-components';
4
+ export { CSSObject } from 'styled-components';
5
+ export interface Theme extends PuiTheme {
6
+ components?: {
7
+ [componentName: string]: {
8
+ styleOverrides?: CSSObject;
9
+ variants?: {
10
+ props: Record<string, {
11
+ toString: () => string;
12
+ }>;
13
+ style: CSSObject;
14
+ }[];
15
+ };
16
+ };
17
+ }
18
+ export declare type ThemedStyledFunctionBase<C extends keyof JSX.IntrinsicElements | React.ComponentType<any>, T extends object, O extends object = {}, A extends keyof any = never> = <U extends object = {}>(first: TemplateStringsArray | CSSObject | InterpolationFunction<ThemedStyledProps<StyledComponentPropsWithRef<C> & O & U, T>>, ...rest: Array<Interpolation<ThemedStyledProps<StyledComponentPropsWithRef<C> & O & U, T>>>) => StyledComponent<C, T, O & U, A>;
19
+ declare type ThemedStyledComponentFactories<T extends object> = {
20
+ [TTag in keyof JSX.IntrinsicElements]: ThemedStyledFunctionBase<TTag, T>;
21
+ };
22
+ export declare type StyledFunction = <C extends AnyStyledComponent | keyof JSX.IntrinsicElements | React.ComponentType<any>>(tag: C, options?: {
23
+ name: string | null;
24
+ slot: string | null;
25
+ }) => ThemedStyledFunctionBase<C extends AnyStyledComponent ? StyledComponentInnerComponent<C> : C, Theme, C extends AnyStyledComponent ? StyledComponentInnerOtherProps<C> : {}, C extends AnyStyledComponent ? StyledComponentInnerAttrs<C> : never>;
26
+ export interface StyledObject extends ThemedStyledComponentFactories<Theme> {
27
+ }
28
+ export declare type Styled = StyledFunction & StyledObject;
@@ -1,4 +1,6 @@
1
- import type { Theme } from '@elliemae/pui-theme';
1
+ import type { Theme } from './types';
2
2
  export declare const isEmpty: (string: string) => boolean;
3
3
  export declare const coerceWithDefaultTheme: (themeInput: Theme) => Theme;
4
- export declare const propsToClassKey: (props: Record<string, unknown>) => string;
4
+ export declare const propsToClassKey: (props: Record<string, {
5
+ toString: () => string;
6
+ }>) => string;
package/types/utils.d.ts CHANGED
@@ -2,7 +2,7 @@ import { rgba } from 'polished';
2
2
  import { Keyframes } from 'styled-components';
3
3
  import { css, withTheme, keyframes as kfrm, createGlobalStyle, useTheme } from 'styled-components';
4
4
  export { withTheme, createGlobalStyle, rgba, useTheme, kfrm, css };
5
- export declare function truncate(width: string): (props: any) => import("styled-components").FlattenSimpleInterpolation;
5
+ export declare function truncate(width?: string): (props: any) => import("styled-components").FlattenSimpleInterpolation;
6
6
  export declare function flexCenter(): string;
7
7
  export declare function disabled(): string;
8
8
  export declare function keyframes(obj: Record<string, unknown>): Keyframes;
@@ -21,7 +21,7 @@ export declare function fakeActive(): import("styled-components").FlattenInterpo
21
21
  export declare function clearFocus(): string;
22
22
  export declare function buttonLink(): string;
23
23
  export declare function transition(t?: string): string;
24
- export declare function onlySafariAndFiredox(styles: string): string;
25
- export declare function onlySafari(styles: string): string;
26
- export declare function onlyFirefox(styles: string): string;
27
- export declare function safariAndFirefoxBold(color: string): string;
24
+ export declare const onlySafariAndFirefox: (styles: string) => string;
25
+ export declare const onlySafari: (styles: string) => string;
26
+ export declare const onlyFirefox: (styles: string) => string;
27
+ export declare const safariAndFirefoxBold: (color: string) => string;