@smilodon/core 1.21.0 → 1.23.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/README.md CHANGED
@@ -12,6 +12,8 @@
12
12
 
13
13
  > **Verification status:** `EnhancedSelect`'s public `virtualize` setting chunks large-list rendering but does not bound the final option DOM. Viewport-windowed rendering remains behind a private test seam and is not production-activated. ARIA and keyboard behaviors have automated coverage in progress; WCAG conformance and manual assistive-technology review have not been certified. See [known limitations](../../docs/KNOWN-LIMITATIONS.md#viewport-virtualization-status) and the [Phase 4 certification record](../../docs/architecture/PHASE-4-CERTIFICATION.md).
14
14
 
15
+ > **Next Core candidate (unpublished):** Core `1.23.0` adds dropdown border controls, group/option stacking and loading-state styling, plus fixes for disabled-option clicks, pointer-reopen active state, and final-chip placeholder timing. See the [release candidate record](../../docs/releases/WEB-1.23.0-RELEASE.md).
16
+
15
17
  > **Issue #100:** `multiSelectDisplay.scrollToLatestChip` is available in `@smilodon/core@1.17.0`. See [Multi-Select Display Modes](#multi-select-display-modes) and the [release verification](../../docs/releases/WEB-1.17.0-REGISTRY-VERIFICATION.json).
16
18
 
17
19
  > **Core 1.20.0:** Adds selected-first option presentation and selected-option open positioning through `selectedOptions` and `scrollToSelected`. It also includes Core 1.19.0's styling fixes and search threshold. See [selected-option configuration](#selected-option-presentation-and-opening-scroll), [arrow container positioning](#custom-arrow-slot), and the [release record](../../docs/releases/WEB-1.20.0-RELEASE.md).
@@ -29,10 +31,18 @@ select.updateConfig({
29
31
  })
30
32
  ```
31
33
 
34
+ ## Active option state on open
35
+
36
+ Pointer-opening or reopening the dropdown preserves selected styling without assigning the selected option as the keyboard-active option. Active identity and `aria-activedescendant` are cleared for pointer opens; actual pointer hover remains native. Keyboard navigation establishes an active option, and keyboard focus/open continues to expose the selected active option where applicable. This keeps selection, hover, and keyboard navigation as separate states.
37
+
32
38
  ## Selected-label tooltip
33
39
 
34
40
  Core displays the full selected display label in a shared tooltip when the closed single-select value or a multi-select chip is visually truncated. The tooltip appears on pointer hover or keyboard focus; a label that fits does not open one. It uses the same configured item-label resolver as the visible selection, so custom `serverSide.getLabelFromItem` labels are reflected. Search queries are not treated as selected values. Multi-select chip labels become tab stops only while truncated, and Escape dismisses the tooltip without moving focus. This behavior covers selected values and chips, not custom option content in the dropdown.
35
41
 
42
+ ### Truncated search queries (Issue #129)
43
+
44
+ When a searchable input's current query is wider than the visible input area, Core uses the same tooltip to expose the full query on hover or keyboard focus. Search content remains a query, never a selected label; pending acknowledged input is considered while its update is in flight. The tooltip follows edits, query clearing, resize, and direction changes without changing the input value, caret, selection, or scroll position. Escape dismisses the tooltip, and a later edit can show it again. This behavior is included in Core `1.22.0`.
45
+
36
46
  ## Custom busy bucket (Core 1.13.0)
37
47
 
38
48
  Introduced in `@smilodon/core@1.13.0` (Issue #90), the busy bucket keeps request state in Core and lets the host customize its presentation. Use the native slots with the Web Component or Vanilla API:
@@ -64,6 +74,26 @@ select.updateConfig({
64
74
 
65
75
  The bucket exposes `::part(loading)`, `::part(loading-icon)`, `::part(loading-spinner)`, `::part(loading-message)`, and `::part(loading-content)`. Layout can be adjusted with `--select-busy-gap`, `--select-busy-padding`, `--select-busy-color`, `--select-busy-bg`, and the existing `--select-spinner-size` token. `minDisplayTime` is a visual minimum after request completion; it does not delay acceptance, pagination, or `aria-busy` updates.
66
76
 
77
+ ### Group, option, and loading presentation hooks
78
+
79
+ Sticky group headers keep their current defaults and can be adjusted with `--select-group-header-position`, `--select-group-header-top`, and `--select-group-header-z-index`. The same properties can be set at runtime with `styles.groupHeader.position`, `.top`, and `.zIndex`. Group headers expose `::part(group-header)`.
80
+
81
+ The individual option stacking token is `--select-option-z-index` (default `auto`). It applies to built-in option hosts and custom-rendered option roots. A positioned option with a raised z-index can overlap a sticky header; a child cannot escape its dropdown or another ancestor stacking/clipping context.
82
+
83
+ The separate searching state now exposes `::part(searching)`, `::part(searching-spinner)`, and `::part(searching-message)` while retaining the legacy `::part(loading)` hook. Set its accessible status text through the Core instance config:
84
+
85
+ ```ts
86
+ select.updateConfig({ searchingMessage: 'Searching the catalog…' });
87
+ ```
88
+
89
+ `loadMore.label` customizes the keyboard-accessible manual action, and its container and button expose `::part(load-more-container)` and `::part(load-more-button)`:
90
+
91
+ ```ts
92
+ select.updateConfig({ loadMore: { enabled: true, label: 'Show more products' } });
93
+ ```
94
+
95
+ `styles.loader` provides shared `gap`, `padding`, `color`, `background`, `fontSize`, `textAlign`, `alignItems`, and `justifyContent` styling for busy and searching containers. `styles.classNames.loader` is applied to both and updated when configuration changes. These settings complement the existing busy bucket slots and do not style or replace the infinite-scroll sentinel; the sentinel remains visually transparent and continues to drive observation.
96
+
67
97
  ## Acknowledged data loading
68
98
 
69
99
  The acknowledged protocol provides per-instance data-loading configuration and request completion on `EnhancedSelect`. It is included in the published Core package; the legacy protocol remains the default. Remote and hybrid search or cursor pagination require explicit acknowledged-protocol opt-in. There is no global acknowledged-loading default. See the [Core 1.19.0 release record](../../docs/releases/WEB-1.19.0-RELEASE.md) for the tested scope and browser limitations.
@@ -561,10 +591,43 @@ enhanced-select {
561
591
  /* Dropdown */
562
592
  --select-dropdown-bg: white;
563
593
  --select-dropdown-border: #ccc;
594
+ --select-dropdown-border-width: 1px;
595
+ --select-dropdown-border-style: solid;
564
596
  --select-dropdown-shadow: 0 4px 6px rgba(0,0,0,0.1);
565
597
  }
566
598
  ```
