@smilodon/core 1.10.2 → 1.11.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.
package/dist/index.umd.js CHANGED
@@ -2610,14 +2610,13 @@
2610
2610
  transition: var(--select-option-transition, background-color 0.2s ease);
2611
2611
  }
2612
2612
 
2613
- :host(:hover):not(.smilodon-option--disabled):not([aria-disabled="true"]),
2613
+ :host(:hover:not(.smilodon-option--disabled):not([aria-disabled="true"])),
2614
2614
  :host(.smilodon-option--disabled-hoverable:hover) {
2615
2615
  background: var(--select-option-hover-bg, #f0f0f0);
2616
2616
  color: var(--select-option-hover-color, var(--select-option-color, var(--select-text-color, #1f2937)));
2617
- border: var(--select-option-hover-border, var(--select-option-border, none));
2618
- border-bottom: var(--select-option-hover-border-bottom, var(--select-option-border-bottom, none));
2617
+ outline: var(--select-option-hover-border, none);
2618
+ outline-offset: -1px;
2619
2619
  box-shadow: var(--select-option-hover-shadow, var(--select-option-shadow, none));
2620
- transform: var(--select-option-hover-transform, var(--select-option-transform, none));
2621
2620
  }
2622
2621
 
2623
2622
  /* Keep the visual surface on the host so external utility classes applied
@@ -2638,10 +2637,9 @@
2638
2637
  :host(.smilodon-option--selected:hover) {
2639
2638
  background: var(--select-option-selected-hover-bg, var(--select-option-selected-bg, #e3f2fd));
2640
2639
  color: var(--select-option-selected-hover-color, var(--select-option-selected-color, #1976d2));
2641
- border: var(--select-option-selected-hover-border, var(--select-option-selected-border, var(--select-option-border, none)));
2642
- border-bottom: var(--select-option-selected-hover-border-bottom, var(--select-option-selected-border-bottom, var(--select-option-border-bottom, none)));
2640
+ outline: var(--select-option-selected-hover-border, var(--select-option-hover-border, none));
2641
+ outline-offset: -1px;
2643
2642
  box-shadow: var(--select-option-selected-hover-shadow, var(--select-option-selected-shadow, var(--select-option-shadow, none)));
2644
- transform: var(--select-option-selected-hover-transform, var(--select-option-selected-transform, var(--select-option-transform, none)));
2645
2643
  }
2646
2644
 
2647
2645
  :host(.smilodon-option--active):not(.smilodon-option--disabled):not([aria-disabled="true"]),
@@ -5498,10 +5496,21 @@
5498
5496
  const container = document.createElement('div');
5499
5497
  container.className = 'dropdown-arrow-container';
5500
5498
  container.innerHTML = `
5501
- <svg class="dropdown-arrow" part="arrow" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
5502
- <path d="M4 6L8 10L12 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
5503
- </svg>
5499
+ <slot name="arrow">
5500
+ <svg class="dropdown-arrow" part="arrow" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
5501
+ <path d="M4 6L8 10L12 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
5502
+ </svg>
5503
+ </slot>
5504
5504
  `;
5505
+ const slot = container.querySelector('slot[name="arrow"]');
5506
+ slot?.addEventListener('slotchange', () => {
5507
+ if (slot.assignedElements({ flatten: true }).length > 0) {
5508
+ this.setAttribute('data-custom-arrow', 'true');
5509
+ }
5510
+ else {
5511
+ this.removeAttribute('data-custom-arrow');
5512
+ }
5513
+ });
5505
5514
  return container;
5506
5515
  }
5507
5516
  _createClearControl() {
@@ -5657,7 +5666,7 @@
5657
5666
  --select-scrollbar-width: 6px;
5658
5667
  --select-scrollbar-thumb-radius: 3px;
5659
5668
  --select-option-hover-enabled: 1;
5660
- --select-option-hover-transform: translateX(2px);
5669
+ --select-option-hover-transform: none;
5661
5670
  --select-option-font-weight: 450;
5662
5671
  --select-option-margin: 2px 0;
5663
5672
  --select-input-font-size: inherit;
@@ -6216,6 +6225,10 @@
6216
6225
  .dropdown-arrow-container:hover {
6217
6226
  background-color: var(--select-arrow-hover-bg, rgba(15, 52, 96, 0.05));
6218
6227
  }
6228
+
6229
+ :host([data-custom-arrow="true"]) .dropdown-arrow-container:hover {
6230
+ background-color: transparent;
6231
+ }
6219
6232
 
6220
6233
  .dropdown-arrow {
6221
6234
  width: var(--select-arrow-width, var(--select-arrow-size, 16px));
@@ -6437,8 +6450,7 @@
6437
6450
  transition: var(--select-option-transition,
6438
6451
  background var(--select-transition-fast),
6439
6452
  color var(--select-transition-fast),
6440
- border var(--select-transition-fast),
6441
- transform var(--select-transition-fast),
6453
+ outline-color var(--select-transition-fast),
6442
6454
  box-shadow var(--select-transition-fast)
6443
6455
  );
6444
6456
  user-select: none;
@@ -6452,9 +6464,10 @@
6452
6464
  .option:hover:not(.disabled):not(.smilodon-option--disabled),
6453
6465
  .option.smilodon-option--disabled-hoverable:hover {
6454
6466
  background: var(--select-option-hover-bg, var(--select-surface-elevated));
6455
- border: var(--select-option-hover-border, var(--select-option-border, none));
6467
+ /* Hover decoration must not resize or translate the pointer hit target. */
6468
+ outline: var(--select-option-hover-border, none);
6469
+ outline-offset: -1px;
6456
6470
  color: var(--select-option-hover-color, var(--select-text));
6457
- transform: var(--select-option-hover-transform, none);
6458
6471
  }
6459
6472
 
6460
6473
  .option.selected {
@@ -6497,7 +6510,8 @@
6497
6510
 
6498
6511
  .option.selected:hover {
6499
6512
  background: var(--select-option-selected-hover-bg, var(--select-option-selected-bg, linear-gradient(135deg, rgba(15, 52, 96, 0.12) 0%, rgba(15, 52, 96, 0.06) 100%)));
6500
- border: var(--select-option-selected-hover-border, var(--select-option-selected-border, var(--select-option-hover-border, var(--select-option-border, none))));
6513
+ outline: var(--select-option-selected-hover-border, var(--select-option-hover-border, none));
6514
+ outline-offset: -1px;
6501
6515
  color: var(--select-option-selected-hover-color, var(--select-option-selected-color, var(--select-accent)));
6502
6516
  }
6503
6517
 
@@ -7927,7 +7941,9 @@
7927
7941
  _setInitialActiveOption() {
7928
7942
  const selectableIndices = this._getSelectableOptionIndices();
7929
7943
  const selected = Array.from(this._state.selectedIndices).sort((a, b) => a - b);
7930
- if (selectableIndices.length === 0 || (this._config.selection.mode === 'multi' && selected.length === 0)) {
7944
+ // Opening an empty select must not implicitly assign an active descendant.
7945
+ // Keyboard navigation and pointer interaction establish active identity.
7946
+ if (selectableIndices.length === 0 || selected.length === 0) {
7931
7947
  this._dispatchActiveKey(null, 'open', 'initial active option');
7932
7948
  return;
7933
7949
  }