@nebula.js/stardust 4.6.0 → 4.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/core/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "module": "esm/index.js",
3
3
  "peerDependencies": {
4
- "@mui/material": "^5.14.14",
5
- "@mui/icons-material": "^5.14.14",
4
+ "@mui/material": "^5.14.15",
5
+ "@mui/icons-material": "^5.14.15",
6
6
  "@emotion/react": "^11.11.1",
7
7
  "@emotion/styled": "^11.11.0",
8
8
  "react": "^17.0.2 || ^18.1.0",
@@ -1,5 +1,5 @@
1
1
  /*
2
- * @nebula.js/stardust v4.6.0
2
+ * @nebula.js/stardust v4.6.1
3
3
  * Copyright (c) 2023 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -11818,7 +11818,7 @@
11818
11818
  return cache[key];
11819
11819
  }
11820
11820
 
11821
- const NEBULA_VERSION_HASH = "ba42" ;
11821
+ const NEBULA_VERSION_HASH = "2504" ;
11822
11822
  ClassNameGenerator$1.configure(componentName => {
11823
11823
  return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
11824
11824
  });
@@ -12079,7 +12079,7 @@
12079
12079
  const appRef = React.createRef();
12080
12080
  const element = document.createElement('div');
12081
12081
  element.style.display = 'none';
12082
- element.setAttribute('data-nebulajs-version', "4.6.0" );
12082
+ element.setAttribute('data-nebulajs-version', "4.6.1" );
12083
12083
  element.setAttribute('data-app-id', app.id);
12084
12084
  document.body.appendChild(element);
12085
12085
  if (context) {
@@ -12147,6 +12147,246 @@
12147
12147
  }, appRef, rendered];
12148
12148
  }
12149
12149
 
12150
+ const pink = {
12151
+ 50: '#fce4ec',
12152
+ 100: '#f8bbd0',
12153
+ 200: '#f48fb1',
12154
+ 300: '#f06292',
12155
+ 400: '#ec407a',
12156
+ 500: '#e91e63',
12157
+ 600: '#d81b60',
12158
+ 700: '#c2185b',
12159
+ 800: '#ad1457',
12160
+ 900: '#880e4f',
12161
+ A100: '#ff80ab',
12162
+ A200: '#ff4081',
12163
+ A400: '#f50057',
12164
+ A700: '#c51162'
12165
+ };
12166
+ var pink$1 = pink;
12167
+
12168
+ const deepPurple = {
12169
+ 50: '#ede7f6',
12170
+ 100: '#d1c4e9',
12171
+ 200: '#b39ddb',
12172
+ 300: '#9575cd',
12173
+ 400: '#7e57c2',
12174
+ 500: '#673ab7',
12175
+ 600: '#5e35b1',
12176
+ 700: '#512da8',
12177
+ 800: '#4527a0',
12178
+ 900: '#311b92',
12179
+ A100: '#b388ff',
12180
+ A200: '#7c4dff',
12181
+ A400: '#651fff',
12182
+ A700: '#6200ea'
12183
+ };
12184
+ var deepPurple$1 = deepPurple;
12185
+
12186
+ const indigo = {
12187
+ 50: '#e8eaf6',
12188
+ 100: '#c5cae9',
12189
+ 200: '#9fa8da',
12190
+ 300: '#7986cb',
12191
+ 400: '#5c6bc0',
12192
+ 500: '#3f51b5',
12193
+ 600: '#3949ab',
12194
+ 700: '#303f9f',
12195
+ 800: '#283593',
12196
+ 900: '#1a237e',
12197
+ A100: '#8c9eff',
12198
+ A200: '#536dfe',
12199
+ A400: '#3d5afe',
12200
+ A700: '#304ffe'
12201
+ };
12202
+ var indigo$1 = indigo;
12203
+
12204
+ const cyan = {
12205
+ 50: '#e0f7fa',
12206
+ 100: '#b2ebf2',
12207
+ 200: '#80deea',
12208
+ 300: '#4dd0e1',
12209
+ 400: '#26c6da',
12210
+ 500: '#00bcd4',
12211
+ 600: '#00acc1',
12212
+ 700: '#0097a7',
12213
+ 800: '#00838f',
12214
+ 900: '#006064',
12215
+ A100: '#84ffff',
12216
+ A200: '#18ffff',
12217
+ A400: '#00e5ff',
12218
+ A700: '#00b8d4'
12219
+ };
12220
+ var cyan$1 = cyan;
12221
+
12222
+ const teal = {
12223
+ 50: '#e0f2f1',
12224
+ 100: '#b2dfdb',
12225
+ 200: '#80cbc4',
12226
+ 300: '#4db6ac',
12227
+ 400: '#26a69a',
12228
+ 500: '#009688',
12229
+ 600: '#00897b',
12230
+ 700: '#00796b',
12231
+ 800: '#00695c',
12232
+ 900: '#004d40',
12233
+ A100: '#a7ffeb',
12234
+ A200: '#64ffda',
12235
+ A400: '#1de9b6',
12236
+ A700: '#00bfa5'
12237
+ };
12238
+ var teal$1 = teal;
12239
+
12240
+ const lightGreen = {
12241
+ 50: '#f1f8e9',
12242
+ 100: '#dcedc8',
12243
+ 200: '#c5e1a5',
12244
+ 300: '#aed581',
12245
+ 400: '#9ccc65',
12246
+ 500: '#8bc34a',
12247
+ 600: '#7cb342',
12248
+ 700: '#689f38',
12249
+ 800: '#558b2f',
12250
+ 900: '#33691e',
12251
+ A100: '#ccff90',
12252
+ A200: '#b2ff59',
12253
+ A400: '#76ff03',
12254
+ A700: '#64dd17'
12255
+ };
12256
+ var lightGreen$1 = lightGreen;
12257
+
12258
+ const lime = {
12259
+ 50: '#f9fbe7',
12260
+ 100: '#f0f4c3',
12261
+ 200: '#e6ee9c',
12262
+ 300: '#dce775',
12263
+ 400: '#d4e157',
12264
+ 500: '#cddc39',
12265
+ 600: '#c0ca33',
12266
+ 700: '#afb42b',
12267
+ 800: '#9e9d24',
12268
+ 900: '#827717',
12269
+ A100: '#f4ff81',
12270
+ A200: '#eeff41',
12271
+ A400: '#c6ff00',
12272
+ A700: '#aeea00'
12273
+ };
12274
+ var lime$1 = lime;
12275
+
12276
+ const yellow = {
12277
+ 50: '#fffde7',
12278
+ 100: '#fff9c4',
12279
+ 200: '#fff59d',
12280
+ 300: '#fff176',
12281
+ 400: '#ffee58',
12282
+ 500: '#ffeb3b',
12283
+ 600: '#fdd835',
12284
+ 700: '#fbc02d',
12285
+ 800: '#f9a825',
12286
+ 900: '#f57f17',
12287
+ A100: '#ffff8d',
12288
+ A200: '#ffff00',
12289
+ A400: '#ffea00',
12290
+ A700: '#ffd600'
12291
+ };
12292
+ var yellow$1 = yellow;
12293
+
12294
+ const amber = {
12295
+ 50: '#fff8e1',
12296
+ 100: '#ffecb3',
12297
+ 200: '#ffe082',
12298
+ 300: '#ffd54f',
12299
+ 400: '#ffca28',
12300
+ 500: '#ffc107',
12301
+ 600: '#ffb300',
12302
+ 700: '#ffa000',
12303
+ 800: '#ff8f00',
12304
+ 900: '#ff6f00',
12305
+ A100: '#ffe57f',
12306
+ A200: '#ffd740',
12307
+ A400: '#ffc400',
12308
+ A700: '#ffab00'
12309
+ };
12310
+ var amber$1 = amber;
12311
+
12312
+ const deepOrange = {
12313
+ 50: '#fbe9e7',
12314
+ 100: '#ffccbc',
12315
+ 200: '#ffab91',
12316
+ 300: '#ff8a65',
12317
+ 400: '#ff7043',
12318
+ 500: '#ff5722',
12319
+ 600: '#f4511e',
12320
+ 700: '#e64a19',
12321
+ 800: '#d84315',
12322
+ 900: '#bf360c',
12323
+ A100: '#ff9e80',
12324
+ A200: '#ff6e40',
12325
+ A400: '#ff3d00',
12326
+ A700: '#dd2c00'
12327
+ };
12328
+ var deepOrange$1 = deepOrange;
12329
+
12330
+ const brown = {
12331
+ 50: '#efebe9',
12332
+ 100: '#d7ccc8',
12333
+ 200: '#bcaaa4',
12334
+ 300: '#a1887f',
12335
+ 400: '#8d6e63',
12336
+ 500: '#795548',
12337
+ 600: '#6d4c41',
12338
+ 700: '#5d4037',
12339
+ 800: '#4e342e',
12340
+ 900: '#3e2723',
12341
+ A100: '#d7ccc8',
12342
+ A200: '#bcaaa4',
12343
+ A400: '#8d6e63',
12344
+ A700: '#5d4037'
12345
+ };
12346
+ var brown$1 = brown;
12347
+
12348
+ const blueGrey = {
12349
+ 50: '#eceff1',
12350
+ 100: '#cfd8dc',
12351
+ 200: '#b0bec5',
12352
+ 300: '#90a4ae',
12353
+ 400: '#78909c',
12354
+ 500: '#607d8b',
12355
+ 600: '#546e7a',
12356
+ 700: '#455a64',
12357
+ 800: '#37474f',
12358
+ 900: '#263238',
12359
+ A100: '#cfd8dc',
12360
+ A200: '#b0bec5',
12361
+ A400: '#78909c',
12362
+ A700: '#455a64'
12363
+ };
12364
+ var blueGrey$1 = blueGrey;
12365
+
12366
+ var namedColors = /*#__PURE__*/Object.freeze({
12367
+ __proto__: null,
12368
+ amber: amber$1,
12369
+ blue: blue$1,
12370
+ blueGrey: blueGrey$1,
12371
+ brown: brown$1,
12372
+ common: common$1,
12373
+ cyan: cyan$1,
12374
+ deepOrange: deepOrange$1,
12375
+ deepPurple: deepPurple$1,
12376
+ green: green$1,
12377
+ grey: grey$1,
12378
+ indigo: indigo$1,
12379
+ lightBlue: lightBlue$1,
12380
+ lightGreen: lightGreen$1,
12381
+ lime: lime$1,
12382
+ orange: orange$1,
12383
+ pink: pink$1,
12384
+ purple: purple$1,
12385
+ red: red$1,
12386
+ teal: teal$1,
12387
+ yellow: yellow$1
12388
+ });
12389
+
12150
12390
  function getSvgIconUtilityClass(slot) {
12151
12391
  return generateUtilityClass('MuiSvgIcon', slot);
12152
12392
  }
@@ -27351,16 +27591,55 @@
27351
27591
 
27352
27592
  const LIGHT = '#FFF';
27353
27593
  const DARK = '#000';
27594
+ const TRANSPARENT = 'rgba(255, 255, 255, 0)';
27595
+
27596
+ /**
27597
+ * If needed, converts a named color to a more reliable CSS color format.
27598
+ *
27599
+ * @param {string} c The CSS color.
27600
+ * @returns {string} Converted color or same color as before.
27601
+ * @private
27602
+ * @example
27603
+ * convertNamedColor('red') => '#FF0000'
27604
+ */
27605
+ function convertNamedColor(c) {
27606
+ let out = c;
27607
+ try {
27608
+ if (c in namedColors) {
27609
+ ({
27610
+ 500: out
27611
+ } = namedColors[c]); // 500 exposes the standard color
27612
+ } else if (c === 'transparent') {
27613
+ out = TRANSPARENT;
27614
+ }
27615
+ } catch (err) {
27616
+ out = c;
27617
+ }
27618
+ return out;
27619
+ }
27620
+ const hasEnoughContrast = (desiredTextColor, backgroundColor) => {
27621
+ const desired = convertNamedColor(desiredTextColor);
27622
+ const background = convertNamedColor(backgroundColor);
27623
+ const CONTRAST_THRESHOLD = 3.0;
27624
+ let isContrastingEnough;
27625
+ try {
27626
+ isContrastingEnough = getContrastRatio(desired, background) > CONTRAST_THRESHOLD;
27627
+ } catch (err) {
27628
+ // The function throws on unsupported or misspelled colors.
27629
+ // In these cases, simply return true.
27630
+ isContrastingEnough = true;
27631
+ }
27632
+ return isContrastingEnough;
27633
+ };
27354
27634
  function getContrastingColor(backgroundColor) {
27355
27635
  let desiredTextColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
27356
27636
  let dark = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DARK;
27357
27637
  let light = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : LIGHT;
27358
- const CONTRAST_THRESHOLD = 3.0;
27359
27638
  let contrastingColor;
27360
- if (desiredTextColor && getContrastRatio(desiredTextColor, backgroundColor) > CONTRAST_THRESHOLD) {
27639
+ if (desiredTextColor && hasEnoughContrast(desiredTextColor, backgroundColor)) {
27361
27640
  contrastingColor = desiredTextColor;
27362
27641
  } else {
27363
- contrastingColor = getContrastRatio(light, backgroundColor) > CONTRAST_THRESHOLD ? light : dark;
27642
+ contrastingColor = hasEnoughContrast(light, backgroundColor) ? light : dark;
27364
27643
  }
27365
27644
  return contrastingColor;
27366
27645
  }