@smilodon/react 1.4.11 → 1.8.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.
Files changed (2) hide show
  1. package/README.md +43 -1
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1169,7 +1169,49 @@ function OptimizedExample() {
1169
1169
 
1170
1170
  ### Multi-select chip styling
1171
1171
 
1172
- Selected chips in multi-select mode use softer default pill styles and remain fully customizable. Target them with `::part(chip)` and `::part(chip-remove)`, or override CSS variables such as `--select-badge-bg`, `--select-badge-border`, `--select-badge-color`, `--select-badge-shadow`, `--select-badge-remove-bg`, `--select-badge-remove-color`, and `--select-multi-input-min-width`.
1172
+ Selected chips in multi-select mode use softer default pill styles and remain fully customizable. Target them with `::part(chip)`, `::part(chip-label)`, `::part(chip-remove)`, and `::part(chip-remove-icon)`, or override CSS variables such as `--select-badge-bg`, `--select-badge-border`, `--select-badge-color`, `--select-badge-shadow`, `--select-badge-width`, `--select-badge-height`, `--select-badge-remove-size`, `--select-badge-remove-icon-size`, and `--select-multi-input-min-width`.
1173
+
1174
+ Group headers and option states now expose a matching styling surface as well, including `--select-group-header-*`, `--select-option-border-radius`, `--select-option-active-*`, and `--select-option-disabled-*`.
1175
+
1176
+ If you prefer runtime config over raw CSS variables, the shared `styles` config now supports `badge`, `badgeHover`, `badgeActive`, `badgeLabel`, `badgeRemove`, `badgeRemoveHover`, `badgeRemoveActive`, `groupHeader`, and `activeOption`. Custom chip remove icons are available through `selection.removeButtonIcon`.
1177
+
1178
+ ### Alignment in closed input and dropdown options
1179
+
1180
+ To switch alignment and inspect both the selected value in the closed control and the option labels in the dropdown, use the shared alignment tokens together:
1181
+
1182
+ - `--select-input-text-align`
1183
+ - `--select-option-text-align`
1184
+ - `--select-input-justify-content`
1185
+ - `--select-group-header-text-align`
1186
+
1187
+ Example:
1188
+
1189
+ ```tsx
1190
+ <Select
1191
+ items={items}
1192
+ style={{
1193
+ '--select-input-text-align': 'center',
1194
+ '--select-option-text-align': 'center',
1195
+ } as React.CSSProperties}
1196
+ />
1197
+ ```
1198
+
1199
+ When testing alignment, inspect the closed selected value first, then open the dropdown and verify the option rows follow the same alignment.
1200
+
1201
+ ### Direction
1202
+
1203
+ The shared default direction is `ltr`, and you can switch a React select to `rtl` through `config.direction`.
1204
+
1205
+ ```tsx
1206
+ <Select
1207
+ items={items}
1208
+ config={{
1209
+ direction: 'rtl',
1210
+ }}
1211
+ />
1212
+ ```
1213
+
1214
+ This mirrors the shell and dropdown layout automatically, including arrow placement, clear-button placement, separator side, and selected indicator side.
1173
1215
 
1174
1216
  ### Types
1175
1217
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smilodon/react",
3
- "version": "1.4.11",
3
+ "version": "1.8.0",
4
4
  "description": "React adapter for @smilodon/core",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -23,7 +23,7 @@
23
23
  "build": "vite build && tsc --declaration --emitDeclarationOnly --outDir dist/types && node scripts/cleanup-types.js"
24
24
  },
25
25
  "peerDependencies": {
26
- "@smilodon/core": "^1.4.13",
26
+ "@smilodon/core": "^1.6.0",
27
27
  "react": ">=16.8.0",
28
28
  "react-dom": ">=16.8.0"
29
29
  }