@ni/nimble-components 35.5.4 → 35.5.6

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 (34) hide show
  1. package/dist/all-components-bundle.js +229 -32
  2. package/dist/all-components-bundle.js.map +1 -1
  3. package/dist/all-components-bundle.min.js +3485 -3383
  4. package/dist/all-components-bundle.min.js.map +1 -1
  5. package/dist/custom-elements.json +204 -186
  6. package/dist/custom-elements.md +32 -32
  7. package/dist/esm/anchor-step/index.d.ts +4 -0
  8. package/dist/esm/anchor-step/index.js +9 -0
  9. package/dist/esm/anchor-step/index.js.map +1 -1
  10. package/dist/esm/anchor-step/template.js +3 -1
  11. package/dist/esm/anchor-step/template.js.map +1 -1
  12. package/dist/esm/patterns/step/styles.js +40 -16
  13. package/dist/esm/patterns/step/styles.js.map +1 -1
  14. package/dist/esm/patterns/step/testing/step-base.pageobject.d.ts +1 -0
  15. package/dist/esm/patterns/step/testing/step-base.pageobject.js +3 -0
  16. package/dist/esm/patterns/step/testing/step-base.pageobject.js.map +1 -1
  17. package/dist/esm/patterns/step/types.d.ts +5 -0
  18. package/dist/esm/patterns/step/types.js.map +1 -1
  19. package/dist/esm/step/index.d.ts +4 -0
  20. package/dist/esm/step/index.js +9 -0
  21. package/dist/esm/step/index.js.map +1 -1
  22. package/dist/esm/step/template.js +3 -1
  23. package/dist/esm/step/template.js.map +1 -1
  24. package/dist/esm/stepper/index.d.ts +18 -0
  25. package/dist/esm/stepper/index.js +82 -1
  26. package/dist/esm/stepper/index.js.map +1 -1
  27. package/dist/esm/stepper/styles.js +50 -4
  28. package/dist/esm/stepper/styles.js.map +1 -1
  29. package/dist/esm/stepper/template.js +37 -5
  30. package/dist/esm/stepper/template.js.map +1 -1
  31. package/dist/esm/stepper/testing/stepper.pageobject.d.ts +17 -0
  32. package/dist/esm/stepper/testing/stepper.pageobject.js +91 -0
  33. package/dist/esm/stepper/testing/stepper.pageobject.js.map +1 -0
  34. package/package.json +1 -1
@@ -17817,6 +17817,7 @@ Defines an interaction area clip-path that leaves out the severity text so it is
17817
17817
  :host([selected]) .control {
17818
17818
  --ni-private-step-icon-color: ${borderHoverColor};
17819
17819
  --ni-private-step-icon-border-color: ${borderHoverColor};
17820
+ --ni-private-step-icon-border-width: 2px;
17820
17821
  --ni-private-step-icon-background-color: rgb(from ${borderHoverColor} r g b / 30%);
17821
17822
  --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-none-size);
17822
17823
  --ni-private-step-line-color: ${borderHoverColor};
@@ -17856,10 +17857,6 @@ Defines an interaction area clip-path that leaves out the severity text so it is
17856
17857
  box-shadow ${smallDelay} ease-in-out;
17857
17858
  }
17858
17859
 
