@sentinel-password/react-components
Advanced tools
+3
-3
| { | ||
| "name": "@sentinel-password/react-components", | ||
| "version": "0.4.6", | ||
| "version": "0.4.7", | ||
| "type": "module", | ||
@@ -59,4 +59,4 @@ "description": "Accessible, headless React components for @sentinel-password - password validation UI made simple", | ||
| "dependencies": { | ||
| "@sentinel-password/core": "0.4.4", | ||
| "@sentinel-password/react": "0.5.6" | ||
| "@sentinel-password/core": "0.4.5", | ||
| "@sentinel-password/react": "0.5.7" | ||
| }, | ||
@@ -63,0 +63,0 @@ "devDependencies": { |
+31
-5
| # @sentinel-password/react-components | ||
| [](https://www.npmjs.com/package/@sentinel-password/react-components) | ||
| [](https://www.typescriptlang.org/) | ||
| [](https://opensource.org/licenses/MIT) | ||
| Accessible, headless React components for password validation built on top of `@sentinel-password/core` and `@sentinel-password/react`. | ||
| **[Documentation](https://akankov.github.io/sentinel-password/)** | **[Interactive Playground](https://akankov.github.io/sentinel-password/playground/)** | **[API Reference](https://akankov.github.io/sentinel-password/api/react-components.html)** | ||
| ## Features | ||
@@ -13,2 +19,3 @@ | ||
| - **Flexible** - Controlled and uncontrolled modes | ||
| - **React 18 & 19** - Supports both React 18 and 19 | ||
@@ -36,3 +43,4 @@ ## Installation | ||
| onValidationChange={(result) => { | ||
| console.log('Valid:', result.isValid) | ||
| console.log('Valid:', result.valid) | ||
| console.log('Strength:', result.strength) | ||
| }} | ||
@@ -56,2 +64,7 @@ /> | ||
| onValidationChange={(result) => console.log(result)} | ||
| onChange={(value) => console.log(value)} | ||
| showPassword={false} | ||
| onShowPasswordChange={(show) => console.log(show)} | ||
| validateOnMount={false} | ||
| debounceMs={300} | ||
| /> | ||
@@ -62,7 +75,15 @@ ``` | ||
| - `label` - Accessible label for the input | ||
| - `description` - Optional description text | ||
| - `onValidationChange` - Callback fired when validation state changes | ||
| - Standard HTML input props supported | ||
| | Prop | Type | Default | Description | | ||
| |------|------|---------|-------------| | ||
| | `label` | `string` | **required** | Accessible label for the input | | ||
| | `description` | `string` | - | Optional description text | | ||
| | `onValidationChange` | `(result: ValidationResult) => void` | - | Callback when validation state changes | | ||
| | `onChange` | `(value: string) => void` | - | Callback when input value changes | | ||
| | `showPassword` | `boolean` | `false` | Whether to show/hide the password | | ||
| | `onShowPasswordChange` | `(show: boolean) => void` | - | Callback when show/hide toggle changes | | ||
| | `validateOnMount` | `boolean` | `false` | Validate immediately on mount | | ||
| | `debounceMs` | `number` | `300` | Debounce delay in ms | | ||
| All standard HTML input props are also supported (except `type` and `onChange`). | ||
| ## Accessibility | ||
@@ -78,4 +99,9 @@ | ||
| ## Related Packages | ||
| - [`@sentinel-password/core`](https://www.npmjs.com/package/@sentinel-password/core) - Core validation engine (zero dependencies) | ||
| - [`@sentinel-password/react`](https://www.npmjs.com/package/@sentinel-password/react) - React hook for password validation | ||
| ## License | ||
| MIT © Aleksei Kankov |
53808
3.38%103
33.77%+ Added
+ Added
- Removed
- Removed