@smilodon/core 1.4.10 → 1.4.11

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
@@ -1538,6 +1538,8 @@
1538
1538
  padding: var(--select-option-padding, 8px 12px);
1539
1539
  cursor: pointer;
1540
1540
  user-select: none;
1541
+ color: var(--select-option-color, var(--select-text-color, #1f2937));
1542
+ background: var(--select-option-bg, var(--select-dropdown-bg, var(--select-bg, white)));
1541
1543
  transition: var(--select-option-transition, background-color 0.2s ease);
1542
1544
  border: var(--select-option-border, none);
1543
1545
  border-bottom: var(--select-option-border-bottom, none);
@@ -1582,9 +1584,20 @@
1582
1584
 
1583
1585
  .option-content {
1584
1586
  flex: 1;
1585
- overflow: hidden;
1586
- text-overflow: ellipsis;
1587
- white-space: nowrap;
1587
+ overflow: var(--select-option-content-overflow, hidden);
1588
+ text-overflow: var(--select-option-content-text-overflow, ellipsis);
1589
+ white-space: var(--select-option-content-white-space, nowrap);
1590
+ }
1591
+
1592
+ .checkmark-icon {
1593
+ display: none;
1594
+ margin-left: var(--select-checkmark-margin-left, 8px);
1595
+ color: var(--select-checkmark-color, currentColor);
1596
+ }
1597
+
1598
+ :host([aria-selected="true"]) .checkmark-icon,
1599
+ .option-container.selected .checkmark-icon {
1600
+ display: inline-flex;
1588
1601
  }
1589
1602
 
1590
1603
  .remove-button {
@@ -1712,16 +1725,6 @@
1712
1725
  <path d="M4 8.5L6.5 11L12 5.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
1713
1726
  </svg>
1714
1727
  `;
1715
- // Visibility control via CSS or inline style
1716
- // We set it to display: none unless selected.
1717
- // User can override this behavior via part styling if they want transitions
1718
- if (!selected) {
1719
- checkmark.style.display = 'none';
1720
- }
1721
- else {
1722
- checkmark.style.marginLeft = '8px';
1723
- checkmark.style.color = 'currentColor';
1724
- }
1725
1728
  this._container.appendChild(checkmark);
1726
1729
  }
1727
1730
  // Data Attributes Contract on Host
@@ -1959,7 +1962,6 @@
1959
1962
  // Angular's rendering seems to not apply :host styles correctly in some cases
1960
1963
  // Must be done in connectedCallback when element is attached to DOM
1961
1964
  this.style.display = 'block';
1962
- this.style.width = '100%';
1963
1965
  if (this._optionRenderer) {
1964
1966
  this._setGlobalStylesMirroring(true);
1965
1967
  }
@@ -2202,7 +2204,8 @@
2202
2204
  :host {
2203
2205
  display: block;
2204
2206
  position: relative;
2205
- width: 100%;
2207
+ width: var(--select-width, 100%);
2208
+ height: var(--select-height, auto);
2206
2209
  }
2207
2210
 
2208
2211
  .select-container {
@@ -2218,6 +2221,7 @@
2218
2221
  flex-wrap: wrap;
2219
2222
  gap: var(--select-input-gap, 6px);
2220
2223
  padding: var(--select-input-padding, 6px 52px 6px 8px);
2224
+ height: var(--select-input-height, auto);
2221
2225
  min-height: var(--select-input-min-height, 44px);
2222
2226
  max-height: var(--select-input-max-height, 160px);
2223
2227
  overflow-y: var(--select-input-overflow-y, auto);
@@ -2239,17 +2243,17 @@
2239
2243
  content: '';
2240
2244
  position: absolute;
2241
2245
  top: 50%;
2242
- right: var(--select-separator-position, 40px);
2246
+ right: var(--select-separator-position, var(--select-seperator-position, 40px));
2243
2247
  transform: translateY(-50%);
2244
- width: var(--select-separator-width, 1px);
2245
- height: var(--select-separator-height, 60%);
2246
- background: var(--select-separator-bg, var(--select-separator-gradient, linear-gradient(
2248
+ width: var(--select-separator-width, var(--select-seperator-width, 1px));
2249
+ height: var(--select-separator-height, var(--select-seperator-height, 60%));
2250
+ background: var(--select-separator-bg, var(--select-seperator-bg, var(--select-separator-gradient, var(--select-seperator-gradient, linear-gradient(
2247
2251
  to bottom,
2248
2252
  transparent 0%,
2249
2253
  rgba(0, 0, 0, 0.1) 20%,
2250
2254
  rgba(0, 0, 0, 0.1) 80%,
2251
2255
  transparent 100%
2252
- )));
2256
+ ))));
2253
2257
  pointer-events: none;
2254
2258
  z-index: 1;
2255
2259
  }
@@ -2276,7 +2280,7 @@
2276
2280
  }
2277
2281
 
2278
2282
  .input-container.has-clear-control::after {
2279
- right: var(--select-separator-position-with-clear, 72px);
2283
+ right: var(--select-separator-position-with-clear, var(--select-seperator-position-with-clear, 72px));
2280
2284
  }
2281
2285
 
2282
2286
  .dropdown-arrow-container.with-clear-control {
@@ -2354,6 +2358,7 @@
2354
2358
 
2355
2359
  .select-input {
2356
2360
  flex: 1;
2361
+ width: var(--select-input-width, auto);
2357
2362
  min-width: var(--select-input-min-width, 120px);
2358
2363
  padding: var(--select-input-field-padding, 4px);
2359
2364
  border: none;
@@ -2448,6 +2453,7 @@
2448
2453
  font-weight: var(--select-group-header-weight, 600);
2449
2454
  color: var(--select-group-header-color, #6b7280);
2450
2455
  background-color: var(--select-group-header-bg, #f3f4f6);
2456
+ text-align: var(--select-group-header-text-align, left);
2451
2457
  font-size: var(--select-group-header-font-size, 12px);
2452
2458
  text-transform: var(--select-group-header-text-transform, uppercase);
2453
2459
  letter-spacing: var(--select-group-header-letter-spacing, 0.05em);
@@ -2632,10 +2638,25 @@
2632
2638
 
2633
2639
  /* Dark mode - Opt-in via class, data attribute, or ancestor context */
2634
2640
  :host(.dark-mode),
2641
+ :host([dark-mode]),
2642
+ :host([darkmode]),
2635
2643
  :host([data-theme="dark"]),
2644
+ :host([theme="dark"]),
2636
2645
  :host-context(.dark-mode),
2637
2646
  :host-context(.dark),
2638
- :host-context([data-theme="dark"]) {
2647
+ :host-context([dark-mode]),
2648
+ :host-context([darkmode]),
2649
+ :host-context([data-theme="dark"]),
2650
+ :host-context([theme="dark"]) {
2651
+ /* map dark tokens to base option tokens so nested <select-option>
2652
+ components also pick up dark mode via inherited CSS variables */
2653
+ --select-option-bg: var(--select-dark-option-bg, #1f2937);
2654
+ --select-option-color: var(--select-dark-option-color, #f9fafb);
2655
+ --select-option-hover-bg: var(--select-dark-option-hover-bg, #374151);
2656
+ --select-option-hover-color: var(--select-dark-option-hover-color, #f9fafb);
2657
+ --select-option-selected-bg: var(--select-dark-option-selected-bg, #3730a3);
2658
+ --select-option-selected-color: var(--select-dark-option-selected-text, #e0e7ff);
2659
+
2639
2660
  .input-container {
2640
2661
  background: var(--select-dark-bg, #1f2937);
2641
2662
  border-color: var(--select-dark-border, #4b5563);
@@ -2688,6 +2709,8 @@
2688
2709
 
2689
2710
  .option.active:not(.selected) {
2690
2711
  background-color: var(--select-dark-option-active-bg, #374151);
2712
+ color: var(--select-dark-option-active-color, #f9fafb);
2713
+ outline: var(--select-dark-option-active-outline, 2px solid rgba(129, 140, 248, 0.55));
2691
2714
  }
2692
2715
 
2693
2716
  /* Group header in dark mode */
@@ -2695,9 +2718,6 @@
2695
2718
  color: var(--select-dark-group-header-color, var(--select-group-header-color, #6b7280));
2696
2719
  background-color: var(--select-dark-group-header-bg, var(--select-group-header-bg, #374151));
2697
2720
  }
2698
- color: var(--select-dark-option-active-color, #f9fafb);
2699
- outline: var(--select-dark-option-active-outline, 2px solid rgba(129, 140, 248, 0.55));
2700
- }
2701
2721
 
2702
2722
  .option.selected.active {
2703
2723
  background-color: var(--select-dark-option-selected-active-bg, var(--select-dark-option-selected-bg, #3730a3));
@@ -2819,7 +2839,13 @@
2819
2839
  this._handleOpen();
2820
2840
  }
2821
2841
  else {
2822
- // clicking the input while open should close the dropdown too
2842
+ // Keep open while interacting directly with the input so users can
2843
+ // place cursor/type without accidental collapse.
2844
+ if (target === this._input) {
2845
+ this._input.focus();
2846
+ return;
2847
+ }
2848
+ // clicking other parts of the input container while open toggles close
2823
2849
  this._handleClose();
2824
2850
  }
2825
2851
  // Focus the input (do not prevent default behavior)