@xsolla/xui-field-group 0.96.0 → 0.97.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 +42 -0
- package/package.json +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# @xsolla/xui-field-group
|
|
2
|
+
|
|
3
|
+
Form field wrapper providing a label, required indicator, icon, and helper text aligned to a size scale.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
yarn add @xsolla/xui-field-group
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { FieldGroup } from '@xsolla/xui-field-group';
|
|
15
|
+
import { Input } from '@xsolla/xui-input';
|
|
16
|
+
|
|
17
|
+
const Example = () => (
|
|
18
|
+
<FieldGroup
|
|
19
|
+
label="Email address"
|
|
20
|
+
required
|
|
21
|
+
helper="We'll never share your email."
|
|
22
|
+
size="md"
|
|
23
|
+
htmlFor="email-input"
|
|
24
|
+
>
|
|
25
|
+
<Input id="email-input" placeholder="you@example.com" />
|
|
26
|
+
</FieldGroup>
|
|
27
|
+
);
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Props
|
|
31
|
+
|
|
32
|
+
### FieldGroup
|
|
33
|
+
|
|
34
|
+
| Prop | Type | Default | Description |
|
|
35
|
+
|------|------|---------|-------------|
|
|
36
|
+
| `label` | `ReactNode` | — | Label displayed above the field |
|
|
37
|
+
| `required` | `boolean` | — | Shows a required marker next to the label |
|
|
38
|
+
| `icon` | `ReactElement` | — | Icon displayed alongside the label |
|
|
39
|
+
| `helper` | `ReactNode` | — | Helper text displayed below the field |
|
|
40
|
+
| `size` | `"xl" \| "lg" \| "md" \| "sm" \| "xs"` | — | Size scale applied to label and spacing |
|
|
41
|
+
| `htmlFor` | `string` | — | `for` attribute on the rendered `<label>` |
|
|
42
|
+
| `marginBottom` | `number \| string` | — | Override bottom margin of the group |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/xui-field-group",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.97.0",
|
|
4
4
|
"main": "./web/index.js",
|
|
5
5
|
"module": "./web/index.mjs",
|
|
6
6
|
"types": "./web/index.d.ts",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"test:coverage": "vitest run --coverage"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@xsolla/xui-core": "0.
|
|
17
|
-
"@xsolla/xui-primitives-core": "0.
|
|
16
|
+
"@xsolla/xui-core": "0.97.0",
|
|
17
|
+
"@xsolla/xui-primitives-core": "0.97.0"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"react": ">=16.8.0",
|