@behivetech/atoms.select 0.4.3 → 0.4.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 +2 -13
- package/docs.json +78 -0
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
A bare select control (built on Radix's `Select`) — the Radix trigger button is this component's own root element. It has no built-in label/hint/error; wrap it in `FormField` for that chrome.
|
|
4
4
|
|
|
5
|
+
Docs: https://bht-galaxy.vercel.app/behivetech/atoms/select
|
|
6
|
+
|
|
5
7
|
## Usage
|
|
6
8
|
|
|
7
9
|
```jsx
|
|
@@ -31,16 +33,3 @@ const roleOptions = [
|
|
|
31
33
|
```
|
|
32
34
|
|
|
33
35
|
Pass `aria-invalid="true"` to visually mark the field as invalid (pair with `FormField`'s `error` prop for the message).
|
|
34
|
-
|
|
35
|
-
## Props
|
|
36
|
-
|
|
37
|
-
| Prop | Type | Default | Description |
|
|
38
|
-
| --------------- | ------------------------- | ------- | ------------------------------------------------- |
|
|
39
|
-
| `options` | `SelectOption[]` | — | Array of `{ label, value, disabled? }` (required) |
|
|
40
|
-
| `value` | `string` | — | Controlled selected value |
|
|
41
|
-
| `defaultValue` | `string` | — | Uncontrolled initial value |
|
|
42
|
-
| `onValueChange` | `(value: string) => void` | — | Called when the selection changes |
|
|
43
|
-
| `placeholder` | `string` | — | Placeholder shown when nothing is selected |
|
|
44
|
-
| `disabled` | `boolean` | `false` | Disables the field |
|
|
45
|
-
| `required` | `boolean` | `false` | Marks field as required |
|
|
46
|
-
| `className` | `string` | — | Additional class names |
|
package/docs.json
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://github.com/behivetech/bht-component-registry/docs.schema.json",
|
|
3
|
+
"version": 2,
|
|
4
|
+
"generatedAt": "2026-10-23T19:01:21.124Z",
|
|
5
|
+
"docs": [
|
|
6
|
+
{
|
|
7
|
+
"displayName": "Select",
|
|
8
|
+
"description": "Bare select control — the Radix select trigger button is this component's\nown root element, no built-in label/hint/error. Wrap it in `FormField` for\nthat chrome: `<FormField label=\"...\" htmlFor=\"x\"><Select id=\"x\" .../></FormField>`.",
|
|
9
|
+
"extendsNative": true,
|
|
10
|
+
"props": [
|
|
11
|
+
{
|
|
12
|
+
"name": "options",
|
|
13
|
+
"type": "SelectOption[]",
|
|
14
|
+
"required": true,
|
|
15
|
+
"defaultValue": null,
|
|
16
|
+
"description": "Options rendered in the dropdown"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "asChild",
|
|
20
|
+
"type": "boolean",
|
|
21
|
+
"required": false,
|
|
22
|
+
"defaultValue": null,
|
|
23
|
+
"description": ""
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "className",
|
|
27
|
+
"type": "string",
|
|
28
|
+
"required": false,
|
|
29
|
+
"defaultValue": null,
|
|
30
|
+
"description": "Additional class names to merge with the component root element"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "defaultValue",
|
|
34
|
+
"type": "string",
|
|
35
|
+
"required": false,
|
|
36
|
+
"defaultValue": null,
|
|
37
|
+
"description": "Initial selected value for uncontrolled usage"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "name",
|
|
41
|
+
"type": "string",
|
|
42
|
+
"required": false,
|
|
43
|
+
"defaultValue": null,
|
|
44
|
+
"description": "Form field name submitted with the value"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "onValueChange",
|
|
48
|
+
"type": "((value: string) => void)",
|
|
49
|
+
"required": false,
|
|
50
|
+
"defaultValue": null,
|
|
51
|
+
"description": "Called with the new value when the selection changes"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "placeholder",
|
|
55
|
+
"type": "string",
|
|
56
|
+
"required": false,
|
|
57
|
+
"defaultValue": null,
|
|
58
|
+
"description": "Text shown when no value is selected"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "required",
|
|
62
|
+
"type": "boolean",
|
|
63
|
+
"required": false,
|
|
64
|
+
"defaultValue": null,
|
|
65
|
+
"description": "Marks the field as required for form validation"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "value",
|
|
69
|
+
"type": "string",
|
|
70
|
+
"required": false,
|
|
71
|
+
"defaultValue": null,
|
|
72
|
+
"description": "Controlled selected value"
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"functions": []
|
|
78
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@behivetech/atoms.select",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"license": "MIT",
|
|
5
|
+
"description": "A bare select control (built on Radix's `Select`) — the Radix trigger button is this component's own root element. It has no built-in label/hint/error; wrap it in `FormField` for that chrome.",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"private": false,
|
|
7
8
|
"exports": {
|
|
@@ -38,7 +39,7 @@
|
|
|
38
39
|
"tsup": "^8.5.1",
|
|
39
40
|
"typescript": "^6.0.3",
|
|
40
41
|
"vitest": "^4.1.10",
|
|
41
|
-
"@behivetech/forms.form-field": "0.3.
|
|
42
|
+
"@behivetech/forms.form-field": "0.3.4",
|
|
42
43
|
"@bht-component-registry/class-names": "0.0.6",
|
|
43
44
|
"@bht-component-registry/env": "0.1.0"
|
|
44
45
|
},
|
|
@@ -47,6 +48,7 @@
|
|
|
47
48
|
"url": "https://github.com/behivetech/bht-galaxy.git",
|
|
48
49
|
"directory": "registry/behivetech/atoms/select"
|
|
49
50
|
},
|
|
51
|
+
"homepage": "https://bht-galaxy.vercel.app/behivetech/atoms/select",
|
|
50
52
|
"publishConfig": {
|
|
51
53
|
"registry": "https://registry.npmjs.org",
|
|
52
54
|
"access": "public",
|