@ni/ok-components 0.2.5 → 0.2.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.
@@ -65439,7 +65439,9 @@ ${nextLine.slice(indentLevel + 2)}`;
65439
65439
  flex-direction: column;
65440
65440
  cursor: pointer;
65441
65441
  --ni-private-switch-height: 24px;
65442
- --ni-private-switch-indicator-size: 16px;
65442
+ --ni-private-switch-indicator-size: 24px;
65443
+ --ni-private-switch-indicator-inner-size: 18px;
65444
+ --ni-private-switch-indicator-margin: -2px;
65443
65445
  padding-bottom: calc(
65444
65446
  ${controlHeight} - var(--ni-private-switch-height)
65445
65447
  );
@@ -65477,20 +65479,36 @@ ${nextLine.slice(indentLevel + 2)}`;
65477
65479
  display: flex;
65478
65480
  height: var(--ni-private-switch-height);
65479
65481
  width: calc(var(--ni-private-switch-height) * 2);
65480
- background-color: ${fillHoverColor};
65482
+ background-color: var(--ni-private-switch-background-color);
65481
65483
  border-radius: calc(var(--ni-private-switch-height) / 2);
65482
65484
  align-items: center;
65483
- border: calc(${borderWidth} * 2) solid transparent;
65485
+ border: calc(${borderWidth}) solid transparent;
65484
65486
  }
65485
65487
 
