@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
@@ -0,0 +1,265 @@
1
+ import * as React from "react";
2
+ import { lighten, rgba } from "polished";
3
+ import { reduce } from "lodash";
4
+ import { css, withTheme, keyframes as kfrm, createGlobalStyle, useTheme } from "styled-components";
5
+ import { theme } from "./theme";
6
+ import { toMobile } from "./mobileUtilities";
7
+ function truncate(width) {
8
+ return (props) => css`
9
+ ${!!width || props.width ? `width: ${props.width || width};` : ""}
10
+ white-space: nowrap;
11
+ overflow: hidden;
12
+ text-overflow: ellipsis;
13
+ `;
14
+ }
15
+ function flexCenter() {
16
+ return `
17
+ display: flex;
18
+ justify-content: center;
19
+ align-items: center;
20
+ `;
21
+ }
22
+ function disabled() {
23
+ return `
24
+ cursor: not-allowed;
25
+ pointer-events: none;
26
+ `;
27
+ }
28
+ function keyframes(obj) {
29
+ return kfrm`${reduce(obj, (result, value, key) => `
30
+ ${result}
31
+ ${key}% {
32
+ ${value}
33
+ }
34
+ `, "")}
35
+ `;
36
+ }
37
+ function boxShadow(top, left, blur, color2, inset = false) {
38
+ return `box-shadow: ${inset ? "inset" : ""} ${top} ${left} ${blur} ${color2};`;
39
+ }
40
+ function color(variant = "neutral", type = 400) {
41
+ return css`
42
+ color: ${(props) => props.theme.colors[variant][type]};
43
+ `;
44
+ }
45
+ function border(color2 = theme.colors.brand[600], size = "1px", type = "solid") {
46
+ return `${size} ${type} ${color2}`;
47
+ }
48
+ function animation(animationKeyframes, animationLength, animationTimingFn) {
49
+ return (props) => css`
50
+ animation: ${props.animationKeyframes || animationKeyframes} ${props.animationLength || animationLength}
51
+ ${props.animationTimingFn || animationTimingFn};
52
+ `;
53
+ }
54
+ function focus(color2 = theme.colors.brand[600]) {
55
+ return () => css`
56
+ outline: none;
57
+ border: 1px solid ${color2};
58
+ box-shadow: inset 0 0 0 1px ${lighten(0.3, color2)};
59
+ border-radius: 2px;
60
+ `;
61
+ }
62
+ function focusAfter(color2) {
63
+ return css`
64
+ outline: none;
65
+ position: relative;
66
+ &:after {
67
+ content: '';
68
+ z-index: 10;
69
+ position: absolute;
70
+ top: 0;
71
+ left: 0;
72
+ width: 100%;
73
+ height: 100%;
74
+ pointer-events: none;
75
+ ${focus(color2)}
76
+ }
77
+ `;
78
+ }
79
+ function active() {
80
+ return (props) => css`
81
+ outline: none;
82
+ border: 1px solid ${props.theme.colors.brand[700]};
83
+ border-radius: 2px;
84
+ `;
85
+ }
86
+ function hover() {
87
+ return (props) => css`
88
+ outline: 1px solid ${props.theme.colors.brand[600]};
89
+ outline-offset: -1px;
90
+ `;
91
+ }
92
+ function textStyle(type, weight = "regular") {
93
+ return (props) => {
94
+ let cssVar = `font-weight: ${props.theme.fontWeights[weight]};`;
95
+ switch (type) {
96
+ case "h1":
97
+ cssVar += `
98
+ font-size: ${toMobile("2.7692rem")};
99
+ line-height: normal;
100
+ `;
101
+ break;
102
+ case "h2":
103
+ cssVar += `
104
+ font-size: ${toMobile(props.theme.fontSizes.title[800])};
105
+ line-height: normal;
106
+ `;
107
+ break;
108
+ case "h3":
109
+ cssVar += `
110
+ font-size: ${toMobile(props.theme.fontSizes.title[700])};
111
+ line-height: 1.2;
112
+ `;
113
+ break;
114
+ case "h4":
115
+ cssVar += `
116
+ font-size: ${toMobile(props.theme.fontSizes.title[600])};
117
+ line-height: normal;
118
+ `;
119
+ break;
120
+ case "h5":
121
+ cssVar += `
122
+ font-size: ${toMobile(props.theme.fontSizes.title[500])};
123
+ line-height: normal;
124
+ `;
125
+ break;
126
+ case "section-header":
127
+ cssVar += `
128
+ font-size: ${toMobile(props.theme.fontSizes.title[500])};
129
+ line-height: normal;
130
+ text-transform: uppercase;
131
+ `;
132
+ break;
133
+ case "body":
134
+ cssVar += `
135
+ font-size: ${toMobile(props.theme.fontSizes.value[400])};
136
+ line-height: normal;
137
+ `;
138
+ break;
139
+ case "body-small":
140
+ cssVar += `
141
+ font-size: ${toMobile(props.theme.fontSizes.value[300])};
142
+ line-height: normal;
143
+ `;
144
+ break;
145
+ case "body-micro":
146
+ cssVar += `
147
+ font-size: ${toMobile(props.theme.fontSizes.microText[200])};
148
+ line-height: normal;
149
+ `;
150
+ break;
151
+ case "list":
152
+ cssVar += `
153
+ font-size: ${toMobile(props.theme.fontSizes.value[400])};
154
+ line-height: normal;
155
+ `;
156
+ break;
157
+ case "link":
158
+ cssVar += `
159
+ line-height: ${props.theme.xl};
160
+ color: ${props.theme.colors.brand[600]};
161
+ cursor: pointer;
162
+ `;
163
+ break;
164
+ }
165
+ return cssVar;
166
+ };
167
+ }
168
+ function iconColor(variant = "neutral", type = 400) {
169
+ return css`
170
+ fill: ${(props) => props.theme.colors[variant][type]};
171
+ `;
172
+ }
173
+ function fakeBorder() {
174
+ return css`
175
+ box-shadow: inset 0 0 0 1px ${(props) => props.theme.colors.neutral[200]};
176
+ border-radius: 2px;
177
+ `;
178
+ }
179
+ function fakeActive() {
180
+ return css`
181
+ outline: none;
182
+ box-shadow: inset 0 0 0 1px ${(props) => props.theme.colors.brand[700]};
183
+ border-radius: 2px;
184
+ `;
185
+ }
186
+ function clearFocus() {
187
+ return `
188
+ border: none;
189
+ box-shadow: none;
190
+ `;
191
+ }
192
+ function buttonLink() {
193
+ return `
194
+ background-color: transparent;
195
+ border: 1px solid transparent;
196
+ cursor: pointer;
197
+ `;
198
+ }
199
+ function transition(t = "all 1s ease") {
200
+ return `
201
+ transition: ${t};
202
+ `;
203
+ }
204
+ const onlySafariAndFirefox = (styles) => css`
205
+ @media not all and (min-resolution: 0.001dpcm) {
206
+ ${styles}
207
+ }
208
+ @media screen and (min--moz-device-pixel-ratio: 0) {
209
+ ${styles}
210
+ }
211
+ `;
212
+ const onlySafari = (styles) => `
213
+ @media not all and (min-resolution: 0.001dpcm) {
214
+ ${styles}
215
+ }
216
+ `;
217
+ const onlyFirefox = (styles) => `
218
+ @media screen and (min--moz-device-pixel-ratio: 0) {
219
+ ${styles}
220
+ }
221
+ `;
222
+ const safariAndFirefoxBold = (color2) => `
223
+ @media not all and (min-resolution: 0.001dpcm) {
224
+ font-weight: 400;
225
+ -webkit-font-smoothing: subpixel-antialiased;
226
+ -webkit-text-stroke: 0.4px ${color2};
227
+ }
228
+ @media screen and (min--moz-device-pixel-ratio: 0) {
229
+ font-weight: 400;
230
+ -webkit-font-smoothing: subpixel-antialiased;
231
+ -webkit-text-stroke: 0.4px ${color2};
232
+ }
233
+ `;
234
+ export {
235
+ active,
236
+ animation,
237
+ border,
238
+ boxShadow,
239
+ buttonLink,
240
+ clearFocus,
241
+ color,
242
+ createGlobalStyle,
243
+ css,
244
+ disabled,
245
+ fakeActive,
246
+ fakeBorder,
247
+ flexCenter,
248
+ focus,
249
+ focusAfter,
250
+ hover,
251
+ iconColor,
252
+ keyframes,
253
+ kfrm,
254
+ onlyFirefox,
255
+ onlySafari,
256
+ onlySafariAndFirefox,
257
+ rgba,
258
+ safariAndFirefoxBold,
259
+ textStyle,
260
+ transition,
261
+ truncate,
262
+ useTheme,
263
+ withTheme
264
+ };
265
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/utils.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-shadow */\n/* eslint-disable max-lines */\n// https://github.com/styled-components/babel-plugin-styled-components/issues/216#issuecomment-516941240\nimport { lighten, rgba } from 'polished';\nimport { reduce } from 'lodash';\nimport { Keyframes, css, withTheme, keyframes as kfrm, createGlobalStyle, useTheme } from 'styled-components';\nimport { theme } from './theme';\nimport { toMobile } from './mobileUtilities';\n\nexport { withTheme, createGlobalStyle, rgba, useTheme, kfrm, css };\n\nexport function truncate(width?: string) {\n return (props) => css`\n ${!!width || props.width ? `width: ${props.width || width};` : ''}\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n `;\n}\n\nexport function flexCenter(): string {\n return `\n display: flex;\n justify-content: center;\n align-items: center;\n `;\n}\n\nexport function disabled(): string {\n return `\n cursor: not-allowed;\n pointer-events: none;\n `;\n}\n\nexport function keyframes(obj: Record<string, unknown>): Keyframes {\n return kfrm`${reduce(\n obj,\n (result, value, key) => `\n ${result}\n ${key}% {\n ${value}\n }\n `,\n '',\n )}\n `;\n}\n\n// eslint-disable-next-line max-params\nexport function boxShadow(top: string, left: string, blur: string, color: string, inset = false): string {\n return `box-shadow: ${inset ? 'inset' : ''} ${top} ${left} ${blur} ${color};`;\n}\n\nexport function color(variant = 'neutral', type = 400) {\n return css`\n color: ${(props) => props.theme.colors[variant][type]};\n `;\n}\n\nexport function border(color = theme.colors.brand[600], size = '1px', type = 'solid'): string {\n return `${size} ${type} ${color}`;\n}\n\nexport function animation(animationKeyframes: string, animationLength: string, animationTimingFn: string) {\n return (props) => css`\n animation: ${props.animationKeyframes || animationKeyframes} ${props.animationLength || animationLength}\n ${props.animationTimingFn || animationTimingFn};\n `;\n}\n// 0.0769\nexport function focus(color: string = theme.colors.brand[600]) {\n return () => css`\n outline: none;\n border: 1px solid ${color};\n box-shadow: inset 0 0 0 1px ${lighten(0.3, color)};\n border-radius: 2px;\n `;\n}\n\nexport function focusAfter(color: string) {\n return css`\n outline: none;\n position: relative;\n &:after {\n content: '';\n z-index: 10;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n ${focus(color)}\n }\n `;\n}\n\nexport function active() {\n return (props) => css`\n outline: none;\n border: 1px solid ${props.theme.colors.brand[700]};\n border-radius: 2px;\n `;\n}\n\nexport function hover() {\n return (props) => css`\n outline: 1px solid ${props.theme.colors.brand[600]};\n outline-offset: -1px;\n `;\n}\n\nexport function textStyle(type: string, weight = 'regular') {\n // eslint-disable-next-line complexity\n return (props): string => {\n let cssVar = `font-weight: ${props.theme.fontWeights[weight]};`;\n // eslint-disable-next-line default-case\n switch (type) {\n case 'h1':\n cssVar += `\n font-size: ${toMobile('2.7692rem')};\n line-height: normal;\n `;\n break;\n case 'h2':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[800])};\n line-height: normal;\n `;\n break;\n case 'h3':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[700])};\n line-height: 1.2;\n `;\n break;\n case 'h4':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[600])};\n line-height: normal;\n `;\n break;\n case 'h5':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[500])};\n line-height: normal;\n `;\n break;\n case 'section-header':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[500])};\n line-height: normal;\n text-transform: uppercase;\n `;\n break;\n case 'body':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.value[400])};\n line-height: normal;\n `;\n break;\n case 'body-small':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.value[300])};\n line-height: normal;\n `;\n break;\n case 'body-micro':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.microText[200])};\n line-height: normal;\n `;\n break;\n case 'list':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.value[400])};\n line-height: normal;\n `;\n break;\n case 'link':\n cssVar += `\n line-height: ${props.theme.xl};\n color: ${props.theme.colors.brand[600]};\n cursor: pointer;\n `;\n break;\n }\n return cssVar;\n };\n}\n\nexport function iconColor(variant = 'neutral', type = 400) {\n return css`\n fill: ${(props) => props.theme.colors[variant][type]};\n `;\n}\n\nexport function fakeBorder() {\n return css`\n box-shadow: inset 0 0 0 1px ${(props) => props.theme.colors.neutral[200]};\n border-radius: 2px;\n `;\n}\n\nexport function fakeActive() {\n return css`\n outline: none;\n box-shadow: inset 0 0 0 1px ${(props) => props.theme.colors.brand[700]};\n border-radius: 2px;\n `;\n}\n\nexport function clearFocus(): string {\n return `\n border: none;\n box-shadow: none;\n `;\n}\n\nexport function buttonLink(): string {\n return `\n background-color: transparent;\n border: 1px solid transparent;\n cursor: pointer;\n `;\n}\n\nexport function transition(t = 'all 1s ease'): string {\n return `\n transition: ${t};\n `;\n}\n\nexport const onlySafariAndFirefox = (styles: string): string => css`\n @media not all and (min-resolution: 0.001dpcm) {\n ${styles}\n }\n @media screen and (min--moz-device-pixel-ratio: 0) {\n ${styles}\n }\n`;\n\nexport const onlySafari = (styles: string): string => `\n @media not all and (min-resolution: 0.001dpcm) {\n ${styles}\n }\n `;\n\nexport const onlyFirefox = (styles: string): string => `\n @media screen and (min--moz-device-pixel-ratio: 0) {\n ${styles}\n }\n `;\n\nexport const safariAndFirefoxBold = (color: string): string => `\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 ${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 ${color};\n }\n`;\n"],
5
+ "mappings": "AAAA;ACGA;AACA;AACA;AACA;AACA;AAIO,kBAAkB,OAAgB;AACvC,SAAO,CAAC,UAAU;AAAA,MACd,CAAC,CAAC,SAAS,MAAM,QAAQ,U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AAA,kCACyB,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA;AAAA;AAKjE,sBAAsB;AAC3B,SAAO;AAAA;AAAA,kCAEyB,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAK/D,sBAA8B;AACnC,SAAO;AAAA;AAAA;AAAA;AAAA;AAMF,sBAA8B;AACnC,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAOF,oBAAoB,IAAI,eAAuB;AACpD,SAAO;AAAA,kBACS;AAAA;AAAA;AAIX,MAAM,uBAAuB,CAAC,WAA2B;AAAA;AAAA,MAE1D;AAAA;AAAA;AAAA,MAGA;AAAA;AAAA;AAIC,MAAM,aAAa,CAAC,WAA2B;AAAA;AAAA,QAE9C;AAAA;AAAA;AAID,MAAM,cAAc,CAAC,WAA2B;AAAA;AAAA,QAE/C;AAAA;AAAA;AAID,MAAM,uBAAuB,CAAC,WAA0B;AAAA;AAAA;AAAA;AAAA,iCAI9B;AAAA;AAAA;AAAA;AAAA;AAAA,iCAKA;AAAA;AAAA;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,67 +1,70 @@
1
1
  {
2
2
  "name": "@elliemae/ds-system",
3
- "version": "3.0.0-next.2",
3
+ "version": "3.0.0-next.6",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - System",
6
- "module": "./esm/index.js",
7
- "main": "./cjs/index.js",
8
- "types": "./types/index.d.ts",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "module": "./dist/esm/index.js",
10
+ "main": "./dist/cjs/index.js",
11
+ "types": "./dist/types/index.d.ts",
9
12
  "exports": {
10
13
  ".": {
11
- "import": "./esm/index.js",
12
- "require": "./cjs/index.js"
14
+ "import": "./dist/esm/index.js",
15
+ "require": "./dist/cjs/index.js"
13
16
  },
14
17
  "./utils": {
15
- "import": "./esm/utils.js",
16
- "require": "./cjs/utils.js"
18
+ "import": "./dist/esm/utils.js",
19
+ "require": "./dist/cjs/utils.js"
17
20
  },
18
21
  "./themeProviderHOC": {
19
- "import": "./esm/themeProviderHOC.js",
20
- "require": "./cjs/themeProviderHOC.js"
22
+ "import": "./dist/esm/themeProviderHOC.js",
23
+ "require": "./dist/cjs/themeProviderHOC.js"
21
24
  },
22
25
  "./theme": {
23
- "import": "./esm/theme.js",
24
- "require": "./cjs/theme.js"
26
+ "import": "./dist/esm/theme.js",
27
+ "require": "./dist/cjs/theme.js"
25
28
  },
26
29
  "./th": {
27
- "import": "./esm/th.js",
28
- "require": "./cjs/th.js"
30
+ "import": "./dist/esm/th.js",
31
+ "require": "./dist/cjs/th.js"
29
32
  },
30
33
  "./styled/utils": {
31
- "import": "./esm/styled/utils.js",
32
- "require": "./cjs/styled/utils.js"
34
+ "import": "./dist/esm/styled/utils.js",
35
+ "require": "./dist/cjs/styled/utils.js"
33
36
  },
34
37
  "./styled/types": {
35
- "import": "./esm/styled/types.js",
36
- "require": "./cjs/styled/types.js"
38
+ "import": "./dist/esm/styled/types.js",
39
+ "require": "./dist/cjs/styled/types.js"
37
40
  },
38
41
  "./styled/styleGetters": {
39
- "import": "./esm/styled/styleGetters.js",
40
- "require": "./cjs/styled/styleGetters.js"
42
+ "import": "./dist/esm/styled/styleGetters.js",
43
+ "require": "./dist/cjs/styled/styleGetters.js"
41
44
  },
42
45
  "./styled": {
43
- "import": "./esm/styled/index.js",
44
- "require": "./cjs/styled/index.js"
46
+ "import": "./dist/esm/styled/index.js",
47
+ "require": "./dist/cjs/styled/index.js"
45
48
  },
46
49
  "./spaceUtilities": {
47
- "import": "./esm/spaceUtilities.js",
48
- "require": "./cjs/spaceUtilities.js"
50
+ "import": "./dist/esm/spaceUtilities.js",
51
+ "require": "./dist/cjs/spaceUtilities.js"
49
52
  },
50
53
  "./mobileUtilities": {
51
- "import": "./esm/mobileUtilities.js",
52
- "require": "./cjs/mobileUtilities.js"
54
+ "import": "./dist/esm/mobileUtilities.js",
55
+ "require": "./dist/cjs/mobileUtilities.js"
53
56
  },
54
57
  "./globalStyles": {
55
- "import": "./esm/globalStyles.js",
56
- "require": "./cjs/globalStyles.js"
58
+ "import": "./dist/esm/globalStyles.js",
59
+ "require": "./dist/cjs/globalStyles.js"
57
60
  },
58
61
  "./constants": {
59
- "import": "./esm/constants.js",
60
- "require": "./cjs/constants.js"
62
+ "import": "./dist/esm/constants.js",
63
+ "require": "./dist/cjs/constants.js"
61
64
  },
62
65
  "./arithmetic": {
63
- "import": "./esm/arithmetic.js",
64
- "require": "./cjs/arithmetic.js"
66
+ "import": "./dist/esm/arithmetic.js",
67
+ "require": "./dist/cjs/arithmetic.js"
65
68
  }
66
69
  },
67
70
  "sideEffects": [
@@ -73,28 +76,27 @@
73
76
  "url": "https://git.elliemae.io/platform-ui/dimsum.git"
74
77
  },
75
78
  "engines": {
76
- "npm": ">=7",
77
- "node": ">=14"
79
+ "pnpm": ">=6",
80
+ "node": ">=16"
78
81
  },
79
82
  "author": "ICE MT",
80
- "scripts": {
81
- "prebuild": "exit 0",
82
- "predev": "exit 0",
83
- "build": "node ../../scripts/build/build.js",
84
- "dev": "cross-env NODE_ENV=development && node ../../scripts/build/build.js -w"
83
+ "jestSonar": {
84
+ "sonar56x": true,
85
+ "reportPath": "reports",
86
+ "reportFile": "tests.xml",
87
+ "indent": 4
85
88
  },
86
89
  "publishConfig": {
87
90
  "access": "public",
88
- "directory": "dist",
89
- "generateSubmodules": true
91
+ "typeSafety": false
90
92
  },
91
93
  "dependencies": {
92
- "@elliemae/ds-utilities": "3.0.0-next.2",
94
+ "@elliemae/ds-utilities": "3.0.0-next.6",
93
95
  "polished": "~3.6.7"
94
96
  },
95
97
  "devDependencies": {
96
- "@elliemae/pui-theme": "~2.2.5",
97
- "@testing-library/jest-dom": "~5.15.0",
98
+ "@elliemae/pui-theme": "~2.3.0",
99
+ "@testing-library/jest-dom": "~5.15.1",
98
100
  "styled-components": "~5.3.3"
99
101
  },
100
102
  "peerDependencies": {
@@ -103,5 +105,12 @@
103
105
  "react": "~17.0.2",
104
106
  "react-dom": "^17.0.2",
105
107
  "styled-components": "^5.3.3"
108
+ },
109
+ "scripts": {
110
+ "test": "node ../../scripts/testing/test.mjs",
111
+ "lint": "node ../../scripts/lint.mjs",
112
+ "dts": "node ../../scripts/dts.mjs",
113
+ "build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs",
114
+ "dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch"
106
115
  }
107
116
  }
package/cjs/arithmetic.js DELETED
@@ -1,43 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- require('core-js/modules/web.dom-collections.iterator.js');
6
-
7
- function getNumberAndUnit(numberStrWithUnit) {
8
- const [number, unit] = String(numberStrWithUnit).match(/[a-z]+|[(/^\-?\d*.\d+|\d+),?]+/gi);
9
- return {
10
- number,
11
- unit
12
- };
13
- }
14
- function op(operator, n1, n2) {
15
- const {
16
- number,
17
- unit
18
- } = getNumberAndUnit(n1);
19
- const {
20
- number: number2,
21
- unit: unit2
22
- } = getNumberAndUnit(n2);
23
-
24
- switch (operator) {
25
- case '*':
26
- return Number(number) * Number(number2) + (unit || unit2);
27
-
28
- case '+':
29
- return Number(number) + Number(number2) + (unit || unit2);
30
-
31
- case '-':
32
- return Number(number) - Number(number2) + (unit || unit2);
33
-
34
- case '/':
35
- return Number(number) / Number(number2) + (unit || unit2);
36
-
37
- default:
38
- return Number(number) + Number(number2) + (unit || unit2);
39
- }
40
- }
41
-
42
- exports.getNumberAndUnit = getNumberAndUnit;
43
- exports.op = op;
package/cjs/constants.js DELETED
@@ -1,19 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const desktopBaseFont = 13;
6
- const mobileBaseFont = 16;
7
- const translateUnits = {
8
- '8px': '4px',
9
- '16px': '8px',
10
- '32px': '16px',
11
- '48px': '24px',
12
- '56px': '32px',
13
- '64px': '48px',
14
- '72px': '64px'
15
- };
16
-
17
- exports.desktopBaseFont = desktopBaseFont;
18
- exports.mobileBaseFont = mobileBaseFont;
19
- exports.translateUnits = translateUnits;
@@ -1,25 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
6
- require('polished');
7
- require('lodash');
8
- require('./theme.js');
9
- require('core-js/modules/web.dom-collections.iterator.js');
10
- require('react');
11
- var styled_component = require('styled-components');
12
-
13
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
-
15
- var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefaultLegacy(_taggedTemplateLiteral);
16
-
17
- var _templateObject;
18
- const GlobalStyles = styled_component.createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral__default["default"](["\n :root, body {\n overscroll-behavior-y: none;\n\n font-size: ", ";\n\n @media(min-width: ", ") {\n font-size: ", ";\n }\n\n }\n"])), 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');
24
-
25
- exports.GlobalStyles = GlobalStyles;
package/cjs/index.js DELETED
@@ -1,84 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var globalStyles = require('./globalStyles.js');
6
- var spaceUtilities = require('./spaceUtilities.js');
7
- var mobileUtilities = require('./mobileUtilities.js');
8
- var utils = require('./utils.js');
9
- var arithmetic = require('./arithmetic.js');
10
- var th = require('./th.js');
11
- var theme = require('./theme.js');
12
- var index = require('./styled/index.js');
13
- var themeProviderHOC = require('./themeProviderHOC.js');
14
- var styled_component = require('styled-components');
15
- var polished = require('polished');
16
-
17
-
18
-
19
- exports.GlobalStyles = globalStyles.GlobalStyles;
20
- exports.fixSpace = spaceUtilities.fixSpace;
21
- exports.fixSpaceGutter = spaceUtilities.fixSpaceGutter;
22
- exports.mapGap = spaceUtilities.mapGap;
23
- exports.mapGrid = spaceUtilities.mapGrid;
24
- exports.mapGutter = spaceUtilities.mapGutter;
25
- exports.mapSpace = spaceUtilities.mapSpace;
26
- exports.mapTemplateGrid = spaceUtilities.mapTemplateGrid;
27
- exports.numbersToFr = spaceUtilities.numbersToFr;
28
- exports.__UNSAFE_SPACE_TO_DIMSUM = mobileUtilities.__UNSAFE_SPACE_TO_DIMSUM;
29
- exports.isMobile = mobileUtilities.isMobile;
30
- exports.toMobile = mobileUtilities.toMobile;
31
- exports.useIsMobile = mobileUtilities.useIsMobile;
32
- exports.active = utils.active;
33
- exports.animation = utils.animation;
34
- exports.border = utils.border;
35
- exports.boxShadow = utils.boxShadow;
36
- exports.buttonLink = utils.buttonLink;
37
- exports.clearFocus = utils.clearFocus;
38
- exports.color = utils.color;
39
- exports.disabled = utils.disabled;
40
- exports.fakeActive = utils.fakeActive;
41
- exports.fakeBorder = utils.fakeBorder;
42
- exports.flexCenter = utils.flexCenter;
43
- exports.focus = utils.focus;
44
- exports.focusAfter = utils.focusAfter;
45
- exports.hover = utils.hover;
46
- exports.iconColor = utils.iconColor;
47
- exports.keyframes = utils.keyframes;
48
- exports.onlyFirefox = utils.onlyFirefox;
49
- exports.onlySafari = utils.onlySafari;
50
- exports.onlySafariAndFirefox = utils.onlySafariAndFirefox;
51
- exports.safariAndFirefoxBold = utils.safariAndFirefoxBold;
52
- exports.textStyle = utils.textStyle;
53
- exports.transition = utils.transition;
54
- exports.truncate = utils.truncate;
55
- exports.getNumberAndUnit = arithmetic.getNumberAndUnit;
56
- exports.op = arithmetic.op;
57
- exports.th = th.th;
58
- exports.theme = theme.theme;
59
- exports.styled = index.styled;
60
- exports.themeProviderHOC = themeProviderHOC.themeProviderHOC;
61
- Object.defineProperty(exports, 'createGlobalStyle', {
62
- enumerable: true,
63
- get: function () { return styled_component.createGlobalStyle; }
64
- });
65
- Object.defineProperty(exports, 'css', {
66
- enumerable: true,
67
- get: function () { return styled_component.css; }
68
- });
69
- Object.defineProperty(exports, 'kfrm', {
70
- enumerable: true,
71
- get: function () { return styled_component.keyframes; }
72
- });
73
- Object.defineProperty(exports, 'useTheme', {
74
- enumerable: true,
75
- get: function () { return styled_component.useTheme; }
76
- });
77
- Object.defineProperty(exports, 'withTheme', {
78
- enumerable: true,
79
- get: function () { return styled_component.withTheme; }
80
- });
81
- Object.defineProperty(exports, 'rgba', {
82
- enumerable: true,
83
- get: function () { return polished.rgba; }
84
- });
@@ -1,41 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- require('core-js/modules/web.dom-collections.iterator.js');
6
- var react = require('react');
7
- var theme = require('./theme.js');
8
- var constants = require('./constants.js');
9
-
10
- function __UNSAFE_SPACE_TO_DIMSUM(unit) {
11
- if (constants.translateUnits[unit]) return constants.translateUnits[unit];
12
- return "".concat(parseFloat(unit) * (constants.mobileBaseFont / constants.desktopBaseFont) / 2, "px");
13
- }
14
- function toMobile(unit) {
15
- if (!isMobile()) return unit;
16
- return "".concat(parseFloat(unit) * (constants.desktopBaseFont / constants.mobileBaseFont), "rem");
17
- }
18
- const useIsMobile = () => {
19
- const [mobile, setMobile] = react.useState(isMobile());
20
- react.useEffect(() => {
21
- function handleResize() {
22
- setMobile(isMobile());
23
- }
24
-
25
- if (window) window.addEventListener('resize', handleResize);
26
- return () => {
27
- if (window) window.removeEventListener('resize', handleResize);
28
- };
29
- }, []);
30
- if (!window) return false;
31
- return mobile;
32
- };
33
- const isMobile = () => {
34
- if (!window) return false;
35
- return Number(theme.theme.breakpoints.medium.split('px')[0]) - window.innerWidth >= 0;
36
- };
37
-
38
- exports.__UNSAFE_SPACE_TO_DIMSUM = __UNSAFE_SPACE_TO_DIMSUM;
39
- exports.isMobile = isMobile;
40
- exports.toMobile = toMobile;
41
- exports.useIsMobile = useIsMobile;