@ni/nimble-components 23.0.1 → 24.0.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.
Files changed (47) hide show
  1. package/dist/all-components-bundle.js +357 -151
  2. package/dist/all-components-bundle.js.map +1 -1
  3. package/dist/all-components-bundle.min.js +3596 -3615
  4. package/dist/all-components-bundle.min.js.map +1 -1
  5. package/dist/esm/menu-button/index.d.ts +2 -2
  6. package/dist/esm/menu-button/index.js +4 -2
  7. package/dist/esm/menu-button/index.js.map +1 -1
  8. package/dist/esm/menu-button/template.js +1 -0
  9. package/dist/esm/menu-button/template.js.map +1 -1
  10. package/dist/esm/menu-button/types.d.ts +1 -1
  11. package/dist/esm/menu-button/types.js +1 -1
  12. package/dist/esm/menu-button/types.js.map +1 -1
  13. package/dist/esm/patterns/button/styles.js +42 -42
  14. package/dist/esm/patterns/button/styles.js.map +1 -1
  15. package/dist/esm/theme-provider/design-token-comments.js +0 -2
  16. package/dist/esm/theme-provider/design-token-comments.js.map +1 -1
  17. package/dist/esm/theme-provider/design-token-names.js +0 -2
  18. package/dist/esm/theme-provider/design-token-names.js.map +1 -1
  19. package/dist/esm/theme-provider/design-tokens.d.ts +0 -2
  20. package/dist/esm/theme-provider/design-tokens.js +4 -6
  21. package/dist/esm/theme-provider/design-tokens.js.map +1 -1
  22. package/dist/esm/toggle-button/index.d.ts +7 -1
  23. package/dist/esm/toggle-button/index.js +3 -0
  24. package/dist/esm/toggle-button/index.js.map +1 -1
  25. package/dist/esm/toggle-button/styles.js +27 -58
  26. package/dist/esm/toggle-button/styles.js.map +1 -1
  27. package/dist/esm/toggle-button/types.d.ts +1 -1
  28. package/dist/esm/toggle-button/types.js +1 -1
  29. package/dist/esm/toggle-button/types.js.map +1 -1
  30. package/dist/esm/wafer-map/index.d.ts +7 -1
  31. package/dist/esm/wafer-map/index.js +10 -1
  32. package/dist/esm/wafer-map/index.js.map +1 -1
  33. package/dist/esm/wafer-map/modules/experimental/computations.d.ts +31 -0
  34. package/dist/esm/wafer-map/modules/experimental/computations.js +158 -0
  35. package/dist/esm/wafer-map/modules/experimental/computations.js.map +1 -0
  36. package/dist/esm/wafer-map/modules/experimental/data-manager.d.ts +27 -0
  37. package/dist/esm/wafer-map/modules/experimental/data-manager.js +59 -0
  38. package/dist/esm/wafer-map/modules/experimental/data-manager.js.map +1 -0
  39. package/dist/esm/wafer-map/modules/experimental/hover-handler.js +22 -14
  40. package/dist/esm/wafer-map/modules/experimental/hover-handler.js.map +1 -1
  41. package/dist/esm/wafer-map/modules/hover-handler.js +22 -13
  42. package/dist/esm/wafer-map/modules/hover-handler.js.map +1 -1
  43. package/dist/esm/wafer-map/modules/prerendering.js +1 -1
  44. package/dist/esm/wafer-map/modules/prerendering.js.map +1 -1
  45. package/dist/tokens-internal.scss +0 -12
  46. package/dist/tokens.scss +0 -6
  47. package/package.json +2 -2
@@ -16301,7 +16301,7 @@
16301
16301
 
16302
16302
  /**
16303
16303
  * Do not edit directly
16304
- * Generated on Mon, 25 Mar 2024 16:47:43 GMT
16304
+ * Generated on Wed, 27 Mar 2024 11:47:50 GMT
16305
16305
  */
16306
16306
 
16307
16307
  const Information100DarkUi = "#a46eff";
@@ -16324,9 +16324,8 @@
16324
16324
  const DigitalGreenLight = "#009b65";
16325
16325
  const BannerFail100DarkUi = "#d63434";
16326
16326
  const Warning100LightUi = "#ff4b00";
16327
- const DigitalGreenDark = "#006b46";
16327
+ const DigitalGreenDark = "#008557";
16328
16328
  const DigitalGreenDark105 = "#00734b";
16329
- const DigitalGreenDark110 = "#00613f";
16330
16329
  const PowerGreen = "#32eb96";
16331
16330
  const Title2Family = "Source Sans Pro";
16332
16331
  const Title2Weight = "400";
@@ -16447,12 +16446,10 @@
16447
16446
  sectionBackgroundColor: 'section-background-color',
16448
16447
  buttonFillPrimaryColor: 'button-fill-primary-color',
16449
16448
  buttonPrimaryFontColor: 'button-primary-font-color',
16450
- buttonFillActivePrimaryColor: 'button-fill-active-primary-color',
16451
16449
  buttonFillAccentColor: 'button-fill-accent-color',
16452
16450
  buttonAccentBlockFontColor: 'button-accent-block-font-color',
16453
16451
  buttonAccentOutlineFontColor: 'button-accent-outline-font-color',
16454
16452
  buttonBorderAccentOutlineColor: 'button-border-accent-outline-color',
16455
- buttonFillAccentActiveColor: 'button-fill-accent-active-color',
16456
16453
  fillSelectedColor: 'fill-selected-color',
16457
16454
  fillSelectedRgbPartialColor: 'fill-selected-rgb-partial-color',
16458
16455
  fillHoverSelectedColor: 'fill-hover-selected-color',
@@ -16905,12 +16902,10 @@
16905
16902
  const tableRowBorderColor = DesignToken.create(styleNameFromTokenName(tokenNames.tableRowBorderColor)).withDefault((element) => getColorForTheme(element, Black15, Black80, ForestGreen));
