@neo4j-ndl/react 4.16.7 → 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 (109) hide show
  1. package/lib/cjs/color-picker/ColorPicker.js +3 -1
  2. package/lib/cjs/color-picker/ColorPicker.js.map +1 -1
  3. package/lib/cjs/color-picker/stories/color-picker-dialog.story.js +40 -0
  4. package/lib/cjs/color-picker/stories/color-picker-dialog.story.js.map +1 -0
  5. package/lib/cjs/color-picker/stories/color-picker-popover.story.js +32 -0
  6. package/lib/cjs/color-picker/stories/color-picker-popover.story.js.map +1 -0
  7. package/lib/cjs/color-picker/stories/index.js +9 -1
  8. package/lib/cjs/color-picker/stories/index.js.map +1 -1
  9. package/lib/cjs/popover/use-popover.js +1 -1
  10. package/lib/cjs/popover/use-popover.js.map +1 -1
  11. package/lib/cjs/select/Select.js +2 -0
  12. package/lib/cjs/select/Select.js.map +1 -1
  13. package/lib/esm/color-picker/ColorPicker.js +3 -1
  14. package/lib/esm/color-picker/ColorPicker.js.map +1 -1
  15. package/lib/esm/color-picker/stories/color-picker-dialog.story.js +38 -0
  16. package/lib/esm/color-picker/stories/color-picker-dialog.story.js.map +1 -0
  17. package/lib/esm/color-picker/stories/color-picker-popover.story.js +30 -0
  18. package/lib/esm/color-picker/stories/color-picker-popover.story.js.map +1 -0
  19. package/lib/esm/color-picker/stories/index.js +6 -0
  20. package/lib/esm/color-picker/stories/index.js.map +1 -1
  21. package/lib/esm/popover/use-popover.js +1 -1
  22. package/lib/esm/popover/use-popover.js.map +1 -1
  23. package/lib/esm/select/Select.js +2 -0
  24. package/lib/esm/select/Select.js.map +1 -1
  25. package/lib/types/color-picker/ColorPicker.d.ts +4 -0
  26. package/lib/types/color-picker/ColorPicker.d.ts.map +1 -1
  27. package/lib/types/color-picker/stories/color-picker-dialog.story.d.ts +24 -0
  28. package/lib/types/color-picker/stories/color-picker-dialog.story.d.ts.map +1 -0
  29. package/lib/types/color-picker/stories/color-picker-popover.story.d.ts +24 -0
  30. package/lib/types/color-picker/stories/color-picker-popover.story.d.ts.map +1 -0
  31. package/lib/types/color-picker/stories/index.d.ts +4 -0
  32. package/lib/types/color-picker/stories/index.d.ts.map +1 -1
  33. package/lib/types/select/Select.d.ts.map +1 -1
  34. package/package.json +5 -2
  35. package/skills/ndl-react/SKILL.md +152 -0
  36. package/skills/ndl-react/components/accordion.md +386 -0
  37. package/skills/ndl-react/components/ai/code-preview.md +128 -0
  38. package/skills/ndl-react/components/ai/file-tag.md +90 -0
  39. package/skills/ndl-react/components/ai/image-tag.md +91 -0
  40. package/skills/ndl-react/components/ai/more-files.md +73 -0
  41. package/skills/ndl-react/components/ai/presence.md +54 -0
  42. package/skills/ndl-react/components/ai/preview.md +498 -0
  43. package/skills/ndl-react/components/ai/prompt.md +362 -0
  44. package/skills/ndl-react/components/ai/reasoning.md +95 -0
  45. package/skills/ndl-react/components/ai/response.md +1109 -0
  46. package/skills/ndl-react/components/ai/suggestion.md +84 -0
  47. package/skills/ndl-react/components/ai/thinking.md +43 -0
  48. package/skills/ndl-react/components/ai/tool-call.md +43 -0
  49. package/skills/ndl-react/components/ai/user-bubble.md +187 -0
  50. package/skills/ndl-react/components/avatar.md +169 -0
  51. package/skills/ndl-react/components/banner.md +225 -0
  52. package/skills/ndl-react/components/box.md +39 -0
  53. package/skills/ndl-react/components/breadcrumbs.md +245 -0
  54. package/skills/ndl-react/components/checkbox.md +269 -0
  55. package/skills/ndl-react/components/clean-icon-button.md +294 -0
  56. package/skills/ndl-react/components/clipboard-button.md +154 -0
  57. package/skills/ndl-react/components/code-block.md +276 -0
  58. package/skills/ndl-react/components/code.md +68 -0
  59. package/skills/ndl-react/components/color-picker.md +131 -0
  60. package/skills/ndl-react/components/conditional-wrap.md +46 -0
  61. package/skills/ndl-react/components/data-grid.md +3121 -0
  62. package/skills/ndl-react/components/date-picker.md +652 -0
  63. package/skills/ndl-react/components/dialog.md +485 -0
  64. package/skills/ndl-react/components/dismissible-tag.md +136 -0
  65. package/skills/ndl-react/components/divider.md +96 -0
  66. package/skills/ndl-react/components/drawer.md +543 -0
  67. package/skills/ndl-react/components/dropdown-button.md +161 -0
  68. package/skills/ndl-react/components/dropzone.md +371 -0
  69. package/skills/ndl-react/components/filled-button.md +26 -0
  70. package/skills/ndl-react/components/flex.md +82 -0
  71. package/skills/ndl-react/components/graph-label.md +167 -0
  72. package/skills/ndl-react/components/icon-button-array.md +187 -0
  73. package/skills/ndl-react/components/icon-button.md +193 -0
  74. package/skills/ndl-react/components/inline-edit.md +209 -0
  75. package/skills/ndl-react/components/kbd.md +63 -0
  76. package/skills/ndl-react/components/loading-bar.md +43 -0
  77. package/skills/ndl-react/components/loading-spinner.md +57 -0
  78. package/skills/ndl-react/components/logo.md +57 -0
  79. package/skills/ndl-react/components/menu.md +993 -0
  80. package/skills/ndl-react/components/modal.md +27 -0
  81. package/skills/ndl-react/components/next/tree-view.md +966 -0
  82. package/skills/ndl-react/components/outlined-button.md +26 -0
  83. package/skills/ndl-react/components/popover.md +283 -0
  84. package/skills/ndl-react/components/progress-bar.md +70 -0
  85. package/skills/ndl-react/components/radio.md +150 -0
  86. package/skills/ndl-react/components/read-only-tag.md +96 -0
  87. package/skills/ndl-react/components/segmented-control.md +200 -0
  88. package/skills/ndl-react/components/select-icon-button.md +183 -0
  89. package/skills/ndl-react/components/select.md +530 -0
  90. package/skills/ndl-react/components/selectable-tag.md +203 -0
  91. package/skills/ndl-react/components/side-navigation.md +652 -0
  92. package/skills/ndl-react/components/skeleton.md +274 -0
  93. package/skills/ndl-react/components/slider.md +308 -0
  94. package/skills/ndl-react/components/spotlight.md +796 -0
  95. package/skills/ndl-react/components/status-indicator.md +57 -0
  96. package/skills/ndl-react/components/status-label.md +132 -0
  97. package/skills/ndl-react/components/switch.md +167 -0
  98. package/skills/ndl-react/components/tabs.md +433 -0
  99. package/skills/ndl-react/components/tag.md +91 -0
  100. package/skills/ndl-react/components/text-area.md +178 -0
  101. package/skills/ndl-react/components/text-button.md +25 -0
  102. package/skills/ndl-react/components/text-input.md +475 -0
  103. package/skills/ndl-react/components/text-link.md +119 -0
  104. package/skills/ndl-react/components/time-picker.md +137 -0
  105. package/skills/ndl-react/components/timezone-picker.md +496 -0
  106. package/skills/ndl-react/components/tooltip.md +478 -0
  107. package/skills/ndl-react/components/tree-view.md +545 -0
  108. package/skills/ndl-react/components/typography.md +72 -0
  109. package/skills/ndl-react/components/wizard.md +152 -0
