@elliemae/ds-system 2.3.1 → 3.0.0-alpha.3

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 (90) 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 -124
  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 -43
  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 -115
  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 -39
  88. package/esm/theme.js +0 -5
  89. package/esm/themeProviderHOC.js +0 -20
  90. package/esm/utils.js +0 -136
@@ -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,115 +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 = null,
27
- slot: componentSlot = null
28
- } = options;
29
-
30
- const func = 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' ? props => stylesArg(_objectSpread(_objectSpread({}, props), {}, {
41
- theme: coerceWithDefaultTheme(props.theme)
42
- })) : stylesArg) : [];
43
- let transformedStyleArg = styleArg;
44
- /*
45
- * Here we get the style overrides from the user
46
- */
47
-
48
- if (componentName && componentSlot) {
49
- expressionsWithDefaultTheme.push(props => {
50
- const theme = coerceWithDefaultTheme(props.theme);
51
- const styleOverrides = getStyleOverrides(componentName, theme);
52
-
53
- if (styleOverrides) {
54
- return [styleOverrides[componentSlot]];
55
- }
56
-
57
- return null;
58
- });
59
- }
60
- /*
61
- * Here we get the variant overrides from the user (only for the root)
62
- */
63
-
64
-
65
- if (componentName && componentSlot === 'root') {
66
- expressionsWithDefaultTheme.push(props => {
67
- const theme = coerceWithDefaultTheme(props.theme);
68
- return variantsResolver(props, getVariantStyles(componentName, theme), theme, componentName);
69
- });
70
- }
71
-
72
- const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressions.length;
73
-
74
- if (Array.isArray(styleArg) && numOfCustomFnsApplied > 0) {
75
- // Here we are adding placeholders for all the new functions that we are gonna call
76
- const placeholders = new Array(numOfCustomFnsApplied).fill('');
77
- transformedStyleArg = Object.assign([...styleArg, ...placeholders], {
78
- raw: [...styleArg.raw, ...placeholders]
79
- });
80
- } else if (typeof styleArg === 'function') {
81
- // Here we just coerce with the default theme
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;
100
- }
101
-
102
- return Component;
103
- };
104
-
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);
114
-
115
- 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,39 +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 => {
6
- const thGetter = function (value) {
7
- let dfault = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
8
-
9
- const func = _ref => {
10
- var _ref2;
11
-
12
- let {
13
- theme
14
- } = _ref;
15
- const parts = value.split('-');
16
- let result = theme[property];
17
- parts.forEach(part => {
18
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
19
- if (result) result = result[part];
20
- });
21
- return (_ref2 = result) !== null && _ref2 !== void 0 ? _ref2 : dfault;
22
- };
23
-
24
- return func;
25
- };
26
-
27
- return thGetter;
28
- };
29
- th.space = th('space');
30
- th.fontSize = th('fontSizes');
31
- th.fontWeight = th('fontWeights');
32
- th.lineHeight = th('lineHeights');
33
- th.letterSpacing = th('letterSpacings');
34
- th.font = th('fonts');
35
- th.color = th('colors');
36
- th.breakpoint = th('breakpoints');
37
- th.media = th('media');
38
-
39
- 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 };