16906
16903
  const buttonFillPrimaryColor = DesignToken.create(styleNameFromTokenName(tokenNames.buttonFillPrimaryColor)).withDefault((element) => getColorForTheme(element, hexToRgbaCssColor(Black91, 0.75), hexToRgbaCssColor(Black15, 0.3), hexToRgbaCssColor(White, 0.3)));
16907
16904
  const buttonPrimaryFontColor = DesignToken.create(styleNameFromTokenName(tokenNames.buttonPrimaryFontColor)).withDefault((element) => getColorForTheme(element, Black15, Black15, White));
16908
- const buttonFillActivePrimaryColor = DesignToken.create(styleNameFromTokenName(tokenNames.buttonFillActivePrimaryColor)).withDefault((element) => getColorForTheme(element, hexToRgbaCssColor(Black91, 0.85), hexToRgbaCssColor(Black15, 0.2), hexToRgbaCssColor(White, 0.2)));
16909
16905
  const buttonFillAccentColor = DesignToken.create(styleNameFromTokenName(tokenNames.buttonFillAccentColor)).withDefault((element) => getColorForTheme(element, DigitalGreenDark, DigitalGreenLight, hexToRgbaCssColor(White, 0.1)));
16910
16906
  const buttonAccentBlockFontColor = DesignToken.create(styleNameFromTokenName(tokenNames.buttonAccentBlockFontColor)).withDefault((element) => getColorForTheme(element, White, Black15, White));
16911
16907
  const buttonAccentOutlineFontColor = DesignToken.create(styleNameFromTokenName(tokenNames.buttonAccentOutlineFontColor)).withDefault((element) => getColorForTheme(element, DigitalGreenDark105, PowerGreen, White));
16912
16908
  const buttonBorderAccentOutlineColor = DesignToken.create(styleNameFromTokenName(tokenNames.buttonBorderAccentOutlineColor)).withDefault((element) => getColorForTheme(element, DigitalGreenLight, PowerGreen, hexToRgbaCssColor(White, 0.3)));
16913
- const buttonFillAccentActiveColor = DesignToken.create(styleNameFromTokenName(tokenNames.buttonFillAccentActiveColor)).withDefault((element) => getColorForTheme(element, DigitalGreenDark110, DigitalGreenDark, hexToRgbaCssColor(White, 0.2)));
16914
16909
  // Component Sizing Tokens
16915
16910
  const controlHeight = DesignToken.create(styleNameFromTokenName(tokenNames.controlHeight)).withDefault('32px');
16916
16911
  const controlSlimHeight = DesignToken.create(styleNameFromTokenName(tokenNames.controlSlimHeight)).withDefault('24px');
@@ -16946,9 +16941,9 @@
16946
16941
  const [subtitlePlus1Font, subtitlePlus1FontColor, subtitlePlus1DisabledFontColor, subtitlePlus1FontFamily, subtitlePlus1FontWeight, subtitlePlus1FontSize, subtitlePlus1FontLineHeight, subtitlePlus1FallbackFontFamily] = createFontTokens(tokenNames.subtitlePlus1Font, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Subtitle2Family, Subtitle2Weight, Subtitle2Size, Subtitle2LineHeight, Subtitle2FallbackFontFamily);
16947
16942
  const [subtitleFont, subtitleFontColor, subtitleDisabledFontColor, subtitleFontFamily, subtitleFontWeight, subtitleFontSize, subtitleFontLineHeight, subtitleFallbackFontFamily] = createFontTokens(tokenNames.subtitleFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Subtitle1Family, Subtitle1Weight, Subtitle1Size, Subtitle1LineHeight, Subtitle1FallbackFontFamily);
16948
16943
  const [linkFont, linkFontColor, linkDisabledFontColor, linkFontFamily, linkFontWeight, linkFontSize, linkFontLineHeight, linkFallbackFontFamily] = createFontTokens(tokenNames.linkFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight, LinkFallbackFontFamily);
16949
- const [linkActiveFont, linkActiveFontColor, linkActiveDisabledFontColor, linkActiveFontFamily, linkActiveFontWeight, linkActiveFontSize, linkActiveFontLineHeight, linkActiveFallbackFontFamily] = createFontTokens(tokenNames.linkActiveFont, (element) => getColorForTheme(element, DigitalGreenDark, PowerGreen, hexToRgbaCssColor(White, 0.6)), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight, LinkFallbackFontFamily);
16950
- const [linkProminentFont, linkProminentFontColor, linkProminentDisabledFontColor, linkProminentFontFamily, linkProminentFontWeight, linkProminentFontSize, linkProminentFontLineHeight, linkProminentFallbackFontFamily] = createFontTokens(tokenNames.linkProminentFont, (element) => getColorForTheme(element, DigitalGreenDark, PowerGreen, PowerGreen), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight, LinkFallbackFontFamily);
16951
- const [linkActiveProminentFont, linkActiveProminentFontColor, linkActiveProminentDisabledFontColor, linkActiveProminentFontFamily, linkActiveProminentFontWeight, linkActiveProminentFontSize, linkActiveProminentFontLineHeight, linkActiveProminentFallbackFontFamily] = createFontTokens(tokenNames.linkActiveProminentFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight, LinkFallbackFontFamily);
16944
+ const [linkActiveFont, linkActiveFontColor, linkActiveDisabledFontColor, linkActiveFontFamily, linkActiveFontWeight, linkActiveFontSize, linkActiveFontLineHeight, linkActiveFallbackFontFamily] = createFontTokens(tokenNames.linkActiveFont, (element) => getColorForTheme(element, DigitalGreenLight, DigitalGreenLight, hexToRgbaCssColor(White, 0.6)), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight, LinkFallbackFontFamily);
16945
+ const [linkProminentFont, linkProminentFontColor, linkProminentDisabledFontColor, linkProminentFontFamily, linkProminentFontWeight, linkProminentFontSize, linkProminentFontLineHeight, linkProminentFallbackFontFamily] = createFontTokens(tokenNames.linkProminentFont, (element) => getColorForTheme(element, DigitalGreenDark105, PowerGreen, PowerGreen), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight, LinkFallbackFontFamily);
16946
+ const [linkActiveProminentFont, linkActiveProminentFontColor, linkActiveProminentDisabledFontColor, linkActiveProminentFontFamily, linkActiveProminentFontWeight, linkActiveProminentFontSize, linkActiveProminentFontLineHeight, linkActiveProminentFallbackFontFamily] = createFontTokens(tokenNames.linkActiveProminentFont, (element) => getColorForTheme(element, DigitalGreenLight, DigitalGreenLight, PowerGreen), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight, LinkFallbackFontFamily);
16952
16947
  const [placeholderFont, placeholderFontColor, placeholderDisabledFontColor, placeholderFontFamily, placeholderFontWeight, placeholderFontSize, placeholderFontLineHeight, placeholderFallbackFontFamily] = createFontTokens(tokenNames.placeholderFont, (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.6), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), PlaceholderFamily, PlaceholderWeight, PlaceholderSize, PlaceholderLineHeight, PlaceholderFallbackFontFamily);