@@ -0,0 +1,25 @@
1
+ # TextButton
2
+
3
+ Import: `import { TextButton } from '@neo4j-ndl/react'`
4
+
5
+ ## Props
6
+
7
+ ### TextButton
8
+
9
+ | Prop | Type | Required | Default | Description |
10
+ |------|------|----------|---------|-------------|
11
+ | `as` | `("a" & ElementType<any, keyof IntrinsicElements>) \| ("symbol" & ElementType<any, keyof IntrinsicElements>) \| ... 178 more ...` | | | An override of the default HTML tag of the root of the component. Can also be another React component. |
12
+ | `children` | `ReactNode` | | | |
13
+ | `href` | `string` | | | The URL to link to. Only applies when `as="a"` |
14
+ | `isDisabled` | `boolean` | | `false` | If the button is in disabled state |
15
+ | `isFluid` | `boolean` | | | If the button is fluid, it will take the full width of its container |
16
+ | `isLoading` | `boolean` | | `false` | If the button is doing something Async, it will display a loading spinner |
17
+ | `leadingVisual` | `ReactNode` | | | Icon to display before the button content |
18
+ | `loadingMessage` | `string` | | | Accessible message for screen readers when the button is in a loading state |
19
+ | `onClick` | `((e: MouseEvent<HTMLButtonElement, MouseEvent>) => void)` | | | onClick callback |
20
+ | `onKeyDown` | `((e: KeyboardEvent<HTMLButtonElement>) => void)` | | | onKeyDown callback |
21
+ | `ref` | `any` | | | A ref to apply to the root element. |
22
+ | `size` | `'large' \| 'medium' \| 'small'` | | `medium` | Size of button |
23
+ | `target` | `HTMLAttributeAnchorTarget` | | | The target window for the link. Only applies when `as="a"`. Not present or required for other element types. |
24
+ | `type` | `'button' \| 'reset' \| 'submit'` | | `button` | Type of button |
25
+ | `variant` | `'danger' \| 'neutral' \| 'primary'` | | `primary` | Variant of the button |
@@ -0,0 +1,475 @@
1
+ # TextInput
2
+
3
+ Import: `import { TextInput } from '@neo4j-ndl/react'`
4
+
5
+ ## Props
6
+
7
+ ### TextInput
8
+
9
+ | Prop | Type | Required | Default | Description |
10
+ |------|------|----------|---------|-------------|
11
+ | `errorText` | `ReactNode` | | | Error message displayed below the input. When provided, it overrides `helpText` and shows an error icon |
12
+ | `helpText` | `ReactNode` | | | Assistive text displayed below the input |
13
+ | `isClearable` | `boolean` | | `false` | Whether to show the clear button |
14
+ | `isDisabled` | `boolean` | | | Whether the input is disabled |
15
+ | `isFluid` | `boolean` | | | Whether the input should take the full available width |
16
+ | `isLoading` | `boolean` | | `false` | Whether to show the loading spinner |
17
+ | `isReadOnly` | `boolean` | | | Whether the input is read-only |
18
+ | `isRequired` | `boolean` | | | Whether the input is required |
19
+ | `isSkeletonLoading` | `boolean` | | `false` | Whether to render skeletons instead of content |
20
+ | `label` | `ReactNode` | | | The label displayed above the input |
21
+ | `leadingElement` | `ReactElement<unknown, string \| JSXElementConstructor<any>>` | | | Leading element rendered inside the input |
22
+ | `moreInformationText` | `ReactNode` | | | Text displayed in the information tooltip shown next to the label |
23
+ | `onChange` | `ChangeEventHandler<HTMLInputElement, HTMLInputElement>` | | | Callback function triggered when the input value changes |
24
+ | `placeholder` | `string` | | | Placeholder text displayed when the input is empty |
25
+ | `ref` | `Ref<HTMLInputElement>` | | | A ref to apply to the root element. |
26
+ | `showRequiredOrOptionalLabel` | `boolean` | | `false` | Whether to display the Required/Optional label next to the field label. Shows Required if isRequired is true, otherwise shows Optional. |
27
+ | `size` | `'large' \| 'medium' \| 'small'` | | `medium` | Size of the input |
28
+ | `skeletonProps` | `(SkeletonProps & { as?: ElementType<any, keyof IntrinsicElements>; } & BaseProps<ElementType<any, keyof IntrinsicElements>>)` | | | Additional props forwarded to the underlying Skeleton components |
29
+ | `tooltipProps` | `TooltipObjectProps` | | | Props for the Tooltip component used by the information icon |
30
+ | `trailingElement` | `ReactElement<unknown, string \| JSXElementConstructor<any>>` | | | Trailing element rendered inside the input |
31
+ | `value` | `string \| number \| readonly string[]` | | | The current value of the input |
32
+
33
+ When `moreInformationText` is provided, a tooltip is rendered next to the label, and the `tooltipProps` prop is used to configure the tooltip. The `TooltipObjectProps` type is defined as: `{ root?: Partial<React.ComponentProps<typeof Tooltip>>; trigger?: Partial<React.ComponentProps<typeof Tooltip.Trigger>>; content?: Partial<React.ComponentProps<typeof Tooltip.Content>>; }`, see the Tooltip component for more details.
34
+
35
+ When `isSkeletonLoading` is true, the input is rendered as a loading skeleton and the `skeletonProps` prop is used to configure the skeleton. For more information, see the Skeleton documentation.
36
+
37
+ ## Accessibility
38
+
39
+ ## Implementation guidelines
40
+
41
+ If you omit the label or provide a non-string custom label, supply an `aria-label` via `htmlAttributes` to keep the component accessible for screen readers.
42
+
43
+ ## Examples
44
+
45
+ ### Default
46
+
47
+ ```tsx
48
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
49
+
50
+ import { TextInput } from '@neo4j-ndl/react';
51
+
52
+ const Component = () => {
53
+ return (
54
+ <TextInput
55
+ label="Label"
56
+ helpText="Help text"
57
+ htmlAttributes={{ id: 'text-input' }}
58
+ />
59
+ );
60
+ };
61
+
62
+ export default Component;
63
+ ```
64
+
65
+ ### Clearable
66
+
67
+ ```tsx
68
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
69
+
70
+ import { TextInput } from '@neo4j-ndl/react';
71
+
72
+ const Component = () => {
73
+ return (
74
+ <TextInput
75
+ label="Clearable"
76
+ isClearable
77
+ placeholder="Type something"
78
+ htmlAttributes={{ id: 'text-input' }}
79
+ />
80
+ );
81
+ };
82
+
83
+ export default Component;
84
+ ```
85
+
86
+ ### Disabled
87
+
88
+ ```tsx
89
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
90
+
91
+ import { TextInput } from '@neo4j-ndl/react';
92
+
93
+ const Component = () => {
94
+ return (
95
+ <TextInput
96
+ label="Label"
97
+ isDisabled
98
+ helpText="Help text"
99
+ value="Value"
100
+ htmlAttributes={{ id: 'text-input' }}
101
+ />
102
+ );
103
+ };
104
+
105
+ export default Component;
106
+ ```
107
+
108
+ ### Email
109
+
110
+ ```tsx
111
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
112
+
113
+ import { TextInput } from '@neo4j-ndl/react';
114
+
115
+ const Component = () => {
116
+ return (
117
+ <TextInput
118
+ label="Email Address"
119
+ isRequired
120
+ placeholder="user@example.com"
121
+ htmlAttributes={{
122
+ id: 'text-input',
123
+ type: 'email',
124
+ }}
125
+ />
126
+ );
127
+ };
128
+
129
+ export default Component;
130
+ ```
131
+
132
+ ### Error
133
+
134
+ ```tsx
135
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
136
+
137
+ import { TextInput } from '@neo4j-ndl/react';
138
+
139
+ const Component = () => {
140
+ return (
141
+ <TextInput
142
+ label="Label"
143
+ errorText="Error text"
144
+ htmlAttributes={{ id: 'text-input' }}
145
+ />
146
+ );
147
+ };
148
+
149
+ export default Component;
150
+ ```
151
+
152
+ ### Full
153
+
154
+ ```tsx
155
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
156
+
157
+ import { CleanIconButton, TextInput } from '@neo4j-ndl/react';
158
+ import { UserIconOutline, XMarkIconOutline } from '@neo4j-ndl/react/icons';
159
+ import { useState } from 'react';
160
+
161
+ const Component = () => {
162
+ const [textValue, setTextValue] = useState('');
163
+
164
+ return (
165
+ <TextInput
166
+ label="Label"
167
+ helpText="Help text"
168
+ placeholder="Placeholder"
169
+ value={textValue}
170
+ onChange={(e) => setTextValue(e.target.value)}
171
+ leadingElement={<UserIconOutline />}
172
+ trailingElement={
173
+ <CleanIconButton
174
+ onClick={() => setTextValue('')}
175
+ description="clear text"
176
+ >
177
+ <XMarkIconOutline />
178
+ </CleanIconButton>
179
+ }
180
+ size="medium"
181
+ moreInformationText="Information icon text"
182
+ tooltipProps={{
183
+ root: { placement: 'top' },
184
+ }}
185
+ isRequired={false}
186
+ showRequiredOrOptionalLabel={true}
187
+ isDisabled={false}
188
+ isReadOnly={false}
189
+ isFluid={false}
190
+ isSkeletonLoading={false}
191
+ skeletonProps={{
192
+ onBackground: 'weak',
193
+ shape: 'rectangular',
194
+ }}
195
+ htmlAttributes={{ id: 'text-input' }}
196
+ />
197
+ );
198
+ };
199
+
200
+ export default Component;
201
+ ```
202
+
203
+ ### Information Icon
204
+
205
+ ```tsx
206
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
207
+
208
+ import { TextInput } from '@neo4j-ndl/react';
209
+
210
+ const Component = () => {
211
+ return (
212
+ <TextInput
213
+ label="Label"
214
+ moreInformationText="Information icon text"
215
+ htmlAttributes={{ id: 'text-input' }}
216
+ />
217
+ );
218
+ };
219
+
220
+ export default Component;
221
+ ```
222
+
223
+ ### Loading
224
+
225
+ ```tsx
226
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
227
+
228
+ import { TextInput } from '@neo4j-ndl/react';
229
+
230
+ const Component = () => {
231
+ return (
232
+ <TextInput
233
+ label="Label"
234
+ helpText="Help text"
235
+ isSkeletonLoading={true}
236
+ skeletonProps={{
237
+ onBackground: 'weak',
238
+ shape: 'rectangular',
239
+ }}
240
+ htmlAttributes={{ id: 'text-input' }}
241
+ />
242
+ );
243
+ };
244
+
245
+ export default Component;
246
+ ```
247
+
248
+ ### Loading Spinner
249
+
250
+ ```tsx
251
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
252
+
253
+ import { TextInput } from '@neo4j-ndl/react';
254
+ import { CalendarDaysIconOutline } from '@neo4j-ndl/react/icons';
255
+
256
+ const Component = () => {
257
+ return (
258
+ <div className="n-flex n-flex-col n-gap-token-16">
259
+ <TextInput
260
+ label="Default loading"
261
+ isLoading
262
+ placeholder="Placeholder"
263
+ htmlAttributes={{ id: 'text-input-loading' }}
264
+ />
265
+ <TextInput
266
+ label="With leading element"
267
+ isLoading
268
+ leadingElement={<CalendarDaysIconOutline />}
269
+ placeholder="Placeholder"
270
+ htmlAttributes={{ id: 'text-input-loading-leading' }}
271
+ />
272
+ <TextInput
273
+ label="With trailing element"
274
+ isLoading
275
+ trailingElement={<CalendarDaysIconOutline />}
276
+ placeholder="Placeholder"
277
+ htmlAttributes={{ id: 'text-input-loading-trailing' }}
278
+ />
279
+ <TextInput
280
+ label="With leading and trailing element"
281
+ isLoading
282
+ leadingElement={<CalendarDaysIconOutline />}
283
+ trailingElement={<CalendarDaysIconOutline />}
284
+ placeholder="Placeholder"
285
+ htmlAttributes={{ id: 'text-input-loading-both' }}
286
+ />
287
+ </div>
288
+ );
289
+ };
290
+
291
+ export default Component;
292
+ ```
293
+
294
+ ### Number
295
+
296
+ ```tsx
297
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
298
+
299
+ import { TextInput } from '@neo4j-ndl/react';
300
+
301
+ const Component = () => {
302
+ return (
303
+ <TextInput
304
+ label="Age"
305
+ htmlAttributes={{
306
+ id: 'text-input',
307
+ max: '100',
308
+ min: '0',
309
+ type: 'number',
310
+ }}
311
+ />
312
+ );
313
+ };
314
+
315
+ export default Component;
316
+ ```
317
+
318
+ ### Optional
319
+
320
+ ```tsx
321
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
322
+
323
+ import { TextInput } from '@neo4j-ndl/react';
324
+
325
+ const Component = () => {
326
+ return (
327
+ <TextInput
328
+ label="Label"
329
+ helpText="Help text"
330
+ showRequiredOrOptionalLabel
331
+ htmlAttributes={{ id: 'text-input' }}
332
+ />
333
+ );
334
+ };
335
+
336
+ export default Component;
337
+ ```
338
+
339
+ ### Password
340
+
341
+ ```tsx
342
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
343
+
344
+ import { CleanIconButton, TextInput } from '@neo4j-ndl/react';
345
+ import { EyeIconOutline, EyeSlashIconOutline } from '@neo4j-ndl/react/icons';
346
+ import { useState } from 'react';
347
+
348
+ const Component = () => {
349
+ const [isPasswordVisible, setIsPasswordVisible] = useState(false);
350
+
351
+ return (
352
+ <TextInput
353
+ label="Password"
354
+ trailingElement={
355
+ <CleanIconButton
356
+ onClick={() => setIsPasswordVisible(!isPasswordVisible)}
357
+ description="toggle password visibility"
358
+ >
359
+ {isPasswordVisible ? <EyeIconOutline /> : <EyeSlashIconOutline />}
360
+ </CleanIconButton>
361
+ }
362
+ placeholder="Enter password"
363
+ htmlAttributes={{
364
+ id: 'text-input',
365
+ type: isPasswordVisible ? 'text' : 'password',
366
+ }}
367
+ />
368
+ );
369
+ };
370
+
371
+ export default Component;
372
+ ```
373
+
374
+ ### Readonly
375
+
376
+ ```tsx
377
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
378
+
379
+ import { TextInput } from '@neo4j-ndl/react';
380
+
381
+ const Component = () => {
382
+ return (
383
+ <TextInput
384
+ label="Label"
385
+ isReadOnly
386
+ helpText="Help text"
387
+ value="Value"
388
+ htmlAttributes={{ id: 'text-input' }}
389
+ />
390
+ );
391
+ };
392
+
393
+ export default Component;
394
+ ```
395
+
396
+ ### Required
397
+
398
+ ```tsx
399
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
400
+
401
+ import { TextInput } from '@neo4j-ndl/react';
402
+
403
+ const Component = () => {
404
+ return (
405
+ <TextInput
406
+ label="Label"
407
+ isRequired
408
+ helpText="Help text"
409
+ showRequiredOrOptionalLabel
410
+ htmlAttributes={{ id: 'text-input' }}
411
+ />
412
+ );
413
+ };
414
+
415
+ export default Component;
416
+ ```
417
+
418
+ ### Sizes
419
+
420
+ ```tsx
421
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
422
+
423
+ import { TextInput } from '@neo4j-ndl/react';
424
+
425
+ const Component = () => {
426
+ return (
427
+ <div className="n-flex n-gap-token-16">
428
+ <TextInput
429
+ label="Small Input"
430
+ size="small"
431
+ htmlAttributes={{ id: 'text-input-small' }}
432
+ />
433
+ <TextInput
434
+ label="Medium Input"
435
+ size="medium"
436
+ htmlAttributes={{ id: 'text-input-medium' }}
437
+ />
438
+ <TextInput
439
+ label="Large Input"
440
+ size="large"
441
+ htmlAttributes={{ id: 'text-input-large' }}
442
+ />
443
+ </div>
444
+ );
445
+ };
446
+
447
+ export default Component;
448
+ ```
449
+
450
+ ### With Icons
451
+
452
+ ```tsx
453
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
454
+
455
+ import { TextInput } from '@neo4j-ndl/react';
456
+ import { DatabasePlugIcon, DatabasePlusIcon } from '@neo4j-ndl/react/icons';
457
+ import { useState } from 'react';
458
+
459
+ const Component = () => {
460
+ const [searchValue, setSearchValue] = useState('');
461
+
462
+ return (
463
+ <TextInput
464
+ label="With icons"
465
+ leadingElement={<DatabasePlugIcon />}
466
+ trailingElement={<DatabasePlusIcon />}
467
+ value={searchValue}
468
+ onChange={(e) => setSearchValue(e.target.value)}
469
+ htmlAttributes={{ id: 'text-input' }}
470
+ />
471
+ );
472
+ };
473
+
474
+ export default Component;
475
+ ```
@@ -0,0 +1,119 @@
1
+ # TextLink
2
+
3
+ Import: `import { TextLink } from '@neo4j-ndl/react'`
4
+
5
+ ## Props
6
+
7
+ ### TextLink
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 link |
13
+ | `href` | `string` | | | The URL the link points to |
14
+ | `ref` | `any` | | | A ref to apply to the root element. |
15
+ | `target` | `string` | | `type === 'external' \|\| type === 'external-underline' ? '_blank' : ''` | Specifies where to open the linked document. If omitted and `type` is `"external"` it defaults to `"_blank"`. |
16
+ | `type` | `'external-underline' \| 'external' \| 'internal-icon' \| 'internal-underline' \| 'internal'` | | `internal` | The type of the text link All types render with an underline and primary text color by default. Additional color styling can be applied via `className`. - 'internal': A link to another page within the application - 'internal-underline': Deprecated alias of 'internal' - 'internal-icon': Deprecated variant with a trailing chevron icon - 'external': A link to an external website. An external link icon is appended. - 'external-underline': Deprecated alias of 'external' |
17
+
18
+ ## Accessibility
19
+
20
+ ## Implementation guidelines
21
+
22
+ TextLink is always underlined and uses primary text color by default, making it distinguishable in running text. Legacy types `internal-underline` and `external-underline` are kept for compatibility but render the same as `internal` and `external`.
23
+ By default the component renders an anchor element but can be overridden with the `as` prop.
24
+
25
+ ## Examples
26
+
27
+ ### Default
28
+
29
+ ```tsx
30
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
31
+
32
+ import { TextLink } from '@neo4j-ndl/react';
33
+
34
+ const Component = () => {
35
+ return <TextLink href="/">Link</TextLink>;
36
+ };
37
+
38
+ export default Component;
39
+ ```
40
+
41
+ ### External
42
+
43
+ ```tsx
44
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
45
+
46
+ import { TextLink } from '@neo4j-ndl/react';
47
+
48
+ const Component = () => {
49
+ return (
50
+ <TextLink href="https://neo4j.com" type="external">
51
+ Link
52
+ </TextLink>
53
+ );
54
+ };
55
+
56
+ export default Component;
57
+ ```
58
+
59
+ ### External Underline
60
+
61
+ ```tsx
62
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
63
+
64
+ import { TextLink, Typography } from '@neo4j-ndl/react';
65
+
66
+ const Component = () => {
67
+ return (
68
+ <Typography variant="body-medium">
69
+ The quick brown fox{' '}
70
+ <TextLink href="https://neo4j.com" type="external-underline">
71
+ jumps
72
+ </TextLink>{' '}
73
+ over the lazy dog.
74
+ </Typography>
75
+ );
76
+ };
77
+
78
+ export default Component;
79
+ ```
80
+
81
+ ### Internal Icon
82
+
83
+ ```tsx
84
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
85
+
86
+ import { TextLink } from '@neo4j-ndl/react';
87
+
88
+ const Component = () => {
89
+ return (
90
+ <TextLink href="/" type="internal-icon">
91
+ Link
92
+ </TextLink>
93
+ );
94
+ };
95
+
96
+ export default Component;
97
+ ```
98
+
99
+ ### Internal Underline
100
+
101
+ ```tsx
102
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
103
+
104
+ import { TextLink, Typography } from '@neo4j-ndl/react';
105
+
106
+ const Component = () => {
107
+ return (
108
+ <Typography variant="body-medium">
109
+ The quick brown fox{' '}
110
+ <TextLink href="/" type="internal-underline">
111
+ jumps
112
+ </TextLink>{' '}
113
+ over the lazy dog.
114
+ </Typography>
115
+ );
116
+ };
117
+
118
+ export default Component;
119
+ ```