@neo4j-ndl/react 4.16.8 → 4.16.9

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.
Files changed (76) hide show
  1. package/package.json +5 -2
  2. package/skills/ndl-react/SKILL.md +152 -0
  3. package/skills/ndl-react/components/accordion.md +386 -0
  4. package/skills/ndl-react/components/ai/code-preview.md +128 -0
  5. package/skills/ndl-react/components/ai/file-tag.md +90 -0
  6. package/skills/ndl-react/components/ai/image-tag.md +91 -0
  7. package/skills/ndl-react/components/ai/more-files.md +73 -0
  8. package/skills/ndl-react/components/ai/presence.md +54 -0
  9. package/skills/ndl-react/components/ai/preview.md +498 -0
  10. package/skills/ndl-react/components/ai/prompt.md +362 -0
  11. package/skills/ndl-react/components/ai/reasoning.md +95 -0
  12. package/skills/ndl-react/components/ai/response.md +1109 -0
  13. package/skills/ndl-react/components/ai/suggestion.md +84 -0
  14. package/skills/ndl-react/components/ai/thinking.md +43 -0
  15. package/skills/ndl-react/components/ai/tool-call.md +43 -0
  16. package/skills/ndl-react/components/ai/user-bubble.md +187 -0
  17. package/skills/ndl-react/components/avatar.md +169 -0
  18. package/skills/ndl-react/components/banner.md +225 -0
  19. package/skills/ndl-react/components/box.md +39 -0
  20. package/skills/ndl-react/components/breadcrumbs.md +245 -0
  21. package/skills/ndl-react/components/checkbox.md +269 -0
  22. package/skills/ndl-react/components/clean-icon-button.md +294 -0
  23. package/skills/ndl-react/components/clipboard-button.md +154 -0
  24. package/skills/ndl-react/components/code-block.md +276 -0
  25. package/skills/ndl-react/components/code.md +68 -0
  26. package/skills/ndl-react/components/color-picker.md +131 -0
  27. package/skills/ndl-react/components/conditional-wrap.md +46 -0
  28. package/skills/ndl-react/components/data-grid.md +3121 -0
  29. package/skills/ndl-react/components/date-picker.md +652 -0
  30. package/skills/ndl-react/components/dialog.md +485 -0
  31. package/skills/ndl-react/components/dismissible-tag.md +136 -0
  32. package/skills/ndl-react/components/divider.md +96 -0
  33. package/skills/ndl-react/components/drawer.md +543 -0
  34. package/skills/ndl-react/components/dropdown-button.md +161 -0
  35. package/skills/ndl-react/components/dropzone.md +371 -0
  36. package/skills/ndl-react/components/filled-button.md +26 -0
  37. package/skills/ndl-react/components/flex.md +82 -0
  38. package/skills/ndl-react/components/graph-label.md +167 -0
  39. package/skills/ndl-react/components/icon-button-array.md +187 -0
  40. package/skills/ndl-react/components/icon-button.md +193 -0
  41. package/skills/ndl-react/components/inline-edit.md +209 -0
  42. package/skills/ndl-react/components/kbd.md +63 -0
  43. package/skills/ndl-react/components/loading-bar.md +43 -0
  44. package/skills/ndl-react/components/loading-spinner.md +57 -0
  45. package/skills/ndl-react/components/logo.md +57 -0
  46. package/skills/ndl-react/components/menu.md +993 -0
  47. package/skills/ndl-react/components/modal.md +27 -0
  48. package/skills/ndl-react/components/next/tree-view.md +966 -0
  49. package/skills/ndl-react/components/outlined-button.md +26 -0
  50. package/skills/ndl-react/components/popover.md +283 -0
  51. package/skills/ndl-react/components/progress-bar.md +70 -0
  52. package/skills/ndl-react/components/radio.md +150 -0
  53. package/skills/ndl-react/components/read-only-tag.md +96 -0
  54. package/skills/ndl-react/components/segmented-control.md +200 -0
  55. package/skills/ndl-react/components/select-icon-button.md +183 -0
  56. package/skills/ndl-react/components/select.md +530 -0
  57. package/skills/ndl-react/components/selectable-tag.md +203 -0
  58. package/skills/ndl-react/components/side-navigation.md +652 -0
  59. package/skills/ndl-react/components/skeleton.md +274 -0
  60. package/skills/ndl-react/components/slider.md +308 -0
  61. package/skills/ndl-react/components/spotlight.md +796 -0
  62. package/skills/ndl-react/components/status-indicator.md +57 -0
  63. package/skills/ndl-react/components/status-label.md +132 -0
  64. package/skills/ndl-react/components/switch.md +167 -0
  65. package/skills/ndl-react/components/tabs.md +433 -0
  66. package/skills/ndl-react/components/tag.md +91 -0
  67. package/skills/ndl-react/components/text-area.md +178 -0
  68. package/skills/ndl-react/components/text-button.md +25 -0
  69. package/skills/ndl-react/components/text-input.md +475 -0
  70. package/skills/ndl-react/components/text-link.md +119 -0
  71. package/skills/ndl-react/components/time-picker.md +137 -0
  72. package/skills/ndl-react/components/timezone-picker.md +496 -0
  73. package/skills/ndl-react/components/tooltip.md +478 -0
  74. package/skills/ndl-react/components/tree-view.md +545 -0
  75. package/skills/ndl-react/components/typography.md +72 -0
  76. package/skills/ndl-react/components/wizard.md +152 -0