16953
16948
  const [bodyFont, bodyFontColor, bodyDisabledFontColor, bodyFontFamily, bodyFontWeight, bodyFontSize, bodyFontLineHeight, bodyFallbackFontFamily] = createFontTokens(tokenNames.bodyFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), BodyFamily, BodyWeight, BodySize, BodyLineHeight, BodyFallbackFontFamily);
16954
16949
  const [bodyEmphasizedFont, bodyEmphasizedFontColor, bodyEmphasizedDisabledFontColor, bodyEmphasizedFontFamily, bodyEmphasizedFontWeight, bodyEmphasizedFontSize, bodyEmphasizedFontLineHeight, bodyEmphasizedFallbackFontFamily] = createFontTokens(tokenNames.bodyEmphasizedFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), BodyEmphasizedFamily, BodyEmphasizedWeight, BodyEmphasizedSize, BodyEmphasizedLineHeight, BodyEmphasizedFallbackFontFamily);
@@ -17352,7 +17347,7 @@
17352
17347
  `;
17353
17348
 
17354
17349
  const styles$V = css `
17355
- @layer base, hover, focusVisible, active, disabled, top;
17350
+ @layer base, checked, hover, focusVisible, active, disabled, top;
17356
17351
 
17357
17352
  @layer base {
17358
17353
  ${display('inline-flex')}
@@ -17425,15 +17420,15 @@
17425
17420
  display: contents;
17426
17421
  }
17427
17422
 
17428
- :host([content-hidden]) .content {
17429
- ${accessiblyHidden}
17430
- }
17431
-
17432
17423
  [part='start'] {
17433
17424
  display: contents;
17434
17425
  ${iconColor.cssCustomProperty}: ${buttonLabelFontColor};
17435
17426
  }
17436
17427
 
17428
+ :host([content-hidden]) .content {
17429
+ ${accessiblyHidden}
17430
+ }
17431
+
17437
17432
  [part='end'] {
17438
17433
  display: contents;
17439
17434
  ${iconColor.cssCustomProperty}: ${buttonLabelFontColor};
@@ -17462,6 +17457,8 @@
17462
17457
  @layer active {
17463
17458
  .control:active {
17464
17459
  box-shadow: none;
17460
+ color: ${buttonLabelFontColor};
17461
+ border-color: ${borderHoverColor};
17465
17462
  background-image: linear-gradient(
17466
17463
  ${fillSelectedColor},
17467
17464
  ${fillSelectedColor}
@@ -17472,29 +17469,30 @@
17472
17469
  .control:active::before {
17473
17470
  outline: none;
17474
17471
  }
17472
+
17473
+ .control:active [part='start'],
17474
+ .control:active [part='end'] {
17475
+ ${iconColor.cssCustomProperty}: ${buttonLabelFontColor};
17476
+ }
17475
17477
  }
17476
17478
 
17477
17479
  @layer disabled {
17478
17480
  :host([disabled]) {
17479
- color: ${buttonLabelDisabledFontColor};
17480
17481
  cursor: default;
17481
17482
  }
17482
17483
 
17483
17484
  :host([disabled]) .control {
17485
+ color: ${buttonLabelDisabledFontColor};
17484
17486
  box-shadow: none;
17485
17487
  background-image: none;
17486
- color: rgba(${actionRgbPartialColor}, 0.3);
17488
+ background-size: 100% 100%;
17487
17489
  }
17488
17490
 
17489
17491
  :host([disabled]) .control::before {
17490
17492
  box-shadow: none;
17491
17493
  }
17492
17494
 
17493
- :host([disabled]) slot[name='start']::slotted(*) {
17494
- opacity: 0.3;
17495
- ${iconColor.cssCustomProperty}: ${buttonLabelFontColor};
17496
- }
17497
-
17495
+ :host([disabled]) slot[name='start']::slotted(*),
17498
17496
  :host([disabled]) slot[name='end']::slotted(*) {
17499
17497
  opacity: 0.3;
17500
17498
  ${iconColor.cssCustomProperty}: ${buttonLabelFontColor};
@@ -17559,7 +17557,6 @@
17559
17557
  rgba(${borderRgbPartialColor}, 0.1),
17560
17558
  rgba(${borderRgbPartialColor}, 0.1)
17561
17559
  );
17562
- background-size: 100% 100%;
17563
17560
  border-color: rgba(${borderRgbPartialColor}, 0.1);
17564
17561
  }
17565
17562
  }
@@ -17574,13 +17571,29 @@
17574
17571
  border-color: ${buttonBorderAccentOutlineColor};
17575
17572
  color: ${buttonAccentOutlineFontColor};
17576
17573
  }
17574
+
17575
+ :host([appearance-variant='accent']) [part='start'],
17576
+ :host([appearance-variant='accent']) [part='end'] {
17577
+ ${iconColor.cssCustomProperty}: ${buttonAccentOutlineFontColor};
17578
+ }
17579
+ }
17580
+
17581
+ @layer active {
17582
+ :host([appearance-variant='accent']) .control:active {
17583
+ color: ${buttonAccentOutlineFontColor};
17584
+ }
17585
+
17586
+ :host([appearance-variant='accent'])
17587
+ .control:active
17588
+ [part='start'],
17589
+ :host([appearance-variant='accent'])
17590
+ .control:active
17591
+ [part='end'] {
17592
+ ${iconColor.cssCustomProperty}: ${buttonAccentOutlineFontColor};
17593
+ }
17577
17594
  }