65486
- :host([disabled]) .switch {
65487
- background-color: var(--ni-private-switch-background-disabled-color);
65488
+ :host([aria-checked='true']) .switch {
65489
+ background-color: var(--ni-private-switch-background-selected-color);
65490
+ }
65491
+
65492
+ :host([aria-checked='true']:hover) .switch {
65493
+ background-color: var(--ni-private-switch-background-selected-rollover-color);
65488
65494
  }
65489
65495
 
65490
65496
  :host(${focusVisible}) .switch {
65491
65497
  border-color: ${borderHoverColor};
65492
65498
  }
65493
65499
 
65500
+ :host(${focusVisible}[aria-checked='true']) .switch {
65501
+ background-color: var(--ni-private-switch-background-selected-rollover-color);
65502
+ }
65503
+
65504
+ :host([disabled]) .switch {
65505
+ background-color: var(--ni-private-switch-background-disabled-color);
65506
+ }
65507
+
65508
+ :host([disabled]:hover) .switch {
65509
+ background-color: var(--ni-private-switch-background-disabled-color);
65510
+ }
65511
+
65494
65512
  .checked-indicator-spacer {
65495
65513
  flex-grow: 0;
65496
65514
  transition: flex-grow ${smallDelay} ease-in-out;
@@ -65508,51 +65526,81 @@ ${nextLine.slice(indentLevel + 2)}`;
65508
65526
  width: var(--ni-private-switch-indicator-size);
65509
65527
  height: var(--ni-private-switch-indicator-size);
65510
65528
  border-radius: calc(var(--ni-private-switch-indicator-size) / 2);
65511
- margin: calc(
65512
- calc(
65513
- var(--ni-private-switch-height) - var(
65514
- --ni-private-switch-indicator-size
65515
- )
65516
- ) /
65517
- 2
65518
- );
65529
+ margin: var(--ni-private-switch-indicator-margin);
65519
65530
  border: ${borderWidth} solid
65520
65531
  var(--ni-private-switch-indicator-border-color);
65521
65532
  }
65522
65533
 
65534
+ :host([aria-checked='true']) .checked-indicator {
65535
+ border-color: var(--ni-private-switch-indicator-border-selected-color);
65536
+ }
65537
+
65523
65538
  :host(:hover) .checked-indicator {
65524
65539
  border: calc(${borderWidth} * 2) solid ${borderHoverColor};
65525
65540
  }
65526
65541
 
65542
+ :host(${focusVisible}) .checked-indicator {
65543
+ border: calc(${borderWidth} * 2) solid ${borderHoverColor};
65544
+ }
65545
+
65527
65546
  :host([disabled]) .checked-indicator {
65528
- background-color: var(
65529
- --ni-private-switch-indicator-background-disabled-color
65530
- );
65547
+ background-color: transparent;
65531
65548
  border: ${borderWidth} solid
65532
65549
  var(--ni-private-switch-indicator-border-disabled-color);
65533
65550
  }
65534
65551
 
65535
- :host(${focusVisible}) .checked-indicator {
65536
- border: ${borderWidth} solid ${borderHoverColor};
65552
+ :host([disabled]:hover) .checked-indicator {
65553
+ background-color: transparent;
65554
+ border: ${borderWidth} solid
65555
+ var(--ni-private-switch-indicator-border-disabled-color);
65537
65556
  }
65538
65557
 
65539
- .checked-indicator-inner {
65540
- width: calc(var(--ni-private-switch-indicator-size) / 2);
65541
- height: calc(var(--ni-private-switch-indicator-size) / 2);
65542
- border-radius: calc(var(--ni-private-switch-indicator-size) / 4);
65543
- background-color: var(--ni-private-switch-indicator-border-color);
65558
+ :host([disabled]${focusVisible}) .checked-indicator {
65559
+ background-color: transparent;
65560
+ border: ${borderWidth} solid
65561
+ var(--ni-private-switch-indicator-border-disabled-color);
65562
+ }
65563
+
65564
+ :host([disabled]:active) .checked-indicator-inner {
65565
+ background-color: var(
65566
+ --ni-private-switch-indicator-border-disabled-color
65567
+ );
65544
65568
  opacity: 0;
65545
- transition: opacity ${smallDelay} ease-in-out;
65546
65569
  }
65547
65570
 
65548
- :host([disabled]) .checked-indicator-inner {
65571
+ :host([disabled]${focusVisible}) .checked-indicator-inner {
65549
65572
  background-color: var(
65550
65573
  --ni-private-switch-indicator-border-disabled-color
65551
65574
  );
65575
+ opacity: 0;
65576
+ }
65577
+
65578
+ .checked-indicator-inner {
65579
+ width: var(--ni-private-switch-indicator-inner-size);
65580
+ height: var(--ni-private-switch-indicator-inner-size);
65581
+ border-radius: calc(var(--ni-private-switch-indicator-inner-size) / 2);
65582
+ opacity: 0;
65552
65583
  }
65553
65584
 
65554
65585
  :host([aria-checked='true']) .checked-indicator-inner {
65586
+ opacity: 0;
65587
+ }
65588
+
65589
+ :host(${focusVisible}) .checked-indicator-inner {
65590
+ opacity: 1;
65591
+ background-color: var(--ni-private-switch-indicator-background-color);
65592
+ border: 1px solid var(--ni-private-switch-indicator-border-selected-color);
65593
+ }
65594
+
65595
+ :host(:active) .checked-indicator-inner {
65555
65596
  opacity: 1;
65597
+ background-color: var(--ni-private-switch-indicator-background-active-color);
65598
+ }
65599
+
65600
+ :host([disabled]) .checked-indicator-inner {
65601
+ background-color: var(
65602
+ --ni-private-switch-indicator-border-disabled-color
65603
+ );
65556
65604
  }
65557
65605
 
65558
65606
  slot[name='checked-message']::slotted(*) {
@@ -65567,26 +65615,43 @@ ${nextLine.slice(indentLevel + 2)}`;
65567
65615
  }
65568
65616
  `.withBehaviors(themeBehavior(Theme.light, css `
65569
65617
  :host {
65618
+ --ni-private-switch-background-color: ${hexToRgbaCssColor(Black91, 0.1)};
65570
65619
  --ni-private-switch-background-disabled-color: ${hexToRgbaCssColor(Black91, 0.07)};
65620
+ --ni-private-switch-background-selected-color: ${hexToRgbaCssColor(DigitalGreenLight, 0.6)};
65621
+ --ni-private-switch-background-selected-rollover-color: ${hexToRgbaCssColor(DigitalGreenLight, 0.3)};
65571
65622
  --ni-private-switch-indicator-background-color: ${White};
65572
- --ni-private-switch-indicator-background-disabled-color: ${hexToRgbaCssColor(White, 0.1)};
65573
- --ni-private-switch-indicator-border-color: ${Black91};
65574
- --ni-private-switch-indicator-border-disabled-color: ${hexToRgbaCssColor(Black91, 0.3)};
65623
+ --ni-private-switch-indicator-background-disabled-color: ${hexToRgbaCssColor(Black91, 0.15)};
65624
+ --ni-private-switch-indicator-background-active-color: ${hexToRgbaCssColor(DigitalGreenLight, 0.3)};
65625
+
65626
+ --ni-private-switch-indicator-border-color: ${hexToRgbaCssColor(Black91, 0.3)};
65627
+ --ni-private-switch-indicator-border-selected-color: ${DigitalGreenLight};
65628
+ --ni-private-switch-indicator-border-disabled-color: ${hexToRgbaCssColor(Black91, 0.15)};
65629
+
65575
65630
  }
65576
65631
  `), themeBehavior(Theme.dark, css `
65577
65632
  :host {
65633
+ --ni-private-switch-background-color: ${hexToRgbaCssColor(Black15, 0.1)};
65578
65634
  --ni-private-switch-background-disabled-color: ${hexToRgbaCssColor(Black15, 0.07)};
65579
- --ni-private-switch-indicator-background-color: ${hexToRgbaCssColor(Black91, 0.3)};
65580
- --ni-private-switch-indicator-background-disabled-color: ${hexToRgbaCssColor(Black91, 0.1)};
65581
- --ni-private-switch-indicator-border-color: ${Black7};
65582
- --ni-private-switch-indicator-border-disabled-color: ${hexToRgbaCssColor(Black7, 0.3)};
65635
+ --ni-private-switch-background-selected-color: ${hexToRgbaCssColor(PowerGreen, 0.6)};
65636
+ --ni-private-switch-background-selected-rollover-color: ${hexToRgbaCssColor(PowerGreen, 0.3)};
65637
+ --ni-private-switch-indicator-background-color: ${Black75};
65638
+ --ni-private-switch-indicator-background-disabled-color: ${hexToRgbaCssColor(Black15, 0.1)};
65639
+ --ni-private-switch-indicator-background-active-color: ${hexToRgbaCssColor(PowerGreen, 0.3)};
65640
+ --ni-private-switch-indicator-border-color: ${hexToRgbaCssColor(Black15, 0.3)};
65641
+ --ni-private-switch-indicator-border-selected-color: ${PowerGreen};
65642
+ --ni-private-switch-indicator-border-disabled-color: ${hexToRgbaCssColor(Black15, 0.15)};
65583
65643
  }
65584
65644
  `), themeBehavior(Theme.color, css `
65585
65645
  :host {
65646
+ --ni-private-switch-background-color: ${hexToRgbaCssColor(White, 0.1)};
65586
65647
  --ni-private-switch-background-disabled-color: ${hexToRgbaCssColor(White, 0.07)};
65587
- --ni-private-switch-indicator-background-color: ${hexToRgbaCssColor(White, 0.1)};
65648
+ --ni-private-switch-background-selected-color: ${hexToRgbaCssColor(White, 0.6)};
65649
+ --ni-private-switch-background-selected-rollover-color: ${hexToRgbaCssColor(White, 0.3)};
65650
+ --ni-private-switch-indicator-background-color: ${hexToRgbaCssColor(White, 0.3)};
65588
65651
  --ni-private-switch-indicator-background-disabled-color: ${hexToRgbaCssColor(White, 0.1)};
65589
- --ni-private-switch-indicator-border-color: ${White};
65652
+ --ni-private-switch-indicator-background-active-color: ${hexToRgbaCssColor(White, 0.3)};
65653
+ --ni-private-switch-indicator-border-color: ${hexToRgbaCssColor(White, 0.3)};
65654
+ --ni-private-switch-indicator-border-selected-color: ${White} ;
65590
65655
  --ni-private-switch-indicator-border-disabled-color: ${hexToRgbaCssColor(White, 0.3)};
65591
65656
  }
65592
65657
  `));