@@ -0,0 +1,57 @@
1
+ # StatusIndicator
2
+
3
+ Import: `import { StatusIndicator } from '@neo4j-ndl/react'`
4
+
5
+ ## Props
6
+
7
+ ### StatusIndicator
8
+
9
+ | Prop | Type | Required | Default | Description |
10
+ |------|------|----------|---------|-------------|
11
+ | `ref` | `Ref<SVGSVGElement>` | | | A ref to apply to the root element. |
12
+ | `variant` | `'danger' \| 'info' \| 'success' \| 'unknown' \| 'warning'` | | `unknown` | Type of the status indicator. |
13
+
14
+ ## Accessibility
15
+
16
+ ## Implementation guidelines
17
+
18
+ The StatusIndicator component uses the `aria-hidden` attribute to hide it from screen readers. This component should be used as a visual indicator only, and the meaning that it represents should be conveyed through other means; like connected text, or a tooltip/aria-label if it's on a button.
19
+
20
+ ## Examples
21
+
22
+ ### Variants
23
+
24
+ ```tsx
25
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
26
+
27
+ import { StatusIndicator, Typography } from '@neo4j-ndl/react';
28
+
29
+ const Component = () => {
30
+ return (
31
+ <div className="n-flex n-gap-token-16">
32
+ <div className="n-flex n-flex-col n-items-center n-gap-token-8">
33
+ <StatusIndicator variant="unknown" />
34
+ <Typography variant="label">Unknown</Typography>
35
+ </div>
36
+ <div className="n-flex n-flex-col n-items-center n-gap-token-8">
37
+ <StatusIndicator variant="success" />
38
+ <Typography variant="label">Success</Typography>
39
+ </div>
40
+ <div className="n-flex n-flex-col n-items-center n-gap-token-8">
41
+ <StatusIndicator variant="info" />
42
+ <Typography variant="label">Info</Typography>
43
+ </div>
44
+ <div className="n-flex n-flex-col n-items-center n-gap-token-8">
45
+ <StatusIndicator variant="warning" />
46
+ <Typography variant="label">Warning</Typography>
47
+ </div>
48
+ <div className="n-flex n-flex-col n-items-center n-gap-token-8">
49
+ <StatusIndicator variant="danger" />
50
+ <Typography variant="label">Danger</Typography>
51
+ </div>
52
+ </div>
53
+ );
54
+ };
55
+
56
+ export default Component;
57
+ ```
@@ -0,0 +1,132 @@
1
+ # StatusLabel
2
+
3
+ Import: `import { StatusLabel } from '@neo4j-ndl/react'`
4
+
5
+ ## Props
6
+
7
+ ### StatusLabel
8
+
9
+ | Prop | Type | Required | Default | Description |
10
+ |------|------|----------|---------|-------------|
11
+ | `as` | `ElementType<any, keyof IntrinsicElements>` | | | An override of the default HTML tag of the root of the component. Can also be another React component. |
12
+ | `children` | `ReactNode` | ✅ | | The content displayed inside the status label |
13
+ | `fill` | `'clean' \| 'filled' \| 'outlined' \| 'semi-filled'` | | `filled` | Fill type of status label, determines the background and border styles. |
14
+ | `hasIcon` | `boolean` | | `false` | Whether the status label have an icon |
15
+ | `ref` | `any` | | | A ref to apply to the root element. |
16
+ | `size` | `'large' \| 'small'` | | `large` | Size of the status label |
17
+ | `variant` | `'danger' \| 'default' \| 'discovery' \| 'info' \| 'success' \| 'warning'` | | `default` | Color of the status label that indicates its purpose. |
18
+
19
+ ## Examples
20
+
21
+ ### Default
22
+
23
+ ```tsx
24
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
25
+
26
+ import { StatusLabel } from '@neo4j-ndl/react';
27
+
28
+ const Component = () => {
29
+ return <StatusLabel>StatusLabel</StatusLabel>;
30
+ };
31
+
32
+ export default Component;
33
+ ```
34
+
35
+ ### Colors
36
+
37
+ ```tsx
38
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
39
+
40
+ import { StatusLabel } from '@neo4j-ndl/react';
41
+
42
+ const Component = () => {
43
+ return (
44
+ <div className="n-flex n-gap-token-16 n-flex-wrap">
45
+ <StatusLabel variant="default">Default</StatusLabel>
46
+ <StatusLabel variant="info">Info</StatusLabel>
47
+ <StatusLabel variant="success">Success</StatusLabel>
48
+ <StatusLabel variant="warning">Warning</StatusLabel>
49
+ <StatusLabel variant="danger">Danger</StatusLabel>
50
+ <StatusLabel variant="discovery">Discovery</StatusLabel>
51
+ </div>
52
+ );
53
+ };
54
+
55
+ export default Component;
56
+ ```
57
+
58
+ ### Fills
59
+
60
+ ```tsx
61
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
62
+
63
+ import { StatusLabel } from '@neo4j-ndl/react';
64
+
65
+ const Component = () => {
66
+ return (
67
+ <div className="n-flex n-gap-token-16 n-flex-wrap">
68
+ <StatusLabel fill="filled">Filled</StatusLabel>
69
+ <StatusLabel fill="outlined">Outlined</StatusLabel>
70
+ <StatusLabel fill="semi-filled">Semi-filled</StatusLabel>
71
+ <StatusLabel fill="clean" hasIcon>
72
+ Clean
73
+ </StatusLabel>
74
+ </div>
75
+ );
76
+ };
77
+
78
+ export default Component;
79
+ ```
80
+
81
+ ### With Icons
82
+
83
+ ```tsx
84
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
85
+
86
+ import { StatusLabel } from '@neo4j-ndl/react';
87
+
88
+ const Component = () => {
89
+ return (
90
+ <div className="n-grid n-grid-cols-6 n-grid-rows-2 n-gap-token-16 n-items-center n-justify-items-center">
91
+ <StatusLabel variant="default" hasIcon>
92
+ Default
93
+ </StatusLabel>
94
+ <StatusLabel variant="info" hasIcon>
95
+ Info
96
+ </StatusLabel>
97
+ <StatusLabel variant="success" hasIcon>
98
+ Success
99
+ </StatusLabel>
100
+ <StatusLabel variant="danger" hasIcon>
101
+ Danger
102
+ </StatusLabel>
103
+ <StatusLabel variant="warning" hasIcon>
104
+ Warning
105
+ </StatusLabel>
106
+ <StatusLabel variant="discovery" hasIcon>
107
+ Discovery
108
+ </StatusLabel>
109
+ <StatusLabel variant="default" fill="clean" hasIcon>
110
+ Default
111
+ </StatusLabel>
112
+ <StatusLabel variant="info" fill="clean" hasIcon>
113
+ Info
114
+ </StatusLabel>
115
+ <StatusLabel variant="success" fill="clean" hasIcon>
116
+ Success
117
+ </StatusLabel>
118
+ <StatusLabel variant="danger" fill="clean" hasIcon>
119
+ Danger
120
+ </StatusLabel>
121
+ <StatusLabel variant="warning" fill="clean" hasIcon>
122
+ Warning
123
+ </StatusLabel>
124
+ <StatusLabel variant="discovery" fill="clean" hasIcon>
125
+ Discovery
126
+ </StatusLabel>
127
+ </div>
128
+ );
129
+ };
130
+
131
+ export default Component;
132
+ ```
@@ -0,0 +1,167 @@
1
+ # Switch
2
+
3
+ Import: `import { Switch } from '@neo4j-ndl/react'`
4
+
5
+ ## Props
6
+
7
+ ### Switch
8
+
9
+ | Prop | Type | Required | Default | Description |
10
+ |------|------|----------|---------|-------------|
11
+ | `ariaLabel` | `string` | | | The aria label of the switch. Required if the label is not a string. |
12
+ | `hasLeadingLabel` | `boolean` | | | Whether the label should be displayed before the switch |
13
+ | `isChecked` | `boolean` | | | Whether the switch is checked |
14
+ | `isDefaultChecked` | `boolean` | | | Checks the input by default in uncontrolled mode |
15
+ | `isDisabled` | `boolean` | | `false` | Whether the switch is disabled |
16
+ | `isFluid` | `boolean` | | `false` | Whether the switch & label should take the full available width of its container |
17
+ | `isIndeterminate` | `boolean` | | `false` | Whether the switch is indeterminate |
18
+ | `label` | `ReactNode` | | | The label of the switch. If not a string, supply an aria label for screen reader support. |
19
+ | `onChange` | `((event: ChangeEvent<HTMLInputElement, Element>) => void)` | | | The callback function triggered when the switch value changes |
20
+ | `onClick` | `((event: MouseEvent<HTMLInputElement, MouseEvent>) => void)` | | | The callback function triggered when the switch is clicked |
21
+ | `ref` | `Ref<HTMLInputElement>` | | | A ref to apply to the root element. |
22
+ | `value` | `string \| number \| readonly string[]` | | | The value of the switch |
23
+
24
+ ## Accessibility
25
+
26
+ ## Implementation guidelines
27
+
28
+ The Switch component uses implicit label wrapping to associate the visible label with the input for screen readers. If you omit the label prop or use an invalid label (no text content), the `ariaLabel` prop will be required to ensure an accessible name.
29
+
30
+ ## Examples
31
+
32
+ ### Default
33
+
34
+ ```tsx
35
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
36
+
37
+ import { Switch } from '@neo4j-ndl/react';
38
+
39
+ const Component = () => {
40
+ return <Switch label="Label" />;
41
+ };
42
+
43
+ export default Component;
44
+ ```
45
+
46
+ ### Controlled
47
+
48
+ ```tsx
49
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
50
+
51
+ import { Switch } from '@neo4j-ndl/react';
52
+ import { useState } from 'react';
53
+
54
+ const Component = () => {
55
+ const [isChecked, setIsChecked] = useState(false);
56
+
57
+ return (
58
+ <Switch
59
+ isChecked={isChecked}
60
+ label="Controlled switch"
61
+ onChange={(event) => setIsChecked(event.target.checked)}
62
+ />
63
+ );
64
+ };
65
+
66
+ export default Component;
67
+ ```
68
+
69
+ ### Disabled
70
+
71
+ ```tsx
72
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
73
+
74
+ import { Switch } from '@neo4j-ndl/react';
75
+
76
+ const Component = () => {
77
+ return <Switch label="Label" isDisabled />;
78
+ };
79
+
80
+ export default Component;
81
+ ```
82
+
83
+ ### Full
84
+
85
+ ```tsx
86
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
87
+
88
+ import { Switch } from '@neo4j-ndl/react';
89
+ import { useState } from 'react';
90
+
91
+ const Component = () => {
92
+ const [isChecked, setIsChecked] = useState<boolean>(false);
93
+
94
+ const handleClick = (event: React.MouseEvent<HTMLInputElement>) => {
95
+ console.info('Switch clicked!', event);
96
+ };
97
+
98
+ const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
99
+ setIsChecked(event.target.checked);
100
+ console.info('Switch changed:', event.target.checked);
101
+ };
102
+
103
+ return (
104
+ <Switch
105
+ label="Label"
106
+ ariaLabel="Comprehensive switch example with all props"
107
+ isChecked={isChecked}
108
+ hasLeadingLabel={false}
109
+ isDisabled={false}
110
+ isFluid={false}
111
+ value="switch-value"
112
+ onClick={handleClick}
113
+ onChange={handleChange}
114
+ />
115
+ );
116
+ };
117
+
118
+ export default Component;
119
+ ```
120
+
121
+ ### Has Label Before
122
+
123
+ ```tsx
124
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
125
+
126
+ import { Switch } from '@neo4j-ndl/react';
127
+
128
+ const Component = () => {
129
+ return (
130
+ <Switch
131
+ label="Label"
132
+ hasLeadingLabel
133
+ onClick={() => console.info('Clicked on the switch!')}
134
+ />
135
+ );
136
+ };
137
+
138
+ export default Component;
139
+ ```
140
+
141
+ ### Indeterminate
142
+
143
+ ```tsx
144
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
145
+
146
+ import { Switch } from '@neo4j-ndl/react';
147
+
148
+ const Component = () => {
149
+ return <Switch label="Label" isIndeterminate />;
150
+ };
151
+
152
+ export default Component;
153
+ ```
154
+
155
+ ### No Label
156
+
157
+ ```tsx
158
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
159
+
160
+ import { Switch } from '@neo4j-ndl/react';
161
+
162
+ const Component = () => {
163
+ return <Switch ariaLabel="Label" />;
164
+ };
165
+
166
+ export default Component;
167
+ ```