17578
17595
  `), appearanceBehavior(ButtonAppearance.block, css `
17579
17596
  @layer base {
17580
- :host([appearance-variant='primary']) [part='start'] {
17581
- ${iconColor.cssCustomProperty}: white;
17582
- }
17583
-
17584
17597
  :host([appearance-variant='primary']) .control {
17585
17598
  background-image: linear-gradient(
17586
17599
  ${buttonFillPrimaryColor},
@@ -17590,14 +17603,6 @@
17590
17603
  border-color: ${buttonFillPrimaryColor};
17591
17604
  }
17592
17605
 
17593
- :host([appearance-variant='primary']) [part='end'] {
17594
- ${iconColor.cssCustomProperty}: white;
17595
- }
17596
-
17597
- :host([appearance-variant='accent']) [part='start'] {
17598
- ${iconColor.cssCustomProperty}: white;
17599
- }
17600
-
17601
17606
  :host([appearance-variant='accent']) .control {
17602
17607
  background-image: linear-gradient(
17603
17608
  ${buttonFillAccentColor},
@@ -17607,24 +17612,14 @@
17607
17612
  border-color: ${buttonFillAccentColor};
17608
17613
  }
17609
17614
 
17610
- :host([appearance-variant='accent']) [part='end'] {
17611
- ${iconColor.cssCustomProperty}: white;
17612
- }
17613
- }
17614
-
17615
- @layer active {
17616
- :host([appearance-variant='primary']) .control:active {
17617
- background-image: linear-gradient(
17618
- ${buttonFillActivePrimaryColor},
17619
- ${buttonFillActivePrimaryColor}
17620
- );
17615
+ :host([appearance-variant='primary']) [part='start'],
17616
+ :host([appearance-variant='primary']) [part='end'] {
17617
+ ${iconColor.cssCustomProperty}: ${buttonPrimaryFontColor};
17621
17618
  }
17622
17619
 
17623
- :host([appearance-variant='accent']) .control:active {
17624
- background-image: linear-gradient(
17625
- ${buttonFillAccentActiveColor},
17626
- ${buttonFillAccentActiveColor}
17627
- );
17620
+ :host([appearance-variant='accent']) [part='start'],
17621
+ :host([appearance-variant='accent']) [part='end'] {
17622
+ ${iconColor.cssCustomProperty}: ${buttonPrimaryFontColor};
17628
17623
  }
17629
17624
  }
17630
17625
  `));
@@ -20442,60 +20437,22 @@
20442
20437
 
20443
20438
  const styles$G = css `
20444
20439
  ${styles$V}
20440
+ ${buttonAppearanceVariantStyles}
20445
20441
 
20446
- @layer base {
20442
+ @layer checked {
20447
20443
  .control[aria-pressed='true'] {
20448
20444
  background-color: transparent;
20445
+ color: ${buttonLabelFontColor};
20449
20446
  background-image: linear-gradient(
20450
20447
  ${fillSelectedColor},
20451
20448
  ${fillSelectedColor}
20452
20449
  );
20453
20450
  border-color: rgba(${fillSelectedRgbPartialColor}, 0.3);
20454
20451
  }
20455
- }
20456
-
20457
- @layer hover {
20458
- .control[aria-pressed='true']:hover {
20459
- border-color: ${borderHoverColor};
20460
- box-shadow: 0px 0px 0px ${borderWidth} ${borderHoverColor} inset;
20461
- background-image: linear-gradient(
20462
- ${fillSelectedColor},
20463
- ${fillSelectedColor}
20464
- );
20465
- background-size: calc(100% - 4px) calc(100% - 4px);
20466
- }
20467
- }
20468
-
20469
- @layer focusVisible {
20470
- .control[aria-pressed='true']${focusVisible} {
20471
- border-color: ${borderHoverColor};
20472
- box-shadow: 0px 0px 0px ${borderWidth} ${borderHoverColor} inset;
20473
- background-image: linear-gradient(
20474
- ${fillSelectedColor},
20475
- ${fillSelectedColor}
20476
- );
20477
- background-size: calc(100% - 4px) calc(100% - 4px);
20478
- }
20479
-
20480
- .control[aria-pressed='true']${focusVisible}::before {
20481
- outline: ${borderWidth} solid ${borderHoverColor};
20482
- outline-offset: -3px;
20483
- color: transparent;
20484
- }
20485
- }
20486
-
20487
- @layer active {
20488
- .control[aria-pressed='true']:active {
20489
- box-shadow: none;
20490
- background-image: linear-gradient(
20491
- ${fillSelectedColor},
20492
- ${fillSelectedColor}
20493
- );
20494
- background-size: calc(100% - 2px) calc(100% - 2px);
20495
- }
20496
20452
 
20497
- .control[aria-pressed='true']:active::before {
20498
- outline: none;
20453
+ .control[aria-pressed='true'] [part='start'],
20454
+ .control[aria-pressed='true'] [part='end'] {
20455
+ ${iconColor.cssCustomProperty}: ${buttonLabelFontColor};
20499
20456
  }
20500
20457
  }
20501
20458
 
@@ -20507,18 +20464,24 @@
20507
20464
  );
20508
20465
  border-color: rgba(${fillSelectedRgbPartialColor}, 0.3);
20509
20466
  }
20510
-
20511
- :host([disabled]) .control[aria-pressed='true']:hover {
20512
- background-image: linear-gradient(
20513
- ${fillSelectedColor},
20514
- ${fillSelectedColor}
20515
- );
20516
- background-size: 100% 100%;
20517
- border-color: rgba(${fillSelectedRgbPartialColor}, 0.3);
20518
- box-shadow: none;
20519
- }
20520
20467
  }
20521
- `;
20468
+ `.withBehaviors(appearanceBehavior(ButtonAppearance.outline, css `
20469
+ @layer checked {
20470
+ :host([appearance-variant='accent'])
20471
+ .control[aria-pressed='true'] {
20472
+ color: ${buttonAccentOutlineFontColor};
20473
+ }
20474
+
20475
+ :host([appearance-variant='accent'])
20476
+ .control[aria-pressed='true']
20477
+ [part='start'],
20478
+ :host([appearance-variant='accent'])
20479
+ .control[aria-pressed='true']
20480
+ [part='end'] {
20481
+ ${iconColor.cssCustomProperty}: ${buttonAccentOutlineFontColor};
20482
+ }
20483
+ }
20484
+ `));
20522
20485
 
20523
20486
  const template$v = (context, definition) => html `
20524
20487
  <div
@@ -20589,6 +20552,9 @@
20589
20552
  __decorate$1([
20590
20553
  attr
20591
20554
  ], ToggleButton.prototype, "appearance", void 0);
20555
+ __decorate$1([
20556
+ attr({ attribute: 'appearance-variant' })
20557
+ ], ToggleButton.prototype, "appearanceVariant", void 0);
20592
20558
  __decorate$1([
20593
20559
  attr({ attribute: 'content-hidden', mode: 'boolean' })
20594
20560
  ], ToggleButton.prototype, "contentHidden", void 0);
@@ -24706,6 +24672,19 @@
24706
24672
  });
24707
24673
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleMenu());
24708
24674
 
24675
+ /**
24676
+ * Types of menu button appearance.
24677
+ * @public
24678
+ */
24679
+ /**
24680
+ * The options of where to position the menu relative to the menu button.
24681
+ */
24682
+ const MenuButtonPosition = {
24683
+ above: 'above',
24684
+ below: 'below',
24685
+ auto: 'auto'
24686
+ };
24687
+
24709
24688
  const styles$y = css `
24710
24689
  ${display('inline-block')}
24711
24690
 
@@ -24733,6 +24712,7 @@
24733
24712
  <${toggleButtonTag}
24734
24713
  part="button"
24735
24714
  appearance="${x => x.appearance}"
24715
+ appearance-variant="${x => x.appearanceVariant}"
24736
24716
  ?content-hidden="${x => x.contentHidden}"
24737
24717
  ?checked="${x => x.open}"
24738
24718
  ?disabled="${x => x.disabled}"
@@ -24768,19 +24748,6 @@
24768
24748
  </template>
24769
24749
  `;
24770
24750
 
24771
- /**
24772
- * Types of menu button appearance.
24773
- * @public
24774
- */
24775
- /**
24776
- * The options of where to position the menu relative to the menu button.
24777
- */
24778
- const MenuButtonPosition = {
24779
- above: 'above',
24780
- below: 'below',
24781
- auto: 'auto'
24782
- };
24783
-
24784
24751
  /**
24785
24752
  * A nimble-styled menu button control.
24786
24753
  */
@@ -24957,6 +24924,9 @@
24957
24924
  __decorate$1([
24958
24925
  attr
24959
24926
  ], MenuButton.prototype, "appearance", void 0);
24927
+ __decorate$1([
24928
+ attr({ attribute: 'appearance-variant' })
24929
+ ], MenuButton.prototype, "appearanceVariant", void 0);
24960
24930
  __decorate$1([
24961
24931
  attr({ mode: 'boolean' })
24962
24932
  ], MenuButton.prototype, "disabled", void 0);
@@ -75118,7 +75088,7 @@ img.ProseMirror-separator {
75118
75088
  /**
75119
75089
  * Computations calculates and stores different measures which are used in the Wafermap
75120
75090
  */
75121
- class Computations {
75091
+ let Computations$1 = class Computations {
75122
75092
  get containerDimensions() {
75123
75093
  return this._containerDimensions;
75124
75094
  }
@@ -75295,7 +75265,7 @@ img.ProseMirror-separator {
75295
75265
  left: baseMargin.left + addedMargin.left
75296
75266
  };
75297
75267
  }
75298
- }
75268
+ };
75299
75269
 
75300
75270
  /**
75301
75271
  * Prerendering prepares render-ready dies data to be used by the rendering module
@@ -75361,7 +75331,7 @@ img.ProseMirror-separator {
75361
75331
  return '';
75362
75332
  }
75363
75333
  const label = `${value}${dieLabelsSuffix}`;
75364
- if (label.length > maxCharacters) {
75334
+ if (label.length >= maxCharacters) {
75365
75335
  return `${label.substring(0, maxCharacters)}…`;
75366
75336
  }
75367
75337
  return label;
@@ -75410,7 +75380,7 @@ img.ProseMirror-separator {
75410
75380
  /**
75411
75381
  * Data Manager uses Computations and Prerendering modules in order and exposes the results
75412
75382
  */
75413
- class DataManager {
75383
+ let DataManager$1 = class DataManager {
75414
75384
  get containerDimensions() {
75415
75385
  return this.computations.containerDimensions;
75416
75386
  }
@@ -75444,6 +75414,219 @@ img.ProseMirror-separator {
75444
75414
  get data() {
75445
75415
  return this.dataMap;
75446
75416
  }
75417
+ constructor(wafermap) {
75418
+ this.wafermap = wafermap;
75419
+ this.computations = new Computations$1(wafermap);
75420
+ this.prerendering = new Prerendering(wafermap);
75421
+ }
75422
+ updateContainerDimensions() {
75423
+ this.computations.updateContainerDimensions();
75424
+ this.updateDataMap();
75425
+ this.updateLabelsFontSize();
75426
+ }
75427
+ updateScales() {
75428
+ this.computations.updateScales();
75429
+ this.updateDataMap();
75430
+ this.updateLabelsFontSize();
75431
+ }
75432
+ updateLabelsFontSize() {
75433
+ this.prerendering.updateLabelsFontSize();
75434
+ }
75435
+ updateDiesRenderInfo() {
75436
+ this.prerendering.updateDiesRenderInfo();
75437
+ }
75438
+ getWaferMapDie(point) {
75439
+ return this.dataMap.get(`${point.x}_${point.y}`);
75440
+ }
75441
+ updateDataMap() {
75442
+ this.dataMap = new Map(this.wafermap.dies.map(die => [`${die.x}_${die.y}`, die]));
75443
+ }
75444
+ };
75445
+
75446
+ /**
75447
+ * Computations calculates and stores different measures which are used in the Wafermap
75448
+ */
75449
+ class Computations {
75450
+ get containerDimensions() {
75451
+ return this._containerDimensions;
75452
+ }
75453
+ get dieDimensions() {
75454
+ return this._dieDimensions;
75455
+ }
75456
+ get margin() {
75457
+ return this._margin;
75458
+ }
75459
+ get horizontalScale() {
75460
+ return this._horizontalScale;
75461
+ }
75462
+ get verticalScale() {
75463
+ return this._verticalScale;
75464
+ }
75465
+ constructor(wafermap) {
75466
+ this.wafermap = wafermap;
75467
+ this.defaultPadding = 0;
75468
+ this.baseMarginPercentage = 0.04;
75469
+ }
75470
+ updateContainerDimensions() {
75471
+ const canvasDimensions = {
75472
+ width: this.wafermap.canvasWidth,
75473
+ height: this.wafermap.canvasHeight
75474
+ };
75475
+ const canvasDiameter = Math.min(canvasDimensions.width, canvasDimensions.height);
75476
+ const canvasMargin = {
75477
+ top: (canvasDimensions.height - canvasDiameter) / 2,
75478
+ right: (canvasDimensions.width - canvasDiameter) / 2,
75479
+ bottom: (canvasDimensions.height - canvasDiameter) / 2,
75480
+ left: (canvasDimensions.width - canvasDiameter) / 2
75481
+ };
75482
+ const baseMargin = {
75483
+ top: canvasDiameter * this.baseMarginPercentage,
75484
+ right: canvasDiameter * this.baseMarginPercentage,
75485
+ bottom: canvasDiameter * this.baseMarginPercentage,
75486
+ left: canvasDiameter * this.baseMarginPercentage
75487
+ };
75488
+ this._margin = this.calculateMarginAddition(baseMargin, canvasMargin);
75489
+ this._containerDimensions = this.calculateContainerDimensions(canvasDimensions, this._margin);
75490
+ this.updateScales();
75491
+ }
75492
+ updateScales() {
75493
+ const containerDiameter = Math.min(this._containerDimensions.width, this._containerDimensions.height);
75494
+ const gridDimensions = this.gridDimensionsValidAndDefined()
75495
+ ? this.calculateGridDimensionsFromBoundingBox()
75496
+ : this.calculateGridDimensionsFromDies();
75497
+ // this scale is used for positioning the dies on the canvas
75498
+ const originLocation = this.wafermap.originLocation;
75499
+ this._horizontalScale = this.createHorizontalScale(originLocation, gridDimensions, containerDiameter);
75500
+ // this scale is used for positioning the dies on the canvas
75501
+ this._verticalScale = this.createVerticalScale(originLocation, gridDimensions, containerDiameter);
75502
+ this._dieDimensions = {
75503
+ width: Math.abs(this._horizontalScale(0) - this._horizontalScale(1)),
75504
+ height: Math.abs(this._verticalScale(0) - this._verticalScale(1))
75505
+ };
75506
+ }
75507
+ gridDimensionsValidAndDefined() {
75508
+ return (!this.wafermap.validity.invalidGridDimensions
75509
+ && typeof this.wafermap.gridMinX === 'number'
75510
+ && typeof this.wafermap.gridMinY === 'number'
75511
+ && typeof this.wafermap.gridMaxX === 'number'
75512
+ && typeof this.wafermap.gridMinX === 'number');
75513
+ }
75514
+ calculateGridDimensionsFromBoundingBox() {
75515
+ const gridDimensions = { origin: { x: 0, y: 0 }, rows: 0, cols: 0 };
75516
+ if (typeof this.wafermap.gridMaxY === 'number'
75517
+ && typeof this.wafermap.gridMinY === 'number'
75518
+ && typeof this.wafermap.gridMaxX === 'number'
75519
+ && typeof this.wafermap.gridMinX === 'number') {
75520
+ gridDimensions.origin.x = this.wafermap.gridMinX;
75521
+ gridDimensions.origin.y = this.wafermap.gridMinY;
75522
+ gridDimensions.rows = this.wafermap.gridMaxY - this.wafermap.gridMinY + 1;
75523
+ gridDimensions.cols = this.wafermap.gridMaxX - this.wafermap.gridMinX + 1;
75524
+ }
75525
+ return gridDimensions;
75526
+ }
75527
+ calculateGridDimensionsFromDies() {
75528
+ if (this.wafermap.diesTable === undefined) {
75529
+ return { origin: { x: 0, y: 0 }, rows: 0, cols: 0 };
75530
+ }
75531
+ const colIndex = this.wafermap.diesTable
75532
+ .getChild('colIndex')
75533
+ .toArray();
75534
+ const rowIndex = this.wafermap.diesTable
75535
+ .getChild('rowIndex')
75536
+ .toArray();
75537
+ const minPoint = { x: colIndex[0], y: rowIndex[0] };
75538
+ const maxPoint = { x: colIndex[0], y: rowIndex[0] };
75539
+ // will replace iterating with arquero after fixing issues: https://github.com/uwdata/arquero/pull/346
75540
+ for (let i = 0; i < colIndex.length; i++) {
75541
+ if (colIndex[i] < minPoint.x) {
75542
+ minPoint.x = colIndex[i];
75543
+ }
75544
+ if (colIndex[i] > maxPoint.x) {
75545
+ maxPoint.x = colIndex[i];
75546
+ }
75547
+ if (rowIndex[i] < minPoint.y) {
75548
+ minPoint.y = rowIndex[i];
75549
+ }
75550
+ if (rowIndex[i] > maxPoint.y) {
75551
+ maxPoint.y = rowIndex[i];
75552
+ }
75553
+ }
75554
+ return {
75555
+ origin: minPoint,
75556
+ rows: maxPoint.y - minPoint.y + 1,
75557
+ cols: maxPoint.x - minPoint.x + 1
75558
+ };
75559
+ }
75560
+ calculateContainerDimensions(canvasDimensions, margin) {
75561
+ return {
75562
+ width: canvasDimensions.width - margin.left - margin.right,
75563
+ height: canvasDimensions.height - margin.top - margin.bottom
75564
+ };
75565
+ }
75566
+ createHorizontalScale(originLocation, grid, containerWidth) {
75567
+ const scale = linear();
75568
+ if (originLocation === WaferMapOriginLocation.bottomLeft
75569
+ || originLocation === WaferMapOriginLocation.topLeft) {
75570
+ return scale
75571
+ .domain([grid.origin.x, grid.origin.x + grid.cols])
75572
+ .range([0, containerWidth]);
75573
+ }
75574
+ return scale
75575
+ .domain([grid.origin.x - 1, grid.origin.x + grid.cols - 1])
75576
+ .range([containerWidth, 0]);
75577
+ }
75578
+ createVerticalScale(originLocation, grid, containerHeight) {
75579
+ const scale = linear();
75580
+ // html canvas has top-left origin https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Drawing_shapes#the_grid
75581
+ // we need to flip the vertical scale
75582
+ if (originLocation === WaferMapOriginLocation.bottomLeft
75583
+ || originLocation === WaferMapOriginLocation.bottomRight) {
75584
+ return scale
75585
+ .domain([grid.origin.y - 1, grid.origin.y + grid.rows - 1])
75586
+ .range([containerHeight, 0]);
75587
+ }
75588
+ return scale
75589
+ .domain([grid.origin.y, grid.origin.y + grid.rows])
75590
+ .range([0, containerHeight]);
75591
+ }
75592
+ calculateMarginAddition(baseMargin, addedMargin) {
75593
+ return {
75594
+ top: baseMargin.top + addedMargin.top,
75595
+ right: baseMargin.right + addedMargin.right,
75596
+ bottom: baseMargin.bottom + addedMargin.bottom,
75597
+ left: baseMargin.left + addedMargin.left
75598
+ };
75599
+ }
75600
+ }
75601
+
75602
+ /**
75603
+ * Data Manager uses Computations and Prerendering modules in order and exposes the results
75604
+ */
75605
+ class DataManager {
75606
+ get containerDimensions() {
75607
+ return this.computations.containerDimensions;
75608
+ }
75609
+ get dieDimensions() {
75610
+ return this.computations.dieDimensions;
75611
+ }
75612
+ get margin() {
75613
+ return this.computations.margin;
75614
+ }
75615
+ get horizontalScale() {
75616
+ return this.computations.horizontalScale;
75617
+ }
75618
+ get verticalScale() {
75619
+ return this.computations.verticalScale;
75620
+ }
75621
+ get labelsFontSize() {
75622
+ return this.prerendering.labelsFontSize;
75623
+ }
75624
+ get diesRenderInfo() {
75625
+ return this.prerendering.diesRenderInfo;
75626
+ }
75627
+ get data() {
75628
+ return this.dataMap;
75629
+ }
75447
75630
  constructor(wafermap) {
75448
75631
  this.wafermap = wafermap;
75449
75632
  this.computations = new Computations(wafermap);
@@ -76415,6 +76598,10 @@ img.ProseMirror-separator {
76415
76598
  x: invertedPoint[0],
76416
76599
  y: invertedPoint[1]
76417
76600
  });
76601
+ if (dieCoordinates === undefined) {
76602
+ this.wafermap.hoverDie = undefined;
76603
+ return;
76604
+ }
76418
76605
  this.wafermap.hoverDie = this.wafermap.dataManager.getWaferMapDie(dieCoordinates);
76419
76606
  };
76420
76607
  this.onMouseOut = (_event) => {
@@ -76436,19 +76623,23 @@ img.ProseMirror-separator {
76436
76623
  this.wafermap.removeEventListener('mouseout', this.onMouseOut);
76437
76624
  }
76438
76625
  calculateDieCoordinates(mousePosition) {
76439
- const originLocation = this.wafermap.originLocation;
76440
- const xRoundFunction = originLocation === WaferMapOriginLocation.bottomLeft
76441
- || originLocation === WaferMapOriginLocation.topLeft
76442
- ? Math.floor
76443
- : Math.ceil;
76444
- const yRoundFunction = originLocation === WaferMapOriginLocation.bottomLeft
76445
- || originLocation === WaferMapOriginLocation.bottomRight
76446
- ? Math.floor
76447
- : Math.ceil;
76448
- // go to x and y scale to get the x,y values of the die.
76449
- const x = xRoundFunction(this.wafermap.dataManager.invertedHorizontalScale(mousePosition.x - this.wafermap.dataManager.margin.left));
76450
- const y = yRoundFunction(this.wafermap.dataManager.invertedVerticalScale(mousePosition.y - this.wafermap.dataManager.margin.top));
76451
- return { x, y };
76626
+ if (!this.wafermap.isExperimentalRenderer()
76627
+ && this.wafermap.dataManager instanceof DataManager$1) {
76628
+ const originLocation = this.wafermap.originLocation;
76629
+ const xRoundFunction = originLocation === WaferMapOriginLocation.bottomLeft
76630
+ || originLocation === WaferMapOriginLocation.topLeft
76631
+ ? Math.floor
76632
+ : Math.ceil;
76633
+ const yRoundFunction = originLocation === WaferMapOriginLocation.bottomLeft
76634
+ || originLocation === WaferMapOriginLocation.bottomRight
76635
+ ? Math.floor
76636
+ : Math.ceil;
76637
+ // go to x and y scale to get the x,y values of the die.
76638
+ const x = xRoundFunction(this.wafermap.dataManager.invertedHorizontalScale(mousePosition.x - this.wafermap.dataManager.margin.left));
76639
+ const y = yRoundFunction(this.wafermap.dataManager.invertedVerticalScale(mousePosition.y - this.wafermap.dataManager.margin.top));
76640
+ return { x, y };
76641
+ }
76642
+ return undefined;
76452
76643
  }
76453
76644
  hoversOverDie(mousePosition) {
76454
76645
  const rgba = this.wafermap.canvasContext.getImageData(mousePosition.x, mousePosition.y, 1, 1).data;
@@ -76479,11 +76670,14 @@ img.ProseMirror-separator {
76479
76670
  event.offsetX,
76480
76671
  event.offsetY
76481
76672
  ]);
76482
- // does not work yet until data manager will parse diesTable
76483
76673
  const dieCoordinates = this.calculateDieCoordinates({
76484
76674
  x: invertedPoint[0],
76485
76675
  y: invertedPoint[1]
76486
76676
  });
76677
+ if (dieCoordinates === undefined) {
76678
+ this.wafermap.hoverDie = undefined;
76679
+ return;
76680
+ }
76487
76681
  const colIndex = this.wafermap
76488
76682
  .diesTable.getChild('colIndex')
76489
76683
  .toArray();
@@ -76523,19 +76717,23 @@ img.ProseMirror-separator {
76523
76717
  this.wafermap.removeEventListener('mouseout', this.onMouseOut);
76524
76718
  }
76525
76719
  calculateDieCoordinates(mousePosition) {
76526
- const originLocation = this.wafermap.originLocation;
76527
- const xRoundFunction = originLocation === WaferMapOriginLocation.bottomLeft
76528
- || originLocation === WaferMapOriginLocation.topLeft
76529
- ? Math.floor
76530
- : Math.ceil;
76531
- const yRoundFunction = originLocation === WaferMapOriginLocation.bottomLeft
76532
- || originLocation === WaferMapOriginLocation.bottomRight
76533
- ? Math.floor
76534
- : Math.ceil;
76535
- // go to x and y scale to get the x,y values of the die.
76536
- const x = xRoundFunction(this.wafermap.dataManager.invertedHorizontalScale(mousePosition.x - this.wafermap.dataManager.margin.left));
76537
- const y = yRoundFunction(this.wafermap.dataManager.invertedVerticalScale(mousePosition.y - this.wafermap.dataManager.margin.top));
76538
- return { x, y };
76720
+ if (this.wafermap.isExperimentalRenderer()
76721
+ && this.wafermap.dataManager instanceof DataManager) {
76722
+ const originLocation = this.wafermap.originLocation;
76723
+ const xRoundFunction = originLocation === WaferMapOriginLocation.bottomLeft
76724
+ || originLocation === WaferMapOriginLocation.topLeft
76725
+ ? Math.floor
76726
+ : Math.ceil;
76727
+ const yRoundFunction = originLocation === WaferMapOriginLocation.bottomLeft
76728
+ || originLocation === WaferMapOriginLocation.bottomRight
76729
+ ? Math.ceil
76730
+ : Math.floor;
76731
+ // go to x and y scale to get the x,y values of the die.
76732
+ const x = xRoundFunction(this.wafermap.dataManager.horizontalScale.invert(mousePosition.x - this.wafermap.dataManager.margin.left));
76733
+ const y = yRoundFunction(this.wafermap.dataManager.verticalScale.invert(mousePosition.y - this.wafermap.dataManager.margin.top));
76734
+ return { x, y };
76735
+ }
76736
+ return undefined;
76539
76737
  }
76540
76738
  }
76541
76739
 
@@ -76606,7 +76804,12 @@ img.ProseMirror-separator {
76606
76804
  /**
76607
76805
  * @internal
76608
76806
  */
76609
- this.dataManager = new DataManager(this.asRequiredFieldsWaferMap);
76807
+ this.stableDataManager = new DataManager$1(this.asRequiredFieldsWaferMap);
76808
+ /**
76809
+ * @internal
76810
+ */
76811
+ this.experimentalDataManager = new DataManager(this.asRequiredFieldsWaferMap);
76812
+ this.dataManager = this.stableDataManager;
76610
76813
  /**
76611
76814
  * @internal
76612
76815
  */
@@ -76692,6 +76895,9 @@ img.ProseMirror-separator {
76692
76895
  if (this.waferMapUpdateTracker.requiresEventsUpdate) {
76693
76896
  // zoom translateExtent needs to be recalculated when canvas size changes
76694
76897
  this.zoomHandler.disconnect();
76898
+ this.dataManager = this.isExperimentalRenderer()
76899
+ ? this.experimentalDataManager
76900
+ : this.stableDataManager;
76695
76901
  if (this.waferMapUpdateTracker.requiresContainerDimensionsUpdate) {
76696
76902
  this.dataManager.updateContainerDimensions();
76697
76903
  this.renderer.updateSortedDiesAndDrawWafer();