@smilodon/core 1.5.5 → 1.6.0-debug.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 +138 -8
- package/dist/index.cjs +293 -88
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +293 -88
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/index.umd.js +293 -88
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/types/src/components/enhanced-select.d.ts +3 -0
- package/dist/types/src/components/select-option.d.ts +5 -0
- package/dist/types/src/config/global-config.d.ts +17 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -753,20 +753,106 @@ Control badge scrolling behavior in multi-select mode with `multiSelectDisplay`
|
|
|
753
753
|
```javascript
|
|
754
754
|
{
|
|
755
755
|
multiSelectDisplay: {
|
|
756
|
-
mode: 'wrap', // 'wrap' | 'horizontal' | 'vertical'
|
|
757
|
-
maxHeight: '160px',
|
|
758
|
-
overflowX: '
|
|
759
|
-
overflowY: '
|
|
756
|
+
mode: 'wrap', // 'wrap' | 'horizontal' | 'vertical'
|
|
757
|
+
maxHeight: '160px', // used by vertical / horizontal modes
|
|
758
|
+
overflowX: 'hidden',
|
|
759
|
+
overflowY: 'hidden',
|
|
760
760
|
dragScroll: true // Enable drag-to-scroll (horizontal mode)
|
|
761
761
|
}
|
|
762
762
|
}
|
|
763
763
|
```
|
|
764
764
|
|
|
765
765
|
**Display Modes:**
|
|
766
|
-
- **`wrap`** (default) - Badges wrap
|
|
767
|
-
- **`horizontal`** - Single row, horizontal scroll, drag-to-scroll enabled
|
|
768
|
-
- **`vertical`** -
|
|
769
|
-
|
|
766
|
+
- **`wrap`** (default) - Badges wrap naturally and the input shell grows with them; no internal chip scrollbar by default
|
|
767
|
+
- **`horizontal`** - Single row, stable trigger height, horizontal scroll, drag-to-scroll enabled, and action-area spacing reserved automatically
|
|
768
|
+
- **`vertical`** - Wrapped badges inside a constrained chip area with vertical scrolling that stops before the arrow / clear-control region
|
|
769
|
+
|
|
770
|
+
> **Important:** setting only overflow CSS variables is not the full mode contract. Use `multiSelectDisplay.mode` so Smilodon can switch wrapping, scroll direction, input sizing, and reserved arrow/clear-control spacing correctly.
|
|
771
|
+
|
|
772
|
+
#### Disabled / dimmed option behavior
|
|
773
|
+
|
|
774
|
+
Items with `disabled: true` are dimmed and non-selectable by default.
|
|
775
|
+
|
|
776
|
+
- no click selection
|
|
777
|
+
- no keyboard selection
|
|
778
|
+
- no hover affordance by default
|
|
779
|
+
- skipped by default keyboard navigation and range-selection helpers
|
|
780
|
+
|
|
781
|
+
If you need a dimmed option to remain hoverable, focusable, or selectable, configure it explicitly:
|
|
782
|
+
|
|
783
|
+
```javascript
|
|
784
|
+
{
|
|
785
|
+
selection: {
|
|
786
|
+
disabledOptionBehavior: {
|
|
787
|
+
hoverable: true,
|
|
788
|
+
focusable: true,
|
|
789
|
+
selectable: false
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
```
|
|
794
|
+
|
|
795
|
+
Styling hooks:
|
|
796
|
+
|
|
797
|
+
- `styles.disabledOption`
|
|
798
|
+
- `classMap.disabled`
|
|
799
|
+
- `--select-option-disabled-bg`
|
|
800
|
+
- `--select-option-disabled-color`
|
|
801
|
+
- `--select-option-disabled-border`
|
|
802
|
+
- `--select-option-disabled-opacity`
|
|
803
|
+
- `--select-option-disabled-cursor`
|
|
804
|
+
|
|
805
|
+
### Selected + active state tokens
|
|
806
|
+
|
|
807
|
+
When keyboard focus lands on an already selected option, Smilodon now keeps the selected surface and layers the active affordance on top of it.
|
|
808
|
+
|
|
809
|
+
Use these tokens to customize that combined state:
|
|
810
|
+
|
|
811
|
+
- `--select-option-selected-active-bg`
|
|
812
|
+
- `--select-option-selected-active-color`
|
|
813
|
+
- `--select-option-selected-active-border`
|
|
814
|
+
- `--select-option-selected-active-shadow`
|
|
815
|
+
- `--select-option-selected-active-outline`
|
|
816
|
+
- `--select-option-selected-active-outline-offset`
|
|
817
|
+
|
|
818
|
+
### Selected indicator controls
|
|
819
|
+
|
|
820
|
+
Smilodon exposes the selected side indicator directly now, so you do not need to rely on custom `::before` overrides.
|
|
821
|
+
|
|
822
|
+
Runtime control:
|
|
823
|
+
|
|
824
|
+
- `selection.showSelectedIndicator` - quickly show / hide the indicator
|
|
825
|
+
- `styles.selectedIndicator` - configure width, height, placement, background, radius, transform, and animation
|
|
826
|
+
|
|
827
|
+
Related CSS variables:
|
|
828
|
+
|
|
829
|
+
- `--select-option-selected-indicator-display`
|
|
830
|
+
- `--select-option-selected-indicator-width`
|
|
831
|
+
- `--select-option-selected-indicator-height`
|
|
832
|
+
- `--select-option-selected-indicator-bg`
|
|
833
|
+
- `--select-option-selected-indicator-left`
|
|
834
|
+
- `--select-option-selected-indicator-right`
|
|
835
|
+
- `--select-option-selected-indicator-top`
|
|
836
|
+
- `--select-option-selected-indicator-transform`
|
|
837
|
+
- `--select-option-selected-indicator-animation`
|
|
838
|
+
|
|
839
|
+
Example:
|
|
840
|
+
|
|
841
|
+
```javascript
|
|
842
|
+
{
|
|
843
|
+
selection: {
|
|
844
|
+
showSelectedIndicator: false
|
|
845
|
+
},
|
|
846
|
+
styles: {
|
|
847
|
+
selectedIndicator: {
|
|
848
|
+
width: '4px',
|
|
849
|
+
background: '#2563eb',
|
|
850
|
+
right: '0',
|
|
851
|
+
left: 'auto'
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
```
|
|
770
856
|
|
|
771
857
|
---
|
|
772
858
|
|
|
@@ -784,6 +870,19 @@ enhanced-select {
|
|
|
784
870
|
}
|
|
785
871
|
```
|
|
786
872
|
|
|
873
|
+
#### Removing Option Press Animation / Active Border
|
|
874
|
+
|
|
875
|
+
Smilodon now ships without the old pressed transform and active outline by default. If you want to enforce a flat option surface explicitly:
|
|
876
|
+
|
|
877
|
+
```css
|
|
878
|
+
enhanced-select {
|
|
879
|
+
--select-option-pressed-transform: none;
|
|
880
|
+
--select-option-selected-pressed-transform: none;
|
|
881
|
+
--select-option-active-outline: none;
|
|
882
|
+
--select-option-selected-active-outline: none;
|
|
883
|
+
}
|
|
884
|
+
```
|
|
885
|
+
|
|
787
886
|
#### Multi-Select Container & Badge Padding
|
|
788
887
|
|
|
789
888
|
Control container padding separately from badge padding:
|
|
@@ -992,6 +1091,36 @@ select.updateConfig({
|
|
|
992
1091
|
});
|
|
993
1092
|
```
|
|
994
1093
|
|
|
1094
|
+
If you want to style the icon itself separately from the circular button shell, use the dedicated icon hooks:
|
|
1095
|
+
|
|
1096
|
+
- `styles.badgeRemoveIcon`
|
|
1097
|
+
- `classNames.badgeRemoveIcon`
|
|
1098
|
+
- `::part(chip-remove-icon)`
|
|
1099
|
+
- `--select-badge-remove-icon-size`
|
|
1100
|
+
- `--select-badge-remove-icon-color`
|
|
1101
|
+
- `--select-badge-remove-icon-font-size`
|
|
1102
|
+
- `--select-badge-remove-icon-line-height`
|
|
1103
|
+
- `--select-badge-remove-icon-transform`
|
|
1104
|
+
- `--select-badge-remove-icon-opacity`
|
|
1105
|
+
|
|
1106
|
+
Example:
|
|
1107
|
+
|
|
1108
|
+
```ts
|
|
1109
|
+
select.updateConfig({
|
|
1110
|
+
selection: {
|
|
1111
|
+
removeButtonIcon: '<svg viewBox="0 0 16 16" fill="none"><path d="M3 8h10" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>'
|
|
1112
|
+
},
|
|
1113
|
+
styles: {
|
|
1114
|
+
badgeRemoveIcon: {
|
|
1115
|
+
width: '12px',
|
|
1116
|
+
height: '12px',
|
|
1117
|
+
color: '#ffffff',
|
|
1118
|
+
transform: 'scale(0.95)'
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
});
|
|
1122
|
+
```
|
|
1123
|
+
|
|
995
1124
|
Runtime style config now also supports higher-level sections for:
|
|
996
1125
|
|
|
997
1126
|
- `badge`
|
|
@@ -999,6 +1128,7 @@ Runtime style config now also supports higher-level sections for:
|
|
|
999
1128
|
- `badgeActive`
|
|
1000
1129
|
- `badgeLabel`
|
|
1001
1130
|
- `badgeRemove`
|
|
1131
|
+
- `badgeRemoveIcon`
|
|
1002
1132
|
- `badgeRemoveHover`
|
|
1003
1133
|
- `badgeRemoveActive`
|
|
1004
1134
|
- `groupHeader`
|