@walidsj/react-ui 0.1.3 → 0.1.4
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 +30 -3
- package/dist/index.js +15 -1163
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,13 +29,14 @@ Import the compiled stylesheet once, then use components from the package
|
|
|
29
29
|
root:
|
|
30
30
|
|
|
31
31
|
``` tsx
|
|
32
|
-
import { Button, Input } from "@walidsj/react-ui";
|
|
32
|
+
import { Button, Input, Textarea } from "@walidsj/react-ui";
|
|
33
33
|
import "@walidsj/react-ui/style.css";
|
|
34
34
|
|
|
35
35
|
export function Example() {
|
|
36
36
|
return (
|
|
37
37
|
<div style={{ display: "grid", gap: "1rem", maxWidth: "24rem" }}>
|
|
38
38
|
<Input aria-label="Full name" placeholder="Full name" />
|
|
39
|
+
<Textarea aria-label="Notes" placeholder="Notes" size="lg" />
|
|
39
40
|
<Button variant="primary" size="md">
|
|
40
41
|
Save changes
|
|
41
42
|
</Button>
|
|
@@ -77,8 +78,34 @@ consumer-provided `aria-invalid` value is preserved when `invalid` is
|
|
|
77
78
|
not set. Labels, descriptions, and error messages are composed by the
|
|
78
79
|
consumer.
|
|
79
80
|
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
`size` controls the input height and horizontal padding:
|
|
82
|
+
|
|
83
|
+
- `sm`: compact control (`h-8`)
|
|
84
|
+
- `md`: default control (`h-10`)
|
|
85
|
+
- `lg`: larger control (`h-12`)
|
|
86
|
+
|
|
87
|
+
### Textarea
|
|
88
|
+
|
|
89
|
+
Renders a native `<textarea>` and forwards native textarea props and refs.
|
|
90
|
+
|
|
91
|
+
| Prop | Type | Default |
|
|
92
|
+
| ----------- | ---------------- | ------- |
|
|
93
|
+
| `invalid` | `boolean` | `false` |
|
|
94
|
+
| `size` | `sm \| md \| lg` | `md` |
|
|
95
|
+
| `className` | `string` | — |
|
|
96
|
+
|
|
97
|
+
`invalid` sets `aria-invalid="true"` and applies error styling. A
|
|
98
|
+
consumer-provided `aria-invalid` value is preserved when `invalid` is not set.
|
|
99
|
+
Labels, descriptions, and error messages are composed by the consumer.
|
|
100
|
+
|
|
101
|
+
`size` controls the minimum height and horizontal padding:
|
|
102
|
+
|
|
103
|
+
- `sm`: compact textarea (`min-h-16`)
|
|
104
|
+
- `md`: default textarea (`min-h-20`)
|
|
105
|
+
- `lg`: larger textarea (`min-h-28`)
|
|
106
|
+
|
|
107
|
+
Both form controls merge `className` with their internal classes using the
|
|
108
|
+
`cn` package. Consumers do not need to install `clsx` or `tailwind-merge`.
|
|
82
109
|
|
|
83
110
|
## Styling
|
|
84
111
|
|