17859
- :host([selected]) .icon {
17860
- --ni-private-step-icon-border-width: 2px;
17861
- }
17862
-
17863
17860
  .icon::before {
17864
17861
  content: '';
17865
17862
  position: absolute;
@@ -17869,7 +17866,8 @@ Defines an interaction area clip-path that leaves out the severity text so it is
17869
17866
  outline-color: var(--ni-private-step-icon-outline-inset-color);
17870
17867
  outline-style: solid;
17871
17868
  outline-width: 0px;
17872
- outline-offset: 0px;
17869
+ ${'' /* outline-offset should always be <=-1 to always render inset */}
17870
+ outline-offset: -1px;
17873
17871
  border: none;
17874
17872
  border-radius: 100%;
17875
17873
  color: transparent;
@@ -17947,9 +17945,9 @@ Defines an interaction area clip-path that leaves out the severity text so it is
17947
17945
  min-width: ${standardPadding};
17948
17946
  height: 1px;
17949
17947
  min-height: 1px;
17948
+ transform: scale(1, 1);
17950
17949
  background: var(--ni-private-step-line-color);
17951
17950
  background-clip: content-box;
17952
- transform: scale(1, 1);
17953
17951
  transition:
17954
17952
  background-color ${smallDelay} ease-in-out,
17955
17953
  transform ${smallDelay} ease-in-out;
@@ -17963,8 +17961,8 @@ Defines an interaction area clip-path that leaves out the severity text so it is
17963
17961
  width: 1px;
17964
17962
  min-width: 1px;
17965
17963
  height: 100%;
17966
- padding-top: ${smallPadding};
17967
17964
  min-height: ${standardPadding};
17965
+ padding-top: ${smallPadding};
17968
17966
  }
17969
17967
 
17970
17968
  .subtitle {
@@ -17993,6 +17991,7 @@ Defines an interaction area clip-path that leaves out the severity text so it is
17993
17991
  @layer hover {
17994
17992
  .control:hover {
17995
17993
  --ni-private-step-icon-border-color: ${borderHoverColor};
17994
+ --ni-private-step-icon-border-width: 2px;
17996
17995
  --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-inset-size);
17997
17996
  --ni-private-step-line-color: ${borderHoverColor};
17998
17997
  }
@@ -18023,8 +18022,12 @@ Defines an interaction area clip-path that leaves out the severity text so it is
18023
18022
  --ni-private-step-line-color: ${borderHoverColor};
18024
18023
  }
18025
18024
 
