@elliemae/ds-system 3.0.0-next.2 → 3.0.0-next.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/dist/cjs/arithmetic.js +55 -0
  2. package/dist/cjs/arithmetic.js.map +7 -0
  3. package/dist/cjs/constants.js +47 -0
  4. package/dist/cjs/constants.js.map +7 -0
  5. package/dist/cjs/globalStyles.js +47 -0
  6. package/dist/cjs/globalStyles.js.map +7 -0
  7. package/dist/cjs/index.js +43 -0
  8. package/dist/cjs/index.js.map +7 -0
  9. package/dist/cjs/mobileUtilities.js +72 -0
  10. package/dist/cjs/mobileUtilities.js.map +7 -0
  11. package/dist/cjs/spaceUtilities.js +94 -0
  12. package/dist/cjs/spaceUtilities.js.map +7 -0
  13. package/dist/cjs/styled/index.d.js +27 -0
  14. package/dist/cjs/styled/index.d.js.map +7 -0
  15. package/dist/cjs/styled/index.js +105 -0
  16. package/dist/cjs/styled/index.js.map +7 -0
  17. package/dist/cjs/styled/styleGetters.js +56 -0
  18. package/dist/cjs/styled/styleGetters.js.map +7 -0
  19. package/dist/cjs/styled/types.js +35 -0
  20. package/dist/cjs/styled/types.js.map +7 -0
  21. package/dist/cjs/styled/utils.js +47 -0
  22. package/dist/cjs/styled/utils.js.map +7 -0
  23. package/dist/cjs/th.js +58 -0
  24. package/dist/cjs/th.js.map +7 -0
  25. package/dist/cjs/theme.js +36 -0
  26. package/dist/cjs/theme.js.map +7 -0
  27. package/dist/cjs/themeProviderHOC.js +54 -0
  28. package/dist/cjs/themeProviderHOC.js.map +7 -0
  29. package/dist/cjs/utils.js +294 -0
  30. package/dist/cjs/utils.js.map +7 -0
  31. package/{esm → dist/esm}/arithmetic.js +13 -25
  32. package/dist/esm/arithmetic.js.map +7 -0
  33. package/dist/esm/constants.js +18 -0
  34. package/dist/esm/constants.js.map +7 -0
  35. package/dist/esm/globalStyles.js +18 -0
  36. package/dist/esm/globalStyles.js.map +7 -0
  37. package/dist/esm/index.js +14 -0
  38. package/dist/esm/index.js.map +7 -0
  39. package/dist/esm/mobileUtilities.js +43 -0
  40. package/dist/esm/mobileUtilities.js.map +7 -0
  41. package/dist/esm/spaceUtilities.js +65 -0
  42. package/dist/esm/spaceUtilities.js.map +7 -0
  43. package/dist/esm/styled/index.d.js +2 -0
  44. package/dist/esm/styled/index.d.js.map +7 -0
  45. package/dist/esm/styled/index.js +78 -0
  46. package/dist/esm/styled/index.js.map +7 -0
  47. package/dist/esm/styled/styleGetters.js +27 -0
  48. package/dist/esm/styled/styleGetters.js.map +7 -0
  49. package/dist/esm/styled/types.js +6 -0
  50. package/dist/esm/styled/types.js.map +7 -0
  51. package/dist/esm/styled/utils.js +18 -0
  52. package/dist/esm/styled/utils.js.map +7 -0
  53. package/dist/esm/th.js +29 -0
  54. package/dist/esm/th.js.map +7 -0
  55. package/dist/esm/theme.js +7 -0
  56. package/dist/esm/theme.js.map +7 -0
  57. package/dist/esm/themeProviderHOC.js +27 -0
  58. package/dist/esm/themeProviderHOC.js.map +7 -0
  59. package/dist/esm/utils.js +265 -0
  60. package/dist/esm/utils.js.map +7 -0
  61. package/package.json +53 -44
  62. package/cjs/arithmetic.js +0 -43
  63. package/cjs/constants.js +0 -19
  64. package/cjs/globalStyles.js +0 -25
  65. package/cjs/index.js +0 -84
  66. package/cjs/mobileUtilities.js +0 -41
  67. package/cjs/spaceUtilities.js +0 -68
  68. package/cjs/styled/index.d.js +0 -2
  69. package/cjs/styled/index.js +0 -125
  70. package/cjs/styled/styleGetters.js +0 -44
  71. package/cjs/styled/types.js +0 -12
  72. package/cjs/styled/utils.js +0 -24
  73. package/cjs/th.js +0 -32
  74. package/cjs/theme.js +0 -9
  75. package/cjs/themeProviderHOC.js +0 -29
  76. package/cjs/utils.js +0 -184
  77. package/esm/constants.js +0 -13
  78. package/esm/globalStyles.js +0 -17
  79. package/esm/index.js +0 -11
  80. package/esm/mobileUtilities.js +0 -34
  81. package/esm/spaceUtilities.js +0 -57
  82. package/esm/styled/index.d.js +0 -1
  83. package/esm/styled/index.js +0 -116
  84. package/esm/styled/styleGetters.js +0 -38
  85. package/esm/styled/types.js +0 -1
  86. package/esm/styled/utils.js +0 -18
  87. package/esm/th.js +0 -28
  88. package/esm/theme.js +0 -5
  89. package/esm/themeProviderHOC.js +0 -20
  90. package/esm/utils.js +0 -136
  91. package/types/arithmetic.d.ts +0 -5
  92. package/types/constants.d.ts +0 -11
  93. package/types/globalStyles.d.ts +0 -1
  94. package/types/index.d.ts +0 -9
  95. package/types/mobileUtilities.d.ts +0 -4
  96. package/types/spaceUtilities.d.ts +0 -13
  97. package/types/styled/index.d.ts +0 -2
  98. package/types/styled/styleGetters.d.ts +0 -4
  99. package/types/styled/types.d.ts +0 -28
  100. package/types/styled/utils.d.ts +0 -6
  101. package/types/tests/arithmetic.test.d.ts +0 -1
  102. package/types/th.d.ts +0 -14
  103. package/types/theme.d.ts +0 -2
  104. package/types/themeProviderHOC.d.ts +0 -2
  105. package/types/utils.d.ts +0 -27
