@ni/nimble-components 35.2.1 → 35.2.3

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.
@@ -39923,7 +39923,17 @@ so this becomes the fallback color for the slot */ ''}
39923
39923
  }
39924
39924
  }
39925
39925
  }
39926
- if (gecko && added.length) {
39926
+ if (added.some(n => n.nodeName == "BR") && (view.input.lastKeyCode == 8 || view.input.lastKeyCode == 46)) {
39927
+ // Browsers sometimes insert a bogus break node if you
39928
+ // backspace out the last bit of text before an inline-flex node (#1552)
39929
+ for (let node of added)
39930
+ if (node.nodeName == "BR" && node.parentNode) {
39931
+ let after = node.nextSibling;
39932
+ if (after && after.nodeType == 1 && after.contentEditable == "false")
39933
+ node.parentNode.removeChild(node);
39934
+ }
39935
+ }
39936
+ else if (gecko && added.length) {
39927
39937
  let brs = added.filter(n => n.nodeName == "BR");
39928
39938
  if (brs.length == 2) {
39929
39939
  let [a, b] = brs;
@@ -39941,17 +39951,6 @@ so this becomes the fallback color for the slot */ ''}
39941
39951
  }
39942
39952
  }
39943
39953
  }
39944
- else if ((chrome || safari) && added.some(n => n.nodeName == "BR") &&
39945
- (view.input.lastKeyCode == 8 || view.input.lastKeyCode == 46)) {
39946
- // Chrome/Safari sometimes insert a bogus break node if you
39947
- // backspace out the last bit of text before an inline-flex node (#1552)
39948
- for (let node of added)
39949
- if (node.nodeName == "BR" && node.parentNode) {
39950
- let after = node.nextSibling;
39951
- if (after && after.nodeType == 1 && after.contentEditable == "false")
39952
- node.parentNode.removeChild(node);
39953
- }
39954
- }
39955
39954
  let readSel = null;
39956
39955
  // If it looks like the browser has reset the selection to the
39957
39956
  // start of the document after focus, restore the selection from
@@ -56745,7 +56744,7 @@ ${renderedContent}
56745
56744
  */
56746
56745
  isMarkAhead(parent, index, mark) {
56747
56746
  for (;; index++) {
56748
- if (index == parent.childCount)
56747
+ if (index >= parent.childCount)
56749
56748
  return false;
56750
56749
  let next = parent.child(index);
56751
56750
  if (next.type.name != this.options.hardBreakNodeName)
@@ -59607,6 +59606,9 @@ ${renderedContent}
59607
59606
  },
59608
59607
  class: {
59609
59608
  default: this.options.HTMLAttributes.class
59609
+ },
59610
+ title: {
59611
+ default: null
59610
59612
  }
59611
59613
  };
59612
59614
  },
@@ -59646,10 +59648,11 @@ ${renderedContent}
59646
59648
  });
59647
59649
  },
59648
59650
  renderMarkdown: (node, h) => {
59649
- var _a;
59650
- const href = ((_a = node.attrs) == null ? void 0 : _a.href) || "";
59651
+ var _a, _b, _c, _d;
59652
+ const href = (_b = (_a = node.attrs) == null ? void 0 : _a.href) != null ? _b : "";
59653
+ const title = (_d = (_c = node.attrs) == null ? void 0 : _c.title) != null ? _d : "";
59651
59654
  const text = h.renderChildren(node);
59652
- return `[${text}](${href})`;
59655
+ return title ? `[${text}](${href} "${title}")` : `[${text}](${href})`;
59653
59656
  },