18026
- .control:hover .icon {
18027
- --ni-private-step-icon-border-width: 2px;
18025
+ :host([readonly]) .control:hover {
18026
+ --ni-private-step-icon-color: revert-layer;
18027
+ --ni-private-step-icon-border-color: revert-layer;
18028
+ --ni-private-step-icon-border-width: revert-layer;
18029
+ --ni-private-step-icon-background-size: revert-layer;
18030
+ --ni-private-step-line-color: revert-layer;
18028
18031
  }
18029
18032
 
18030
18033
  .control:hover .line {
@@ -18034,11 +18037,16 @@ Defines an interaction area clip-path that leaves out the severity text so it is
18034
18037
  .container.vertical .control:hover .line {
18035
18038
  transform: scale(2, 1);
18036
18039
  }
18040
+
18041
+ :host([readonly]) .container .control:hover .line {
18042
+ transform: revert-layer;
18043
+ }
18037
18044
  }
18038
18045
 
18039
18046
  @layer focusVisible {
18040
18047
  .control${focusVisible} {
18041
18048
  --ni-private-step-icon-border-color: ${borderHoverColor};
18049
+ --ni-private-step-icon-border-width: 2px;
18042
18050
  --ni-private-step-icon-outline-inset-color: ${borderHoverColor};
18043
18051
  --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-inset-size);
18044
18052
  --ni-private-step-line-color: ${borderHoverColor};
@@ -18074,10 +18082,6 @@ Defines an interaction area clip-path that leaves out the severity text so it is
18074
18082
  --ni-private-step-line-color: ${borderHoverColor};
18075
18083
  }
18076
18084
 
18077
- .control${focusVisible} .icon {
18078
- --ni-private-step-icon-border-width: 2px;
18079
- }
18080
-
18081
18085
  .control${focusVisible} .icon::before {
18082
18086
  outline-width: ${borderWidth};
18083
18087
  ${'' /* -1px control to outline edge -2px focus border -1px inset gap */}
@@ -18096,6 +18100,7 @@ Defines an interaction area clip-path that leaves out the severity text so it is
18096
18100
  @layer active {
18097
18101
  .control:active {
18098
18102
  --ni-private-step-icon-border-color: ${borderHoverColor};
18103
+ --ni-private-step-icon-border-width: 2px;
18099
18104
  --ni-private-step-icon-background-color: ${fillSelectedColor};
18100
18105
  --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-full-size);
18101
18106
  --ni-private-step-line-color: ${borderHoverColor};
@@ -18127,26 +18132,45 @@ Defines an interaction area clip-path that leaves out the severity text so it is
18127
18132
  --ni-private-step-line-color: ${borderHoverColor};
18128
18133
  }
18129
18134
 
18130
- .control:active .icon {
18131
- --ni-private-step-icon-border-width: 2px;
18135
+ :host([readonly]) .control:active {
18136
+ --ni-private-step-icon-color: revert-layer;
18137
+ --ni-private-step-icon-border-color: revert-layer;
18138
+ --ni-private-step-icon-border-width: revert-layer;
18139
+ --ni-private-step-icon-background-color: revert-layer;
18140
+ --ni-private-step-icon-background-size: revert-layer;
18141
+ --ni-private-step-line-color: revert-layer;
18132
18142
  }
18133
18143
 
18134
18144
  .control:active .icon::before {
18135
18145
  outline-width: 0px;
18136
- outline-offset: 0px;
18146
+ outline-offset: -1px;
18147
+ }
18148
+
18149
+ :host([readonly]) .control:active .icon::before {
18150
+ outline-width: revert-layer;
18151
+ outline-offset: revert-layer;
18137
18152
  }
18138
18153
 
18139
18154
  .control:active .line {
18140
18155
  transform: scale(1, 1);
18141
18156
  }
18157
+
18158
+ :host([readonly]) .control:active .line {
18159
+ transform: revert-layer;
18160
+ }
18142
18161
  }
18143
18162
 
18144
18163
  @layer disabled {
18164
+ :host([readonly]) .control {
18165
+ cursor: default;
18166
+ }
18167
+
18145
18168
  :host([disabled]) .control {
18146
18169
  cursor: default;
18147
18170
  color: ${buttonLabelDisabledFontColor};
18148
18171
  --ni-private-step-icon-color: rgb(from ${buttonLabelFontColor} r g b / 30%);
18149
18172
  --ni-private-step-icon-border-color: transparent;
18173
+ --ni-private-step-icon-border-width: 1px;
18150
18174
  --ni-private-step-icon-background-color: rgba(${borderRgbPartialColor}, 0.1);
18151
18175
  --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-full-size);
18152
18176
  --ni-private-step-icon-outline-inset-color: transparent;
@@ -19421,11 +19445,17 @@ Defines an interaction area clip-path that leaves out the severity text so it is
19421
19445
  cssCustomPropertyName: null
19422
19446
  }).withDefault(coreLabelDefaults.itemRemoveLabel);
19423
19447
 
19448
+ /**
19449
+ * Orientation of steppers.
19450
+ * @public
19451
+ */
19452
+ const StepperOrientation = Orientation;
19453
+
19424
19454
  const template$M = (context, definition) => html `
19425
19455
  <template slot="step">
19426
19456
  <li class="
19427
19457
  container
19428
- ${x => (x.stepInternals.orientation === 'vertical' ? 'vertical' : '')}
19458
+ ${x => (x.stepInternals.orientation === StepperOrientation.vertical ? 'vertical' : '')}
19429
19459
  ${x => (x.stepInternals.last ? 'last' : '')}
19430
19460
  ">
19431
19461
  <a
@@ -19460,6 +19490,7 @@ Defines an interaction area clip-path that leaves out the severity text so it is
19460
19490
  aria-owns="${x => x.ariaOwns}"
19461
19491
  aria-relevant="${x => x.ariaRelevant}"
19462
19492
  aria-roledescription="${x => x.ariaRoledescription}"
19493
+ @click="${(x, c) => x.onClick(c.event)}"
19463
19494
  ${ref('control')}
19464
19495
  >
19465
19496
  <div class="icon-background"></div>
@@ -19482,12 +19513,6 @@ Defines an interaction area clip-path that leaves out the severity text so it is
19482
19513
  </template>
19483
19514
  `;
19484
19515
 
19485
- /**
19486
- * Orientation of steppers.
19487
- * @public
19488
- */
19489
- const StepperOrientation = Orientation;
19490
-
19491
19516
  /**
19492
19517
  * Internal properties configurable for a step
19493
19518
  */
@@ -19545,6 +19570,15 @@ Defines an interaction area clip-path that leaves out the severity text so it is
19545
19570
  */
19546
19571
  this.stepInternals = new StepInternals();
19547
19572
  }
