@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/esm/dev.js CHANGED
@@ -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
  */
@@ -8549,7 +8549,7 @@ function create$3(definition) {
8549
8549
  return cache[key];
8550
8550
  }
8551
8551
 
8552
- const NEBULA_VERSION_HASH = "ba42" ;
8552
+ const NEBULA_VERSION_HASH = "2504" ;
8553
8553
  ClassNameGenerator$1.configure(componentName => {
8554
8554
  return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
8555
8555
  });
@@ -8810,7 +8810,7 @@ function boot(_ref2) {
8810
8810
  const appRef = React__default.createRef();
8811
8811
  const element = document.createElement('div');
8812
8812
  element.style.display = 'none';
8813
- element.setAttribute('data-nebulajs-version', "4.6.0" );
8813
+ element.setAttribute('data-nebulajs-version', "4.6.1" );
8814
8814
  element.setAttribute('data-app-id', app.id);
8815
8815
  document.body.appendChild(element);
8816
8816
  if (context) {
@@ -15539,18 +15539,297 @@ function hasSelections(layout) {
15539
15539
  return totalCounts > 0;
15540
15540
  }
15541
15541
 
15542
+ const pink = {
15543
+ 50: '#fce4ec',
15544
+ 100: '#f8bbd0',
15545
+ 200: '#f48fb1',
15546
+ 300: '#f06292',
15547
+ 400: '#ec407a',
15548
+ 500: '#e91e63',
15549
+ 600: '#d81b60',
15550
+ 700: '#c2185b',
15551
+ 800: '#ad1457',
15552
+ 900: '#880e4f',
15553
+ A100: '#ff80ab',
15554
+ A200: '#ff4081',
15555
+ A400: '#f50057',
15556
+ A700: '#c51162'
15557
+ };
15558
+ var pink$1 = pink;
15559
+
15560
+ const deepPurple = {
15561
+ 50: '#ede7f6',
15562
+ 100: '#d1c4e9',
15563
+ 200: '#b39ddb',
15564
+ 300: '#9575cd',
15565
+ 400: '#7e57c2',
15566
+ 500: '#673ab7',
15567
+ 600: '#5e35b1',
15568
+ 700: '#512da8',
15569
+ 800: '#4527a0',
15570
+ 900: '#311b92',
15571
+ A100: '#b388ff',
15572
+ A200: '#7c4dff',
15573
+ A400: '#651fff',
15574
+ A700: '#6200ea'
15575
+ };
15576
+ var deepPurple$1 = deepPurple;
15577
+
15578
+ const indigo = {
15579
+ 50: '#e8eaf6',
15580
+ 100: '#c5cae9',
15581
+ 200: '#9fa8da',
15582
+ 300: '#7986cb',
15583
+ 400: '#5c6bc0',
15584
+ 500: '#3f51b5',
15585
+ 600: '#3949ab',
15586
+ 700: '#303f9f',
15587
+ 800: '#283593',
15588
+ 900: '#1a237e',
15589
+ A100: '#8c9eff',
15590
+ A200: '#536dfe',
15591
+ A400: '#3d5afe',
15592
+ A700: '#304ffe'
15593
+ };
15594
+ var indigo$1 = indigo;
15595
+
15596
+ const cyan = {
15597
+ 50: '#e0f7fa',
15598
+ 100: '#b2ebf2',
15599
+ 200: '#80deea',
15600
+ 300: '#4dd0e1',
15601
+ 400: '#26c6da',
15602
+ 500: '#00bcd4',
15603
+ 600: '#00acc1',
15604
+ 700: '#0097a7',
15605
+ 800: '#00838f',
15606
+ 900: '#006064',
15607
+ A100: '#84ffff',
15608
+ A200: '#18ffff',
15609
+ A400: '#00e5ff',
15610
+ A700: '#00b8d4'
15611
+ };
15612
+ var cyan$1 = cyan;
15613
+
15614
+ const teal = {
15615
+ 50: '#e0f2f1',
15616
+ 100: '#b2dfdb',
15617
+ 200: '#80cbc4',
15618
+ 300: '#4db6ac',
15619
+ 400: '#26a69a',
15620
+ 500: '#009688',
15621
+ 600: '#00897b',
15622
+ 700: '#00796b',
15623
+ 800: '#00695c',
15624
+ 900: '#004d40',
15625
+ A100: '#a7ffeb',
15626
+ A200: '#64ffda',
15627
+ A400: '#1de9b6',
15628
+ A700: '#00bfa5'
15629
+ };
15630
+ var teal$1 = teal;
15631
+
15632
+ const lightGreen = {
15633
+ 50: '#f1f8e9',
15634
+ 100: '#dcedc8',
15635
+ 200: '#c5e1a5',
15636
+ 300: '#aed581',
15637
+ 400: '#9ccc65',
15638
+ 500: '#8bc34a',
15639
+ 600: '#7cb342',
15640
+ 700: '#689f38',
15641
+ 800: '#558b2f',
15642
+ 900: '#33691e',
15643
+ A100: '#ccff90',
15644
+ A200: '#b2ff59',
15645
+ A400: '#76ff03',
15646
+ A700: '#64dd17'
15647
+ };
15648
+ var lightGreen$1 = lightGreen;
15649
+
15650
+ const lime = {
15651
+ 50: '#f9fbe7',
15652
+ 100: '#f0f4c3',
15653
+ 200: '#e6ee9c',
15654
+ 300: '#dce775',
15655
+ 400: '#d4e157',
15656
+ 500: '#cddc39',
15657
+ 600: '#c0ca33',
15658
+ 700: '#afb42b',
15659
+ 800: '#9e9d24',
15660
+ 900: '#827717',
15661
+ A100: '#f4ff81',
15662
+ A200: '#eeff41',
15663
+ A400: '#c6ff00',
15664
+ A700: '#aeea00'
15665
+ };
15666
+ var lime$1 = lime;
15667
+
15668
+ const yellow = {
15669
+ 50: '#fffde7',
15670
+ 100: '#fff9c4',
15671
+ 200: '#fff59d',
15672
+ 300: '#fff176',
15673
+ 400: '#ffee58',
15674
+ 500: '#ffeb3b',
15675
+ 600: '#fdd835',
15676
+ 700: '#fbc02d',
15677
+ 800: '#f9a825',
15678
+ 900: '#f57f17',
15679
+ A100: '#ffff8d',
15680
+ A200: '#ffff00',
15681
+ A400: '#ffea00',
15682
+ A700: '#ffd600'
15683
+ };
15684
+ var yellow$1 = yellow;
15685
+
15686
+ const amber = {
15687
+ 50: '#fff8e1',
15688
+ 100: '#ffecb3',
15689
+ 200: '#ffe082',
15690
+ 300: '#ffd54f',
15691
+ 400: '#ffca28',
15692
+ 500: '#ffc107',
15693
+ 600: '#ffb300',
15694
+ 700: '#ffa000',
15695
+ 800: '#ff8f00',
15696
+ 900: '#ff6f00',
15697
+ A100: '#ffe57f',
15698
+ A200: '#ffd740',
15699
+ A400: '#ffc400',
15700
+ A700: '#ffab00'
15701
+ };
15702
+ var amber$1 = amber;
15703
+
15704
+ const deepOrange = {
15705
+ 50: '#fbe9e7',
15706
+ 100: '#ffccbc',
15707
+ 200: '#ffab91',
15708
+ 300: '#ff8a65',
15709
+ 400: '#ff7043',
15710
+ 500: '#ff5722',
15711
+ 600: '#f4511e',
15712
+ 700: '#e64a19',
15713
+ 800: '#d84315',
15714
+ 900: '#bf360c',
15715
+ A100: '#ff9e80',
15716
+ A200: '#ff6e40',
15717
+ A400: '#ff3d00',
15718
+ A700: '#dd2c00'
15719
+ };
15720
+ var deepOrange$1 = deepOrange;
15721
+
15722
+ const brown = {
15723
+ 50: '#efebe9',
15724
+ 100: '#d7ccc8',
15725
+ 200: '#bcaaa4',
15726
+ 300: '#a1887f',
15727
+ 400: '#8d6e63',
15728
+ 500: '#795548',
15729
+ 600: '#6d4c41',
15730
+ 700: '#5d4037',
15731
+ 800: '#4e342e',
15732
+ 900: '#3e2723',
15733
+ A100: '#d7ccc8',
15734
+ A200: '#bcaaa4',
15735
+ A400: '#8d6e63',
15736
+ A700: '#5d4037'
15737
+ };
15738
+ var brown$1 = brown;
15739
+
15740
+ const blueGrey = {
15741
+ 50: '#eceff1',
15742
+ 100: '#cfd8dc',
15743
+ 200: '#b0bec5',
15744
+ 300: '#90a4ae',
15745
+ 400: '#78909c',
15746
+ 500: '#607d8b',
15747
+ 600: '#546e7a',
15748
+ 700: '#455a64',
15749
+ 800: '#37474f',
15750
+ 900: '#263238',
15751
+ A100: '#cfd8dc',
15752
+ A200: '#b0bec5',
15753
+ A400: '#78909c',
15754
+ A700: '#455a64'
15755
+ };
15756
+ var blueGrey$1 = blueGrey;
15757
+
15758
+ var namedColors = /*#__PURE__*/Object.freeze({
15759
+ __proto__: null,
15760
+ amber: amber$1,
15761
+ blue: blue$1,
15762
+ blueGrey: blueGrey$1,
15763
+ brown: brown$1,
15764
+ common: common$1,
15765
+ cyan: cyan$1,
15766
+ deepOrange: deepOrange$1,
15767
+ deepPurple: deepPurple$1,
15768
+ green: green$1,
15769
+ grey: grey$1,
15770
+ indigo: indigo$1,
15771
+ lightBlue: lightBlue$1,
15772
+ lightGreen: lightGreen$1,
15773
+ lime: lime$1,
15774
+ orange: orange$1,
15775
+ pink: pink$1,
15776
+ purple: purple$1,
15777
+ red: red$1,
15778
+ teal: teal$1,
15779
+ yellow: yellow$1
15780
+ });
15781
+
15542
15782
  const LIGHT = '#FFF';
15543
15783
  const DARK = '#000';
15784
+ const TRANSPARENT = 'rgba(255, 255, 255, 0)';
15785
+
15786
+ /**
15787
+ * If needed, converts a named color to a more reliable CSS color format.
15788
+ *
15789
+ * @param {string} c The CSS color.
15790
+ * @returns {string} Converted color or same color as before.
15791
+ * @private
15792
+ * @example
15793
+ * convertNamedColor('red') => '#FF0000'
15794
+ */
15795
+ function convertNamedColor(c) {
15796
+ let out = c;
15797
+ try {
15798
+ if (c in namedColors) {
15799
+ ({
15800
+ 500: out
15801
+ } = namedColors[c]); // 500 exposes the standard color
15802
+ } else if (c === 'transparent') {
15803
+ out = TRANSPARENT;
15804
+ }
15805
+ } catch (err) {
15806
+ out = c;
15807
+ }
15808
+ return out;
15809
+ }
15810
+ const hasEnoughContrast = (desiredTextColor, backgroundColor) => {
15811
+ const desired = convertNamedColor(desiredTextColor);
15812
+ const background = convertNamedColor(backgroundColor);
15813
+ const CONTRAST_THRESHOLD = 3.0;
15814
+ let isContrastingEnough;
15815
+ try {
15816
+ isContrastingEnough = getContrastRatio(desired, background) > CONTRAST_THRESHOLD;
15817
+ } catch (err) {
15818
+ // The function throws on unsupported or misspelled colors.
15819
+ // In these cases, simply return true.
15820
+ isContrastingEnough = true;
15821
+ }
15822
+ return isContrastingEnough;
15823
+ };
15544
15824
  function getContrastingColor(backgroundColor) {
15545
15825
  let desiredTextColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
15546
15826
  let dark = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DARK;
15547
15827
  let light = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : LIGHT;
15548
- const CONTRAST_THRESHOLD = 3.0;
15549
15828
  let contrastingColor;
15550
- if (desiredTextColor && getContrastRatio(desiredTextColor, backgroundColor) > CONTRAST_THRESHOLD) {
15829
+ if (desiredTextColor && hasEnoughContrast(desiredTextColor, backgroundColor)) {
15551
15830
  contrastingColor = desiredTextColor;
15552
15831
  } else {
15553
- contrastingColor = getContrastRatio(light, backgroundColor) > CONTRAST_THRESHOLD ? light : dark;
15832
+ contrastingColor = hasEnoughContrast(light, backgroundColor) ? light : dark;
15554
15833
  }
15555
15834
  return contrastingColor;
15556
15835
  }