@equinor/eds-core-react 0.16.0 → 0.16.1-dev.12072021

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.
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var React = require('react');
6
6
  var styled = require('styled-components');
7
7
  var edsTokens = require('@equinor/eds-tokens');
8
- var R = require('ramda');
9
8
  var jsxRuntime = require('react/jsx-runtime');
10
9
  var edsIcons = require('@equinor/eds-icons');
11
10
  var ReactDom = require('react-dom');
@@ -36,7 +35,6 @@ function _interopNamespace(e) {
36
35
 
37
36
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
38
37
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
39
- var R__namespace = /*#__PURE__*/_interopNamespace(R);
40
38
  var ReactDom__namespace = /*#__PURE__*/_interopNamespace(ReactDom);
41
39
 
42
40
  const {
@@ -163,6 +161,257 @@ const button$1 = {
163
161
  }
164
162
  };
165
163
 
164
+ function _isPlaceholder$3(a) {
165
+ return a != null && typeof a === 'object' && a['@@functional/placeholder'] === true;
166
+ }
167
+
168
+ var _isPlaceholder_1 = _isPlaceholder$3;
169
+
170
+ var _isPlaceholder$2 = _isPlaceholder_1;
171
+ /**
172
+ * Optimized internal one-arity curry function.
173
+ *
174
+ * @private
175
+ * @category Function
176
+ * @param {Function} fn The function to curry.
177
+ * @return {Function} The curried function.
178
+ */
179
+
180
+ function _curry1$2(fn) {
181
+ return function f1(a) {
182
+ if (arguments.length === 0 || _isPlaceholder$2(a)) {
183
+ return f1;
184
+ } else {
185
+ return fn.apply(this, arguments);
186
+ }
187
+ };
188
+ }
189
+
190
+ var _curry1_1 = _curry1$2;
191
+
192
+ var _curry1$1 = _curry1_1;
193
+ var _isPlaceholder$1 = _isPlaceholder_1;
194
+ /**
195
+ * Optimized internal two-arity curry function.
196
+ *
197
+ * @private
198
+ * @category Function
199
+ * @param {Function} fn The function to curry.
200
+ * @return {Function} The curried function.
201
+ */
202
+
203
+ function _curry2$2(fn) {
204
+ return function f2(a, b) {
205
+ switch (arguments.length) {
206
+ case 0:
207
+ return f2;
208
+
209
+ case 1:
210
+ return _isPlaceholder$1(a) ? f2 : _curry1$1(function (_b) {
211
+ return fn(a, _b);
212
+ });
213
+
214
+ default:
215
+ return _isPlaceholder$1(a) && _isPlaceholder$1(b) ? f2 : _isPlaceholder$1(a) ? _curry1$1(function (_a) {
216
+ return fn(_a, b);
217
+ }) : _isPlaceholder$1(b) ? _curry1$1(function (_b) {
218
+ return fn(a, _b);
219
+ }) : fn(a, b);
220
+ }
221
+ };
222
+ }
223
+
224
+ var _curry2_1 = _curry2$2;
225
+
226
+ var _curry1 = _curry1_1;
227
+ var _curry2$1 = _curry2_1;
228
+ var _isPlaceholder = _isPlaceholder_1;
229
+ /**
230
+ * Optimized internal three-arity curry function.
231
+ *
232
+ * @private
233
+ * @category Function
234
+ * @param {Function} fn The function to curry.
235
+ * @return {Function} The curried function.
236
+ */
237
+
238
+ function _curry3$2(fn) {
239
+ return function f3(a, b, c) {
240
+ switch (arguments.length) {
241
+ case 0:
242
+ return f3;
243
+
244
+ case 1:
245
+ return _isPlaceholder(a) ? f3 : _curry2$1(function (_b, _c) {
246
+ return fn(a, _b, _c);
247
+ });
248
+
249
+ case 2:
250
+ return _isPlaceholder(a) && _isPlaceholder(b) ? f3 : _isPlaceholder(a) ? _curry2$1(function (_a, _c) {
251
+ return fn(_a, b, _c);
252
+ }) : _isPlaceholder(b) ? _curry2$1(function (_b, _c) {
253
+ return fn(a, _b, _c);
254
+ }) : _curry1(function (_c) {
255
+ return fn(a, b, _c);
256
+ });
257
+
258
+ default:
259
+ return _isPlaceholder(a) && _isPlaceholder(b) && _isPlaceholder(c) ? f3 : _isPlaceholder(a) && _isPlaceholder(b) ? _curry2$1(function (_a, _b) {
260
+ return fn(_a, _b, c);
261
+ }) : _isPlaceholder(a) && _isPlaceholder(c) ? _curry2$1(function (_a, _c) {
262
+ return fn(_a, b, _c);
263
+ }) : _isPlaceholder(b) && _isPlaceholder(c) ? _curry2$1(function (_b, _c) {
264
+ return fn(a, _b, _c);
265
+ }) : _isPlaceholder(a) ? _curry1(function (_a) {
266
+ return fn(_a, b, c);
267
+ }) : _isPlaceholder(b) ? _curry1(function (_b) {
268
+ return fn(a, _b, c);
269
+ }) : _isPlaceholder(c) ? _curry1(function (_c) {
270
+ return fn(a, b, _c);
271
+ }) : fn(a, b, c);
272
+ }
273
+ };
274
+ }
275
+
276
+ var _curry3_1 = _curry3$2;
277
+
278
+ function _isObject$1(x) {
279
+ return Object.prototype.toString.call(x) === '[object Object]';
280
+ }
281
+
282
+ var _isObject_1 = _isObject$1;
283
+
284
+ function _has$1(prop, obj) {
285
+ return Object.prototype.hasOwnProperty.call(obj, prop);
286
+ }
287
+
288
+ var _has_1 = _has$1;
289
+
290
+ var _curry3$1 = _curry3_1;
291
+ var _has = _has_1;
292
+ /**
293
+ * Creates a new object with the own properties of the two provided objects. If
294
+ * a key exists in both objects, the provided function is applied to the key
295
+ * and the values associated with the key in each object, with the result being
296
+ * used as the value associated with the key in the returned object.
297
+ *
298
+ * @func
299
+ * @memberOf R
300
+ * @since v0.19.0
301
+ * @category Object
302
+ * @sig ((String, a, a) -> a) -> {a} -> {a} -> {a}
303
+ * @param {Function} fn
304
+ * @param {Object} l
305
+ * @param {Object} r
306
+ * @return {Object}
307
+ * @see R.mergeDeepWithKey, R.merge, R.mergeWith
308
+ * @example
309
+ *
310
+ * let concatValues = (k, l, r) => k == 'values' ? R.concat(l, r) : r
311
+ * R.mergeWithKey(concatValues,
312
+ * { a: true, thing: 'foo', values: [10, 20] },
313
+ * { b: true, thing: 'bar', values: [15, 35] });
314
+ * //=> { a: true, b: true, thing: 'bar', values: [10, 20, 15, 35] }
315
+ * @symb R.mergeWithKey(f, { x: 1, y: 2 }, { y: 5, z: 3 }) = { x: 1, y: f('y', 2, 5), z: 3 }
316
+ */
317
+
318
+ var mergeWithKey$1 = /*#__PURE__*/_curry3$1(function mergeWithKey(fn, l, r) {
319
+ var result = {};
320
+ var k;
321
+
322
+ for (k in l) {
323
+ if (_has(k, l)) {
324
+ result[k] = _has(k, r) ? fn(k, l[k], r[k]) : l[k];
325
+ }
326
+ }
327
+
328
+ for (k in r) {
329
+ if (_has(k, r) && !_has(k, result)) {
330
+ result[k] = r[k];
331
+ }
332
+ }
333
+
334
+ return result;
335
+ });
336
+
337
+ var mergeWithKey_1 = mergeWithKey$1;
338
+
339
+ var _curry3 = _curry3_1;
340
+ var _isObject = _isObject_1;
341
+ var mergeWithKey = mergeWithKey_1;
342
+ /**
343
+ * Creates a new object with the own properties of the two provided objects.
344
+ * If a key exists in both objects:
345
+ * - and both associated values are also objects then the values will be
346
+ * recursively merged.
347
+ * - otherwise the provided function is applied to the key and associated values
348
+ * using the resulting value as the new value associated with the key.
349
+ * If a key only exists in one object, the value will be associated with the key
350
+ * of the resulting object.
351
+ *
352
+ * @func
353
+ * @memberOf R
354
+ * @since v0.24.0
355
+ * @category Object
356
+ * @sig ((String, a, a) -> a) -> {a} -> {a} -> {a}
357
+ * @param {Function} fn
358
+ * @param {Object} lObj
359
+ * @param {Object} rObj
360
+ * @return {Object}
361
+ * @see R.mergeWithKey, R.mergeDeepWith
362
+ * @example
363
+ *
364
+ * let concatValues = (k, l, r) => k == 'values' ? R.concat(l, r) : r
365
+ * R.mergeDeepWithKey(concatValues,
366
+ * { a: true, c: { thing: 'foo', values: [10, 20] }},
367
+ * { b: true, c: { thing: 'bar', values: [15, 35] }});
368
+ * //=> { a: true, b: true, c: { thing: 'bar', values: [10, 20, 15, 35] }}
369
+ */
370
+
371
+ var mergeDeepWithKey$1 = /*#__PURE__*/_curry3(function mergeDeepWithKey(fn, lObj, rObj) {
372
+ return mergeWithKey(function (k, lVal, rVal) {
373
+ if (_isObject(lVal) && _isObject(rVal)) {
374
+ return mergeDeepWithKey(fn, lVal, rVal);
375
+ } else {
376
+ return fn(k, lVal, rVal);
377
+ }
378
+ }, lObj, rObj);
379
+ });
380
+
381
+ var mergeDeepWithKey_1 = mergeDeepWithKey$1;
382
+
383
+ var _curry2 = _curry2_1;
384
+ var mergeDeepWithKey = mergeDeepWithKey_1;
385
+ /**
386
+ * Creates a new object with the own properties of the first object merged with
387
+ * the own properties of the second object. If a key exists in both objects:
388
+ * - and both values are objects, the two values will be recursively merged
389
+ * - otherwise the value from the second object will be used.
390
+ *
391
+ * @func
392
+ * @memberOf R
393
+ * @since v0.24.0
394
+ * @category Object
395
+ * @sig {a} -> {a} -> {a}
396
+ * @param {Object} lObj
397
+ * @param {Object} rObj
398
+ * @return {Object}
399
+ * @see R.merge, R.mergeDeepLeft, R.mergeDeepWith, R.mergeDeepWithKey
400
+ * @example
401
+ *
402
+ * R.mergeDeepRight({ name: 'fred', age: 10, contact: { email: 'moo@example.com' }},
403
+ * { age: 40, contact: { email: 'baa@example.com' }});
404
+ * //=> { name: 'fred', age: 40, contact: { email: 'baa@example.com' }}
405
+ */
406
+
407
+ var mergeDeepRight = /*#__PURE__*/_curry2(function mergeDeepRight(lObj, rObj) {
408
+ return mergeDeepWithKey(function (k, lVal, rVal) {
409
+ return rVal;
410
+ }, lObj, rObj);
411
+ });
412
+
413
+ var mergeDeepRight_1 = mergeDeepRight;
414
+
166
415
  const {
167
416
  colors: {
168
417
  text: {
@@ -197,7 +446,7 @@ const {
197
446
  }
198
447
  }
199
448
  } = edsTokens.tokens;
200
- const primary$9 = R__namespace.mergeDeepRight(button$1, {
449
+ const primary$9 = mergeDeepRight_1(button$1, {
201
450
  background: primaryColor$8,
202
451
  typography: {
203
452
  color: primaryWhite
@@ -215,7 +464,7 @@ const primary$9 = R__namespace.mergeDeepRight(button$1, {
215
464
  }
216
465
  }
217
466
  });
218
- const secondary$4 = R__namespace.mergeDeepRight(primary$9, {
467
+ const secondary$4 = mergeDeepRight_1(primary$9, {
219
468
  background: secondaryColor$3,
220
469
  border: {
221
470
  color: secondaryColor$3
@@ -229,7 +478,7 @@ const secondary$4 = R__namespace.mergeDeepRight(primary$9, {
229
478
  }
230
479
  }
231
480
  });
232
- const danger$5 = R__namespace.mergeDeepRight(primary$9, {
481
+ const danger$5 = mergeDeepRight_1(primary$9, {
233
482
  background: dangerColor$3,
234
483
  border: {
235
484
  color: dangerColor$3
@@ -282,7 +531,7 @@ const {
282
531
  }
283
532
  }
284
533
  } = edsTokens.tokens;
285
- const primary$8 = R__namespace.mergeDeepRight(button$1, {
534
+ const primary$8 = mergeDeepRight_1(button$1, {
286
535
  typography: {
287
536
  color: primaryColor$7
288
537
  },
@@ -311,7 +560,7 @@ const primary$8 = R__namespace.mergeDeepRight(button$1, {
311
560
  }
312
561
  }
313
562
  });
314
- const secondary$3 = R__namespace.mergeDeepRight(primary$8, {
563
+ const secondary$3 = mergeDeepRight_1(primary$8, {
315
564
  typography: {
316
565
  color: secondaryColor$2
317
566
  },
@@ -330,7 +579,7 @@ const secondary$3 = R__namespace.mergeDeepRight(primary$8, {
330
579
  }
331
580
  }
332
581
  });
333
- const danger$4 = R__namespace.mergeDeepRight(primary$8, {
582
+ const danger$4 = mergeDeepRight_1(primary$8, {
334
583
  typography: {
335
584
  color: dangerColor$2
336
585
  },
@@ -383,7 +632,7 @@ const {
383
632
  }
384
633
  }
385
634
  } = edsTokens.tokens;
386
- const primary$7 = R__namespace.mergeDeepRight(button$1, {
635
+ const primary$7 = mergeDeepRight_1(button$1, {
387
636
  typography: {
388
637
  color: primaryColor$6
389
638
  },
@@ -402,7 +651,7 @@ const primary$7 = R__namespace.mergeDeepRight(button$1, {
402
651
  }
403
652
  }
404
653
  });
405
- const secondary$2 = R__namespace.mergeDeepRight(primary$7, {
654
+ const secondary$2 = mergeDeepRight_1(primary$7, {
406
655
  typography: {
407
656
  color: secondaryColor$1
408
657
  },
@@ -415,7 +664,7 @@ const secondary$2 = R__namespace.mergeDeepRight(primary$7, {
415
664
  }
416
665
  }
417
666
  });
418
- const danger$3 = R__namespace.mergeDeepRight(primary$7, {
667
+ const danger$3 = mergeDeepRight_1(primary$7, {
419
668
  typography: {
420
669
  color: dangerColor$1
421
670
  },
@@ -464,7 +713,7 @@ const {
464
713
  },
465
714
  shape: shape$2
466
715
  } = edsTokens.tokens;
467
- const primary$6 = R__namespace.mergeDeepRight(button$1, {
716
+ const primary$6 = mergeDeepRight_1(button$1, {
468
717
  height: shape$2.icon_button.minHeight,
469
718
  width: shape$2.icon_button.minWidth,
470
719
  typography: {
@@ -520,7 +769,7 @@ const primary$6 = R__namespace.mergeDeepRight(button$1, {
520
769
  }
521
770
  }
522
771
  });
523
- const secondary$1 = R__namespace.mergeDeepRight(primary$6, {
772
+ const secondary$1 = mergeDeepRight_1(primary$6, {
524
773
  typography: {
525
774
  color: secondaryColor
526
775
  },
@@ -533,7 +782,7 @@ const secondary$1 = R__namespace.mergeDeepRight(primary$6, {
533
782
  }
534
783
  }
535
784
  });
536
- const danger$2 = R__namespace.mergeDeepRight(primary$6, {
785
+ const danger$2 = mergeDeepRight_1(primary$6, {
537
786
  typography: {
538
787
  color: dangerColor
539
788
  },
@@ -869,7 +1118,7 @@ const useToken = (options, token) => React.useCallback(() => {
869
1118
  } = options;
870
1119
 
871
1120
  if (density === 'compact') {
872
- return R.mergeDeepRight(token, token.modes.compact);
1121
+ return mergeDeepRight_1(token, token.modes.compact);
873
1122
  }
874
1123
 
875
1124
  return token;
@@ -1313,7 +1562,7 @@ const tableCell = {
1313
1562
  const applyVariant = (variant, token) => {
1314
1563
  switch (variant) {
1315
1564
  case 'numeric':
1316
- return R__namespace.mergeDeepRight(token, token.variants.numeric);
1565
+ return mergeDeepRight_1(token, token.variants.numeric);
1317
1566
 
1318
1567
  default:
1319
1568
  return token;
@@ -1935,7 +2184,7 @@ const input$2 = {
1935
2184
  }
1936
2185
  }
1937
2186
  };
1938
- const error$4 = R.mergeDeepRight(input$2, {
2187
+ const error$4 = mergeDeepRight_1(input$2, {
1939
2188
  boxShadow: 'inset 0px -1px 0px 0px transparent',
1940
2189
  states: {
1941
2190
  active: {
@@ -1958,7 +2207,7 @@ const error$4 = R.mergeDeepRight(input$2, {
1958
2207
  }
1959
2208
  }
1960
2209
  });
1961
- const warning$4 = R.mergeDeepRight(input$2, {
2210
+ const warning$4 = mergeDeepRight_1(input$2, {
1962
2211
  boxShadow: 'inset 0px -1px 0px 0px transparent',
1963
2212
  states: {
1964
2213
  active: {
@@ -1981,7 +2230,7 @@ const warning$4 = R.mergeDeepRight(input$2, {
1981
2230
  }
1982
2231
  }
1983
2232
  });
1984
- const success$1 = R.mergeDeepRight(input$2, {
2233
+ const success$1 = mergeDeepRight_1(input$2, {
1985
2234
  boxShadow: 'inset 0px -1px 0px 0px transparent',
1986
2235
  states: {
1987
2236
  active: {
@@ -7710,7 +7959,7 @@ const select = {
7710
7959
  }
7711
7960
  }
7712
7961
  };
7713
- const multiSelect = R__namespace.mergeDeepRight(select, {
7962
+ const multiSelect = mergeDeepRight_1(select, {
7714
7963
  spacings: {
7715
7964
  top: '0',
7716
7965
  bottom: '0',
@@ -1,6 +1,6 @@
1
1
  import { tokens } from '@equinor/eds-tokens';
2
2
  import { button } from './button.js';
3
- import * as R from 'ramda';
3
+ import mergeDeepRight_1 from '../../../node_modules/.pnpm/ramda@0.27.1/node_modules/ramda/src/mergeDeepRight.js';
4
4
 
5
5
  const {
6
6
  colors: {
@@ -36,7 +36,7 @@ const {
36
36
  }
37
37
  }
38
38
  } = tokens;
39
- const primary = R.mergeDeepRight(button, {
39
+ const primary = mergeDeepRight_1(button, {
40
40
  background: primaryColor,
41
41
  typography: {
42
42
  color: primaryWhite
@@ -54,7 +54,7 @@ const primary = R.mergeDeepRight(button, {
54
54
  }
55
55
  }
56
56
  });
57
- const secondary = R.mergeDeepRight(primary, {
57
+ const secondary = mergeDeepRight_1(primary, {
58
58
  background: secondaryColor,
59
59
  border: {
60
60
  color: secondaryColor
@@ -68,7 +68,7 @@ const secondary = R.mergeDeepRight(primary, {
68
68
  }
69
69
  }
70
70
  });
71
- const danger = R.mergeDeepRight(primary, {
71
+ const danger = mergeDeepRight_1(primary, {
72
72
  background: dangerColor,
73
73
  border: {
74
74
  color: dangerColor
@@ -1,5 +1,5 @@
1
1
  import { tokens } from '@equinor/eds-tokens';
2
- import * as R from 'ramda';
2
+ import mergeDeepRight_1 from '../../../node_modules/.pnpm/ramda@0.27.1/node_modules/ramda/src/mergeDeepRight.js';
3
3
  import { button } from './button.js';
4
4
 
5
5
  const {
@@ -35,7 +35,7 @@ const {
35
35
  }
36
36
  }
37
37
  } = tokens;
38
- const primary = R.mergeDeepRight(button, {
38
+ const primary = mergeDeepRight_1(button, {
39
39
  typography: {
40
40
  color: primaryColor
41
41
  },
@@ -54,7 +54,7 @@ const primary = R.mergeDeepRight(button, {
54
54
  }
55
55
  }
56
56
  });
57
- const secondary = R.mergeDeepRight(primary, {
57
+ const secondary = mergeDeepRight_1(primary, {
58
58
  typography: {
59
59
  color: secondaryColor
60
60
  },
@@ -67,7 +67,7 @@ const secondary = R.mergeDeepRight(primary, {
67
67
  }
68
68
  }
69
69
  });
70
- const danger = R.mergeDeepRight(primary, {
70
+ const danger = mergeDeepRight_1(primary, {
71
71
  typography: {
72
72
  color: dangerColor
73
73
  },
@@ -1,5 +1,5 @@
1
1
  import { tokens } from '@equinor/eds-tokens';
2
- import * as R from 'ramda';
2
+ import mergeDeepRight_1 from '../../../node_modules/.pnpm/ramda@0.27.1/node_modules/ramda/src/mergeDeepRight.js';
3
3
  import { button } from './button.js';
4
4
 
5
5
  const {
@@ -37,7 +37,7 @@ const {
37
37
  },
38
38
  shape
39
39
  } = tokens;
40
- const primary = R.mergeDeepRight(button, {
40
+ const primary = mergeDeepRight_1(button, {
41
41
  height: shape.icon_button.minHeight,
42
42
  width: shape.icon_button.minWidth,
43
43
  typography: {
@@ -93,7 +93,7 @@ const primary = R.mergeDeepRight(button, {
93
93
  }
94
94
  }
95
95
  });
96
- const secondary = R.mergeDeepRight(primary, {
96
+ const secondary = mergeDeepRight_1(primary, {
97
97
  typography: {
98
98
  color: secondaryColor
99
99
  },
@@ -106,7 +106,7 @@ const secondary = R.mergeDeepRight(primary, {
106
106
  }
107
107
  }
108
108
  });
109
- const danger = R.mergeDeepRight(primary, {
109
+ const danger = mergeDeepRight_1(primary, {
110
110
  typography: {
111
111
  color: dangerColor
112
112
  },
@@ -1,5 +1,5 @@
1
1
  import { tokens } from '@equinor/eds-tokens';
2
- import * as R from 'ramda';
2
+ import mergeDeepRight_1 from '../../../node_modules/.pnpm/ramda@0.27.1/node_modules/ramda/src/mergeDeepRight.js';
3
3
  import { button } from './button.js';
4
4
 
5
5
  const {
@@ -40,7 +40,7 @@ const {
40
40
  }
41
41
  }
42
42
  } = tokens;
43
- const primary = R.mergeDeepRight(button, {
43
+ const primary = mergeDeepRight_1(button, {
44
44
  typography: {
45
45
  color: primaryColor
46
46
  },
@@ -69,7 +69,7 @@ const primary = R.mergeDeepRight(button, {
69
69
  }
70
70
  }
71
71
  });
72
- const secondary = R.mergeDeepRight(primary, {
72
+ const secondary = mergeDeepRight_1(primary, {
73
73
  typography: {
74
74
  color: secondaryColor
75
75
  },
@@ -88,7 +88,7 @@ const secondary = R.mergeDeepRight(primary, {
88
88
  }
89
89
  }
90
90
  });
91
- const danger = R.mergeDeepRight(primary, {
91
+ const danger = mergeDeepRight_1(primary, {
92
92
  typography: {
93
93
  color: dangerColor
94
94
  },
@@ -1,5 +1,5 @@
1
1
  import { tokens as tokens$1 } from '@equinor/eds-tokens';
2
- import { mergeDeepRight } from 'ramda';
2
+ import mergeDeepRight_1 from '../../node_modules/.pnpm/ramda@0.27.1/node_modules/ramda/src/mergeDeepRight.js';
3
3
 
4
4
  const {
5
5
  colors: {
@@ -93,7 +93,7 @@ const input = {
93
93
  }
94
94
  }
95
95
  };
96
- const error = mergeDeepRight(input, {
96
+ const error = mergeDeepRight_1(input, {
97
97
  boxShadow: 'inset 0px -1px 0px 0px transparent',
98
98
  states: {
99
99
  active: {
@@ -116,7 +116,7 @@ const error = mergeDeepRight(input, {
116
116
  }
117
117
  }
118
118
  });
119
- const warning = mergeDeepRight(input, {
119
+ const warning = mergeDeepRight_1(input, {
120
120
  boxShadow: 'inset 0px -1px 0px 0px transparent',
121
121
  states: {
122
122
  active: {
@@ -139,7 +139,7 @@ const warning = mergeDeepRight(input, {
139
139
  }
140
140
  }
141
141
  });
142
- const success = mergeDeepRight(input, {
142
+ const success = mergeDeepRight_1(input, {
143
143
  boxShadow: 'inset 0px -1px 0px 0px transparent',
144
144
  states: {
145
145
  active: {
@@ -1,5 +1,5 @@
1
1
  import { tokens } from '@equinor/eds-tokens';
2
- import * as R from 'ramda';
2
+ import mergeDeepRight_1 from '../../node_modules/.pnpm/ramda@0.27.1/node_modules/ramda/src/mergeDeepRight.js';
3
3
 
4
4
  const {
5
5
  typography,
@@ -78,7 +78,7 @@ const select = {
78
78
  }
79
79
  }
80
80
  };
81
- const multiSelect = R.mergeDeepRight(select, {
81
+ const multiSelect = mergeDeepRight_1(select, {
82
82
  spacings: {
83
83
  top: '0',
84
84
  bottom: '0',
@@ -1,5 +1,5 @@
1
1
  import { tokens } from '@equinor/eds-tokens';
2
- import * as R from 'ramda';
2
+ import mergeDeepRight_1 from '../../../node_modules/.pnpm/ramda@0.27.1/node_modules/ramda/src/mergeDeepRight.js';
3
3
 
4
4
  const {
5
5
  typography: {
@@ -141,7 +141,7 @@ const tableCell = {
141
141
  const applyVariant = (variant, token) => {
142
142
  switch (variant) {
143
143
  case 'numeric':
144
- return R.mergeDeepRight(token, token.variants.numeric);
144
+ return mergeDeepRight_1(token, token.variants.numeric);
145
145
 
146
146
  default:
147
147
  return token;
@@ -1,5 +1,5 @@
1
1
  import { useCallback } from 'react';
2
- import { mergeDeepRight } from 'ramda';
2
+ import mergeDeepRight_1 from '../node_modules/.pnpm/ramda@0.27.1/node_modules/ramda/src/mergeDeepRight.js';
3
3
 
4
4
  const useToken = (options, token) => useCallback(() => {
5
5
  const {
@@ -7,7 +7,7 @@ const useToken = (options, token) => useCallback(() => {
7
7
  } = options;
8
8
 
9
9
  if (density === 'compact') {
10
- return mergeDeepRight(token, token.modes.compact);
10
+ return mergeDeepRight_1(token, token.modes.compact);
11
11
  }
12
12
 
13
13
  return token;
@@ -0,0 +1,25 @@
1
+ import _isPlaceholder_1 from './_isPlaceholder.js';
2
+
3
+ var _isPlaceholder = _isPlaceholder_1;
4
+ /**
5
+ * Optimized internal one-arity curry function.
6
+ *
7
+ * @private
8
+ * @category Function
9
+ * @param {Function} fn The function to curry.
10
+ * @return {Function} The curried function.
11
+ */
12
+
13
+ function _curry1(fn) {
14
+ return function f1(a) {
15
+ if (arguments.length === 0 || _isPlaceholder(a)) {
16
+ return f1;
17
+ } else {
18
+ return fn.apply(this, arguments);
19
+ }
20
+ };
21
+ }
22
+
23
+ var _curry1_1 = _curry1;
24
+
25
+ export default _curry1_1;
@@ -0,0 +1,38 @@
1
+ import _curry1_1 from './_curry1.js';
2
+ import _isPlaceholder_1 from './_isPlaceholder.js';
3
+
4
+ var _curry1 = _curry1_1;
5
+ var _isPlaceholder = _isPlaceholder_1;
6
+ /**
7
+ * Optimized internal two-arity curry function.
8
+ *
9
+ * @private
10
+ * @category Function
11
+ * @param {Function} fn The function to curry.
12
+ * @return {Function} The curried function.
13
+ */
14
+
15
+ function _curry2(fn) {
16
+ return function f2(a, b) {
17
+ switch (arguments.length) {
18
+ case 0:
19
+ return f2;
20
+
21
+ case 1:
22
+ return _isPlaceholder(a) ? f2 : _curry1(function (_b) {
23
+ return fn(a, _b);
24
+ });
25
+
26
+ default:
27
+ return _isPlaceholder(a) && _isPlaceholder(b) ? f2 : _isPlaceholder(a) ? _curry1(function (_a) {
28
+ return fn(_a, b);
29
+ }) : _isPlaceholder(b) ? _curry1(function (_b) {
30
+ return fn(a, _b);
31
+ }) : fn(a, b);
32
+ }
33
+ };
34
+ }
35
+
36
+ var _curry2_1 = _curry2;
37
+
38
+ export default _curry2_1;
@@ -0,0 +1,57 @@
1
+ import _curry1_1 from './_curry1.js';
2
+ import _curry2_1 from './_curry2.js';
3
+ import _isPlaceholder_1 from './_isPlaceholder.js';
4
+
5
+ var _curry1 = _curry1_1;
6
+ var _curry2 = _curry2_1;
7
+ var _isPlaceholder = _isPlaceholder_1;
8
+ /**
9
+ * Optimized internal three-arity curry function.
10
+ *
11
+ * @private
12
+ * @category Function
13
+ * @param {Function} fn The function to curry.
14
+ * @return {Function} The curried function.
15
+ */
16
+
17
+ function _curry3(fn) {
18
+ return function f3(a, b, c) {
19
+ switch (arguments.length) {
20
+ case 0:
21
+ return f3;
22
+
23
+ case 1:
24
+ return _isPlaceholder(a) ? f3 : _curry2(function (_b, _c) {
25
+ return fn(a, _b, _c);
26
+ });
27
+
28
+ case 2:
29
+ return _isPlaceholder(a) && _isPlaceholder(b) ? f3 : _isPlaceholder(a) ? _curry2(function (_a, _c) {
30
+ return fn(_a, b, _c);
31
+ }) : _isPlaceholder(b) ? _curry2(function (_b, _c) {
32
+ return fn(a, _b, _c);
33
+ }) : _curry1(function (_c) {
34
+ return fn(a, b, _c);
35
+ });
36
+
37
+ default:
38
+ return _isPlaceholder(a) && _isPlaceholder(b) && _isPlaceholder(c) ? f3 : _isPlaceholder(a) && _isPlaceholder(b) ? _curry2(function (_a, _b) {
39
+ return fn(_a, _b, c);
40
+ }) : _isPlaceholder(a) && _isPlaceholder(c) ? _curry2(function (_a, _c) {
41
+ return fn(_a, b, _c);
42
+ }) : _isPlaceholder(b) && _isPlaceholder(c) ? _curry2(function (_b, _c) {
43
+ return fn(a, _b, _c);
44
+ }) : _isPlaceholder(a) ? _curry1(function (_a) {
45
+ return fn(_a, b, c);
46
+ }) : _isPlaceholder(b) ? _curry1(function (_b) {
47
+ return fn(a, _b, c);
48
+ }) : _isPlaceholder(c) ? _curry1(function (_c) {
49
+ return fn(a, b, _c);
50
+ }) : fn(a, b, c);
51
+ }
52
+ };
53
+ }
54
+
55
+ var _curry3_1 = _curry3;
56
+
57
+ export default _curry3_1;
@@ -0,0 +1,7 @@
1
+ function _has(prop, obj) {
2
+ return Object.prototype.hasOwnProperty.call(obj, prop);
3
+ }
4
+
5
+ var _has_1 = _has;
6
+
7
+ export default _has_1;
@@ -0,0 +1,7 @@
1
+ function _isObject(x) {
2
+ return Object.prototype.toString.call(x) === '[object Object]';
3
+ }
4
+
5
+ var _isObject_1 = _isObject;
6
+
7
+ export default _isObject_1;
@@ -0,0 +1,7 @@
1
+ function _isPlaceholder(a) {
2
+ return a != null && typeof a === 'object' && a['@@functional/placeholder'] === true;
3
+ }
4
+
5
+ var _isPlaceholder_1 = _isPlaceholder;
6
+
7
+ export default _isPlaceholder_1;
@@ -0,0 +1,36 @@
1
+ import _curry2_1 from './internal/_curry2.js';
2
+ import mergeDeepWithKey_1 from './mergeDeepWithKey.js';
3
+
4
+ var _curry2 = _curry2_1;
5
+ var mergeDeepWithKey = mergeDeepWithKey_1;
6
+ /**
7
+ * Creates a new object with the own properties of the first object merged with
8
+ * the own properties of the second object. If a key exists in both objects:
9
+ * - and both values are objects, the two values will be recursively merged
10
+ * - otherwise the value from the second object will be used.
11
+ *
12
+ * @func
13
+ * @memberOf R
14
+ * @since v0.24.0
15
+ * @category Object
16
+ * @sig {a} -> {a} -> {a}
17
+ * @param {Object} lObj
18
+ * @param {Object} rObj
19
+ * @return {Object}
20
+ * @see R.merge, R.mergeDeepLeft, R.mergeDeepWith, R.mergeDeepWithKey
21
+ * @example
22
+ *
23
+ * R.mergeDeepRight({ name: 'fred', age: 10, contact: { email: 'moo@example.com' }},
24
+ * { age: 40, contact: { email: 'baa@example.com' }});
25
+ * //=> { name: 'fred', age: 40, contact: { email: 'baa@example.com' }}
26
+ */
27
+
28
+ var mergeDeepRight = /*#__PURE__*/_curry2(function mergeDeepRight(lObj, rObj) {
29
+ return mergeDeepWithKey(function (k, lVal, rVal) {
30
+ return rVal;
31
+ }, lObj, rObj);
32
+ });
33
+
34
+ var mergeDeepRight_1 = mergeDeepRight;
35
+
36
+ export default mergeDeepRight_1;
@@ -0,0 +1,49 @@
1
+ import _curry3_1 from './internal/_curry3.js';
2
+ import _isObject_1 from './internal/_isObject.js';
3
+ import mergeWithKey_1 from './mergeWithKey.js';
4
+
5
+ var _curry3 = _curry3_1;
6
+ var _isObject = _isObject_1;
7
+ var mergeWithKey = mergeWithKey_1;
8
+ /**
9
+ * Creates a new object with the own properties of the two provided objects.
10
+ * If a key exists in both objects:
11
+ * - and both associated values are also objects then the values will be
12
+ * recursively merged.
13
+ * - otherwise the provided function is applied to the key and associated values
14
+ * using the resulting value as the new value associated with the key.
15
+ * If a key only exists in one object, the value will be associated with the key
16
+ * of the resulting object.
17
+ *
18
+ * @func
19
+ * @memberOf R
20
+ * @since v0.24.0
21
+ * @category Object
22
+ * @sig ((String, a, a) -> a) -> {a} -> {a} -> {a}
23
+ * @param {Function} fn
24
+ * @param {Object} lObj
25
+ * @param {Object} rObj
26
+ * @return {Object}
27
+ * @see R.mergeWithKey, R.mergeDeepWith
28
+ * @example
29
+ *
30
+ * let concatValues = (k, l, r) => k == 'values' ? R.concat(l, r) : r
31
+ * R.mergeDeepWithKey(concatValues,
32
+ * { a: true, c: { thing: 'foo', values: [10, 20] }},
33
+ * { b: true, c: { thing: 'bar', values: [15, 35] }});
34
+ * //=> { a: true, b: true, c: { thing: 'bar', values: [10, 20, 15, 35] }}
35
+ */
36
+
37
+ var mergeDeepWithKey = /*#__PURE__*/_curry3(function mergeDeepWithKey(fn, lObj, rObj) {
38
+ return mergeWithKey(function (k, lVal, rVal) {
39
+ if (_isObject(lVal) && _isObject(rVal)) {
40
+ return mergeDeepWithKey(fn, lVal, rVal);
41
+ } else {
42
+ return fn(k, lVal, rVal);
43
+ }
44
+ }, lObj, rObj);
45
+ });
46
+
47
+ var mergeDeepWithKey_1 = mergeDeepWithKey;
48
+
49
+ export default mergeDeepWithKey_1;
@@ -0,0 +1,53 @@
1
+ import _curry3_1 from './internal/_curry3.js';
2
+ import _has_1 from './internal/_has.js';
3
+
4
+ var _curry3 = _curry3_1;
5
+ var _has = _has_1;
6
+ /**
7
+ * Creates a new object with the own properties of the two provided objects. If
8
+ * a key exists in both objects, the provided function is applied to the key
9
+ * and the values associated with the key in each object, with the result being
10
+ * used as the value associated with the key in the returned object.
11
+ *
12
+ * @func
13
+ * @memberOf R
14
+ * @since v0.19.0
15
+ * @category Object
16
+ * @sig ((String, a, a) -> a) -> {a} -> {a} -> {a}
17
+ * @param {Function} fn
18
+ * @param {Object} l
19
+ * @param {Object} r
20
+ * @return {Object}
21
+ * @see R.mergeDeepWithKey, R.merge, R.mergeWith
22
+ * @example
23
+ *
24
+ * let concatValues = (k, l, r) => k == 'values' ? R.concat(l, r) : r
25
+ * R.mergeWithKey(concatValues,
26
+ * { a: true, thing: 'foo', values: [10, 20] },
27
+ * { b: true, thing: 'bar', values: [15, 35] });
28
+ * //=> { a: true, b: true, thing: 'bar', values: [10, 20, 15, 35] }
29
+ * @symb R.mergeWithKey(f, { x: 1, y: 2 }, { y: 5, z: 3 }) = { x: 1, y: f('y', 2, 5), z: 3 }
30
+ */
31
+
32
+ var mergeWithKey = /*#__PURE__*/_curry3(function mergeWithKey(fn, l, r) {
33
+ var result = {};
34
+ var k;
35
+
36
+ for (k in l) {
37
+ if (_has(k, l)) {
38
+ result[k] = _has(k, r) ? fn(k, l[k], r[k]) : l[k];
39
+ }
40
+ }
41
+
42
+ for (k in r) {
43
+ if (_has(k, r) && !_has(k, result)) {
44
+ result[k] = r[k];
45
+ }
46
+ }
47
+
48
+ return result;
49
+ });
50
+
51
+ var mergeWithKey_1 = mergeWithKey;
52
+
53
+ export default mergeWithKey_1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/eds-core-react",
3
- "version": "0.16.0",
3
+ "version": "0.16.1-dev.12072021",
4
4
  "description": "The React implementation of the Equinor Design System",
5
5
  "sideEffects": false,
6
6
  "main": "dist/core-react.cjs.js",
@@ -62,6 +62,7 @@
62
62
  "jest": "^27.0.6",
63
63
  "jest-styled-components": "^7.0.5",
64
64
  "js-file-download": "^0.4.12",
65
+ "ramda": "^0.27.1",
65
66
  "react": "^17.0.2",
66
67
  "react-dom": "^17.0.2",
67
68
  "react-hook-form": "^7.11.1",
@@ -82,7 +83,6 @@
82
83
  "@equinor/eds-tokens": "0.7.0",
83
84
  "@popperjs/core": "2.9.2",
84
85
  "downshift": "^6.1.7",
85
- "ramda": "^0.27.1",
86
86
  "react-fast-compare": "3.2.0",
87
87
  "react-popper": "2.2.5"
88
88
  },