59654
59657
  addCommands() {
59655
59658
  return {
@@ -65438,7 +65441,9 @@ ${nextLine.slice(indentLevel + 2)}`;
65438
65441
  flex-direction: column;
65439
65442
  cursor: pointer;
65440
65443
  --ni-private-switch-height: 24px;
65441
- --ni-private-switch-indicator-size: 16px;
65444
+ --ni-private-switch-indicator-size: 24px;
65445
+ --ni-private-switch-indicator-inner-size: 18px;
65446
+ --ni-private-switch-indicator-margin: -2px;
65442
65447
  padding-bottom: calc(
65443
65448
  ${controlHeight} - var(--ni-private-switch-height)
65444
65449
  );
@@ -65476,20 +65481,36 @@ ${nextLine.slice(indentLevel + 2)}`;
65476
65481
  display: flex;
65477
65482
  height: var(--ni-private-switch-height);
65478
65483
  width: calc(var(--ni-private-switch-height) * 2);
65479
- background-color: ${fillHoverColor};
65484
+ background-color: var(--ni-private-switch-background-color);
65480
65485
  border-radius: calc(var(--ni-private-switch-height) / 2);
65481
65486
  align-items: center;
65482
- border: calc(${borderWidth} * 2) solid transparent;
65487
+ border: calc(${borderWidth}) solid transparent;
65483
65488
  }
65484
65489
 
65485
- :host([disabled]) .switch {
65486
- background-color: var(--ni-private-switch-background-disabled-color);
65490
+ :host([aria-checked='true']) .switch {
65491
+ background-color: var(--ni-private-switch-background-selected-color);
65492
+ }
65493
+
65494
+ :host([aria-checked='true']:hover) .switch {
65495
+ background-color: var(--ni-private-switch-background-selected-rollover-color);
65487
65496
  }
65488
65497
 
65489
65498
  :host(${focusVisible}) .switch {
65490
65499
  border-color: ${borderHoverColor};
65491
65500
  }
65492
65501
 
65502
+ :host(${focusVisible}[aria-checked='true']) .switch {
65503
+ background-color: var(--ni-private-switch-background-selected-rollover-color);
65504
+ }
65505
+
65506
+ :host([disabled]) .switch {
65507
+ background-color: var(--ni-private-switch-background-disabled-color);
65508
+ }
65509
+
65510
+ :host([disabled]:hover) .switch {
65511
+ background-color: var(--ni-private-switch-background-disabled-color);
65512
+ }
65513
+
65493
65514
  .checked-indicator-spacer {
65494
65515
  flex-grow: 0;
65495
65516
  transition: flex-grow ${smallDelay} ease-in-out;
@@ -65507,51 +65528,81 @@ ${nextLine.slice(indentLevel + 2)}`;
65507
65528
  width: var(--ni-private-switch-indicator-size);
65508
65529
  height: var(--ni-private-switch-indicator-size);
65509
65530
  border-radius: calc(var(--ni-private-switch-indicator-size) / 2);
65510
- margin: calc(
65511
- calc(
65512
- var(--ni-private-switch-height) - var(
65513
- --ni-private-switch-indicator-size
65514
- )
65515
- ) /
65516
- 2
65517
- );
65531
+ margin: var(--ni-private-switch-indicator-margin);
65518
65532
  border: ${borderWidth} solid
65519
65533
  var(--ni-private-switch-indicator-border-color);
65520
65534
  }
65521
65535
 
65536
+ :host([aria-checked='true']) .checked-indicator {
65537
+ border-color: var(--ni-private-switch-indicator-border-selected-color);
65538
+ }
65539
+
65522
65540
  :host(:hover) .checked-indicator {
65523
65541
  border: calc(${borderWidth} * 2) solid ${borderHoverColor};
65524
65542
  }
65525
65543
 
65544
+ :host(${focusVisible}) .checked-indicator {
65545
+ border: calc(${borderWidth} * 2) solid ${borderHoverColor};
65546
+ }
65547
+
65526
65548
  :host([disabled]) .checked-indicator {
65527
- background-color: var(
65528
- --ni-private-switch-indicator-background-disabled-color
65529
- );
65549
+ background-color: transparent;
65530
65550
  border: ${borderWidth} solid
65531
65551
  var(--ni-private-switch-indicator-border-disabled-color);
65532
65552
  }
65533
65553
 
65534
- :host(${focusVisible}) .checked-indicator {
65535
- border: ${borderWidth} solid ${borderHoverColor};
65554
+ :host([disabled]:hover) .checked-indicator {
65555
+ background-color: transparent;
65556
+ border: ${borderWidth} solid
65557
+ var(--ni-private-switch-indicator-border-disabled-color);
65536
65558
  }
65537
65559
 
65538
- .checked-indicator-inner {
65539
- width: calc(var(--ni-private-switch-indicator-size) / 2);
65540
- height: calc(var(--ni-private-switch-indicator-size) / 2);
65541
- border-radius: calc(var(--ni-private-switch-indicator-size) / 4);
65542
- background-color: var(--ni-private-switch-indicator-border-color);
65560
+ :host([disabled]${focusVisible}) .checked-indicator {
65561
+ background-color: transparent;
65562
+ border: ${borderWidth} solid
65563
+ var(--ni-private-switch-indicator-border-disabled-color);
65564
+ }
65565
+
65566
+ :host([disabled]:active) .checked-indicator-inner {
65567
+ background-color: var(
65568
+ --ni-private-switch-indicator-border-disabled-color
65569
+ );
65543
65570
  opacity: 0;
65544
- transition: opacity ${smallDelay} ease-in-out;
65545
65571
  }
65546
65572
 
65547
- :host([disabled]) .checked-indicator-inner {
65573
+ :host([disabled]${focusVisible}) .checked-indicator-inner {
65548
65574
  background-color: var(
65549
65575
  --ni-private-switch-indicator-border-disabled-color
65550
65576
  );
65577
+ opacity: 0;
65578
+ }
65579
+
65580
+ .checked-indicator-inner {
65581
+ width: var(--ni-private-switch-indicator-inner-size);
65582
+ height: var(--ni-private-switch-indicator-inner-size);
65583
+ border-radius: calc(var(--ni-private-switch-indicator-inner-size) / 2);
65584
+ opacity: 0;
65551
65585
  }
65552
65586
 
65553
65587
  :host([aria-checked='true']) .checked-indicator-inner {
65588
+ opacity: 0;
65589
+ }
65590
+
65591
+ :host(${focusVisible}) .checked-indicator-inner {
65554
65592
  opacity: 1;
65593
+ background-color: var(--ni-private-switch-indicator-background-color);
65594
+ border: 1px solid var(--ni-private-switch-indicator-border-selected-color);
65595
+ }
65596
+
65597
+ :host(:active) .checked-indicator-inner {
65598
+ opacity: 1;
65599
+ background-color: var(--ni-private-switch-indicator-background-active-color);
65600
+ }
65601
+
65602
+ :host([disabled]) .checked-indicator-inner {
65603
+ background-color: var(
65604
+ --ni-private-switch-indicator-border-disabled-color
65605
+ );
65555
65606
  }
65556
65607
 
65557
65608
  slot[name='checked-message']::slotted(*) {
@@ -65566,26 +65617,43 @@ ${nextLine.slice(indentLevel + 2)}`;
65566
65617
  }
65567
65618
  `.withBehaviors(themeBehavior(Theme.light, css `
65568
65619
  :host {
65620
+ --ni-private-switch-background-color: ${hexToRgbaCssColor(Black91, 0.1)};
65569
65621
  --ni-private-switch-background-disabled-color: ${hexToRgbaCssColor(Black91, 0.07)};
65622
+ --ni-private-switch-background-selected-color: ${hexToRgbaCssColor(DigitalGreenLight, 0.6)};
65623
+ --ni-private-switch-background-selected-rollover-color: ${hexToRgbaCssColor(DigitalGreenLight, 0.3)};
65570
65624
  --ni-private-switch-indicator-background-color: ${White};
65571
- --ni-private-switch-indicator-background-disabled-color: ${hexToRgbaCssColor(White, 0.1)};
65572
- --ni-private-switch-indicator-border-color: ${Black91};
65573
- --ni-private-switch-indicator-border-disabled-color: ${hexToRgbaCssColor(Black91, 0.3)};
65625
+ --ni-private-switch-indicator-background-disabled-color: ${hexToRgbaCssColor(Black91, 0.15)};
65626
+ --ni-private-switch-indicator-background-active-color: ${hexToRgbaCssColor(DigitalGreenLight, 0.3)};
65627
+
65628
+ --ni-private-switch-indicator-border-color: ${hexToRgbaCssColor(Black91, 0.3)};
65629
+ --ni-private-switch-indicator-border-selected-color: ${DigitalGreenLight};
65630
+ --ni-private-switch-indicator-border-disabled-color: ${hexToRgbaCssColor(Black91, 0.15)};
65631
+
65574
65632
  }
65575
65633
  `), themeBehavior(Theme.dark, css `
65576
65634
  :host {
65635
+ --ni-private-switch-background-color: ${hexToRgbaCssColor(Black15, 0.1)};
65577
65636
  --ni-private-switch-background-disabled-color: ${hexToRgbaCssColor(Black15, 0.07)};
65578
- --ni-private-switch-indicator-background-color: ${hexToRgbaCssColor(Black91, 0.3)};
65579
- --ni-private-switch-indicator-background-disabled-color: ${hexToRgbaCssColor(Black91, 0.1)};
65580
- --ni-private-switch-indicator-border-color: ${Black7};
65581
- --ni-private-switch-indicator-border-disabled-color: ${hexToRgbaCssColor(Black7, 0.3)};
65637
+ --ni-private-switch-background-selected-color: ${hexToRgbaCssColor(PowerGreen, 0.6)};
65638
+ --ni-private-switch-background-selected-rollover-color: ${hexToRgbaCssColor(PowerGreen, 0.3)};
65639
+ --ni-private-switch-indicator-background-color: ${Black75};
65640
+ --ni-private-switch-indicator-background-disabled-color: ${hexToRgbaCssColor(Black15, 0.1)};
65641
+ --ni-private-switch-indicator-background-active-color: ${hexToRgbaCssColor(PowerGreen, 0.3)};
65642
+ --ni-private-switch-indicator-border-color: ${hexToRgbaCssColor(Black15, 0.3)};
65643
+ --ni-private-switch-indicator-border-selected-color: ${PowerGreen};
65644
+ --ni-private-switch-indicator-border-disabled-color: ${hexToRgbaCssColor(Black15, 0.15)};
65582
65645
  }
65583
65646
  `), themeBehavior(Theme.color, css `
65584
65647
  :host {
65648
+ --ni-private-switch-background-color: ${hexToRgbaCssColor(White, 0.1)};
65585
65649
  --ni-private-switch-background-disabled-color: ${hexToRgbaCssColor(White, 0.07)};
65586
- --ni-private-switch-indicator-background-color: ${hexToRgbaCssColor(White, 0.1)};
65650
+ --ni-private-switch-background-selected-color: ${hexToRgbaCssColor(White, 0.6)};
65651
+ --ni-private-switch-background-selected-rollover-color: ${hexToRgbaCssColor(White, 0.3)};
65652
+ --ni-private-switch-indicator-background-color: ${hexToRgbaCssColor(White, 0.3)};
65587
65653
  --ni-private-switch-indicator-background-disabled-color: ${hexToRgbaCssColor(White, 0.1)};
65588
- --ni-private-switch-indicator-border-color: ${White};
65654
+ --ni-private-switch-indicator-background-active-color: ${hexToRgbaCssColor(White, 0.3)};
65655
+ --ni-private-switch-indicator-border-color: ${hexToRgbaCssColor(White, 0.3)};
65656
+ --ni-private-switch-indicator-border-selected-color: ${White} ;
65589
65657
  --ni-private-switch-indicator-border-disabled-color: ${hexToRgbaCssColor(White, 0.3)};
65590
65658
  }
65591
65659
  `));