19573
+ /**
19574
+ * @internal
19575
+ */
19576
+ onClick(e) {
19577
+ if (this.disabled || this.readOnly) {
19578
+ e.preventDefault();
19579
+ e.stopImmediatePropagation();
19580
+ }
19581
+ }
19548
19582
  }
19549
19583
  __decorate([
19550
19584
  attr()
@@ -23583,6 +23617,7 @@ so this becomes the fallback color for the slot */ ''}
23583
23617
  }
23584
23618
  }
23585
23619
  registerIconSvg('icon-arrow-expander-up', IconArrowExpanderUp);
23620
+ const iconArrowExpanderUpTag = 'nimble-icon-arrow-expander-up';
23586
23621
 
23587
23622
  // AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
23588
23623
  // See generation source in nimble-components/build/generate-icons
@@ -66486,7 +66521,7 @@ ${nextLine.slice(indentLevel + 2)}`;
66486
66521
  <template slot="step">
66487
66522
  <li class="
66488
66523
  container
66489
- ${x => (x.stepInternals.orientation === 'vertical' ? 'vertical' : '')}
66524
+ ${x => (x.stepInternals.orientation === StepperOrientation.vertical ? 'vertical' : '')}
66490
66525
  ${x => (x.stepInternals.last ? 'last' : '')}
66491
66526
  ">
66492
66527
  <button
@@ -66525,6 +66560,7 @@ ${nextLine.slice(indentLevel + 2)}`;
66525
66560
  aria-pressed="${x => x.ariaPressed}"
66526
66561
  aria-relevant="${x => x.ariaRelevant}"
66527
66562
  aria-roledescription="${x => x.ariaRoledescription}"
66563
+ @click="${(x, c) => x.onClick(c.event)}"
66528
66564
  ${ref('control')}
66529
66565
  >
66530
66566
  <div class="icon-background"></div>
@@ -66578,6 +66614,15 @@ ${nextLine.slice(indentLevel + 2)}`;
66578
66614
  */
66579
66615
  this.stepInternals = new StepInternals();
66580
66616
  }
66617
+ /**
66618
+ * @internal
66619
+ */
66620
+ onClick(e) {
66621
+ if (this.disabled || this.readOnly) {
66622
+ e.preventDefault();
66623
+ e.stopImmediatePropagation();
66624
+ }
66625
+ }
66581
66626
  }
66582
66627
  __decorate([
66583
66628
  attr()
@@ -66606,15 +66651,61 @@ ${nextLine.slice(indentLevel + 2)}`;
66606
66651
 
66607
66652
  :host {
66608
66653
  border: none;
66609
- gap: ${smallPadding};
66610
66654
  }
66611
66655
 
66612
66656
  :host([orientation="vertical"]) {
66613
66657
  flex-direction: column;
66614
66658
  }
66615
66659
 
