@ni/nimble-components 8.3.0 → 8.6.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.
Files changed (46) hide show
  1. package/dist/all-components-bundle.js +102 -48
  2. package/dist/all-components-bundle.js.map +1 -1
  3. package/dist/all-components-bundle.min.js +835 -796
  4. package/dist/all-components-bundle.min.js.map +1 -1
  5. package/dist/esm/all-components.d.ts +1 -0
  6. package/dist/esm/all-components.js +1 -0
  7. package/dist/esm/all-components.js.map +1 -1
  8. package/dist/esm/anchored-region/index.d.ts +11 -0
  9. package/dist/esm/anchored-region/index.js +24 -0
  10. package/dist/esm/anchored-region/index.js.map +1 -0
  11. package/dist/esm/anchored-region/styles.d.ts +1 -0
  12. package/dist/esm/anchored-region/styles.js +9 -0
  13. package/dist/esm/anchored-region/styles.js.map +1 -0
  14. package/dist/esm/button/index.d.ts +2 -7
  15. package/dist/esm/button/index.js +0 -6
  16. package/dist/esm/button/index.js.map +1 -1
  17. package/dist/esm/menu-button/index.d.ts +50 -0
  18. package/dist/esm/menu-button/index.js +154 -0
  19. package/dist/esm/menu-button/index.js.map +1 -0
  20. package/dist/esm/menu-button/styles.d.ts +1 -0
  21. package/dist/esm/menu-button/styles.js +29 -0
  22. package/dist/esm/menu-button/styles.js.map +1 -0
  23. package/dist/esm/menu-button/template.d.ts +2 -0
  24. package/dist/esm/menu-button/template.js +48 -0
  25. package/dist/esm/menu-button/template.js.map +1 -0
  26. package/dist/esm/menu-button/types.d.ts +15 -0
  27. package/dist/esm/menu-button/types.js +11 -0
  28. package/dist/esm/menu-button/types.js.map +1 -0
  29. package/dist/esm/nimble-components/src/all-components.d.ts +1 -0
  30. package/dist/esm/nimble-components/src/anchored-region/index.d.ts +11 -0
  31. package/dist/esm/nimble-components/src/anchored-region/styles.d.ts +1 -0
  32. package/dist/esm/nimble-components/src/button/index.d.ts +2 -7
  33. package/dist/esm/nimble-components/src/menu-button/index.d.ts +50 -0
  34. package/dist/esm/nimble-components/src/menu-button/styles.d.ts +1 -0
  35. package/dist/esm/nimble-components/src/menu-button/template.d.ts +2 -0
  36. package/dist/esm/nimble-components/src/menu-button/types.d.ts +15 -0
  37. package/dist/esm/nimble-components/src/patterns/button/types.d.ts +20 -0
  38. package/dist/esm/nimble-components/src/toggle-button/index.d.ts +3 -8
  39. package/dist/esm/patterns/button/types.d.ts +20 -0
  40. package/dist/esm/patterns/button/types.js.map +1 -1
  41. package/dist/esm/text-field/styles.js +31 -7
  42. package/dist/esm/text-field/styles.js.map +1 -1
  43. package/dist/esm/toggle-button/index.d.ts +3 -8
  44. package/dist/esm/toggle-button/index.js +1 -7
  45. package/dist/esm/toggle-button/index.js.map +1 -1
  46. package/package.json +1 -1
@@ -4730,6 +4730,18 @@
4730
4730
  applyMixins(DelegatesARIALink, ARIAGlobalStatesAndProperties);
4731
4731
  applyMixins(Anchor, StartEnd, DelegatesARIALink);
4732
4732
 
