@neo4j-ndl/react 4.22.0 → 4.23.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/lib/cjs/_common/form-control/FormFieldLabel.js +52 -0
- package/lib/cjs/_common/form-control/FormFieldLabel.js.map +1 -0
- package/lib/cjs/_common/form-control/FormFieldMessage.js +72 -0
- package/lib/cjs/_common/form-control/FormFieldMessage.js.map +1 -0
- package/lib/cjs/_common/form-control/form-control-types.js +23 -0
- package/lib/cjs/_common/form-control/form-control-types.js.map +1 -0
- package/lib/cjs/_common/form-control/index.js +39 -0
- package/lib/cjs/_common/form-control/index.js.map +1 -0
- package/lib/cjs/_common/form-control/use-form-field.js +76 -0
- package/lib/cjs/_common/form-control/use-form-field.js.map +1 -0
- package/lib/cjs/_common/form-control/use-inline-field-label.js +76 -0
- package/lib/cjs/_common/form-control/use-inline-field-label.js.map +1 -0
- package/lib/cjs/checkbox/Checkbox.js +9 -21
- package/lib/cjs/checkbox/Checkbox.js.map +1 -1
- package/lib/cjs/combobox/Combobox.js +75 -53
- package/lib/cjs/combobox/Combobox.js.map +1 -1
- package/lib/cjs/combobox/combobox-types.js.map +1 -1
- package/lib/cjs/date-picker/DatePicker.js.map +1 -1
- package/lib/cjs/icons/generated/custom/FloppyDiskArrowTopRight.js +30 -0
- package/lib/cjs/icons/generated/custom/FloppyDiskArrowTopRight.js.map +1 -0
- package/lib/cjs/icons/generated/custom/OpenQueryTab.js +1 -0
- package/lib/cjs/icons/generated/custom/OpenQueryTab.js.map +1 -1
- package/lib/cjs/icons/generated/custom/index.js +5 -3
- package/lib/cjs/icons/generated/custom/index.js.map +1 -1
- package/lib/cjs/next/tree-view/TreeView.js +16 -1
- package/lib/cjs/next/tree-view/TreeView.js.map +1 -1
- package/lib/cjs/radio/Radio.js +12 -22
- package/lib/cjs/radio/Radio.js.map +1 -1
- package/lib/cjs/select/Select.js +14 -5
- package/lib/cjs/select/Select.js.map +1 -1
- package/lib/cjs/select/types.js.map +1 -1
- package/lib/cjs/switch/Switch.js +9 -21
- package/lib/cjs/switch/Switch.js.map +1 -1
- package/lib/cjs/text-area/TextArea.js +8 -21
- package/lib/cjs/text-area/TextArea.js.map +1 -1
- package/lib/cjs/text-input/TextInput.js +15 -38
- package/lib/cjs/text-input/TextInput.js.map +1 -1
- package/lib/cjs/text-input/stories/text-input-sizes.story.js +1 -1
- package/lib/cjs/text-input/stories/text-input-sizes.story.js.map +1 -1
- package/lib/cjs/time-picker/TimePicker.js +13 -7
- package/lib/cjs/time-picker/TimePicker.js.map +1 -1
- package/lib/cjs/timezone-picker/TimeZonePicker.js +13 -7
- package/lib/cjs/timezone-picker/TimeZonePicker.js.map +1 -1
- package/lib/esm/_common/form-control/FormFieldLabel.js +45 -0
- package/lib/esm/_common/form-control/FormFieldLabel.js.map +1 -0
- package/lib/esm/_common/form-control/FormFieldMessage.js +65 -0
- package/lib/esm/_common/form-control/FormFieldMessage.js.map +1 -0
- package/lib/esm/_common/form-control/form-control-types.js +22 -0
- package/lib/esm/_common/form-control/form-control-types.js.map +1 -0
- package/lib/esm/_common/form-control/index.js +32 -0
- package/lib/esm/_common/form-control/index.js.map +1 -0
- package/lib/esm/_common/form-control/use-form-field.js +72 -0
- package/lib/esm/_common/form-control/use-form-field.js.map +1 -0
- package/lib/esm/_common/form-control/use-inline-field-label.js +69 -0
- package/lib/esm/_common/form-control/use-inline-field-label.js.map +1 -0
- package/lib/esm/checkbox/Checkbox.js +10 -22
- package/lib/esm/checkbox/Checkbox.js.map +1 -1
- package/lib/esm/combobox/Combobox.js +76 -54
- package/lib/esm/combobox/Combobox.js.map +1 -1
- package/lib/esm/combobox/combobox-types.js.map +1 -1
- package/lib/esm/date-picker/DatePicker.js.map +1 -1
- package/lib/esm/icons/generated/custom/FloppyDiskArrowTopRight.js +28 -0
- package/lib/esm/icons/generated/custom/FloppyDiskArrowTopRight.js.map +1 -0
- package/lib/esm/icons/generated/custom/OpenQueryTab.js +1 -0
- package/lib/esm/icons/generated/custom/OpenQueryTab.js.map +1 -1
- package/lib/esm/icons/generated/custom/index.js +1 -0
- package/lib/esm/icons/generated/custom/index.js.map +1 -1
- package/lib/esm/next/tree-view/TreeView.js +16 -1
- package/lib/esm/next/tree-view/TreeView.js.map +1 -1
- package/lib/esm/radio/Radio.js +12 -22
- package/lib/esm/radio/Radio.js.map +1 -1
- package/lib/esm/select/Select.js +14 -5
- package/lib/esm/select/Select.js.map +1 -1
- package/lib/esm/select/types.js.map +1 -1
- package/lib/esm/switch/Switch.js +10 -22
- package/lib/esm/switch/Switch.js.map +1 -1
- package/lib/esm/text-area/TextArea.js +9 -22
- package/lib/esm/text-area/TextArea.js.map +1 -1
- package/lib/esm/text-input/TextInput.js +15 -38
- package/lib/esm/text-input/TextInput.js.map +1 -1
- package/lib/esm/text-input/stories/text-input-sizes.story.js +1 -1
- package/lib/esm/text-input/stories/text-input-sizes.story.js.map +1 -1
- package/lib/esm/time-picker/TimePicker.js +13 -7
- package/lib/esm/time-picker/TimePicker.js.map +1 -1
- package/lib/esm/timezone-picker/TimeZonePicker.js +13 -7
- package/lib/esm/timezone-picker/TimeZonePicker.js.map +1 -1
- package/lib/types/_common/form-control/FormFieldLabel.d.ts +58 -0
- package/lib/types/_common/form-control/FormFieldLabel.d.ts.map +1 -0
- package/lib/types/_common/form-control/FormFieldMessage.d.ts +46 -0
- package/lib/types/_common/form-control/FormFieldMessage.d.ts.map +1 -0
- package/lib/types/_common/form-control/form-control-types.d.ts +92 -0
- package/lib/types/_common/form-control/form-control-types.d.ts.map +1 -0
- package/lib/types/_common/form-control/index.d.ts +33 -0
- package/lib/types/_common/form-control/index.d.ts.map +1 -0
- package/lib/types/_common/form-control/use-form-field.d.ts +53 -0
- package/lib/types/_common/form-control/use-form-field.d.ts.map +1 -0
- package/lib/types/_common/form-control/use-inline-field-label.d.ts +69 -0
- package/lib/types/_common/form-control/use-inline-field-label.d.ts.map +1 -0
- package/lib/types/checkbox/Checkbox.d.ts.map +1 -1
- package/lib/types/combobox/Combobox.d.ts.map +1 -1
- package/lib/types/combobox/combobox-types.d.ts +6 -5
- package/lib/types/combobox/combobox-types.d.ts.map +1 -1
- package/lib/types/icons/generated/custom/FloppyDiskArrowTopRight.d.ts +29 -0
- package/lib/types/icons/generated/custom/FloppyDiskArrowTopRight.d.ts.map +1 -0
- package/lib/types/icons/generated/custom/OpenQueryTab.d.ts +1 -0
- package/lib/types/icons/generated/custom/OpenQueryTab.d.ts.map +1 -1
- package/lib/types/icons/generated/custom/index.d.ts +1 -0
- package/lib/types/icons/generated/custom/index.d.ts.map +1 -1
- package/lib/types/next/tree-view/TreeView.d.ts.map +1 -1
- package/lib/types/radio/Radio.d.ts.map +1 -1
- package/lib/types/select/Select.d.ts.map +1 -1
- package/lib/types/select/types.d.ts.map +1 -1
- package/lib/types/switch/Switch.d.ts.map +1 -1
- package/lib/types/text-area/TextArea.d.ts.map +1 -1
- package/lib/types/text-input/TextInput.d.ts.map +1 -1
- package/lib/types/text-input/stories/text-input-sizes.story.d.ts.map +1 -1
- package/lib/types/time-picker/TimePicker.d.ts +3 -1
- package/lib/types/time-picker/TimePicker.d.ts.map +1 -1
- package/lib/types/timezone-picker/TimeZonePicker.d.ts +4 -1
- package/lib/types/timezone-picker/TimeZonePicker.d.ts.map +1 -1
- package/package.json +3 -3
- package/skills/ndl-react/SKILL.md +7 -2
- package/skills/ndl-react/components/accordion.md +2 -0
- package/skills/ndl-react/components/ai/code-preview.md +4 -0
- package/skills/ndl-react/components/ai/file-tag.md +2 -0
- package/skills/ndl-react/components/ai/image-tag.md +2 -0
- package/skills/ndl-react/components/ai/more-files.md +2 -0
- package/skills/ndl-react/components/ai/presence.md +2 -0
- package/skills/ndl-react/components/ai/preview.md +2 -0
- package/skills/ndl-react/components/ai/prompt.md +2 -0
- package/skills/ndl-react/components/ai/reasoning.md +2 -0
- package/skills/ndl-react/components/ai/response.md +2 -0
- package/skills/ndl-react/components/ai/suggestion.md +2 -0
- package/skills/ndl-react/components/ai/thinking.md +2 -0
- package/skills/ndl-react/components/ai/tool-call.md +2 -0
- package/skills/ndl-react/components/ai/user-bubble.md +2 -0
- package/skills/ndl-react/components/avatar.md +2 -0
- package/skills/ndl-react/components/banner.md +2 -0
- package/skills/ndl-react/components/box.md +2 -0
- package/skills/ndl-react/components/breadcrumbs.md +2 -0
- package/skills/ndl-react/components/checkbox.md +2 -0
- package/skills/ndl-react/components/clean-icon-button.md +2 -0
- package/skills/ndl-react/components/clipboard-button.md +2 -0
- package/skills/ndl-react/components/code-block.md +2 -0
- package/skills/ndl-react/components/code.md +2 -0
- package/skills/ndl-react/components/color-picker.md +34 -32
- package/skills/ndl-react/components/combobox.md +5 -3
- package/skills/ndl-react/components/conditional-wrap.md +2 -0
- package/skills/ndl-react/components/data-grid.md +2 -0
- package/skills/ndl-react/components/date-picker.md +2 -0
- package/skills/ndl-react/components/dialog.md +2 -0
- package/skills/ndl-react/components/dismissible-tag.md +2 -0
- package/skills/ndl-react/components/divider.md +2 -0
- package/skills/ndl-react/components/drawer.md +2 -0
- package/skills/ndl-react/components/dropdown-button.md +2 -0
- package/skills/ndl-react/components/dropzone.md +7 -5
- package/skills/ndl-react/components/filled-button.md +2 -0
- package/skills/ndl-react/components/flex.md +2 -0
- package/skills/ndl-react/components/graph-label.md +2 -0
- package/skills/ndl-react/components/icon-button-array.md +2 -0
- package/skills/ndl-react/components/icon-button.md +2 -0
- package/skills/ndl-react/components/inline-edit.md +2 -0
- package/skills/ndl-react/components/kbd.md +2 -0
- package/skills/ndl-react/components/loading-bar.md +2 -0
- package/skills/ndl-react/components/loading-spinner.md +2 -0
- package/skills/ndl-react/components/logo.md +2 -0
- package/skills/ndl-react/components/menu.md +2 -0
- package/skills/ndl-react/components/modal.md +2 -0
- package/skills/ndl-react/components/next/tree-view.md +90 -2
- package/skills/ndl-react/components/outlined-button.md +2 -0
- package/skills/ndl-react/components/popover.md +2 -0
- package/skills/ndl-react/components/progress-bar.md +2 -0
- package/skills/ndl-react/components/radio.md +2 -0
- package/skills/ndl-react/components/read-only-tag.md +2 -0
- package/skills/ndl-react/components/segmented-control.md +2 -0
- package/skills/ndl-react/components/select-icon-button.md +2 -0
- package/skills/ndl-react/components/select.md +4 -0
- package/skills/ndl-react/components/selectable-tag.md +2 -0
- package/skills/ndl-react/components/side-navigation.md +2 -0
- package/skills/ndl-react/components/skeleton.md +2 -0
- package/skills/ndl-react/components/slider.md +2 -0
- package/skills/ndl-react/components/spotlight.md +2 -0
- package/skills/ndl-react/components/status-indicator.md +2 -0
- package/skills/ndl-react/components/status-label.md +2 -0
- package/skills/ndl-react/components/switch.md +2 -0
- package/skills/ndl-react/components/tabs.md +2 -0
- package/skills/ndl-react/components/tag.md +4 -0
- package/skills/ndl-react/components/text-area.md +2 -0
- package/skills/ndl-react/components/text-button.md +2 -0
- package/skills/ndl-react/components/text-input.md +8 -0
- package/skills/ndl-react/components/text-link.md +2 -0
- package/skills/ndl-react/components/time-picker.md +3 -0
- package/skills/ndl-react/components/timezone-picker.md +3 -0
- package/skills/ndl-react/components/tooltip.md +2 -0
- package/skills/ndl-react/components/tree-view.md +2 -0
- package/skills/ndl-react/components/typography.md +2 -0
- package/skills/ndl-react/components/wizard.md +2 -0
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ndl-react
|
|
3
|
+
metadata:
|
|
4
|
+
package: '@neo4j-ndl/react'
|
|
5
|
+
version: '4.23.3'
|
|
3
6
|
description: >-
|
|
4
7
|
Build and edit UI with the Neo4j Needle React design system
|
|
5
8
|
(@neo4j-ndl/react). Use when adding, composing, or modifying Needle components
|
|
@@ -8,9 +11,11 @@ description: >-
|
|
|
8
11
|
Claude, etc.).
|
|
9
12
|
---
|
|
10
13
|
|
|
14
|
+
[//]: # (This file is auto-generated by the docs:generate-skills script, do not edit it manually)
|
|
15
|
+
|
|
11
16
|
# Neo4j Needle (@neo4j-ndl/react)
|
|
12
17
|
|
|
13
|
-
> 📌 Shipped with `@neo4j-ndl/react
|
|
18
|
+
> 📌 Shipped with `@neo4j-ndl/react` v4.23.3. Once installed into your repo (e.g. via
|
|
14
19
|
> `npx skills add`) this folder is detached from the package — the installed
|
|
15
20
|
> package (TypeScript types in `node_modules/@neo4j-ndl/react`) is the source of
|
|
16
21
|
> truth.
|
|
@@ -198,7 +203,7 @@ Next-generation components, imported from the `@neo4j-ndl/react/next` subpath. A
|
|
|
198
203
|
|
|
199
204
|
| Component | Docs | Accessibility | Examples |
|
|
200
205
|
|-----------|------|---------------|----------|
|
|
201
|
-
| `TreeView` | [components/next/tree-view.md](components/next/tree-view.md) | ✅ |
|
|
206
|
+
| `TreeView` | [components/next/tree-view.md](components/next/tree-view.md) | ✅ | 11 |
|
|
202
207
|
|
|
203
208
|
## AI components
|
|
204
209
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
[//]: # (This file is auto-generated by the docs:generate-skills script, do not edit it manually)
|
|
2
|
+
|
|
1
3
|
# CodePreview
|
|
2
4
|
|
|
3
5
|
Import: `import { CodePreview } from '@neo4j-ndl/react/ai'`
|
|
@@ -6,6 +8,8 @@ Import: `import { CodePreview } from '@neo4j-ndl/react/ai'`
|
|
|
6
8
|
|
|
7
9
|
### CodePreview
|
|
8
10
|
|
|
11
|
+
**Deprecated** - Use `<Preview />` with `<Preview.Code />` instead.
|
|
12
|
+
|
|
9
13
|
| Prop | Type | Required | Default | Description |
|
|
10
14
|
|------|------|----------|---------|-------------|
|
|
11
15
|
| `code` | `string` | ✅ | | The code content to display |
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
[//]: # (This file is auto-generated by the docs:generate-skills script, do not edit it manually)
|
|
2
|
+
|
|
1
3
|
# ColorPicker
|
|
2
4
|
|
|
3
5
|
Import: `import { ColorPicker } from '@neo4j-ndl/react'`
|
|
@@ -36,10 +38,10 @@ import { ColorPicker } from '../ColorPicker';
|
|
|
36
38
|
|
|
37
39
|
const Component = () => {
|
|
38
40
|
const [color, setColor] = useState({
|
|
39
|
-
a: 1,
|
|
40
|
-
b: 0,
|
|
41
|
-
g: 0,
|
|
42
|
-
r: 0,
|
|
41
|
+
a: 1, // oxlint-disable-line id-length
|
|
42
|
+
b: 0, // oxlint-disable-line id-length
|
|
43
|
+
g: 0, // oxlint-disable-line id-length
|
|
44
|
+
r: 0, // oxlint-disable-line id-length
|
|
43
45
|
});
|
|
44
46
|
|
|
45
47
|
return (
|
|
@@ -62,10 +64,10 @@ import { ColorPicker } from '../ColorPicker';
|
|
|
62
64
|
|
|
63
65
|
const Component = () => {
|
|
64
66
|
const [color, setColor] = useState({
|
|
65
|
-
a: 1,
|
|
66
|
-
b: 0,
|
|
67
|
-
g: 0,
|
|
68
|
-
r: 0,
|
|
67
|
+
a: 1, // oxlint-disable-line id-length
|
|
68
|
+
b: 0, // oxlint-disable-line id-length
|
|
69
|
+
g: 0, // oxlint-disable-line id-length
|
|
70
|
+
r: 0, // oxlint-disable-line id-length
|
|
69
71
|
});
|
|
70
72
|
|
|
71
73
|
return (
|
|
@@ -74,28 +76,28 @@ const Component = () => {
|
|
|
74
76
|
onChange={(newColor) => setColor(newColor.rgb)}
|
|
75
77
|
swatches={[
|
|
76
78
|
{
|
|
77
|
-
a: 1,
|
|
78
|
-
b: 0,
|
|
79
|
-
g: 0,
|
|
80
|
-
r: 0,
|
|
79
|
+
a: 1, // oxlint-disable-line id-length
|
|
80
|
+
b: 0, // oxlint-disable-line id-length
|
|
81
|
+
g: 0, // oxlint-disable-line id-length
|
|
82
|
+
r: 0, // oxlint-disable-line id-length
|
|
81
83
|
},
|
|
82
84
|
{
|
|
83
|
-
a: 1,
|
|
84
|
-
b: 255,
|
|
85
|
-
g: 0,
|
|
86
|
-
r: 0,
|
|
85
|
+
a: 1, // oxlint-disable-line id-length
|
|
86
|
+
b: 255, // oxlint-disable-line id-length
|
|
87
|
+
g: 0, // oxlint-disable-line id-length
|
|
88
|
+
r: 0, // oxlint-disable-line id-length
|
|
87
89
|
},
|
|
88
90
|
{
|
|
89
|
-
a: 1,
|
|
90
|
-
b: 0,
|
|
91
|
-
g: 255,
|
|
92
|
-
r: 0,
|
|
91
|
+
a: 1, // oxlint-disable-line id-length
|
|
92
|
+
b: 0, // oxlint-disable-line id-length
|
|
93
|
+
g: 255, // oxlint-disable-line id-length
|
|
94
|
+
r: 0, // oxlint-disable-line id-length
|
|
93
95
|
},
|
|
94
96
|
{
|
|
95
|
-
a: 1,
|
|
96
|
-
b: 0,
|
|
97
|
-
g: 0,
|
|
98
|
-
r: 255,
|
|
97
|
+
a: 1, // oxlint-disable-line id-length
|
|
98
|
+
b: 0, // oxlint-disable-line id-length
|
|
99
|
+
g: 0, // oxlint-disable-line id-length
|
|
100
|
+
r: 255, // oxlint-disable-line id-length
|
|
99
101
|
},
|
|
100
102
|
]}
|
|
101
103
|
/>
|
|
@@ -119,10 +121,10 @@ const Component = () => {
|
|
|
119
121
|
const handleClose = () => setIsOpen(false);
|
|
120
122
|
|
|
121
123
|
const [color, setColor] = useState({
|
|
122
|
-
a: 1,
|
|
123
|
-
b: 0,
|
|
124
|
-
g: 0,
|
|
125
|
-
r: 0,
|
|
124
|
+
a: 1, // oxlint-disable-line id-length
|
|
125
|
+
b: 0, // oxlint-disable-line id-length
|
|
126
|
+
g: 0, // oxlint-disable-line id-length
|
|
127
|
+
r: 0, // oxlint-disable-line id-length
|
|
126
128
|
});
|
|
127
129
|
|
|
128
130
|
return (
|
|
@@ -190,10 +192,10 @@ import { ColorPicker } from '../ColorPicker';
|
|
|
190
192
|
|
|
191
193
|
const Component = () => {
|
|
192
194
|
const [color, setColor] = useState({
|
|
193
|
-
a: 1,
|
|
194
|
-
b: 0,
|
|
195
|
-
g: 0,
|
|
196
|
-
r: 0,
|
|
195
|
+
a: 1, // oxlint-disable-line id-length
|
|
196
|
+
b: 0, // oxlint-disable-line id-length
|
|
197
|
+
g: 0, // oxlint-disable-line id-length
|
|
198
|
+
r: 0, // oxlint-disable-line id-length
|
|
197
199
|
});
|
|
198
200
|
|
|
199
201
|
return (
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
[//]: # (This file is auto-generated by the docs:generate-skills script, do not edit it manually)
|
|
2
|
+
|
|
1
3
|
# Combobox
|
|
2
4
|
|
|
3
5
|
Import: `import { Combobox } from '@neo4j-ndl/react'`
|
|
@@ -19,7 +21,7 @@ Import: `import { Combobox } from '@neo4j-ndl/react'`
|
|
|
19
21
|
| `floatingStrategy` | `'absolute' \| 'fixed'` | | | Positioning strategy used by Floating UI. |
|
|
20
22
|
| `formatCreateLabel` | `((searchValue: string) => ReactNode)` | | `` (searchValue: string) => `Create "${searchValue}"` `` | Text of the create row. Defaults to `Create "<search value>"`. |
|
|
21
23
|
| `formId` | `string` | | | Id of the form the combobox belongs to when it is outside that form. |
|
|
22
|
-
| `hasRequiredIndicator` | `boolean` | | `false` | Whether Required or Optional is shown at the end of the label row
|
|
24
|
+
| `hasRequiredIndicator` | `boolean` | | `false` | Whether Required or Optional is shown at the end of the label row, based on the `isRequired` prop |
|
|
23
25
|
| `hasVisuallyHiddenLabel` | `boolean` | | `false` | Whether the label is clipped out of the layout, leaving it to screen readers only. |
|
|
24
26
|
| `helpText` | `ReactNode` | | | Assistive text below the control. Replaced by `errorText` while there is an error. |
|
|
25
27
|
| `isClean` | `boolean` | | `false` | Whether the control hugs its content without a background or resting outline. |
|
|
@@ -46,7 +48,7 @@ Import: `import { Combobox } from '@neo4j-ndl/react'`
|
|
|
46
48
|
| `placeholder` | `string` | | `Select...` | Text shown in the trigger while nothing is selected. |
|
|
47
49
|
| `portalTarget` | `HTMLElement \| null` | | | Portal target element. Defaults to `document.body`. |
|
|
48
50
|
| `ref` | `Ref<HTMLDivElement>` | | | A ref to apply to the root element. |
|
|
49
|
-
| `renderTrigger` | `((triggerProps: ComboboxTriggerProps, state: ComboboxTriggerState<TOption>) => ReactNode)` | | | Replaces the built-in trigger. Spread `triggerProps` onto the focusable element that should open the panel; the panel is anchored to it.
|
|
51
|
+
| `renderTrigger` | `((triggerProps: ComboboxTriggerProps, state: ComboboxTriggerState<TOption>) => ReactNode)` | | | Replaces the built-in trigger. Spread `triggerProps` onto the focusable element that should open the panel; the panel is anchored to it. No root element is rendered, so the trigger is a direct child of whatever contains the combobox. `isFluid`, `isClean`, `size`, `className`, `style`, `htmlAttributes` and `ref` are ignored; use `triggerRef` to reach the trigger element. |
|
|
50
52
|
| `searchPlaceholder` | `string` | | `Search` | Placeholder for the search input, which also names it. |
|
|
51
53
|
| `searchValue` | `string` | | | The search value in controlled mode. |
|
|
52
54
|
| `size` | `'large' \| 'medium' \| 'small'` | | `medium` | Size of the combobox control. |
|
|
@@ -99,7 +101,7 @@ The trigger is the form control, so it carries all of the validation ARIA.
|
|
|
99
101
|
| `isRequired` | `aria-required="true"` |
|
|
100
102
|
|
|
101
103
|
- An error replaces the help text, so only one message is ever rendered and only that one is described. Do not put the error in `helpText` as well.
|
|
102
|
-
- The message container is
|
|
104
|
+
- The message container is an atomic, polite live region that is always in the document, so a validation error is announced in full when it appears. It stays polite so validation on blur or on change never interrupts the screen reader.
|
|
103
105
|
- `hasRequiredIndicator` adds Required or Optional at the end of the label row without changing the accessible name; requiredness is exposed through `aria-required` alone.
|
|
104
106
|
- Without `name`, `isRequired` only marks the trigger with `aria-required`; validation belongs to the form around it.
|
|
105
107
|
- With `name`, `isRequired` also enables native constraint validation. If submission is attempted without a selection, the hidden native control prevents submission, moves focus to the visible trigger, and puts the browser validation message in the existing error live region. An explicit `errorText` takes precedence over that message.
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
[//]: # (This file is auto-generated by the docs:generate-skills script, do not edit it manually)
|
|
2
|
+
|
|
1
3
|
# Dropzone
|
|
2
4
|
|
|
3
5
|
Import: `import { Dropzone } from '@neo4j-ndl/react'`
|
|
@@ -157,11 +159,11 @@ import {
|
|
|
157
159
|
|
|
158
160
|
// Configuration constants
|
|
159
161
|
const CONFIG = {
|
|
160
|
-
|
|
162
|
+
ACCEPTED_EXTENSIONS: ['.txt', '.json'] as string[],
|
|
161
163
|
MAX_FILE_SIZE: 5 * 1024 * 1024, // 5MB
|
|
164
|
+
MAX_FILES: 3,
|
|
162
165
|
PROGRESS_INCREMENT: 5,
|
|
163
166
|
UPDATE_INTERVAL: 100,
|
|
164
|
-
ACCEPTED_EXTENSIONS: ['.txt', '.json'] as string[],
|
|
165
167
|
} as const;
|
|
166
168
|
|
|
167
169
|
enum UploadState {
|
|
@@ -198,9 +200,9 @@ const Component = () => {
|
|
|
198
200
|
const simulateUpload = useCallback((files: File[]) => {
|
|
199
201
|
setUploadData((prev) => ({
|
|
200
202
|
...prev,
|
|
201
|
-
state: UploadState.Uploading,
|
|
202
203
|
files,
|
|
203
204
|
progress: 0,
|
|
205
|
+
state: UploadState.Uploading,
|
|
204
206
|
}));
|
|
205
207
|
|
|
206
208
|
const interval = setInterval(() => {
|
|
@@ -244,7 +246,7 @@ const Component = () => {
|
|
|
244
246
|
(file) =>
|
|
245
247
|
`${file.file.name}: ${file.errors.map((error) => error.message).join(', ')}`,
|
|
246
248
|
);
|
|
247
|
-
setUploadData((prev) => ({ ...prev, state: UploadState.Error
|
|
249
|
+
setUploadData((prev) => ({ ...prev, errors, state: UploadState.Error }));
|
|
248
250
|
},
|
|
249
251
|
[],
|
|
250
252
|
);
|
|
@@ -253,8 +255,8 @@ const Component = () => {
|
|
|
253
255
|
console.error('Dropzone error:', error);
|
|
254
256
|
setUploadData((prev) => ({
|
|
255
257
|
...prev,
|
|
256
|
-
state: UploadState.Error,
|
|
257
258
|
errors: [error.message],
|
|
259
|
+
state: UploadState.Error,
|
|
258
260
|
}));
|
|
259
261
|
}, []);
|
|
260
262
|
|