@ni/nimble-components 16.1.7 → 17.0.0

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.
@@ -15395,7 +15395,6 @@
15395
15395
  const Pass100DarkUi = "#00c12b";
15396
15396
  const Fail100LightUi = "#c4000c";
15397
15397
  const Fail100DarkUi = "#ff4646";
15398
- const Black75 = "#818386";
15399
15398
  const Black15 = "#f1f1f2";
15400
15399
  const Black7 = "#f5f5f5";
15401
15400
  const White = "#ffffff";
@@ -15533,7 +15532,6 @@
15533
15532
  borderHoverColor: 'border-hover-color',
15534
15533
  iconColor: 'icon-color',
15535
15534
  modalBackdropColor: 'modal-backdrop-color',
15536
- popupBoxShadowColor: 'popup-box-shadow-color',
15537
15535
  popupBorderColor: 'popup-border-color',
15538
15536
  controlHeight: 'control-height',
15539
15537
  smallPadding: 'small-padding',
@@ -15707,7 +15705,10 @@
15707
15705
  errorTextFontWeight: 'error-text-font-weight',
15708
15706
  errorTextFontLineHeight: 'error-text-font-line-height',
15709
15707
  errorTextFallbackFontFamily: 'error-text-fallback-font-family',
15710
- tableRowBorderColor: 'table-row-border-color'
15708
+ tableRowBorderColor: 'table-row-border-color',
15709
+ elevation1BoxShadow: 'elevation-1-box-shadow',
15710
+ elevation2BoxShadow: 'elevation-2-box-shadow',
15711
+ elevation3BoxShadow: 'elevation-3-box-shadow'
15711
15712
  };
15712
15713
  const prefix = 'ni-nimble';
15713
15714
  const styleNameFromTokenName = (tokenName) => `${prefix}-${tokenName}`;
@@ -15798,7 +15799,6 @@
15798
15799
  // Component Color Tokens
15799
15800
  const iconColor = DesignToken.create(styleNameFromTokenName(tokenNames.iconColor)).withDefault((element) => getColorForTheme(element, Black91, Black15, White));
15800
15801
  DesignToken.create(styleNameFromTokenName(tokenNames.modalBackdropColor)).withDefault((element) => getModalBackdropForTheme(element));
15801
- const popupBoxShadowColor = DesignToken.create(styleNameFromTokenName(tokenNames.popupBoxShadowColor)).withDefault((element) => hexToRgbaCssColor(getColorForTheme(element, Black75, Black85, Black85), 0.3));
15802
15802
  const popupBorderColor = DesignToken.create(styleNameFromTokenName(tokenNames.popupBorderColor)).withDefault((element) => hexToRgbaCssColor(getColorForTheme(element, Black91, Black15, White), 0.3));
15803
15803
  DesignToken.create(styleNameFromTokenName(tokenNames.tooltipBackgroundColor)).withDefault((element) => getColorForTheme(element, Black15, Black85, ForestGreen));
15804
15804
  const tableRowBorderColor = DesignToken.create(styleNameFromTokenName(tokenNames.tableRowBorderColor)).withDefault((element) => getColorForTheme(element, Black15, Black88, ForestGreen));
@@ -15810,6 +15810,10 @@
15810
15810
  const borderWidth = DesignToken.create(styleNameFromTokenName(tokenNames.borderWidth)).withDefault('1px');
15811
15811
  const iconSize = DesignToken.create(styleNameFromTokenName(tokenNames.iconSize)).withDefault('16px');
15812
15812
  const drawerWidth = DesignToken.create(styleNameFromTokenName(tokenNames.drawerWidth)).withDefault('784px');
15813
+ // Drop Shadow Tokens
15814
+ DesignToken.create(styleNameFromTokenName(tokenNames.elevation1BoxShadow)).withDefault((element) => `0px 1px 4px ${hexToRgbaCssColor(getColorForTheme(element, Black, Black, Black), 0.16)}`);
15815
+ const elevation2BoxShadow = DesignToken.create(styleNameFromTokenName(tokenNames.elevation2BoxShadow)).withDefault((element) => `0px 2px 4px ${hexToRgbaCssColor(getColorForTheme(element, Black, Black, Black), 0.16)}`);
15816
+ const elevation3BoxShadow = DesignToken.create(styleNameFromTokenName(tokenNames.elevation3BoxShadow)).withDefault((element) => `0px 4px 8px ${hexToRgbaCssColor(getColorForTheme(element, Black, Black, Black), 0.3)}`);
15813
15817
  // Font Tokens
15814
15818
  createFontTokens(tokenNames.headlineFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Headline1Family, Headline1Weight, Headline1Size, Headline1LineHeight, 'serif');
15815
15819
  createFontTokens(tokenNames.headlinePlus1Font, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Headline2Family, Headline2Weight, Headline2Size, Headline2LineHeight, 'serif');
@@ -18058,7 +18062,7 @@
18058
18062
  );
18059
18063
  z-index: 1;
18060
18064
  padding: var(--ni-private-listbox-padding);
18061
- box-shadow: 0px 3px 3px ${popupBoxShadowColor};
18065
+ box-shadow: ${elevation2BoxShadow};
18062
18066
  border: 1px solid ${popupBorderColor};
18063
18067
  background-color: ${applicationBackgroundColor};