4733
+ /**
4734
+ * The template for the {@link @microsoft/fast-foundation#(AnchoredRegion:class)} component.
4735
+ * @public
4736
+ */
4737
+ const anchoredRegionTemplate = (context, definition) => html `
4738
+ <template class="${x => (x.initialLayoutComplete ? "loaded" : "")}">
4739
+ ${when(x => x.initialLayoutComplete, html `
4740
+ <slot></slot>
4741
+ `)}
4742
+ </template>
4743
+ `;
4744
+
4733
4745
  /**
4734
4746
  * a method to determine the current localization direction of the view
4735
4747
  * @param rootNode - the HTMLElement to begin the query from, usually "this" when used in a component controller
@@ -4836,7 +4848,7 @@
4836
4848
  *
4837
4849
  * @public
4838
4850
  */
4839
- class AnchoredRegion extends FoundationElement {
4851
+ class AnchoredRegion$1 extends FoundationElement {
4840
4852
  constructor() {
4841
4853
  super(...arguments);
4842
4854
  /**
@@ -5022,10 +5034,10 @@
5022
5034
  if (this.anchorElement === null || this.pendingPositioningUpdate) {
5023
5035
  return;
5024
5036
  }
5025
- AnchoredRegion.intersectionService.requestPosition(this, this.handleIntersection);
5026
- AnchoredRegion.intersectionService.requestPosition(this.anchorElement, this.handleIntersection);
5037
+ AnchoredRegion$1.intersectionService.requestPosition(this, this.handleIntersection);
5038
+ AnchoredRegion$1.intersectionService.requestPosition(this.anchorElement, this.handleIntersection);
5027
5039
  if (this.viewportElement !== null) {
5028
- AnchoredRegion.intersectionService.requestPosition(this.viewportElement, this.handleIntersection);
5040
+ AnchoredRegion$1.intersectionService.requestPosition(this.viewportElement, this.handleIntersection);
5029
5041
  }
5030
5042
  this.pendingPositioningUpdate = true;
5031
5043
  };
@@ -5035,12 +5047,12 @@
5035
5047
  this.stopObservers = () => {
5036
5048
  if (this.pendingPositioningUpdate) {
5037
5049
  this.pendingPositioningUpdate = false;
5038
- AnchoredRegion.intersectionService.cancelRequestPosition(this, this.handleIntersection);
5050
+ AnchoredRegion$1.intersectionService.cancelRequestPosition(this, this.handleIntersection);
5039
5051
  if (this.anchorElement !== null) {
5040
- AnchoredRegion.intersectionService.cancelRequestPosition(this.anchorElement, this.handleIntersection);
5052
+ AnchoredRegion$1.intersectionService.cancelRequestPosition(this.anchorElement, this.handleIntersection);
5041
5053
  }
5042
5054
  if (this.viewportElement !== null) {
5043
- AnchoredRegion.intersectionService.cancelRequestPosition(this.viewportElement, this.handleIntersection);
5055
+ AnchoredRegion$1.intersectionService.cancelRequestPosition(this.viewportElement, this.handleIntersection);
5044
5056
  }
5045
5057
  }
5046
5058
  if (this.resizeDetector !== null) {
@@ -5723,64 +5735,64 @@
5723
5735
  this.updateRegionStyle();
5724
5736
  }
5725
5737
  }
5726
- AnchoredRegion.intersectionService = new IntersectionService();
5738
+ AnchoredRegion$1.intersectionService = new IntersectionService();
5727
5739
  __decorate$1([
5728
5740
  attr
5729
- ], AnchoredRegion.prototype, "anchor", void 0);
5741
+ ], AnchoredRegion$1.prototype, "anchor", void 0);
5730
5742
  __decorate$1([
5731
5743
  attr
5732
- ], AnchoredRegion.prototype, "viewport", void 0);
5744
+ ], AnchoredRegion$1.prototype, "viewport", void 0);
5733
5745
  __decorate$1([
5734
5746
  attr({ attribute: "horizontal-positioning-mode" })
5735
- ], AnchoredRegion.prototype, "horizontalPositioningMode", void 0);
5747
+ ], AnchoredRegion$1.prototype, "horizontalPositioningMode", void 0);
5736
5748
  __decorate$1([
5737
5749
  attr({ attribute: "horizontal-default-position" })
5738
- ], AnchoredRegion.prototype, "horizontalDefaultPosition", void 0);
5750
+ ], AnchoredRegion$1.prototype, "horizontalDefaultPosition", void 0);
5739
5751
  __decorate$1([
5740
5752
  attr({ attribute: "horizontal-viewport-lock", mode: "boolean" })
5741
- ], AnchoredRegion.prototype, "horizontalViewportLock", void 0);
5753
+ ], AnchoredRegion$1.prototype, "horizontalViewportLock", void 0);
5742
5754
  __decorate$1([
5743
5755
  attr({ attribute: "horizontal-inset", mode: "boolean" })
5744
- ], AnchoredRegion.prototype, "horizontalInset", void 0);
5756
+ ], AnchoredRegion$1.prototype, "horizontalInset", void 0);
5745
5757
  __decorate$1([
5746
5758
  attr({ attribute: "horizontal-threshold" })
5747
- ], AnchoredRegion.prototype, "horizontalThreshold", void 0);
5759
+ ], AnchoredRegion$1.prototype, "horizontalThreshold", void 0);
5748
5760
  __decorate$1([
5749
5761
  attr({ attribute: "horizontal-scaling" })
5750
- ], AnchoredRegion.prototype, "horizontalScaling", void 0);
5762
+ ], AnchoredRegion$1.prototype, "horizontalScaling", void 0);
5751
5763
  __decorate$1([
5752
5764
  attr({ attribute: "vertical-positioning-mode" })
5753
- ], AnchoredRegion.prototype, "verticalPositioningMode", void 0);
5765
+ ], AnchoredRegion$1.prototype, "verticalPositioningMode", void 0);
5754
5766
  __decorate$1([
5755
5767
  attr({ attribute: "vertical-default-position" })
5756
- ], AnchoredRegion.prototype, "verticalDefaultPosition", void 0);
5768
+ ], AnchoredRegion$1.prototype, "verticalDefaultPosition", void 0);
5757
5769
  __decorate$1([
5758
5770
  attr({ attribute: "vertical-viewport-lock", mode: "boolean" })
5759
- ], AnchoredRegion.prototype, "verticalViewportLock", void 0);
5771
+ ], AnchoredRegion$1.prototype, "verticalViewportLock", void 0);
5760
5772
  __decorate$1([
5761
5773
  attr({ attribute: "vertical-inset", mode: "boolean" })
5762
- ], AnchoredRegion.prototype, "verticalInset", void 0);
5774
+ ], AnchoredRegion$1.prototype, "verticalInset", void 0);
5763
5775
  __decorate$1([
5764
5776
  attr({ attribute: "vertical-threshold" })
5765
- ], AnchoredRegion.prototype, "verticalThreshold", void 0);
5777
+ ], AnchoredRegion$1.prototype, "verticalThreshold", void 0);
5766
5778
  __decorate$1([
5767
5779
  attr({ attribute: "vertical-scaling" })
5768
- ], AnchoredRegion.prototype, "verticalScaling", void 0);
5780
+ ], AnchoredRegion$1.prototype, "verticalScaling", void 0);
5769
5781
  __decorate$1([
5770
5782
  attr({ attribute: "fixed-placement", mode: "boolean" })
5771
- ], AnchoredRegion.prototype, "fixedPlacement", void 0);
5783
+ ], AnchoredRegion$1.prototype, "fixedPlacement", void 0);
5772
5784
  __decorate$1([
5773
5785
  attr({ attribute: "auto-update-mode" })
5774
- ], AnchoredRegion.prototype, "autoUpdateMode", void 0);
5786
+ ], AnchoredRegion$1.prototype, "autoUpdateMode", void 0);
5775
5787
  __decorate$1([
5776
5788
  observable
5777
- ], AnchoredRegion.prototype, "anchorElement", void 0);
5789
+ ], AnchoredRegion$1.prototype, "anchorElement", void 0);
5778
5790
  __decorate$1([
5779
5791
  observable
5780
- ], AnchoredRegion.prototype, "viewportElement", void 0);
5792
+ ], AnchoredRegion$1.prototype, "viewportElement", void 0);
5781
5793
  __decorate$1([
5782
5794
  observable
5783
- ], AnchoredRegion.prototype, "initialLayoutComplete", void 0);
5795
+ ], AnchoredRegion$1.prototype, "initialLayoutComplete", void 0);
5784
5796
 
5785
5797
  /**
5786
5798
  * The template for the {@link @microsoft/fast-foundation#(BreadcrumbItem:class)} component.
@@ -9429,7 +9441,7 @@
9429
9441
  </div>
9430
9442
  `)}
9431
9443
  ${when(x => x.expanded, html `
9432
- <${context.tagFor(AnchoredRegion)}
9444
+ <${context.tagFor(AnchoredRegion$1)}
9433
9445
  :anchorElement="${x => x}"
9434
9446
  vertical-positioning-mode="dynamic"
9435
9447
  vertical-default-position="bottom"
@@ -9443,7 +9455,7 @@
9443
9455
  part="submenu-region"
9444
9456
  >
9445
9457
  <slot name="submenu"></slot>
9446
- </${context.tagFor(AnchoredRegion)}>
9458
+ </${context.tagFor(AnchoredRegion$1)}>
9447
9459
  `)}
9448
9460
  </template>
9449
9461
  `;
@@ -12188,6 +12200,36 @@
12188
12200
  observable
12189
12201
  ], TreeView$1.prototype, "slottedTreeItems", void 0);
12190
12202
 
12203
+ const styles$o = css `
12204
+ :host {
12205
+ contain: layout;
12206
+ display: block;
12207
+ z-index: 1000;
12208
+ }
12209
+ `;
12210
+
12211
+ // When the anchor element changes position on the page, it is the client's responsibility to update the position
12212
+ // of the anchored region by calling update() on the anchored region.
12213
+ //
12214
+ // When the anchor element is recreated on the page, it is the client's responsibility to reset the reference the
12215
+ // anchored region has to the anchor element. This can be done by either recreating the anchor element with a new
12216
+ // ID that is also set as the \`anchor\` attribute on the anchored region or by explicitly setting the value of
12217
+ // anchorElement on the anchored region to the new anchor element.
12218
+ /**
12219
+ * A nimble-styled anchored region control.
12220
+ */
12221
+ class AnchoredRegion extends AnchoredRegion$1 {
12222
+ }
12223
+ const nimbleAnchoredRegion = AnchoredRegion.compose({
12224
+ baseName: 'anchored-region',
12225
+ baseClass: AnchoredRegion$1,
12226
+ template: anchoredRegionTemplate,
12227
+ styles: styles$o
12228
+ });
12229
+ DesignSystem.getOrCreate()
12230
+ .withPrefix('nimble')
12231
+ .register(nimbleAnchoredRegion());
12232
+
12191
12233
  /**
12192
12234
  * Do not edit directly
12193
12235
  * Generated on Tue, 01 Mar 2022 15:26:47 GMT
@@ -13869,18 +13911,12 @@
13869
13911
  constructor() {
13870
13912
  super(...arguments);
13871
13913
  /**
13872
- * The appearance the button should have.
13873
- *
13874
13914
  * @public
13875
13915
  * @remarks
13876
13916
  * HTML Attribute: appearance
13877
13917
  */
13878
13918
  this.appearance = ButtonAppearance.Outline;
13879
13919
  /**
13880
- * Specify as 'true' to hide the text content of the button. The button will
13881
- * become square, and the text content will be used as the label of the button
13882
- * for accessibility purposes.
13883
- *
13884
13920
  * @public
13885
13921
  * @remarks
13886
13922
  * HTML Attribute: content-hidden
@@ -18175,6 +18211,7 @@
18175
18211
  --ni-private-hover-bottom-border-width: 2px;
18176
18212
  border: 0px solid rgba(${borderRgbPartialColor}, 0.3);
18177
18213
  border-bottom-width: var(--ni-private-bottom-border-width);
18214
+ gap: calc(${standardPadding} / 2);
18178
18215
  padding-bottom: calc(
18179
18216
  var(--ni-private-hover-bottom-border-width) -
18180
18217
  var(--ni-private-bottom-border-width)
@@ -18218,12 +18255,40 @@
18218
18255
  border-bottom-color: ${borderHoverColor};
18219
18256
  }
18220
18257
 
18258
+ :host([appearance='frameless'].clear-inline-padding) .root {
18259
+ padding-left: 0px;
18260
+ padding-right: 0px;
18261
+ }
18262
+
18263
+ .root::before {
18264
+ ${ /* Empty string causes alignment issue */''}
18265
+ content: ' ';
18266
+ color: transparent;
18267
+ width: 0px;
18268
+ user-select: none;
18269
+ }
18270
+
18271
+ :host([appearance='frameless'].clear-inline-padding) .root::before {
18272
+ display: none;
18273
+ }
18274
+
18275
+ .root::after {
18276
+ ${ /* Empty string causes alignment issue */''}
18277
+ content: ' ';
18278
+ color: transparent;
18279
+ width: 0px;
18280
+ user-select: none;
18281
+ }
18282
+
18283
+ :host([appearance='frameless'].clear-inline-padding) .root::after {
18284
+ display: none;
18285
+ }
18286
+
18221
18287
  [part='start'] {
18222
18288
  display: contents;
18223
18289
  }
18224
18290
 
18225
18291
  slot[name='start']::slotted(*) {
18226
- margin-left: calc(${standardPadding} / 2);
18227
18292
  flex: none;
18228
18293
  }
18229
18294
 
@@ -18232,8 +18297,7 @@
18232
18297
  font: inherit;
18233
18298
  background: transparent;
18234
18299
  color: inherit;
18235
- padding-top: 0px;
18236
- padding-bottom: 0px;
18300
+ padding: 0px;
18237
18301
  height: calc(
18238
18302
  ${controlHeight} - ${borderWidth} -
18239
18303
  var(--ni-private-hover-bottom-border-width)
@@ -18241,8 +18305,6 @@
18241
18305
  width: 100%;
18242
18306
  margin-top: auto;
18243
18307
  margin-bottom: auto;
18244
- padding-left: calc(${standardPadding} / 2);
18245
- padding-right: calc(${standardPadding} / 2);
18246
18308
  border: none;
18247
18309
  text-overflow: ellipsis;
18248
18310
  }
@@ -18286,7 +18348,6 @@
18286
18348
  :host(.invalid) .error-content svg {
18287
18349
  height: ${iconSize};
18288
18350
  width: ${iconSize};
18289
- padding-right: 8px;
18290
18351
  flex: none;
18291
18352
  }
18292
18353
 
@@ -18327,7 +18388,6 @@
18327
18388
  }
18328
18389
 
18329
18390
  slot[name='actions']::slotted(*) {
18330
- margin-right: 8px;
18331
18391
  ${controlHeight.cssCustomProperty}: 24px;
18332
18392
  }
18333
18393
  `.withBehaviors(appearanceBehavior(TextFieldAppearance.Underline, css `
@@ -18560,18 +18620,12 @@
18560
18620
  constructor() {
18561
18621
  super(...arguments);
18562
18622
  /**
18563
- * The appearance the button should have.
18564
- *
18565
18623
  * @public
18566
18624
  * @remarks
18567
18625
  * HTML Attribute: appearance
18568
18626
  */
18569
18627
  this.appearance = ButtonAppearance.Outline;
18570
18628
  /**
18571
- * Specify as 'true' to hide the text content of the button. The button will
18572
- * become square, and the text content will be used as the label of the button
18573
- * for accessibility purposes.
18574
- *
18575
18629
  * @public
18576
18630
  * @remarks
18577
18631
  * HTML Attribute: content-hidden