66616
- ol {
66617
- display: contents;
66660
+ .scroll-button.start {
66661
+ width: ${controlHeight};
66662
+ height: ${controlHeight};
66663
+ margin-right: ${smallPadding};
66664
+ margin-bottom: 0px;
66665
+ }
66666
+
66667
+ :host([orientation="vertical"]) .scroll-button.start {
66668
+ margin-right: 0px;
66669
+ margin-bottom: ${smallPadding};
66670
+ }
66671
+
66672
+ .list {
66673
+ flex-grow: 1;
66674
+ display: inline-flex;
66675
+ gap: ${smallPadding};
66676
+ scrollbar-width: none;
66677
+ padding: 0;
66678
+ margin: 0;
66679
+
66680
+ flex-direction: row;
66681
+ overflow-x: scroll;
66682
+ overflow-y: hidden;
66683
+ width: max-content;
66684
+ max-width: 100%;
66685
+ height: auto;
66686
+ max-height: none;
66687
+ }
66688
+
66689
+ :host([orientation="vertical"]) .list {
66690
+ flex-direction: column;
66691
+ overflow-x: hidden;
66692
+ overflow-y: scroll;
66693
+ width: auto;
66694
+ max-width: none;
66695
+ height: max-content;
66696
+ max-height: 100%;
66697
+ }
66698
+
66699
+ .scroll-button.end {
66700
+ width: ${controlHeight};
66701
+ height: ${controlHeight};
66702
+ margin-left: ${smallPadding};
66703
+ margin-top: 0px;
66704
+ }
66705
+
66706
+ :host([orientation="vertical"]) .scroll-button.end {
66707
+ margin-left: 0px;
66708
+ margin-top: ${smallPadding};
66618
66709
  }
66619
66710
 
66620
66711
  slot[name="step"]::slotted(*) {
@@ -66626,10 +66717,35 @@ ${nextLine.slice(indentLevel + 2)}`;
66626
66717
  }
66627
66718
  `;
66628
66719
 
66629
- const template$n = html `<ol><slot
66630
- name="step"
66631
- ${slotted('steps')}
66632
- ></slot></ol>`;
66720
+ const template$n = html `
66721
+ ${when(x => x.showScrollButtons, html `
66722
+ <${buttonTag}
66723
+ content-hidden
66724
+ class="scroll-button start"
66725
+ appearance="${ButtonAppearance.ghost}"
66726
+ @click="${x => x.onScrollStartClick()}"
66727
+ ${ref('startScrollButton')}
66728
+ >
66729
+ ${x => scrollForwardLabel.getValueFor(x)}
66730
+ ${when(x => x.isHorizontal(), html `<${iconArrowExpanderLeftTag} slot="start"></${iconArrowExpanderLeftTag}>`, html `<${iconArrowExpanderUpTag} slot="start"></${iconArrowExpanderUpTag}>`)}
66731
+ </${buttonTag}>
66732
+ `)}
66733
+ <ol ${ref('list')} class="list"><slot
66734
+ name="step"
66735
+ ${slotted('steps')}
66736
+ ></slot></ol>
66737
+ ${when(x => x.showScrollButtons, html `
66738
+ <${buttonTag}
66739
+ content-hidden
66740
+ class="scroll-button end"
66741
+ appearance="${ButtonAppearance.ghost}"
66742
+ @click="${x => x.onScrollEndClick()}"
66743
+ >
66744
+ ${x => scrollBackwardLabel.getValueFor(x)}
66745
+ ${when(x => x.isHorizontal(), html `<${iconArrowExpanderRightTag} slot="start"></${iconArrowExpanderRightTag}>`, html `<${iconArrowExpanderDownTag} slot="start"></${iconArrowExpanderDownTag}>`)}
66746
+ </${buttonTag}>
66747
+ `)}
66748
+ `;
66633
66749
 
66634
66750
  /**
66635
66751
  * A nimble-styled stepper
@@ -66638,12 +66754,70 @@ ${nextLine.slice(indentLevel + 2)}`;
66638
66754
  constructor() {
66639
66755
  super(...arguments);
66640
66756
  this.orientation = StepperOrientation.horizontal;
66757
+ /** @internal */
66758
+ this.showScrollButtons = false;
66759
+ }
66760
+ /** @internal */
66761
+ onScrollStartClick() {
66762
+ if (this.isHorizontal()) {
66763
+ this.list.scrollBy({
66764
+ left: -this.list.clientWidth,
66765
+ behavior: 'smooth'
66766
+ });
66767
+ }
66768
+ else {
66769
+ this.list.scrollBy({
66770
+ top: -this.list.clientHeight,
66771
+ behavior: 'smooth'
66772
+ });
66773
+ }
66774
+ }
66775
+ /** @internal */
66776
+ onScrollEndClick() {
66777
+ if (this.isHorizontal()) {
66778
+ this.list.scrollBy({
66779
+ left: this.list.clientWidth,
66780
+ behavior: 'smooth'
66781
+ });
66782
+ }
66783
+ else {
66784
+ this.list.scrollBy({
66785
+ top: this.list.clientHeight,
66786
+ behavior: 'smooth'
66787
+ });
66788
+ }
66789
+ }
66790
+ /** @internal */
66791
+ connectedCallback() {
66792
+ super.connectedCallback();
66793
+ // Steps fill parent container so can't rely on a resize observer to track their space usage.
66794
+ // Instead directly track each step's occlusion with intersection observer which is more compute intensive.
66795
+ // When available can switch to container scroll state queries, see: https://github.com/ni/nimble/issues/2922
66796
+ this.listIntersectionObserver = new IntersectionObserver(_ => {
66797
+ this.handleListOverflow();
66798
+ }, {
66799
+ root: this.list,
66800
+ threshold: 1.0
66801
+ });
66802
+ }
66803
+ /** @internal */
66804
+ disconnectedCallback() {
66805
+ super.disconnectedCallback();
66806
+ this.listIntersectionObserver?.disconnect();
66807
+ }
66808
+ /** @internal */
66809
+ isHorizontal() {
66810
+ return this.orientation !== StepperOrientation.vertical;
66641
66811
  }
66642
66812
  orientationChanged() {
66643
66813
  this.updateStepInternals();
66644
66814
  }
66645
66815
  stepsChanged() {
66646
66816
  this.updateStepInternals();
66817
+ this.listIntersectionObserver?.disconnect();
66818
+ if (this.steps) {
66819
+ this.steps.forEach(step => this.listIntersectionObserver?.observe(step));
66820
+ }
66647
66821
  }
66648
66822
  updateStepInternals() {
66649
66823
  if (!this.steps) {
@@ -66651,15 +66825,38 @@ ${nextLine.slice(indentLevel + 2)}`;
66651
66825
  }
66652
66826
  const lastIndex = this.steps.length - 1;
66653
66827
  this.steps.forEach((step, index) => {
66654
- step.stepInternals.orientation = this.orientation;
66828
+ step.stepInternals.orientation = this.isHorizontal()
66829
+ ? StepperOrientation.horizontal
66830
+ : StepperOrientation.vertical;
66655
66831
  step.stepInternals.last = index === lastIndex;
66656
66832
  step.stepInternals.position = index + 1;
66657
66833
  });
66658
66834
  }
66835
+ handleListOverflow() {
66836
+ let listVisibleSize = this.isHorizontal()
66837
+ ? this.list.clientWidth
66838
+ : this.list.clientHeight;
66839
+ if (listVisibleSize !== undefined) {
66840
+ const buttonSize = this.isHorizontal()
66841
+ ? this.startScrollButton?.clientWidth ?? 0
66842
+ : this.startScrollButton?.clientHeight ?? 0;
66843
+ listVisibleSize = Math.ceil(listVisibleSize);
66844
+ if (this.showScrollButtons) {
66845
+ listVisibleSize += buttonSize * 2;
66846
+ }
66847
+ const listScrollSize = this.isHorizontal()
66848
+ ? this.list.scrollWidth
66849
+ : this.list.scrollHeight;
66850
+ this.showScrollButtons = listVisibleSize < listScrollSize;
66851
+ }
66852
+ }
66659
66853
  }
66660
66854
  __decorate([
66661
66855
  attr
66662
66856
  ], Stepper.prototype, "orientation", void 0);
66857
+ __decorate([
66858
+ observable
66859
+ ], Stepper.prototype, "showScrollButtons", void 0);
66663
66860
  __decorate([
66664
66861
  observable
66665
66862
  ], Stepper.prototype, "steps", void 0);