@smilodon/react 1.9.1 → 1.9.3
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 +14 -1
- package/package.json +17 -2
package/README.md
CHANGED
|
@@ -194,6 +194,20 @@ Use the built-in clear control in the input area and style it freely:
|
|
|
194
194
|
|
|
195
195
|
Available parts for advanced styling: `::part(clear-button)`, `::part(clear-icon)`.
|
|
196
196
|
|
|
197
|
+
By default, an empty clearable select does not reserve clear-button space. The button and adjusted input/arrow layout appear after a value is selected or, when search clearing is enabled, after search text is entered. They disappear again when both targets are empty. This applies to single, multi-select, LTR, and RTL layouts.
|
|
198
|
+
|
|
199
|
+
For a permanently visible disabled-when-empty control, use the full core configuration:
|
|
200
|
+
|
|
201
|
+
```tsx
|
|
202
|
+
<Select
|
|
203
|
+
items={items}
|
|
204
|
+
clearable
|
|
205
|
+
config={{ clearControl: { hideWhenEmpty: false } }}
|
|
206
|
+
/>
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
`onClear` receives `{ clearedSelection, clearedSearch }`, so controlled state can distinguish which target changed. The core manages action-area spacing automatically; custom styles should target the exposed parts and `--select-clear-*` tokens instead of adding permanent padding.
|
|
210
|
+
|
|
197
211
|
## Examples
|
|
198
212
|
|
|
199
213
|
### Basic Single Select
|
|
@@ -1553,4 +1567,3 @@ MIT © Smilodon
|
|
|
1553
1567
|
- `@smilodon/core` - Core web component
|
|
1554
1568
|
- `@smilodon/vue` - Vue 3 adapter
|
|
1555
1569
|
- `@smilodon/svelte` - Svelte adapter
|
|
1556
|
-
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smilodon/react",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.3",
|
|
4
4
|
"description": "React adapter for @smilodon/core",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -23,8 +23,23 @@
|
|
|
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.9.
|
|
26
|
+
"@smilodon/core": "^1.9.3",
|
|
27
27
|
"react": ">=16.8.0",
|
|
28
28
|
"react-dom": ">=16.8.0"
|
|
29
|
+
},
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "git+https://github.com/navidrezadoost/smilodon.git",
|
|
33
|
+
"directory": "packages/react"
|
|
34
|
+
},
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://github.com/navidrezadoost/smilodon/issues"
|
|
37
|
+
},
|
|
38
|
+
"homepage": "https://github.com/navidrezadoost/smilodon#readme",
|
|
39
|
+
"author": "Navid Rezadoost <navidrezadoost07@gmail.com>",
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public",
|
|
43
|
+
"registry": "https://registry.npmjs.org/"
|
|
29
44
|
}
|
|
30
45
|
}
|