@smilodon/core 1.4.12 → 1.5.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
@@ -20,9 +20,10 @@ Additional references:
20
20
  - **Performance Runbook**: [`docs/PERFORMANCE-RUNBOOK.md`](../../docs/PERFORMANCE-RUNBOOK.md)
21
21
  - **Performance Guide**: [`docs/PERFORMANCE.md`](../../docs/PERFORMANCE.md)
22
22
  - **Known Limitations**: [`docs/KNOWN-LIMITATIONS.md`](../../docs/KNOWN-LIMITATIONS.md)
23
+ - **Build Tool Integration**: [`docs/BUILD-TOOL-INTEGRATION.md`](../../docs/BUILD-TOOL-INTEGRATION.md)
23
24
 
24
25
  The complete guide includes:
25
- - ✅ All 60+ CSS variables for complete customization
26
+ - ✅ Complete styling token coverage for colors, layout, chips, motion, and accessibility
26
27
  - ✅ Vanilla JavaScript patterns (DOM manipulation, event listeners)
27
28
  - ✅ Complete API reference with all properties and methods
28
29
  - ✅ CDN usage and module bundler integration
@@ -702,18 +703,20 @@ enhanced-select.dark-mode {
702
703
  --select-dark-group-header-bg /* Dark header background */
703
704
  ```
704
705
 
705
- **Complete CSS Variables List (60+ variables)**
706
+ **Complete CSS Variables Reference**
706
707
 
707
- See the [full CSS variables reference](https://github.com/navidrezadoost/smilodon/blob/main/CHANGELOG.md#135---2026-02-09) for all 60+ customizable properties including:
708
- - Input container (gap, padding, height, borders, focus states)
709
- - Input field (width, padding, font, colors)
710
- - Arrow/icon (size, color, hover states, position)
711
- - **Separator line** (width, height, gradient, position)
712
- - **Selection badges** (padding, colors, **remove/delete button**)
713
- - Dropdown (margins, max-height, borders, shadows)
714
- - Options (font size, line height, borders, transitions)
715
- - Load more button (padding, borders, colors, hover states)
716
- - Loading/empty states (padding, colors, backgrounds, spinner)
708
+ The canonical styling inventory now lives in:
709
+
710
+ - [docs/STYLING.md](../../docs/STYLING.md) for strategy and examples
711
+ - [docs/STYLING-TOKENS.md](../../docs/STYLING-TOKENS.md) for the exhaustive token table
712
+
713
+ That reference covers:
714
+
715
+ - Theme foundation tokens (palette, shadows, radii, timing)
716
+ - Input shell, separator, arrow, and clear-control hooks
717
+ - Multi-select chip structure, remove-button states, and badge motion
718
+ - Dropdown, scrollbar, group-header, and option-state hooks
719
+ - Empty, loading, searching, error, reduced-motion, and high-contrast hooks
717
720
 
718
721
  #### Highlighted Customization Features
719
722
 
@@ -747,6 +750,85 @@ enhanced-select {
747
750
  **Gradient Dropdown + Hover/Selected States**
748
751
  If your dropdown uses a gradient background (for example via `--select-dropdown-bg`), option hover/selected colors still work as expected. The component intentionally uses the `background` shorthand for hover/selected option states so any inherited `background-image` layers are cleared correctly.
749
752
 
753
+ **Closed Input Value + Dropdown Option Alignment**
754
+ You can switch alignment and inspect both the selected value in the closed input and the dropdown options with matching tokens:
755
+
756
+ ```css
757
+ enhanced-select.align-center {
758
+ --select-input-text-align: center;
759
+ --select-option-text-align: center;
760
+ }
761
+
762
+ enhanced-select.align-right {
763
+ --select-input-text-align: right;
764
+ --select-option-text-align: right;
765
+ }
766
+ ```
767
+
768
+ Useful related hooks:
769
+
770
+ - `--select-input-text-align`
771
+ - `--select-input-justify-content`
772
+ - `--select-option-text-align`
773
+ - `--select-group-header-text-align`
774
+
775
+ This is especially useful when testing centered or right-aligned UI layouts, because you can verify the closed state and open dropdown state together.
776
+
777
+ **Dropdown Placement: Bottom / Top / Automatic**
778
+ The dropdown can be opened in three modes:
779
+
780
+ - `bottom` — always below the select
781
+ - `top` — always above the select
782
+ - `auto` — below if there is enough room below, otherwise above
783
+
784
+ Per-instance:
785
+
786
+ ```ts
787
+ select.updateConfig({
788
+ dropdownPlacement: {
789
+ mode: 'auto',
790
+ },
791
+ });
792
+ ```
793
+
794
+ Global default:
795
+
796
+ ```ts
797
+ configureSelect({
798
+ dropdownPlacement: {
799
+ mode: 'top',
800
+ },
801
+ });
802
+ ```
803
+
804
+ Related styling hooks:
805
+
806
+ - `--select-dropdown-top`
807
+ - `--select-dropdown-bottom`
808
+ - `--select-dropdown-transform-origin`
809
+ - `--select-dropdown-top-transform-origin`
810
+
811
+ **Direction: LTR / RTL**
812
+ The select supports both `ltr` and `rtl` directions. The default is `ltr`.
813
+
814
+ Global default:
815
+
816
+ ```ts
817
+ configureSelect({
818
+ direction: 'rtl',
819
+ });
820
+ ```
821
+
822
+ Per-instance:
823
+
824
+ ```ts
825
+ select.updateConfig({
826
+ direction: 'rtl',
827
+ });
828
+ ```
829
+
830
+ RTL support mirrors the shell and dropdown layout, including arrow placement, clear control placement, separator side, selected indicator side, and chip remove spacing. The host `dir` attribute is kept in sync automatically.
831
+
750
832
  **Badge Remove/Delete Button (Multi-Select)**
751
833
  The × button that removes selected items in multi-select mode is fully customizable:
752
834
 
@@ -759,10 +841,15 @@ enhanced-select {
759
841
  /* Customize badge appearance */
760
842
  --select-badge-bg: #10b981; /* Badge background */
761
843
  --select-badge-color: white; /* Badge text color */
844
+ --select-badge-width: auto; /* Explicit badge width */
845
+ --select-badge-height: 32px; /* Explicit badge height */
762
846
  --select-badge-padding: 6px 10px; /* Badge spacing */
847
+ --select-badge-margin: 4px; /* Badge outer spacing */
848
+ --select-badge-border-radius: 10px; /* Badge radius */
763
849
 
764
850
  /* Customize the × (remove/delete) button */
765
851
  --select-badge-remove-size: 18px; /* Button size */
852
+ --select-badge-remove-icon-size: 12px; /* Icon glyph / SVG size */
766
853
  --select-badge-remove-bg: rgba(255, 255, 255, 0.3); /* Button background */
767
854
  --select-badge-remove-color: white; /* × symbol color */
768
855
  --select-badge-remove-font-size: 18px; /* × symbol size */
@@ -770,6 +857,30 @@ enhanced-select {
770
857
  }
771
858
  ```
772
859
 
860
+ You can also replace the default `×` with custom SVG or text:
861
+
862
+ ```ts
863
+ select.updateConfig({
864
+ selection: {
865
+ removeButtonIcon: '<svg viewBox="0 0 16 16" fill="none"><path d="M4 4L12 12M12 4L4 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round"/></svg>'
866
+ }
867
+ });
868
+ ```
869
+
870
+ Runtime style config now also supports higher-level sections for:
871
+
872
+ - `badge`
873
+ - `badgeHover`
874
+ - `badgeActive`
875
+ - `badgeLabel`
876
+ - `badgeRemove`
877
+ - `badgeRemoveHover`
878
+ - `badgeRemoveActive`
879
+ - `groupHeader`
880
+ - `activeOption`
881
+
882
+ This means badge size, badge radius, remove-button size, group-header layout, and active-option border/radius can be controlled either with CSS tokens or with `updateConfig({ styles: ... })`.
883
+
773
884
  #### Real-World Customization Examples
774
885
 
775
886
  **Example 1: Bootstrap-style Select**
@@ -778,7 +889,7 @@ enhanced-select {
778
889
  --select-input-border: 1px solid #ced4da;
779
890
  --select-input-border-radius: 0.375rem;
780
891
  --select-input-focus-border: #86b7fe;
781
- --select-input-focus-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
892
+ --select-shadow-focus: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
782
893
  --select-option-hover-bg: #e9ecef;
783
894
  --select-option-selected-bg: #0d6efd;
784
895
  --select-option-selected-color: white;
@@ -791,7 +902,7 @@ enhanced-select {
791
902
  enhanced-select {
792
903
  --select-input-border-radius: 4px;
793
904
  --select-input-focus-border: #1976d2;
794
- --select-input-focus-shadow: none;
905
+ --select-shadow-focus: none;
795
906
  --select-option-padding: 16px;
796
907
  --select-option-hover-bg: rgba(0, 0, 0, 0.04);
797
908
  --select-option-selected-bg: #e3f2fd;
@@ -807,7 +918,7 @@ enhanced-select {
807
918
  --select-input-border: 1px solid #e5e7eb;
808
919
  --select-input-border-radius: 0.5rem;
809
920
  --select-input-focus-border: #3b82f6;
810
- --select-input-focus-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
921
+ --select-shadow-focus: 0 0 0 3px rgba(59, 130, 246, 0.1);
811
922
  --select-option-padding: 0.5rem 0.75rem;
812
923
  --select-option-hover-bg: #f3f4f6;
813
924
  --select-option-selected-bg: #dbeafe;
@@ -815,6 +926,8 @@ enhanced-select {
815
926
  }
816
927
  ```
817
928
 
929
+ Framework compatibility guidance also lives in [../../docs/CSS-FRAMEWORK-COMPATIBILITY.md](../../docs/CSS-FRAMEWORK-COMPATIBILITY.md).
930
+
818
931
  **Example 4: Custom Brand Colors**
819
932
  ```css
820
933
  enhanced-select {