@@ -1,57 +0,0 @@
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';
6
- import { get } from 'lodash';
7
- import { theme } from './theme.js';
8
-
9
- function mapGap(gutter) {
10
- if (!gutter) return '0rem';
11
- if (String(gutter).includes('rem') || String(gutter).includes('px')) return gutter;
12
- return "".concat(theme.space[gutter]);
13
- }
14
- function mapGutter(gutter) {
15
- if (!gutter) return '0rem';
16
- return "".concat(theme.space[gutter], " * 2");
17
- }
18
- function mapSpace(width) {
19
- if (typeof width === 'string') return get(theme, width) ? "".concat(get(theme, width)) : width;
20
- return "".concat(width * 100, "%");
21
- }
22
- function fixSpaceGutter(width, gutter) {
23
- if (!width) return '';
24
- if (Array.isArray(width)) return width.map(w => "calc(".concat(mapSpace(w), " - (").concat(mapGutter(gutter), "))"));
25
- return "calc(".concat(mapSpace(width), " - (").concat(mapGutter(gutter), "))");
26
- }
27
- function fixSpace(width) {
28
- if (!width) return '';
29
- if (Array.isArray(width)) return width.map(w => mapSpace(w));
30
- return mapSpace(width);
31
- }
32
- /**
33
- * Grid
34
- *
35
- * @param grid
36
- */
37
-
38
- function numbersToFr(grid) {
39
- const den = grid.map(f => f < 1 ? Math.floor(1 / f) : f);
40
- return den.map(d => "".concat(d, "fr"));
41
- }
42
- function mapGrid(width) {
43
- if (get(theme, width)) return "".concat(get(theme, width));
44
- if (typeof width === 'string') return width;
45
- const den = width < 1 ? Math.floor(1 / width) : width;
46
- return "".concat(den, "fr");
47
- }
48
- function mapTemplateGrid(grid) {
49
- if (Array.isArray(grid)) {
50
- if (grid.some(w => typeof w === 'string')) return grid.map(w => mapGrid(w));
51
- return numbersToFr(grid);
52
- }
53
-
54
- return mapGrid(grid);
55
- }
56
-
57
- export { fixSpace, fixSpaceGutter, mapGap, mapGrid, mapGutter, mapSpace, mapTemplateGrid, numbersToFr };
@@ -1 +0,0 @@
1
-
@@ -1,116 +0,0 @@
1
- import 'core-js/modules/esnext.async-iterator.filter.js';
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';
5
- import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
6
- import 'core-js/modules/esnext.async-iterator.map.js';
7
- import 'core-js/modules/esnext.iterator.map.js';
8
- import 'core-js/modules/web.dom-collections.iterator.js';
9
- import 'core-js/modules/esnext.async-iterator.reduce.js';
10
- import 'core-js/modules/esnext.iterator.constructor.js';
11
- import 'core-js/modules/esnext.iterator.reduce.js';
12
- import styled_component from 'styled-components';
13
- import { getStyleOverrides, variantsResolver, getVariantStyles } from './styleGetters.js';
14
- import { coerceWithDefaultTheme } from './utils.js';
15
-
16
- 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; }
17
-
18
- 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(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; }
19
-
20
- const styledFunction = function (tag) {
21
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
22
- name: null,
23
- slot: null
24
- };
25
- const {
26
- name: componentName,
27
- slot: componentSlot,
28
- displayName: componentDisplayName = null
29
- } = options;
30
-
31
- const func = function (styleArg) {
32
- for (var _len = arguments.length, expressions = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
33
- expressions[_key - 1] = arguments[_key];
34
- }
35
-
36
- /*
37
- * These are the internal expression written in dimsum
38
- * We just coerce with the default theme in case users
39
- * forget to add the ThemeProvider
40
- */
41
- const expressionsWithDefaultTheme = expressions ? expressions.map(stylesArg => typeof stylesArg === 'function' ? props => stylesArg(_objectSpread(_objectSpread({}, props), {}, {
42
- theme: coerceWithDefaultTheme(props.theme)
43
- })) : stylesArg) : [];
44
- let transformedStyleArg = styleArg;
45
- /*
46
- * Here we get the style overrides from the user
47
- */
48
-
49
- if (componentName && componentSlot) {
50
- expressionsWithDefaultTheme.push(props => {
51
- const theme = coerceWithDefaultTheme(props.theme);
52
- const styleOverrides = getStyleOverrides(componentName, theme);
53
-
54
- if (styleOverrides) {
55
- return [styleOverrides[componentSlot]];
56
- }
57
-
58
- return null;
59
- });
60
- }
61
- /*
62
- * Here we get the variant overrides from the user (only for the root)
63
- */
64
-
65
-
66
- if (componentName && componentSlot === 'root') {
67
- expressionsWithDefaultTheme.push(props => {
68
- const theme = coerceWithDefaultTheme(props.theme);
69
- return variantsResolver(props, getVariantStyles(componentName, theme), theme, componentName);
70
- });
71
- }
72
-
73
- const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressions.length;
74
-
75
- if (Array.isArray(styleArg) && numOfCustomFnsApplied > 0) {
76
- // Here we are adding placeholders for all the new functions that we are gonna call
77
- const placeholders = new Array(numOfCustomFnsApplied).fill('');
78
- transformedStyleArg = Object.assign([...styleArg, ...placeholders], {
79
- raw: [...styleArg.raw, ...placeholders]
80
- });
81
- } else if (typeof styleArg === 'function') {
82
- // Here we just coerce with the default theme
83
- transformedStyleArg = props => styleArg(_objectSpread(_objectSpread({}, props), {}, {
84
- theme: coerceWithDefaultTheme(props.theme)
85
- }));
86
- }
87
-
88
- let Component = /*#__PURE__*/styled_component(tag);
89
- const displayName = componentName !== null && componentSlot !== null ? "".concat(componentName, "-").concat(componentSlot) : componentDisplayName;
90
-
91
- if (displayName !== null) {
92
- Component = Component.attrs({
93
- className: "".concat(componentName, "-").concat(componentSlot)
94
- });
95
- }
96
-
97
- Component = Component(transformedStyleArg, ...expressionsWithDefaultTheme);
98
-
99
- if (displayName !== null) {
100
- Component.displayName = displayName;
101
- }
102
-
103
- return Component;
104
- };
105
-
106
- return func;
107
- };
108
-
109
- const styledObject = Object.keys(styled_component).reduce((obj, key) => {
110
- const castedKey = key;
111
- obj[castedKey] = styledFunction(castedKey);
112
- return obj;
113
- }, {});
114
- const styled = Object.assign(styledFunction, styledObject);
115
-
116
- export { styled };
@@ -1,38 +0,0 @@
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 };
@@ -1 +0,0 @@
1
- export { CSSObject } from 'styled-components';
@@ -1,18 +0,0 @@
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 DELETED
@@ -1,28 +0,0 @@
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 };
package/esm/theme.js DELETED
@@ -1,5 +0,0 @@
1
- import { getDefaultTheme } from '@elliemae/pui-theme';
2
-
3
- const theme = getDefaultTheme();
4
-
5
- export { theme };
@@ -1,20 +0,0 @@
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';
6
- import _jsx2 from '@babel/runtime/helpers/esm/jsx';
7
- import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
8
- import 'react';
9
- import { ThemeProvider } from 'styled-components';
10
- import { theme } from './theme.js';
11
- import { jsx } from 'react/jsx-runtime';
12
-
13
- 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; }
14
-
15
- 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(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; }
16
- const themeProviderHOC = Component => props => /*#__PURE__*/_jsx2(ThemeProvider, {
17
- theme: theme
18
- }, void 0, /*#__PURE__*/jsx(Component, _objectSpread({}, props)));
19
-
20
- export { themeProviderHOC };
package/esm/utils.js DELETED
@@ -1,136 +0,0 @@
1
- import { lighten } from 'polished';
2
- export { rgba } from 'polished';
3
- import { reduce } from 'lodash';
4
- import { theme } from './theme.js';
5
- import { toMobile } from './mobileUtilities.js';
6
- import { css, keyframes as keyframes$1 } from 'styled-components';
7
- export { createGlobalStyle, css, keyframes as kfrm, useTheme, withTheme } from 'styled-components';
8
-
9
- /* eslint-disable no-shadow */
10
- function truncate(width) {
11
- return props => css(["", " white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"], !!width || props.width ? "width: ".concat(props.width || width, ";") : '');
12
- }
13
- function flexCenter() {
14
- return "\n display: flex;\n justify-content: center;\n align-items: center;\n ";
15
- }
16
- function disabled() {
17
- return "\n cursor: not-allowed;\n pointer-events: none;\n ";
18
- }
19
- function keyframes(obj) {
20
- return keyframes$1(["", ""], reduce(obj, (result, value, key) => "\n ".concat(result, "\n ").concat(key, "% {\n ").concat(value, "\n }\n "), ''));
21
- } // eslint-disable-next-line max-params
22
-
23
- function boxShadow(top, left, blur, color) {
24
- let inset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
25
- return "box-shadow: ".concat(inset ? 'inset' : '', " ").concat(top, " ").concat(left, " ").concat(blur, " ").concat(color, ";");
26
- }
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;
30
- return css(["color:", ";"], props => props.theme.colors[variant][type]);
31
- }
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';
36
- return "".concat(size, " ").concat(type, " ").concat(color);
37
- }
38
- function animation(animationKeyframes, animationLength, animationTimingFn) {
39
- return props => css(["animation:", " ", " ", ";"], props.animationKeyframes || animationKeyframes, props.animationLength || animationLength, props.animationTimingFn || animationTimingFn);
40
- } // 0.0769
41
-
42
- function focus() {
43
- let color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : theme.colors.brand[600];
44
- return () => css(["outline:none;border:1px solid ", ";box-shadow:inset 0 0 0 1px ", ";border-radius:2px;"], color, lighten(0.3, color));
45
- }
46
- function focusAfter(color) {
47
- return 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));
48
- }
49
- function active() {
50
- return props => css(["outline:none;border:1px solid ", ";border-radius:2px;"], props.theme.colors.brand[700]);
51
- }
52
- function hover() {
53
- return props => css(["outline:1px solid ", ";outline-offset:-1px;"], props.theme.colors.brand[600]);
54
- }
55
- function textStyle(type) {
56
- let weight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'regular';
57
- // eslint-disable-next-line complexity
58
- return props => {
59
- let cssVar = "font-weight: ".concat(props.theme.fontWeights[weight], ";"); // eslint-disable-next-line default-case
60
-
61
- switch (type) {
62
- case 'h1':
63
- cssVar += "\n font-size: ".concat(toMobile('2.7692rem'), ";\n line-height: normal;\n ");
64
- break;
65
-
66
- case 'h2':
67
- cssVar += "\n font-size: ".concat(toMobile(props.theme.fontSizes.title[800]), ";\n line-height: normal;\n ");
68
- break;
69
-
70
- case 'h3':
71
- cssVar += "\n font-size: ".concat(toMobile(props.theme.fontSizes.title[700]), ";\n line-height: 1.2;\n ");
72
- break;
73
-
74
- case 'h4':
75
- cssVar += "\n font-size: ".concat(toMobile(props.theme.fontSizes.title[600]), ";\n line-height: normal;\n ");
76
- break;
77
-
78
- case 'h5':
79
- cssVar += "\n font-size: ".concat(toMobile(props.theme.fontSizes.title[500]), ";\n line-height: normal;\n ");
80
- break;
81
-
82
- case 'section-header':
83
- cssVar += "\n font-size: ".concat(toMobile(props.theme.fontSizes.title[500]), ";\n line-height: normal;\n text-transform: uppercase;\n ");
84
- break;
85
-
86
- case 'body':
87
- cssVar += "\n font-size: ".concat(toMobile(props.theme.fontSizes.value[400]), ";\n line-height: normal;\n ");
88
- break;
89
-
90
- case 'body-small':
91
- cssVar += "\n font-size: ".concat(toMobile(props.theme.fontSizes.value[300]), ";\n line-height: normal;\n ");
92
- break;
93
-
94
- case 'body-micro':
95
- cssVar += "\n font-size: ".concat(toMobile(props.theme.fontSizes.microText[200]), ";\n line-height: normal;\n ");
96
- break;
97
-
98
- case 'list':
99
- cssVar += "\n font-size: ".concat(toMobile(props.theme.fontSizes.value[400]), ";\n line-height: normal;\n ");
100
- break;
101
-
102
- case 'link':
103
- cssVar += "\n line-height: ".concat(props.theme.xl, ";\n color: ").concat(props.theme.colors.brand[600], ";\n cursor: pointer;\n ");
104
- break;
105
- }
106
-
107
- return cssVar;
108
- };
109
- }
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;
113
- return css(["fill:", ";"], props => props.theme.colors[variant][type]);
114
- }
115
- function fakeBorder() {
116
- return css(["box-shadow:inset 0 0 0 1px ", ";border-radius:2px;"], props => props.theme.colors.neutral[200]);
117
- }
118
- function fakeActive() {
119
- return css(["outline:none;box-shadow:inset 0 0 0 1px ", ";border-radius:2px;"], props => props.theme.colors.brand[700]);
120
- }
121
- function clearFocus() {
122
- return "\n border: none;\n box-shadow: none;\n ";
123
- }
124
- function buttonLink() {
125
- return "\n background-color: transparent;\n border: 1px solid transparent;\n cursor: pointer;\n ";
126
- }
127
- function transition() {
128
- let t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'all 1s ease';
129
- return "\n transition: ".concat(t, ";\n ");
130
- }
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");
135
-
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 };
@@ -1,5 +0,0 @@
1
- export declare function getNumberAndUnit(numberStrWithUnit: string | number): {
2
- number: string;
3
- unit: string;
4
- };
5
- export declare function op(operator: string, n1: string, n2: string | number): string;
@@ -1,11 +0,0 @@
1
- export declare const desktopBaseFont = 13;
2
- export declare const mobileBaseFont = 16;
3
- export declare const translateUnits: {
4
- '8px': string;
5
- '16px': string;
6
- '32px': string;
7
- '48px': string;
8
- '56px': string;
9
- '64px': string;
10
- '72px': string;
11
- };
@@ -1 +0,0 @@
1
- export declare const GlobalStyles: import("styled-components").GlobalStyleComponent<{}, import("styled-components").DefaultTheme>;
package/types/index.d.ts DELETED
@@ -1,9 +0,0 @@
1
- export * from './globalStyles';
2
- export * from './spaceUtilities';
3
- export * from './mobileUtilities';
4
- export * from './utils';
5
- export * from './arithmetic';
6
- export * from './th';
7
- export * from './theme';
8
- export * from './styled';
9
- export { themeProviderHOC } from './themeProviderHOC';
@@ -1,4 +0,0 @@
1
- export declare function __UNSAFE_SPACE_TO_DIMSUM(unit: string): string;
2
- export declare function toMobile(unit: string): string;
3
- export declare const useIsMobile: () => boolean;
4
- export declare const isMobile: () => boolean;
@@ -1,13 +0,0 @@
1
- export declare function mapGap(gutter: number | string): number | string;
2
- export declare function mapGutter(gutter: string | number): string;
3
- export declare function mapSpace(width: string | number): string;
4
- export declare function fixSpaceGutter(width: string | number, gutter: string | number): string | string[];
5
- export declare function fixSpace(width: string | number): string | string[];
6
- /**
7
- * Grid
8
- *
9
- * @param grid
10
- */
11
- export declare function numbersToFr(grid: number[]): string[];
12
- export declare function mapGrid(width: string | number): string;
13
- export declare function mapTemplateGrid(grid: number[]): string | string[];
@@ -1,2 +0,0 @@
1
- import { Styled } from './types';
2
- export declare const styled: Styled;
@@ -1,4 +0,0 @@
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][];
@@ -1,28 +0,0 @@
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,6 +0,0 @@
1
- import type { Theme } from './types';
2
- export declare const isEmpty: (string: string) => boolean;
3
- export declare const coerceWithDefaultTheme: (themeInput: Theme) => Theme;
4
- export declare const propsToClassKey: (props: Record<string, {
5
- toString: () => string;
6
- }>) => string;
@@ -1 +0,0 @@
1
- export {};
package/types/th.d.ts DELETED
@@ -1,14 +0,0 @@
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/theme.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import type { Theme } from '@elliemae/pui-theme';
2
- export declare const theme: Theme;
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const themeProviderHOC: (Component: React.ElementType) => (props: Record<string, unknown>) => JSX.Element;
package/types/utils.d.ts DELETED
@@ -1,27 +0,0 @@
1
- import { rgba } from 'polished';
2
- import { Keyframes } from 'styled-components';
3
- import { css, withTheme, keyframes as kfrm, createGlobalStyle, useTheme } from 'styled-components';
4
- export { withTheme, createGlobalStyle, rgba, useTheme, kfrm, css };
5
- export declare function truncate(width?: string): (props: any) => import("styled-components").FlattenSimpleInterpolation;
6
- export declare function flexCenter(): string;
7
- export declare function disabled(): string;
8
- export declare function keyframes(obj: Record<string, unknown>): Keyframes;
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<import("styled-components").DefaultTheme>>;
11
- export declare function border(color?: string, size?: string, type?: string): string;
12
- export declare function animation(animationKeyframes: string, animationLength: string, animationTimingFn: string): (props: any) => import("styled-components").FlattenSimpleInterpolation;
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<import("styled-components").DefaultTheme>>;
15
- export declare function active(): (props: any) => import("styled-components").FlattenSimpleInterpolation;
16
- export declare function hover(): (props: any) => import("styled-components").FlattenSimpleInterpolation;
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<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
- export declare function clearFocus(): string;
22
- export declare function buttonLink(): string;
23
- export declare function transition(t?: 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;