567
599
 
600
+ `--select-dropdown-border` continues to accept a **color only**. Width and style are independent tokens, so a dashed panel can be configured without replacing the border shorthand:
601
+
602
+ ```css
603
+ enhanced-select.custom-panel {
604
+ --select-dropdown-border: #64748b;
605
+ --select-dropdown-border-width: 2px;
606
+ --select-dropdown-border-style: dashed;
607
+ }
608
+
609
+ enhanced-select.borderless-panel {
610
+ --select-dropdown-border-style: none;
611
+ }
612
+ ```
613
+
614
+ The default remains `1px solid`. The closed field and dropdown panel are available as `::part(button)` and `::part(listbox)`. CSS variables are suitable for themeable defaults; `::part()` can style a part directly. An instance's `styles.dropdown` configuration is applied as inline styling and wins for overlapping properties. Runtime changes update the existing panel, without remounting:
615
+
616
+ ```ts
617
+ select.updateConfig({
618
+ styles: { dropdown: { borderWidth: '2px', borderStyle: 'dotted', borderColor: '#64748b' } },
619
+ });
620
+
621
+ // Release these inline overrides and return to the CSS token/stylesheet values.
622
+ select.updateConfig({
623
+ styles: { dropdown: { borderWidth: '', borderStyle: '', borderColor: '' } },
624
+ });
625
+ ```
626
+
627
+ You can also remove a border directly with `enhanced-select::part(listbox) { border: none; }`. If a runtime `styles.dropdown` value sets the same property, clear that runtime value before expecting the part rule or token fallback to apply. Dark mode retains explicit input and dropdown border colors; hover/focus input colors remain independently customizable with `--select-input-hover-border` and `--select-input-focus-border` (and the `--select-dark-*` state tokens).
628
+
629
+ With `prefers-contrast: more`, Smilodon adds an independent focus outline around the input container. This leaves the consumer-authored shell border dimensions and styling intact.
630
+
568
631
  #### Dark Mode (Opt-in)
569
632
 
570
633
  Dark mode is **opt-in only** and can be enabled by adding a class or data attribute:
@@ -619,6 +682,8 @@ enhanced-select.dark-mode {
619
682
  --select-input-height /* Input container height */
620
683
  --select-dropdown-bg /* Dropdown background (white) */
621
684
  --select-dropdown-border /* Dropdown border color (#ccc) */
685
+ --select-dropdown-border-width /* Dropdown border width (1px) */
686
+ --select-dropdown-border-style /* Dropdown border style (solid) */
622
687
  --select-dropdown-shadow /* Dropdown shadow */
623
688
  --select-empty-padding /* Empty/no-results container padding */
624
689
  --select-empty-color /* Text color for empty/no-results models */
@@ -798,12 +863,15 @@ If you need a dimmed option to remain hoverable, focusable, or selectable, confi
798
863
  disabledOptionBehavior: {
799
864
  hoverable: true,
800
865
  focusable: true,
801
- selectable: false
866
+ selectable: false,
867
+ closeOnClick: false
802
868
  }
803
869
  }
804
870
  }
805
871
  ```
806
872
 
873
+ `closeOnClick` defaults to `false`, so clicking a disabled option keeps the dropdown open and leaves selection unchanged. Set it to `true` to close after that blocked click; it never makes the disabled option selectable. Disabled options remain pointer-targetable for Core event handling while default hover, keyboard navigation, and selection restrictions remain in effect.
874
+
807
875
  Styling hooks:
808
876
 
809
877
  - `styles.disabledOption`