18064
18068
  background-clip: padding-box;
@@ -18494,7 +18498,7 @@
18494
18498
  flex-direction: column;
18495
18499
  background-color: ${applicationBackgroundColor};
18496
18500
  border: none;
18497
- box-shadow: 0px 4px 8px #0000004d;
18501
+ box-shadow: ${elevation3BoxShadow};
18498
18502
  padding: 0px;
18499
18503
  width: 400px;
18500
18504
  max-height: 600px;
@@ -18802,8 +18806,7 @@
18802
18806
  }
18803
18807
 
18804
18808
  :host([location='left']) .dialog-contents {
18805
- border-right: ${borderWidth} solid ${popupBoxShadowColor};
18806
- box-shadow: 3px 0px 8px ${popupBoxShadowColor};
18809
+ box-shadow: 3px 0px 8px #00000033;
18807
18810
  }
18808
18811
 
18809
18812
  :host([location='left']) dialog.animating .dialog-contents {
@@ -18822,8 +18825,7 @@
18822
18825
 
18823
18826
  :host([location='right']) .dialog-contents {
18824
18827
  right: 0px;
18825
- border-left: ${borderWidth} solid ${popupBoxShadowColor};
18826
- box-shadow: -3px 0px 8px ${popupBoxShadowColor};
18828
+ box-shadow: -3px 0px 8px #00000033;
18827
18829
  }
18828
18830
 
18829
18831
  :host([location='right']) dialog.animating .dialog-contents {
@@ -20731,7 +20733,7 @@
20731
20733
  padding: 4px;
20732
20734
  min-width: 168px;
20733
20735
  width: max-content;
20734
- box-shadow: 0px 2px 3px ${popupBoxShadowColor};
20736
+ box-shadow: ${elevation2BoxShadow};
20735
20737
  }
20736
20738
  :host([slot='submenu']) {
20737
20739
  margin: 0 calc(${smallPadding} * 2);
@@ -25921,7 +25923,7 @@
25921
25923
  box-sizing: border-box;
25922
25924
  flex-shrink: 0;
25923
25925
  max-width: 440px;
25924
- box-shadow: 0px 3px 4px ${popupBoxShadowColor};
25926
+ box-shadow: ${elevation2BoxShadow};
25925
25927
  display: inline-flex;
25926
25928
  border: ${borderWidth} solid var(--ni-private-tooltip-border-color);
25927
25929
  background-color: var(--ni-private-tooltip-background-color);
@@ -28106,19 +28108,24 @@ Instead styling against the role which is more general and likely a better appro
28106
28108
  };
28107
28109
  }
28108
28110
  calculateMapDimensions(dies) {
28109
- if (dies.length === 0 || dies[0] === undefined)
28111
+ if (dies.length === 0 || dies[0] === undefined) {
28110
28112
  return { origin: { x: 0, y: 0 }, rows: 0, cols: 0 };
28113
+ }
28111
28114
  const minPoint = { x: dies[0].x, y: dies[0].y };
28112
28115
  const maxPoint = { x: dies[0].x, y: dies[0].y };
28113
28116
  for (const die of dies) {
28114
- if (die.x < minPoint.x)
28117
+ if (die.x < minPoint.x) {
28115
28118
  minPoint.x = die.x;
28116
- if (die.y < minPoint.y)
28119
+ }
28120
+ if (die.y < minPoint.y) {
28117
28121
  minPoint.y = die.y;
28118
- if (die.x > maxPoint.x)
28122
+ }
28123
+ if (die.x > maxPoint.x) {
28119
28124
  maxPoint.x = die.x;
28120
- if (die.y > maxPoint.y)
28125
+ }
28126
+ if (die.y > maxPoint.y) {
28121
28127
  maxPoint.y = die.y;
28128
+ }
28122
28129
  }
28123
28130
  return {
28124
28131
  origin: minPoint,
@@ -29454,8 +29461,9 @@ Instead styling against the role which is more general and likely a better appro
29454
29461
  super.connectedCallback();
29455
29462
  this.resizeObserver = new ResizeObserver(entries => {
29456
29463
  const entry = entries[0];
29457
- if (entry === undefined)
29464
+ if (entry === undefined) {
29458
29465
  return;
29466
+ }
29459
29467
  const { height, width } = entry.contentRect;
29460
29468
  this.canvasSideLength = Math.min(height, width);
29461
29469
  });
@@ -29471,8 +29479,10 @@ Instead styling against the role which is more general and likely a better appro
29471
29479
  */
29472
29480
  render() {
29473
29481
  this.renderQueued = false;
29474
- if (this.canvasSideLength === undefined || this.canvasSideLength === 0)
29482
+ if (this.canvasSideLength === undefined
29483
+ || this.canvasSideLength === 0) {
29475
29484
  return;
29485
+ }
29476
29486
  this.renderer?.clearCanvas(this.canvasSideLength, this.canvasSideLength);
29477
29487
  this.dataManager = new DataManager(this.dies, this.quadrant, { width: this.canvasSideLength, height: this.canvasSideLength }, this.colorScale, this.highlightedValues, this.colorScaleMode, this.dieLabelsHidden, this.dieLabelsSuffix, this.maxCharacters);
29478
29488
  this.renderer = new RenderingModule(this.dataManager, this.canvas);